K-means-based disaster recovery power distribution network dynamic regulation and control method and device, and medium
By applying a dynamic regulation method based on K-means in the disaster relief distribution network, selecting data points as clustering centers and allocating data points, the problem that traditional methods are difficult to deal with large-scale dynamic data is solved, and more efficient and accurate Clustering results support the formulation of effective disaster recovery strategies.
Patent Information
- Application Number
- CN202411490404.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional static clustering methods are difficult to effectively deal with the dynamic characteristics of huge and growing disaster relief distribution network data in modern power systems, resulting in the inability to provide more efficient and accurate clustering results to formulate disaster recovery strategies and improve disaster response flexibility. Sex and effectiveness.
Using a dynamic regulation method based on K-means, by obtaining the data set of the disaster distribution network, selecting several data points as clustering centers, and allocating data points according to the distance between the data points and the clustering center, thereby generating clustering results and Formulate disaster recovery strategies.
It improves the rationality and practicality of clustering results, avoids local optimal solution problems, enhances the global optimality of clustering effects, provides an intuitive representation of the operating status of the power grid, and identifies high-risk areas and potential fault points. Support the formulation of targeted disaster recovery strategies.
Smart Images

Figure CN119482375A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a K-means-based method, device and medium for dynamic control of a disaster recovery distribution network. Background Art
[0002] In modern society, the power system is the infrastructure that supports the normal operation of all walks of life. With the acceleration of urbanization and the increase in electricity demand, the challenges faced by the power system are becoming increasingly greater, especially disaster response and disaster recovery capacity building has become an important research direction. As a key component of the power system, the reliability and stability of the distribution network directly affect the security of power supply. The disaster recovery distribution network refers to a distribution network that can quickly restore power supply in the event of natural disasters or other emergencies. Traditional disaster recovery distribution network design and optimization methods mainly rely on data clustering analysis and processing to understand and predict the operating status and potential risks of the distribution network, so as to cope with complex and dynamic environmental changes.
[0003] However, in modern power systems, especially in provincial disaster recovery distribution networks, the amount of data is huge and growing, which means that traditional static clustering methods may not be able to effectively handle the dynamic characteristics of these massive data, and it is difficult to provide more efficient and accurate clustering results to formulate disaster recovery distribution network strategies and improve the flexibility and effectiveness of disaster response. Summary of the invention
[0004] The present invention provides a K-means-based disaster recovery distribution network dynamic control method, device and medium to solve the problem that it is difficult to effectively cluster data to generate a disaster recovery strategy to deal with disasters.
[0005] Obtain the dataset of the disaster recovery distribution network;
[0006] Selecting a number of data points as cluster centers according to the data set to obtain a first cluster center set;
[0007] Distributing the data set according to the distance between the data set and the first cluster center set to obtain a clustering result;
[0008] A disaster recovery strategy is generated according to the clustering result to regulate the disaster recovery distribution network.
[0009] The present invention selects cluster centers according to data sets, which can make clustering results more reasonable and practical, and can avoid some local optimal solution problems caused by random selection of cluster centers, thereby improving the global optimality of clustering effects. In Euclidean space, distance is a basic measure of the distance between two points. By calculating the distance between data points and cluster centers, data points can be easily assigned to the nearest cluster centers to form clustering results; this distance-based allocation method is applicable to most types of data sets, and no special preprocessing or assumptions are required for the data sets. Whether it is continuous data or discrete data, as long as a suitable distance measurement method can be defined, this method can be used for cluster analysis. Moreover, this distance-based allocation method can ensure that the similarity between data points and the cluster centers to which they belong is maximized, while making the differences between different cluster centers as large as possible. Since data points are assigned to cluster centers similar to them, data points in the same cluster will have higher similarity, which helps to identify similar areas or equipment in the power grid. In addition, the clustering results provide an intuitive representation of the operating status of the power grid. Through clustering analysis, key information such as high-risk areas, important loads and potential fault points can be identified, thereby providing strong support for the formulation of targeted disaster recovery strategies.
[0010] Compared with the existing technology, the present invention can reduce the complexity of the problem by clustering high-dimensional power grid data sets into several groups, and cluster analysis can help identify potential risk points in the power grid, so as to formulate preventive measures in advance and reduce the probability of failure. Therefore, it can solve the problem of difficulty in effectively clustering data and generating disaster recovery strategies to deal with disasters.
[0011] As a preferred solution, several data points are selected as cluster centers according to the data to obtain a first cluster center set, specifically:
[0012] In the data set, randomly select a data point as a first cluster center to obtain a first data set including the first cluster center;
[0013] Calculate the distance between each data point in the first data set and the nearest cluster center to obtain a distance value set;
[0014] According to the distance value set, calculating the probability of each data point in the first data set being selected as the next cluster center to obtain a probability set;
[0015] Based on the probability set, randomly selecting a data point from the first data set as a cluster center;
[0016] Each data point in the first data set is traversed to obtain the first cluster center set consisting of a plurality of the cluster centers.
[0017] This preferred solution can reduce the algorithm's dependence on initial conditions by randomly selecting a data point as the first cluster center, thereby avoiding falling into a local optimal solution to a certain extent. By calculating the probability of each data point being selected as the next cluster center and selecting based on these probabilities, the selection of cluster centers can be made more reasonable and balanced, which helps to avoid over-concentration or sparse distribution of cluster centers in certain areas, thereby improving the clustering effect.
[0018] As a preferred solution, the data set is allocated according to the distance between the data set and the first cluster center set to obtain a clustering result, specifically:
[0019] Calculating the distance between a first data point in the data set and a preset cluster center to obtain a first distance value;
[0020] If the first distance value is less than the initial distance value, the first distance value is updated to the initial distance value to obtain a second distance value; wherein the initial distance value is obtained by initializing the distance value corresponding to the first data point;
[0021] Traversing the data points in the data set to obtain a distance value set consisting of a plurality of second distance values;
[0022] The data points in the data set are allocated according to the distance value set to obtain the clustering result.
[0023] This preferred solution calculates the distance between each data point in the data set and the preset cluster center, and compares it with the currently stored distance value. If the newly calculated distance is smaller, the value is updated. This dynamic update mechanism ensures that each data point is associated with its nearest cluster center, which helps to generate more accurate clustering results. Based on the final set of distance values, the algorithm can clearly assign each data point to its nearest cluster center. This clear assignment mechanism makes the clustering results easy to understand and apply.
[0024] As a preferred solution, the data points in the data set are allocated according to the distance value set to obtain the clustering result, specifically:
[0025] The distance value between the data point in the data set and the nearest cluster center is recorded as the minimum distance value, and a minimum distance value set is obtained;
[0026] If the distance value in the distance value set is less than the corresponding distance value in the minimum distance value set, then the distance value in the minimum distance value set is updated to the corresponding distance value in the distance value set, and the corresponding cluster center index is recorded;
[0027] The data set is allocated to a number of cluster centers corresponding to the cluster center indexes to obtain the clustering result.
[0028] This preferred solution helps to reduce the variance within the cluster by ensuring that each data point is assigned to the cluster center with the smallest distance to it, thereby improving the accuracy and compactness of the cluster. If the new distance value is less than the minimum distance value currently recorded, it is updated. This dynamic update mechanism ensures that the cluster center can be dynamically adjusted as the data changes, thereby improving the real-time and accuracy of the cluster. In addition, the index can quickly determine which cluster center each data point should be assigned to, thereby improving the efficiency of clustering.
[0029] As a preferred solution, a disaster recovery strategy is generated according to the clustering result to regulate the disaster recovery distribution network, specifically:
[0030] If the data points belonging to the first cluster in the clustering result are assigned to the first cluster center among the plurality of cluster centers, a new center of the first cluster is calculated according to the number of data points in the first cluster;
[0031] Updating the center of the first cluster to the new center to obtain a final cluster;
[0032] Traversing the clusters in the plurality of clusters to obtain an update result consisting of a plurality of final clusters;
[0033] If the update result converges, a disaster recovery strategy is generated according to the update result to regulate the disaster recovery distribution network.
[0034] This preferred solution calculates the new center according to the number of data points in the cluster center and updates the cluster center to the new center, which helps to reduce the variance within the cluster and make the cluster more compact and stable. By traversing all cluster centers and continuously updating, the optimal clustering result can be gradually approached, which helps to improve the accuracy and reliability of clustering. Since the cluster center is dynamically updated and the disaster recovery strategy is generated based on the latest clustering results, when an abnormal situation occurs in the distribution network, the system can quickly identify and take appropriate measures to deal with it.
[0035] As a preferred solution, if the update result converges, a disaster recovery strategy is generated according to the update result to regulate the disaster recovery distribution network, specifically:
[0036] Calculating the distance between the current cluster center in the update result and the cluster center corresponding to the previous iteration to obtain a second distance value set;
[0037] If the distance value in the second distance value set is less than a preset value or the number of iterations of the update result reaches a preset maximum value, terminating the iteration;
[0038] The plurality of clusters when the iteration is terminated are defined as final clustering results, and a disaster recovery strategy is generated according to the final clustering results to regulate the disaster recovery distribution network.
[0039] This preferred solution can clearly determine whether the clustering result is stable enough by calculating the distance between the current cluster center and the cluster center corresponding to the previous iteration, and checking whether these distances are less than the preset value, thereby avoiding unnecessary iterations. At the same time, setting a preset maximum number of iterations as another convergence condition can ensure that the algorithm can stop after reaching a certain number of iterations, avoiding infinite loops in extreme cases. Therefore, by introducing a convergence judgment mechanism, the iteration can be stopped in time when the convergence condition is reached, thereby reducing unnecessary computing overhead and improving overall computing efficiency.
[0040] As a preferred solution, after obtaining the data set of the disaster recovery distribution network, the method further includes:
[0041] Calculate the mean and standard deviation of the first feature in the data set respectively to obtain a first mean and a first standard deviation;
[0042] Standardize the first feature according to the first mean and the first standard deviation to obtain a standardized feature;
[0043] The features in the data set are traversed to obtain a data set consisting of a number of the standardized features.
[0044] This preferred solution uses standardization to convert features of different dimensions to the same scale, thereby eliminating the deviation of clustering results caused by different dimensions, allowing subsequent clustering algorithms to more accurately identify natural groups in the data. And because noise data is often pulled toward the mean after standardization, standardization can reduce the extremes of the data and help reduce the impact of noise in the data on the clustering results.
[0045] The present invention also provides a K-means-based disaster recovery distribution network dynamic control device, including a data module, a clustering module, a distribution module and a control module;
[0046] Wherein, the data module is used to obtain a data set of a disaster recovery distribution network;
[0047] The clustering module is used to select a number of data points as cluster centers according to the data set to obtain a first cluster center set;
[0048] The allocation module is used to allocate the data set according to the distance between the data set and the first cluster center set to obtain a clustering result;
[0049] The control module is used to generate a disaster recovery strategy according to the clustering result to control the disaster recovery distribution network.
[0050] As a preferred solution, the clustering module includes a data unit, a distance unit, a probability unit, a center unit and a clustering unit;
[0051] The data unit is used to randomly select a data point in the data set as a first cluster center to obtain a first data set containing the first cluster center;
[0052] The distance unit is used to calculate the distance between each data point in the first data set and the nearest cluster center to obtain a distance value set;
[0053] The probability unit is used to calculate the probability of each data point in the first data set being selected as the next cluster center according to the distance value set to obtain a probability set;
[0054] The center unit is used to randomly select a data point from the first data set as a cluster center based on the probability set;
[0055] The clustering unit is used to traverse each data point in the first data set to obtain the first cluster center set consisting of a plurality of cluster centers.
[0056] As a preferred solution, the allocation module includes a calculation unit, an update unit, a traversal unit and a result unit;
[0057] The calculation unit is used to calculate the distance between the first data point in the data set and the preset cluster center to obtain a first distance value;
[0058] The updating unit is configured to update the first distance value to the initial distance value to obtain a second distance value if the first distance value is less than the initial distance value; wherein the initial distance value is obtained by initializing the distance value corresponding to the first data point;
[0059] The traversal unit is used to traverse the data points in the data set to obtain a distance value set consisting of a plurality of second distance values;
[0060] The result unit is used to allocate the data points in the data set according to the distance value set to obtain the clustering result.
[0061] As a preferred solution, the result unit includes a metric subunit, a collection subunit and an index subunit;
[0062] The metric subunit is used to record the distance value between the data point in the data set and the nearest cluster center as the minimum distance value to obtain a minimum distance value set;
[0063] The collection subunit is used to update the distance value in the minimum distance value set to the corresponding distance value in the distance value set if the distance value in the distance value set is less than the corresponding distance value in the minimum distance value set, and record the corresponding cluster center index;
[0064] The index subunit is used to distribute the data set to a number of cluster centers corresponding to the cluster center indexes to obtain the clustering result.
[0065] As a preferred solution, the control module includes a measurement unit, a final unit, a result unit and a judgment unit;
[0066] The measurement unit is used to calculate a new center of the first cluster according to the number of data points in the first cluster if the data points belonging to the first cluster in the clustering result are assigned to the first cluster center among the plurality of cluster centers;
[0067] The final unit is used to update the center of the first cluster to the new center to obtain a final cluster;
[0068] The result unit is used to traverse the clusters in the plurality of clusters to obtain an update result consisting of a plurality of final clusters;
[0069] The judgment unit is used to generate a disaster recovery strategy according to the update result to regulate the disaster recovery distribution network if the update result converges.
[0070] As a preferred solution, the judgment unit includes a calculation subunit, a termination subunit and a regulation subunit;
[0071] The calculation subunit is used to calculate the distance between the current cluster center in the update result and the cluster center corresponding to the last iteration to obtain a second distance value set;
[0072] The termination subunit is configured to terminate the iteration if the distance value in the second distance value set is less than a preset value or the number of iterations of the update result reaches a preset maximum value;
[0073] The control subunit is used to define a number of clusters when the iteration is terminated as final clustering results, and generate a disaster recovery strategy according to the final clustering results to control the disaster recovery distribution network.
[0074] As a preferred solution, after the data module, it also includes an average unit, a processing unit and a composition unit;
[0075] The mean unit is used to calculate the mean and standard deviation of the first feature in the data set to obtain a first mean and a first standard deviation;
[0076] The processing unit is used to perform standardization processing on the first feature according to the first mean and the first standard deviation to obtain a standardized feature;
[0077] The composition unit is used to traverse the features in the data set to obtain a data set composed of a number of the standardized features.
[0078] The present application also provides a storage medium, on which a computer program is stored. The computer program is called and executed by a computer to implement the above-mentioned K-means-based dynamic control method for disaster recovery distribution network. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 It is a flow chart of a K-means-based dynamic control method for a disaster recovery distribution network provided in an embodiment of the present application;
[0080] Figure 2 It is a flow chart of dynamic control of a disaster recovery distribution network based on K-means provided in an embodiment of the present application;
[0081] Figure 3 It is a distribution network simulation data diagram provided by an embodiment of the present application;
[0082] Figure 4 It is a simulation result diagram provided by the embodiment of the present application;
[0083] Figure 5 It is a structural schematic diagram of a K-means-based disaster recovery distribution network dynamic control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0084] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0085] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "several" means two or more.
[0086] The embodiment of the present application provides a K-means-based dynamic control method for a disaster recovery distribution network, which is mainly used in situations where it is necessary to improve the response speed and accuracy of the distribution network disaster recovery strategy and provide a more scientific and efficient solution for the disaster recovery management of the power system.
[0087] Embodiment 1:
[0088] See also Figure 1 The embodiment of the present application provides a K-means-based method for dynamic control of a disaster recovery distribution network, including S1 to S4, and the specific implementation steps are as follows:
[0089] S1. Obtain the data set of the disaster recovery distribution network.
[0090] Step S1 of the embodiment of the present application is specifically as follows:
[0091] Obtain data of a large-scale controllable source provincial disaster recovery distribution network to obtain a data set; wherein the data set includes information such as voltage, current and power of each node;
[0092] In the data set, calculate the data points (x 1i , x 2i ) in which the first feature x 1i The first mean μ1 and the first standard deviation σ1 of , as well as the second feature x 2i The second mean μ2 and the second standard deviation σ2;
[0093] The first standardized feature x1 is calculated based on the first mean μ1 and the first standard deviation σ1 ′ ii , and the second standardized feature x2 is calculated based on the second mean μ2 and the second standard deviation σ2 ′ i ;
[0094] By the first standardized feature x1 ′ ii and the second normalized feature x2 ′ i Constructing standardized data points (x1 ′ ii , x2 ′ i );
[0095] Traverse the features in the data set and obtain a number of standardized data points (x1 ′ ii , x2 ′ i ) constitutes a data set;
[0096] Among them, the first standardized feature x1 ′ iiand the second normalized feature x2 ′ i They are:
[0097]
[0098] Among them, x 1i is the first feature, μ1 is the first mean, σ1 is the first standard deviation, x 2i is the second feature, μ2 is the second mean, and σ2 is the second standard deviation.
[0099] In this embodiment S1, the data is subjected to Z-score normalization, which converts features of different dimensions to the same scale, thereby eliminating the deviation of the clustering results caused by different dimensions, and allowing the subsequent clustering algorithm to more accurately identify natural groups in the data. And since noise data is often pulled toward the mean after normalization, normalization can reduce the extremeness of the data and help reduce the impact of noise in the data on the clustering results.
[0100] S2. Select several data points as cluster centers according to the data set to obtain a first cluster center set.
[0101] Step S2 of the embodiment of the present application is specifically as follows:
[0102] In the data set, randomly select a data point as the first cluster center w (1) , get the first cluster center w (1) The first dataset of
[0103] Calculate for each data point x in the first data set (j) The distance D(x) to the nearest cluster center (j) , C), get the distance value set;
[0104] According to the distance value set, calculate each data point x in the first data set (j) The probability P(x) of being selected as the next cluster center (j) ), and obtain the probability set;
[0105] Based on the probability set, randomly select a data point from the first data set as the cluster center w (i) ;
[0106] Traverse each data point in the first data set to obtain a first cluster center set consisting of k cluster centers;
[0107] Among them, the probability of the cluster center is:
[0108]
[0109] Among them, D(x (j), C) is each data point x in the first data set (j) The distance to the nearest cluster center, x ′ For each data point x (j) characteristics.
[0110] In this embodiment S2, by randomly selecting a data point as the first cluster center, the algorithm can reduce its dependence on initial conditions, thereby avoiding falling into a local optimal solution to a certain extent. By calculating the probability of each data point being selected as the next cluster center and selecting based on these probabilities, the selection of cluster centers can be made more reasonable and balanced, which helps to avoid over-concentration or sparse distribution of cluster centers in certain areas, thereby improving the clustering effect;
[0111] Moreover, the K-means algorithm can effectively select the initial cluster centers so that these cluster centers are more evenly distributed in space, thus helping to improve the clustering effect and convergence speed of the K-means algorithm.
[0112] S3. Distribute the data set according to the distance between the data set and the first cluster center set to obtain a clustering result.
[0113] Step S3 of the embodiment of the present application includes S3.1 to S3.2, specifically:
[0114] S3.1. For the first data point x in the data set (j) , initialize a variable min_distance to a large value (such as infinity), and record min_distance as the initial distance value;
[0115] Calculate the first data point x (j) Distance from its selected cluster center w (l) The distance of the first distance value distance(x (j) ,μ (l) );
[0116] If the first distance value distance(x (j) ,μ (l) ) is less than the initial distance value min_distance, then the first distance value distance is updated to the initial distance value min_distance, that is, min_distance=distance, to obtain a second distance value;
[0117] The first data point x (j) The distance D(x) from the nearest cluster center has been selected (j) , C) is recorded as min_distance;
[0118] Traversing the data points in the data set to obtain a distance value set consisting of a plurality of second distance values;
[0119] Among them, the first distance value is:
[0120] distance(x (j) ,μ (l) )=||x (j) -w (l) ||
[0121] where ||·|| represents the Euclidean distance (or other distance metric of your choice), x (j) is the first data point, w (l) is the cluster center, μ (l) is the feature of the first data point.
[0122] It should be noted that for a data set X = {x (1) , x (2) , ..., x (m)}, where m is the total number of data points; Steps S1 to S2 have selected i-1 cluster centers {w (1) , w (2) , ..., w (i-1)}, the above step S3.1 is to calculate each data point x (j) The process with the closest distance to these selected cluster centers.
[0123] S3.2, record the distance between the data point in the data set and its nearest cluster center as the minimum distance value, and obtain the minimum distance value set;
[0124] If the distance value distance(x (j) ,μ (l) ) is less than the distance value min_distance corresponding to the minimum distance value set, then the distance value in the minimum distance value set is updated to the distance value corresponding to the distance value set, that is, let min_distance = distance(x (j) ,μ (l) ), and record the corresponding cluster center index closest_cluster(x (j) )=1;
[0125] Based on the cluster center index closest_cluster(x (j) ) The data point x in the data set (j) Cluster centers assigned to several cluster centers Get the clustering results.
[0126] In this embodiment S3.2, the distance between the data point and each cluster center can be calculated and the data point is assigned to the cluster center closest to it;
[0127] For Example S3 as a whole, the distance between each data point in the data set and the preset cluster center is calculated and compared with the currently stored distance value. If the newly calculated distance is smaller, the value is updated. This dynamic update mechanism ensures that each data point is associated with its nearest cluster center, which helps to generate more accurate clustering results. Based on the final set of distance values, the algorithm can clearly assign each data point to its nearest cluster center. This clear assignment mechanism makes the clustering results easy to understand and apply;
[0128] Moreover, by ensuring that each data point is assigned to the cluster center with the smallest distance to it, it helps to reduce the variance within the cluster, thereby improving the accuracy and compactness of the clustering. If the new distance value is less than the minimum distance value currently recorded, it is updated. This dynamic update mechanism ensures that the cluster center can be dynamically adjusted as the data changes, thereby improving the real-time and accuracy of clustering. Establishing an index based on the cluster center can speed up the data point allocation process. Through the index, it can quickly determine which cluster center each data point should be assigned to, thereby improving the efficiency of clustering.
[0129] S4. Generate a disaster recovery strategy based on the clustering results to regulate the disaster recovery distribution network.
[0130] Step S4 of the embodiment of the present application includes S4.1 to S4.2, specifically:
[0131] S4.1. For a data set X = {x (1) , x (2) , ..., x (m)}, where m is the total number of data points, and the current set of cluster centers C = {μ (1) , μ (2) , ..., μ (k)}, where k is the number of clusters;
[0132] For each cluster j: initialize an empty list S j , used to store data points belonging to cluster j; where j represents different cluster categories;
[0133] If the data point x in the clustering result belongs to the first cluster (i) Assigned to the first cluster center j (i.e., closest_cluster(x (i) )=j), then x (i) Add to ListS j middle;
[0134] According to the number of data points in the first cluster, the new center w of the first cluster j is calculated (j) ;
[0135] Update the center of the first cluster j to the new center w (j) , get the final clustering;
[0136] Traverse the clusters in several clusters to obtain an update result consisting of several final clusters;
[0137] Among them, the new center of the first cluster j is:
[0138]
[0139] Among them, |S j | represents the number of data points belonging to cluster j, x (i) is the i-th data point of the first cluster j.
[0140] In this embodiment S4.1, the center (mean) of each cluster can be recalculated and the position of the cluster center can be updated, thereby providing a strong data basis for the subsequent generation of the final clustering result.
[0141] S4.2. Calculate the current cluster center μ in the update result (j) The cluster center μ corresponding to the previous iteration (j),t-1 The distance between them is obtained to obtain a second distance value set;
[0142] If the distance value in the second distance value set is less than the preset value ε or the number of iterations of the update result reaches the preset maximum value t max , the iteration is terminated; otherwise, the number of iterations is updated, that is, t=t+1, and the iteration continues;
[0143] The several clusters at the end of the iteration are defined as the final clustering results, a disaster recovery strategy is generated according to the final clustering results to regulate the disaster recovery distribution network, and the clustering results are displayed through visualization or other methods;
[0144] The distance values in the second distance value set can be expressed as:
[0145] distance_moved (j) =||μ (j) -μ (j),t-1 ||
[0146] Among them, μ (j) is the current cluster center, μ (j),t-1 is the current cluster center μ (j) The cluster center corresponding to the previous iteration.
[0147] In this embodiment, S4 calculates the new center according to the number of data points in the cluster center, and updates the cluster center to the new center, which helps to reduce the variance within the cluster and make the cluster more compact and stable. By traversing all cluster centers and continuously updating, the optimal clustering result can be gradually approached, which helps to improve the accuracy and reliability of clustering. Since the cluster center is dynamically updated and the disaster recovery strategy is generated based on the latest clustering results, when an abnormal situation occurs in the distribution network, the system can quickly identify and take corresponding measures to deal with it;
[0148] Moreover, by calculating the distance between the current cluster center and the corresponding cluster center in the previous iteration, and checking whether these distances are less than the preset value, it is possible to clearly determine whether the clustering result is stable enough, thereby avoiding unnecessary iterations. At the same time, setting a preset maximum number of iterations as another convergence condition can ensure that the algorithm can stop after reaching a certain number of iterations, avoiding infinite loops in extreme cases. Therefore, by introducing a convergence judgment mechanism, the iteration can be stopped in time when the convergence condition is reached, thereby reducing unnecessary computational overhead and improving overall computational efficiency.
[0149] To apply this embodiment, please refer to Figure 2 , Figure 2 It is a flow chart of dynamic control of a disaster recovery distribution network based on K-means provided in an embodiment of the present invention, which shows the general process of obtaining clustering results in the first embodiment of the present invention.
[0150] To apply this embodiment, please refer to Figure 3 and Figure 4 , Figure 3 is a distribution network simulation data diagram provided by an embodiment of the present invention, representing distribution network simulation data of a disaster recovery distribution network dynamic control method studied by the present invention; Figure 4 is a simulation result diagram provided by an embodiment of the present invention, which shows the simulation result of the dynamic control method of the disaster recovery distribution network based on K-means;
[0151] In order to verify the correctness of the method described in the present invention, the embodiment of the present invention is simulated and analyzed based on MATLAB. Among them, for a provincial distribution network data set, some data are used to represent the nodes in the distribution network. The characteristics of these nodes can be load and node location, such as Figure 3 As shown;
[0152] exist Figure 4 In , points of different colors represent different clusters, and the black cross marks indicate the center of each cluster; Figure 4The simulation result diagram shows the distribution of load points and the location of cluster centers. The points of each cluster are clearly separated in three-dimensional space, indicating that the clustering effect is good. At the same time, calculating the SSE (intra-cluster sum of squares error) of each cluster helps to quantify the clustering effect. The smaller the SSE, the tighter the points in the cluster and the better the clustering effect. In addition, the SSE of the four clusters are 150.31, 200.54, 180.12, 170.76, and 190.09, respectively, indicating that this scheme has a good clustering effect.
[0153] Overall, this embodiment has the following beneficial effects:
[0154] The present invention selects cluster centers according to data sets, which can make clustering results more reasonable and practical, and can avoid some local optimal solution problems caused by random selection of cluster centers, thereby improving the global optimality of clustering effects. In Euclidean space, distance is a basic measure of the distance between two points. By calculating the distance between data points and cluster centers, data points can be easily assigned to the nearest cluster centers to form clustering results; this distance-based allocation method is applicable to most types of data sets, and no special preprocessing or assumptions are required for the data sets. Whether it is continuous data or discrete data, as long as a suitable distance measurement method can be defined, this method can be used for cluster analysis. Moreover, this distance-based allocation method can ensure that the similarity between data points and the cluster centers they belong to is maximized, while making the differences between different cluster centers as large as possible. Since data points are assigned to cluster centers similar to them, data points in the same cluster will have high similarity, which helps to identify similar areas or equipment in the power grid. In addition, the clustering results provide an intuitive representation of the power grid operation status. Through clustering analysis, key information such as high-risk areas, important loads and potential fault points can be identified, thus providing strong support for the formulation of targeted disaster recovery strategies.
[0155] Moreover, the improved K-means algorithm in the present invention can provide more efficient and accurate clustering results when the data volume is large and changes rapidly, which is helpful for real-time analysis and optimization of the disaster recovery distribution network strategy, and improves the flexibility and effectiveness of disaster response. By dynamically clustering and optimizing the disaster recovery distribution network, it is possible to effectively reduce the waste of resources and improve the utilization efficiency of disaster recovery resources, which can not only reduce the cost of disaster recovery, but also improve the economic benefits of the power system.
[0156] Embodiment 2:
[0157] See also Figure 5 , the embodiment of the present application provides a K-means-based disaster recovery distribution network dynamic control device, including a data module 10, a clustering module 20, an allocation module 30 and a control module 40;
[0158] Wherein, the data module 10 is used to obtain the data set of the disaster recovery distribution network;
[0159] A clustering module 20, configured to select a number of data points as cluster centers according to the data set to obtain a first cluster center set;
[0160] An allocation module 30, configured to allocate the data set according to the distance between the data set and the first cluster center set to obtain a clustering result;
[0161] The control module 40 is used to generate a disaster recovery strategy according to the clustering result to control the disaster recovery distribution network.
[0162] In one embodiment, the data module 10 is specifically:
[0163] Obtain data of a large-scale controllable source provincial disaster recovery distribution network to obtain a data set; wherein the data set includes information such as voltage, current and power of each node;
[0164] In the data set, calculate the data points (x 1i , x 2i ) in which the first feature x 1i The first mean μ1 and the first standard deviation σ1 of , as well as the second feature x 2i The second mean μ2 and the second standard deviation σ2;
[0165] The first standardized feature x1 is calculated based on the first mean μ1 and the first standard deviation σ1 ′ ii , and the second standardized feature x2 is calculated based on the second mean μ2 and the second standard deviation σ2 ′ i ;
[0166] By the first standardized feature x1 ′ ii and the second normalized feature x2 ′ i Constructing standardized data points (x1 ′ ii , x2 ′ i );
[0167] Traverse the features in the data set and obtain a number of standardized data points (x1 ′ ii , x2 ′ i ) constitutes a data set;
[0168] Among them, the first standardized feature x1 ′ ii and the second normalized feature x2 ′i They are:
[0169]
[0170] Among them, x 1i is the first feature, μ1 is the first mean, σ1 is the first standard deviation, x 2i is the second feature, μ2 is the second mean, and σ2 is the second standard deviation.
[0171] The data module 10 of this embodiment performs Z-score normalization on the data, which converts features of different dimensions to the same scale, thereby eliminating the deviation of the clustering results caused by different dimensions, allowing the subsequent clustering algorithm to more accurately identify natural groups in the data. And since noise data is often pulled toward the mean after normalization, normalization can reduce the extremeness of the data and help reduce the impact of noise in the data on the clustering results.
[0172] In one embodiment, the clustering module 20 includes a data unit, a distance unit, a probability unit, a center unit, and a clustering unit;
[0173] Among them, the data unit is used to randomly select a data point in the data set as the first cluster center w (1) , get the first cluster center w (1) The first dataset of
[0174] Distance unit, used to calculate the distance between each data point x in the first data set (j) The distance D(x) to the nearest cluster center (j) , C), get the distance value set;
[0175] A probability unit is used to calculate the probability of each data point x in the first data set based on the distance value set. (j) The probability P(x) of being selected as the next cluster center (j) ), and obtain the probability set;
[0176] The center unit is used to randomly select a data point from the first data set as the cluster center w based on the probability set. (i) ;
[0177] A clustering unit, used for traversing each data point in the first data set to obtain a first cluster center set consisting of k cluster centers;
[0178] Among them, the probability of the cluster center is:
[0179]
[0180] Among them, D(x (j) , C) is each data point x in the first data set(j) The distance to the nearest cluster center, x ′ For each data point x (j) characteristics.
[0181] The clustering module 20 of this embodiment can reduce the algorithm's dependence on initial conditions by randomly selecting a data point as the first cluster center, thereby avoiding falling into a local optimal solution to a certain extent. By calculating the probability of each data point being selected as the next cluster center and selecting based on these probabilities, the selection of cluster centers can be made more reasonable and balanced, which helps to avoid over-concentration or sparse distribution of cluster centers in certain areas, thereby improving the clustering effect;
[0182] Moreover, the K-means algorithm can effectively select the initial cluster centers so that these cluster centers are more evenly distributed in space, thus helping to improve the clustering effect and convergence speed of the K-means algorithm.
[0183] In one embodiment, the allocation module 30 includes a calculation unit, an update unit, a traversal unit, a measurement subunit, a collection subunit and an index subunit, specifically:
[0184] Calculation unit for the first data point x in the data set (j) , initialize a variable min_distance to a large value (such as infinity), and record min_distance as the initial distance value;
[0185] The calculation unit is also used to calculate the first data point x (j) Distance from its selected cluster center w (l) The distance of the first distance value distance(x (j) ,μ (l) );
[0186] Update unit, used for if the first distance value distance(x (j) ,μ (l) ) is less than the initial distance value min_distance, then the first distance value distance is updated to the initial distance value min_distance, that is, min_distance=distance, to obtain a second distance value;
[0187] The update unit is also used to update the first data point x (j) The distance D(x) from the nearest cluster center has been selected (j) , C) is recorded as min_distance;
[0188] A traversal unit, used for traversing the data points in the data set to obtain a distance value set consisting of a plurality of second distance values;
[0189] Among them, the first distance value is:
[0190] distance(x (j) ,μ (l) )=||x (j) -w (l) ||
[0191] where ||·|| represents the Euclidean distance (or other distance metric of your choice), x (j) is the first data point, w (l) is the cluster center, μ (l) is the feature of the first data point.
[0192] It should be noted that for a data set X = {x (1) , x (2) , ..., x (m)}, where m is the total number of data points; the data module 10 to the clustering module 20 of the embodiment have selected i-1 cluster centers {w (1) , w (2) , ..., w (i-1)}, the calculation unit, update unit and traversal unit in the above steps are to calculate each data point x (j) The process with the closest distance to these selected cluster centers.
[0193] The metric subunit is used to record the distance value between the data point in the data set and its nearest cluster center as the minimum distance value to obtain the minimum distance value set;
[0194] The collection subunit is used if the distance value distance(x (j) ,μ (l) ) is less than the distance value min_distance corresponding to the minimum distance value set, then the distance value in the minimum distance value set is updated to the distance value corresponding to the distance value set, that is, let min_distance = distance(x (j) ,μ (l) ), and record the corresponding cluster center index closest_cluster(x (j) )=1;
[0195] Index subunit, used to index closest_cluster(x (j) ) The data point x in the data set (j) Cluster centers assigned to several cluster centers Get the clustering results.
[0196] The metric subunit, the collection subunit and the index subunit of this embodiment can calculate the distance between the data point and each cluster center and assign it to the cluster center closest to it;
[0197] As a whole, the allocation module 30 of the embodiment calculates the distance between each data point in the data set and the preset cluster center, and compares it with the currently stored distance value. If the newly calculated distance is smaller, the value is updated. This dynamic update mechanism ensures that each data point is associated with its nearest cluster center, which helps to generate more accurate clustering results. Based on the final set of distance values, the algorithm can clearly assign each data point to its nearest cluster center. This clear assignment mechanism makes the clustering results easy to understand and apply;
[0198] Moreover, by ensuring that each data point is assigned to the cluster center with the smallest distance to it, it helps to reduce the variance within the cluster, thereby improving the accuracy and compactness of the clustering. If the new distance value is less than the minimum distance value currently recorded, it is updated. This dynamic update mechanism ensures that the cluster center can be dynamically adjusted as the data changes, thereby improving the real-time and accuracy of clustering. Establishing an index based on the cluster center can speed up the data point allocation process. Through the index, it can quickly determine which cluster center each data point should be assigned to, thereby improving the efficiency of clustering.
[0199] In one embodiment, the control module 40 includes a measurement unit, a final unit, a result unit, a calculation subunit, a termination subunit and a control subunit, specifically:
[0200] The unit of measurement is used for a data set X = {x (1) , x (2) , ..., x (m)}, where m is the total number of data points, and the current set of cluster centers C = {μ (1) , μ (2) , ..., μ (k)}, where k is the number of clusters;
[0201] Metric unit, also used for each cluster j: initialize an empty list S j , used to store data points belonging to cluster j; where j represents different cluster categories;
[0202] The measurement unit is also used if the data point x in the clustering result belongs to the first cluster (i) Assigned to the first cluster center j (i.e., closest_cluster(x (i) )=j), then x (i) Add to ListS j middle;
[0203] The metric unit is also used to calculate the new center w of the first cluster j based on the number of data points in the first cluster. (j) ;
[0204] The final unit is used to update the center of the first cluster j to the new center w (j) , get the final clustering;
[0205] A result unit, used for traversing the clusters in the plurality of clusters to obtain an update result consisting of a plurality of final clusters;
[0206] Among them, the new center of the first cluster j is:
[0207]
[0208] Among them, |S j | represents the number of data points belonging to cluster j, x (i) is the i-th data point of the first cluster j.
[0209] In this embodiment, the measurement unit, the final unit, and the result unit can recalculate the center (mean) of each cluster and update the position of the cluster center, providing a strong data basis for the subsequent generation of the final clustering result.
[0210] The calculation subunit is used to calculate the current cluster center μ in the update result (j) The cluster center μ corresponding to the previous iteration (j),t-1 The distance between them is obtained to obtain a second distance value set;
[0211] The termination subunit is used to terminate the update if the distance value in the second distance value set is less than the preset value ε or the number of iterations of the update result reaches the preset maximum value t max , the iteration is terminated; otherwise, the number of iterations is updated, that is, t=t+1, and the iteration continues;
[0212] A control subunit is used to define several clusters when the iteration is terminated as final clustering results, generate a disaster recovery strategy according to the final clustering results to control the disaster recovery distribution network, and display the clustering results through visualization or other methods;
[0213] The distance values in the second distance value set can be expressed as:
[0214] distance_moved (j) =||μ (j) -μ (j),t-1 ||
[0215] Among them, μ (j) is the current cluster center, μ (j),t-1 is the current cluster center μ (j)The cluster center corresponding to the previous iteration.
[0216] The control module 40 of this embodiment calculates the new center according to the number of data points in the cluster center, and updates the cluster center to the new center, which helps to reduce the variance within the cluster and make the cluster more compact and stable. By traversing all cluster centers and continuously updating, the optimal clustering result can be gradually approached, which helps to improve the accuracy and reliability of clustering. Since the cluster center is dynamically updated and the disaster recovery strategy is generated based on the latest clustering results, when an abnormal situation occurs in the distribution network, the system can quickly identify and take corresponding measures to deal with it;
[0217] Moreover, by calculating the distance between the current cluster center and the corresponding cluster center in the previous iteration, and checking whether these distances are less than the preset value, it is possible to clearly determine whether the clustering result is stable enough, thereby avoiding unnecessary iterations. At the same time, setting a preset maximum number of iterations as another convergence condition can ensure that the algorithm can stop after reaching a certain number of iterations, avoiding infinite loops in extreme cases. Therefore, by introducing a convergence judgment mechanism, the iteration can be stopped in time when the convergence condition is reached, thereby reducing unnecessary computational overhead and improving overall computational efficiency.
[0218] To apply this embodiment, please refer to Figure 2 , Figure 2 It is a flow chart of dynamic control of a disaster recovery distribution network based on K-means provided in an embodiment of the present invention, which shows the general process of obtaining clustering results in the second embodiment of the present invention.
[0219] To apply this embodiment, please refer to Figure 3 and Figure 4 , Figure 3 is a distribution network simulation data diagram provided by an embodiment of the present invention, representing distribution network simulation data of a disaster recovery distribution network dynamic control device studied by the present invention; Figure 4 is a simulation result diagram provided by an embodiment of the present invention, showing the simulation result of a dynamic control device for a disaster recovery distribution network based on K-means;
[0220] In order to verify the correctness of the method described in the present invention, the embodiment of the present invention is simulated and analyzed based on MATLAB. Among them, for a provincial distribution network data set, some data are used to represent the nodes in the distribution network. The characteristics of these nodes can be load and node location, such as Figure 3 As shown;
[0221] exist Figure 4 In , points of different colors represent different clusters, and the black cross marks indicate the center of each cluster; Figure 4The simulation result diagram shows the distribution of load points and the location of cluster centers. The points of each cluster are clearly separated in three-dimensional space, indicating that the clustering effect is good. At the same time, calculating the SSE (intra-cluster sum of squares error) of each cluster helps to quantify the clustering effect. The smaller the SSE, the tighter the points in the cluster and the better the clustering effect. In addition, the SSE of the four clusters are 150.31, 200.54, 180.12, 170.76, and 190.09, respectively, indicating that this scheme has a good clustering effect.
[0222] Overall, this embodiment has the following beneficial effects:
[0223] The present invention selects cluster centers according to data sets, which can make clustering results more reasonable and practical, and can avoid some local optimal solution problems caused by random selection of cluster centers, thereby improving the global optimality of clustering effects. In Euclidean space, distance is a basic measure of the distance between two points. By calculating the distance between data points and cluster centers, data points can be easily assigned to the nearest cluster centers to form clustering results; this distance-based allocation method is applicable to most types of data sets, and no special preprocessing or assumptions are required for the data sets. Whether it is continuous data or discrete data, as long as a suitable distance measurement method can be defined, this method can be used for cluster analysis. Moreover, this distance-based allocation method can ensure that the similarity between data points and the cluster centers they belong to is maximized, while making the differences between different cluster centers as large as possible. Since data points are assigned to cluster centers similar to them, data points in the same cluster will have high similarity, which helps to identify similar areas or equipment in the power grid. In addition, the clustering results provide an intuitive representation of the power grid operation status. Through clustering analysis, key information such as high-risk areas, important loads and potential fault points can be identified, thus providing strong support for the formulation of targeted disaster recovery strategies.
[0224] Moreover, the improved K-means algorithm in the present invention can provide more efficient and accurate clustering results when the data volume is large and changes rapidly, which is helpful for real-time analysis and optimization of the disaster recovery distribution network strategy, and improves the flexibility and effectiveness of disaster response. By dynamically clustering and optimizing the disaster recovery distribution network, it is possible to effectively reduce the waste of resources and improve the utilization efficiency of disaster recovery resources, which can not only reduce the cost of disaster recovery, but also improve the economic benefits of the power system.
[0225] Embodiment three:
[0226] An embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the K-means-based dynamic control method for a disaster recovery distribution network;
[0227] Wherein, the K-means-based dynamic control method for a disaster recovery distribution network, if implemented in the form of a software functional unit and used as an independent product, can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0228] The above are preferred embodiments of the present invention. It should be noted that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A K-means-based method for dynamic control of a disaster recovery distribution network, characterized in that: include: Obtain the dataset of the disaster recovery distribution network; Selecting a number of data points as cluster centers according to the data set to obtain a first cluster center set; Distributing the data set according to the distance between the data set and the first cluster center set to obtain a clustering result; A disaster recovery strategy is generated according to the clustering result to regulate the disaster recovery distribution network.
2. A K-means-based dynamic control method for disaster recovery distribution network according to claim 1, characterized in that: According to the data, several data points are selected as cluster centers to obtain a first cluster center set, which is specifically: In the data set, randomly select a data point as a first cluster center to obtain a first data set including the first cluster center; Calculate the distance between each data point in the first data set and the nearest cluster center to obtain a distance value set; According to the distance value set, calculating the probability of each data point in the first data set being selected as the next cluster center to obtain a probability set; Based on the probability set, randomly selecting a data point from the first data set as a cluster center; Each data point in the first data set is traversed to obtain the first cluster center set consisting of a plurality of the cluster centers.
3. The method for dynamic control of a disaster recovery distribution network based on K-means according to claim 1, characterized in that: The data set is allocated according to the distance between the data set and the first cluster center set to obtain a clustering result, specifically: Calculating the distance between a first data point in the data set and a preset cluster center to obtain a first distance value; If the first distance value is less than the initial distance value, the first distance value is updated to the initial distance value to obtain a second distance value; wherein the initial distance value is obtained by initializing the distance value corresponding to the first data point; Traversing the data points in the data set to obtain a distance value set consisting of a plurality of second distance values; The data points in the data set are allocated according to the distance value set to obtain the clustering result.
4. The method for dynamic control of a disaster recovery distribution network based on K-means according to claim 3, characterized in that: The data points in the data set are allocated according to the distance value set to obtain the clustering result, specifically: The distance value between the data point in the data set and the nearest cluster center is recorded as the minimum distance value, and a minimum distance value set is obtained; If the distance value in the distance value set is less than the corresponding distance value in the minimum distance value set, then the distance value in the minimum distance value set is updated to the corresponding distance value in the distance value set, and the corresponding cluster center index is recorded; The data set is allocated to a number of cluster centers corresponding to the cluster center indexes to obtain the clustering result.
5. A K-means-based dynamic control method for disaster recovery distribution network according to claim 4, characterized in that: Generate a disaster recovery strategy according to the clustering result to regulate the disaster recovery distribution network, specifically: If the data points belonging to the first cluster in the clustering result are assigned to the first cluster center among the plurality of cluster centers, a new center of the first cluster is calculated according to the number of data points in the first cluster; Updating the center of the first cluster to the new center to obtain a final cluster; Traversing the clusters in the plurality of clusters to obtain an update result consisting of a plurality of final clusters; If the update result converges, a disaster recovery strategy is generated according to the update result to regulate the disaster recovery distribution network.
6. A K-means-based dynamic control method for disaster recovery distribution network according to claim 5, characterized in that: If the update result converges, a disaster recovery strategy is generated according to the update result to regulate the disaster recovery distribution network, specifically: Calculating the distance between the current cluster center in the update result and the cluster center corresponding to the previous iteration to obtain a second distance value set; If the distance value in the second distance value set is less than a preset value or the number of iterations of the update result reaches a preset maximum value, terminating the iteration; The plurality of clusters when the iteration is terminated are defined as final clustering results, and a disaster recovery strategy is generated according to the final clustering results to regulate the disaster recovery distribution network.
7. The method for dynamic control of a disaster recovery distribution network based on K-means according to claim 1, characterized in that: After obtaining the data set of the disaster recovery distribution network, the method further includes: Calculate the mean and standard deviation of the first feature in the data set respectively to obtain a first mean and a first standard deviation; Standardize the first feature according to the first mean and the first standard deviation to obtain a standardized feature; The features in the data set are traversed to obtain a data set consisting of a number of the standardized features.
8. A K-means-based dynamic control device for a disaster recovery distribution network, characterized in that: It includes data module, clustering module, allocation module and control module; Wherein, the data module is used to obtain a data set of a disaster recovery distribution network; The clustering module is used to select a number of data points as cluster centers according to the data set to obtain a first cluster center set; The allocation module is used to allocate the data set according to the distance between the data set and the first cluster center set to obtain a clustering result; The control module is used to generate a disaster recovery strategy according to the clustering result to control the disaster recovery distribution network.
9. A K-means-based disaster recovery distribution network dynamic control device as claimed in claim 8, characterized in that: The clustering module includes a data unit, a distance unit, a probability unit, a center unit and a clustering unit; The data unit is used to randomly select a data point in the data set as a first cluster center to obtain a first data set containing the first cluster center; The distance unit is used to calculate the distance between each data point in the first data set and the nearest cluster center to obtain a distance value set; The probability unit is used to calculate the probability of each data point in the first data set being selected as the next cluster center according to the distance value set to obtain a probability set; The center unit is used to randomly select a data point from the first data set as a cluster center based on the probability set; The clustering unit is used to traverse each data point in the first data set to obtain the first cluster center set consisting of a plurality of cluster centers.
10. A K-means-based disaster recovery distribution network dynamic control device as claimed in claim 8, characterized in that: The distribution module includes a calculation unit, an update unit, a traversal unit and a result unit; The calculation unit is used to calculate the distance between the first data point in the data set and the preset cluster center to obtain a first distance value; The updating unit is configured to update the first distance value to the initial distance value to obtain a second distance value if the first distance value is less than the initial distance value; wherein the initial distance value is obtained by initializing the distance value corresponding to the first data point; The traversal unit is used to traverse the data points in the data set to obtain a distance value set consisting of a plurality of second distance values; The result unit is used to allocate the data points in the data set according to the distance value set to obtain the clustering result.
11. A K-means-based disaster recovery distribution network dynamic control device as claimed in claim 10, characterized in that: The result unit includes a metric subunit, a collection subunit and an index subunit; The metric subunit is used to record the distance value between the data point in the data set and the nearest cluster center as the minimum distance value to obtain a minimum distance value set; The collection subunit is used to update the distance value in the minimum distance value set to the corresponding distance value in the distance value set if the distance value in the distance value set is less than the corresponding distance value in the minimum distance value set, and record the corresponding cluster center index; The index subunit is used to distribute the data set to a number of cluster centers corresponding to the cluster center indexes to obtain the clustering result.
12. A K-means-based disaster recovery distribution network dynamic control device as claimed in claim 11, characterized in that: The control module includes a measurement unit, a final unit, a result unit and a judgment unit; The measurement unit is used to calculate a new center of the first cluster according to the number of data points in the first cluster if the data points belonging to the first cluster in the clustering result are assigned to the first cluster center among the plurality of cluster centers; The final unit is used to update the center of the first cluster to the new center to obtain a final cluster; The result unit is used to traverse the clusters in the plurality of clusters to obtain an update result consisting of a plurality of final clusters; The judgment unit is used to generate a disaster recovery strategy according to the update result to regulate the disaster recovery distribution network if the update result converges.
13. A K-means-based disaster recovery distribution network dynamic control device as claimed in claim 12, characterized in that: The judgment unit includes a calculation subunit, a termination subunit and a regulation subunit; The calculation subunit is used to calculate the distance between the current cluster center in the update result and the cluster center corresponding to the last iteration to obtain a second distance value set; The termination subunit is configured to terminate the iteration if the distance value in the second distance value set is less than a preset value or the number of iterations of the update result reaches a preset maximum value; The control subunit is used to define a number of clusters when the iteration is terminated as final clustering results, and generate a disaster recovery strategy according to the final clustering results to control the disaster recovery distribution network.
14. A K-means-based disaster recovery distribution network dynamic control device as claimed in claim 8, characterized in that: After the data module, it also includes a mean unit, a processing unit and a composition unit; The mean unit is used to calculate the mean and standard deviation of the first feature in the data set to obtain a first mean and a first standard deviation; The processing unit is used to perform standardization processing on the first feature according to the first mean and the first standard deviation to obtain a standardized feature; The composition unit is used to traverse the features in the data set to obtain a data set composed of a number of the standardized features.
15. A storage medium, characterized in that: The storage medium stores a computer program, which is called and executed by a computer to implement a dynamic control method for a disaster recovery distribution network based on K-means as described in any one of claims 1 to 7 above.