Energy federated learning data selection method, device and energy federated learning system

Through clustering and dynamic selection of energy data, combined with feasible constraints and overhead minimization criteria, it solves the limitations of data participation in model training in the power Internet of Things, achieves fast and highly accurate learning performance, and avoids the problems of slow learning speed and model skew. .

CN117592580BActive Publication Date: 2024-10-08GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311560308.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2024-10-08
Estimated Expiration
2043-11-21

AI Technical Summary

Technical Problem

In the power Internet of Things, limited communication resources and data equipment power limit the participation of energy data in model training, resulting in slow learning speed and model skew. Existing data selection methods fail to effectively solve these two types of problems.

Method used

By clustering energy data and based on feasible constraints and overhead minimization criteria, data are dynamically selected to participate in federated learning, ensuring that the data completes model updates within the specified time, mitigating the problem of terminal lagging, and improving data diversity and learning accuracy.

Benefits of technology

It achieves fast and highly accurate learning performance under limited resources and power, avoids the problems of model tilt and slow learning speed, and improves the efficiency and accuracy of data selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117592580B_ABST
    Figure CN117592580B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of federated learning technology, and discloses an energy federated learning data selection method, device and energy federated learning system, wherein the method obtains terminal data sent by each terminal device in the current communication round, and clusters the terminal data according to data similarity to obtain a number of clustering clusters; selects a feasible data set from the clustering cluster according to feasible constraints; and iteratively updates the feasible data set according to the overhead minimization criterion to obtain global model training data. The data selection method provided by the present invention can adapt to the network status, alleviate the terminal scheduling problem under the conditions of network resources and terminal power constraints, effectively improve the data diversity involved in model updating, and quickly achieve high-accuracy learning performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning technology, and in particular to an energy federated learning data selection method, device and energy federated learning system. Background Art

[0002] With the development of edge computing and artificial intelligence technologies, traditional power grids are undergoing intelligent upgrades to ubiquitous power Internet of Things to achieve interconnection and interaction in all aspects of the power system, strengthen data processing capabilities, and promote data integration and application, making it a smart service system with full state perception, efficient information processing, and convenient and flexible application. In particular, energy data dispersed in the network can be federated through learning to ensure intelligent services without sharing data and protecting data security.

[0003] However, due to the limited communication resources of the power Internet of Things and the limited power of data devices, not all energy data can participate in the model training process during federated learning. In addition, due to the dynamic characteristics of the communication environment and the differences in the communication environment between data terminals, inappropriate data selection may result in the inability to complete the model update within the specified time, resulting in slow learning speed; and because the energy data scattered in the network has the characteristics of non-independent and identically distributed, inappropriate data selection may cause the learned model to lean towards some data, resulting in low learning accuracy.

[0004] In order to solve this problem, there are different data selection methods in existing research. However, the problem with these existing methods is that in the field of computer science, the proposed data selection methods often only solve the data skew problem caused by non-independent and identically distributed data. In the field of wireless communication, the proposed data selection methods often only solve the problem of not being able to complete model updates on time due to differences in communication environments. Data selection methods that can solve these two types of problems at the same time often ignore the mutual influence between model update rounds and cannot really effectively solve existing problems. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides an adaptive energy federated learning data selection method, device and energy federated learning system, so as to quickly achieve highly accurate learning performance under limited communication resources and equipment power conditions.

[0006] In a first aspect, the present invention provides a method for selecting energy federated learning data, the method comprising:

[0007] Acquire terminal data sent by each terminal device in the current communication round, and cluster the terminal data according to data similarity to obtain a plurality of clustering clusters;

[0008] Selecting a feasible data set from the cluster according to feasible constraints;

[0009] According to the cost minimization criterion, the feasible data set is iteratively updated to obtain global model training data.

[0010] Furthermore, the step of selecting a feasible data set from the cluster according to the feasible constraint condition includes:

[0011] Randomly select a group of terminal data from each cluster, determine whether the terminal data meets the feasible constraint conditions, until the terminal data that meets the feasible constraint conditions is obtained, and use the terminal data as feasible data;

[0012] The feasible data in each cluster are combined into a feasible data set.

[0013] Furthermore, the step of judging whether the terminal data satisfies the feasible constraint condition until the terminal data satisfying the feasible constraint condition is obtained and taking the terminal data as the feasible data comprises:

[0014] Establishing a convex optimization problem according to feasible constraints, and solving the convex optimization problem according to the terminal data to obtain an optimal solution;

[0015] It is determined whether the optimal solution is greater than the delay threshold. If not, the terminal data is used as feasible data. If yes, the terminal data is reselected from the clustering cluster, and the solution and judgment are performed until feasible data is obtained.

[0016] Furthermore, the step of iteratively updating the feasible data set according to the cost minimization criterion to obtain global model training data includes:

[0017] A set of new terminal data that meets feasible constraints and is different from feasible data is randomly selected from the randomly selected clusters;

[0018] Extracting the corresponding feasible data that is in the same cluster as the new terminal data from the feasible data set, and obtaining the selection overhead of the corresponding feasible data and the new terminal data respectively, wherein the selection overhead is calculated according to the sample size of the data, the selection energy consumption and the length of the local virtual energy queue;

[0019] According to the cost minimization criterion, the feasible data set is iteratively updated for multiple rounds using new terminal data to obtain global model training data.

[0020] Furthermore, the step of performing multiple rounds of iterative updates on the feasible data set using new terminal data according to the overhead minimization criterion includes:

[0021] Subtract the selection cost of the corresponding feasible data from the selection cost of the new terminal data to obtain a cost difference, and determine whether the cost difference is greater than zero;

[0022] If so, the selection probability is calculated according to the number of executions of selecting the new terminal data, and the corresponding feasible data is replaced with the new terminal data according to the selection probability to obtain an updated feasible data set;

[0023] Continue to select new terminal data to update the feasible data set until the preset iteration stop condition is reached.

[0024] Furthermore, the step of calculating the selection probability according to the number of executions of selecting new terminal data includes:

[0025] Calculate the probability control parameter according to the number of executions of selecting new terminal data;

[0026] The selection probability is calculated according to the cost difference and the probability control parameter.

[0027] Furthermore, after the step of obtaining global model training data, the method further includes:

[0028] The length of the local virtual energy queue is updated according to the selected energy consumption of the global model training data.

[0029] Furthermore, the selected energy consumption is calculated using the following formula:

[0030]

[0031] In the formula, e kl (t) represents the energy consumed by selecting the lth group of data in the kth cluster in the tth round of communication, x kl (t) indicates whether the lth group of data in the kth cluster is selected in the tth round of communication. represents the sample size of the lth group of data in the kth cluster, represents the time delay of training one sample locally for the lth group of data in the kth cluster in the tth round of communication, B represents the size of the training model, represents the communication rate of uploading the lth group of data in the kth cluster to the edge server in the tth round of communication, represents the power value when the lth group of data in the kth cluster is uploaded to the edge server;

[0032] The local virtual energy queue length is calculated using the following formula:

[0033]

[0034] In the formula, q kl(t+1) represents the length of the local virtual energy queue of the lth group of data in the kth cluster in the t+1th round of communication, Indicates the average energy consumption threshold;

[0035] The selection cost is calculated using the following formula:

[0036]

[0037] In the formula, K represents the number of clusters, L k represents the number of groups of data in the kth cluster, and V represents the weight coefficient;

[0038] The probability control parameter is calculated using the following formula:

[0039]

[0040] In the formula, represents the initial probability control parameter, and n represents the number of executions of selecting the second feasible data;

[0041] The selection probability is calculated using the following formula:

[0042]

[0043] In the formula, △ represents the cost difference, and P represents the selection probability of using the second feasible data to update the first feasible data.

[0044] In a second aspect, the present invention provides an energy federated learning data selection device, the device comprising:

[0045] A data clustering module is used to obtain terminal data sent by each terminal device in the current communication round, and cluster the terminal data according to data similarity to obtain a number of clusters;

[0046] A first data selection module, configured to select a feasible data set from the cluster according to feasible constraints;

[0047] The second data selection module is used to iteratively update the feasible data set according to the cost minimization criterion to obtain global model training data.

[0048] In a third aspect, an embodiment of the present invention further provides an energy federated learning system, including an edge server and at least two terminal devices;

[0049] The terminal device has terminal data for global model training;

[0050] The edge server selects global model training data from the terminal data sent by the terminal device using the method described above.

[0051] The present invention provides a method, device and system for selecting data for energy federated learning. Through the method, data for federated learning in each communication round can be dynamically selected, thereby ensuring that the selected data can complete local model training and upload within the specified time, and reducing the problem of terminal falling behind. The data selection method provided by the present invention can adapt to the network status, effectively improve the data diversity involved in model update under the conditions of network resources and terminal power constraints, and quickly achieve high-accuracy learning performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 is a flow chart of a method for selecting energy federated learning data in an embodiment of the present invention;

[0053] Figure 2 It is a structural diagram of an energy federated learning data selection device in an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] Before describing the method of the present invention in detail, a brief introduction to federated learning is given. The goal of federated learning is to minimize global loss through multiple rounds of model training. In a typical network scenario, including multiple groups of distributed terminal devices and an edge server, the specific steps of each round of model update in federated learning include: 1) selecting data to participate in global model update; 2) the server broadcasts the current global model to the selected terminal devices; 3) the terminal device uses its own data to update the received global model to obtain a local model; 4) the terminal device uploads the local model to the edge server; 5) after the edge server receives all local models, it updates the global model by weighted average.

[0056] Due to the limited communication resources of the power Internet of Things and the limited power of data devices, not all energy data can participate in the model training process during energy federated learning. Therefore, the present invention provides a data selection method for energy federated learning.

[0057] See also Figure 1 , a method for selecting energy federated learning data proposed in the first embodiment of the present invention includes steps S10 to S30:

[0058] Step S10, obtaining terminal data sent by each terminal device in the current communication round, and clustering the terminal data according to data similarity to obtain a plurality of clusters;

[0059] Step S20, selecting a feasible data set from the cluster according to feasible constraints;

[0060] Step S30, iteratively updating the feasible data set according to the cost minimization criterion to obtain global model training data.

[0061] The method provided in this embodiment can be applied to the data selection step of the edge server in each communication round. The following is an example of data selection in the tth communication round:

[0062] The terminal data sent by each terminal device is obtained, and then the data is clustered according to the data similarity to form K clusters. In this step, the core link is the data similarity measurement and data clustering process. Specifically, the similarity measurement standard between the data is first defined, which can be expressed by the following formula:

[0063]

[0064] In the formula, It is the difference between the local model trained with data k and the global model during the t-round model update, which is defined as the representative gradient, and l represents data l. According to the Cauchy-Schwarz inequality, the range of data similarity is [0,1]. The larger the value, the higher the data similarity, and vice versa.

[0065] Based on the similarity measurement, a hierarchical clustering algorithm is used to cluster the terminal data, that is, the data is divided at different levels to form a tree-like clustering structure. Taking the AGNES (AGglomerative NESting) algorithm as an example, a bottom-up aggregation strategy is used to implement hierarchical clustering. The goal of the AGNES algorithm is to divide all the data in the network into K clusters, where any two different clusters are and The key step of the clustering process is to calculate the data similarity between clusters. In the tth communication round, the cluster and The data similarity between can be expressed as:

[0066]

[0067] Based on the definition of inter-cluster data similarity, AGNES first regards each group of data as an initial cluster, and then finds the two clusters with the greatest similarity to merge in each step of the algorithm. This process is repeated until the preset number of clusters K is reached, and then the number of data groups in the kth cluster is expressed as Of course, other clustering standards and clustering algorithms may also be used to divide clusters. The clustering standards and clustering algorithms used in this embodiment are only preferred but not specifically limited.

[0068] After obtaining multiple clusters, the present invention dynamically selects data for federated learning according to the communication conditions of each communication round and under the delay constraint condition. The specific steps are as follows:

[0069] Step S201, randomly selecting a group of terminal data from each cluster, determining whether the terminal data satisfies feasible constraints, until the terminal data satisfying the feasible constraints are obtained, and taking the terminal data as feasible data;

[0070] Step S202: Group the feasible data in each cluster into a feasible data set.

[0071] The feasible constraints used in this embodiment include the principle of selecting a set of data per cluster, the delay constraint principle and the communication rate constraint principle. A feasible data set is selected from the clusters according to these three constraint principles. Specifically, the current network status is obtained:

[0072]

[0073] in, represents the energy consumption of training a sample locally for the lth group of data in the kth cluster in the tth round of communication, represents the energy consumption of training a sample locally for the lth group of data in the kth cluster in the tth round of communication, q kl (t) represents the local virtual energy queue length of the lth group of data in the kth cluster in the tth round of communication.

[0074] According to the current network status, the feasible data set is determined from the clustering cluster as follows:

[0075]

[0076] in, Indicates whether the lth group of data in the kth cluster in the tth round of communication is selected, that is, 1, indicating that it is selected, otherwise, it is not selected. For the selected data , the following three constraints should be met:

[0077] ① The selected data meets the principle of selecting only one group in each cluster:

[0078]

[0079] From the above steps, we can see that clusters are obtained by clustering algorithms. Data in different data clusters have low similarity. Therefore, the principle of selecting only one group in each cluster can ensure that the selected data is diverse, thereby providing more contribution to the model training process of federated learning, accelerating federated learning, and effectively improving the representativeness of data, avoiding the problem of model tilt.

[0080] ② The total delay of all selected data for local model training and local model upload The following conditions are met:

[0081]

[0082] In the formula, Indicates the preset delay threshold. represents the sample size of the lth group of data in the kth cluster, B represents the size of the training model (in bits), It represents the communication rate of uploading the lth group of data in the kth cluster to the edge server in the tth round of communication. Through the delay constraint, it can be guaranteed that the local model trained on the selected data can reach the edge server within the specified time.

[0083] ③ The communication rate of all selected data uploaded to the edge server is subject to the following restrictions:

[0084]

[0085]

[0086] In the formula, Indicates the communication capability of the network.

[0087] This constraint is actually a constraint on the communication rate in the delay constraint. Through this constraint, it is ensured that only selected data is allocated a communication rate, and the sum of the rates allocated to all selected data is lower than the communication capacity of the network.

[0088] This embodiment dynamically selects data for federated learning in each communication round based on the communication conditions of each communication round and under the delay constraint condition, thereby ensuring that the selected data can always complete local model training and upload within the specified time, thereby alleviating the problem of terminal falling behind.

[0089] Based on the above constraints, the following steps are used to initialize the feasible data set:

[0090] Step S2011, establishing a convex optimization problem according to feasible constraints, and solving the convex optimization problem according to the terminal data to obtain an optimal solution;

[0091] Step S2012, judging whether the optimal solution is greater than the delay threshold, if not, taking the terminal data as feasible data; if yes, reselecting terminal data from the clustering cluster, and performing solving and judging until feasible data is obtained.

[0092] The data initialization in this embodiment is to randomly select a set of data from each cluster, and the selected set of data must satisfy the above constraint condition ①, and then determine whether the selected set of data satisfies the constraints ② and ③ by solving the convex optimization problem, which specifically includes:

[0093] Assume that the data selected from cluster k is l k , according to constraints ② and ③, a convex optimization problem (P1) is established:

[0094]

[0095] Find the optimal solution to the convex optimization problem (P1) , if the optimal solution is greater than the preset delay threshold , then it is judged that the selected set of data does not meet the constraints ② and ③, that is, the data is not feasible; otherwise, it is considered that the selected set of data is feasible.

[0096] If the selected data is not feasible, repeat the above process until the selected data is feasible. When the selected data is feasible, it means that the group of data is the old selected data, where the optimal solution of the convex optimization problem is expressed by the following formula:

[0097]

[0098] After the feasible data set is initialized, considering the limited power of the device terminal, this embodiment uses the current overhead minimization criterion to update and iterate the feasible data set. The specific steps include:

[0099] Step S301, randomly selecting a group of new terminal data that meets feasible constraints and is different from feasible data from the randomly selected clusters;

[0100] Step S302, extracting the corresponding feasible data that is in the same cluster as the new terminal data from the feasible data set, and obtaining the selection overhead of the corresponding feasible data and the new terminal data respectively, wherein the selection overhead is calculated according to the sample size of the data, the selection energy consumption and the length of the local virtual energy queue;

[0101] Step S303, based on the cost minimization criterion, the feasible data set is iteratively updated for multiple rounds using the new terminal data to obtain global model training data.

[0102] In this embodiment, it is necessary to select new terminal data for updating the feasible data set, that is, randomly select a cluster k, and then randomly select a set of data from the cluster. , the reselected data must satisfy Then cluster the data of cluster k in the old selected data Replace with , thus obtaining a set of new selected data. For the newly selected data, the above steps are used to determine whether the new terminal data meets the feasible constraints, that is, to determine whether the new terminal data is feasible. If not, repeat the above steps and continue to randomly select data from the cluster until it meets the constraints. And feasible new terminal data.

[0103] After obtaining feasible data and new terminal data through the above steps, the selection costs of the two sets of data are obtained respectively. Assuming that the selection cost corresponding to the feasible data is , the selection cost corresponding to the new terminal data is , where the selection cost corresponding to the selection data can be expressed by the following formula:

[0104]

[0105] In the formula, K represents the number of clusters, L k represents the number of groups of data in the kth cluster, , is a preset weight coefficient used to weigh the energy consumption and data volume of the selected data terminal, where,

[0106]

[0107] In the formula, e kl (t) represents the energy consumed by selecting the lth group of data in the kth cluster in the tth round of communication, x kl (t) indicates whether the lth group of data in the kth cluster is selected in the tth round of communication. represents the sample size of the lth group of data in the kth cluster, represents the energy consumption of training a sample locally for the lth group of data in the kth cluster in the tth round of communication, B represents the size of the training model, represents the communication rate of uploading the lth group of data in the kth cluster to the edge server in the tth round of communication, It represents the power value when the lth group of data in the kth cluster is uploaded to the edge server.

[0108] Then, according to the cost minimization criterion, the feasible data is iteratively updated. The specific steps include:

[0109] Step S3031, subtracting the selection cost of the corresponding feasible data from the selection cost of the new terminal data to obtain a cost difference, and determining whether the cost difference is greater than zero;

[0110] Step S3032: If yes, then the selection probability is calculated according to the number of executions of selecting the new terminal data, and the corresponding feasible data is replaced with the new terminal data according to the selection probability to obtain an updated feasible data set;

[0111] Step S3033: Continue to select new terminal data to update the feasible data set until a preset iteration stop condition is reached.

[0112] In this embodiment, if the overhead of the new terminal data No more than the cost of old selected data , the feasible data is updated with the new terminal data; otherwise, the cost difference between the two feasible data is calculated:

[0113]

[0114] At the same time, update the probability control parameters:

[0115]

[0116] in, Represents the initial probability control parameter, and n represents the number of iterations of executing new selection data.

[0117] Then the selection probability is calculated based on the cost difference and the probability control parameter:

[0118]

[0119] In the formula, P represents the probability of using new terminal data to update feasible data, that is, the feasible data is updated with probability P, and the feasible data is maintained unchanged with probability (1-P). At the same time, if the feasible data is updated, its selection cost also needs to be updated accordingly.

[0120] According to the above steps, new terminal data is continuously selected and the feasible data set is updated until the probability control parameter reaches the parameter threshold, that is, ,in, It is a pre-set threshold value close to zero, which stops the iteration and obtains the final feasible data set, which is also the global model training data. Through the iterative steps provided in this embodiment, feasible data that meets the constraints and has the lowest overhead can be quickly screened out, thereby effectively improving the execution efficiency of data selection.

[0121] Furthermore, in this embodiment, the length of the local virtual energy queue is set to depend on the energy consumed in the previous round of model update, and the formula is as follows:

[0122]

[0123] In the formula, q kl (t+1) represents the length of the local virtual energy queue of the lth group of data in the kth cluster in the t+1th round of communication, Represents the average energy consumption threshold, e kl (t) represents the energy consumed in selecting the lth group of data in the kth cluster in the tth round of communication.

[0124] According to the above formula, the greater the energy consumption corresponding to the data, the greater the length of the local virtual energy queue in the next round of model update, and the less the local remaining power. Combined with the above data selection criteria, the data selection method provided by the present invention is more inclined to select data with more local remaining power, less energy consumption, and larger data volume in each round of model update, thereby being able to improve the diversity of data participating in the model update under the conditions of network resources and terminal power constraints, thereby quickly achieving high-accuracy learning performance.

[0125] This embodiment provides a method for selecting data for energy federated learning. The present invention can improve the representativeness of data and avoid the problem of model tilt through data similarity clustering selection. It also ensures that the selected data can always complete local model training and upload within the specified time by dynamically selecting learning data under delay constraints, thereby alleviating the problem of terminal lagging behind. While dynamically adapting to communication conditions, the present invention alleviates terminal scheduling problems and increases the representativeness of data participating in federated learning, thereby effectively improving the learning performance for energy federated learning.

[0126] See also Figure 2 Based on the same inventive concept, a second embodiment of the present invention proposes an energy federation learning data selection device, comprising:

[0127] The data clustering module 10 is used to obtain the terminal data sent by each terminal device in the current communication round, and cluster the terminal data according to the data similarity to obtain a plurality of clusters;

[0128] A first data selection module 20, configured to select a feasible data set from the cluster according to feasible constraints;

[0129] The second data selection module 30 is used to iteratively update the feasible data set according to the cost minimization criterion to obtain global model training data.

[0130] The technical features and technical effects of the energy federation learning data selection device proposed in the embodiment of the present invention are the same as the method proposed in the embodiment of the present invention, and will not be repeated here. Each module in the above-mentioned energy federation learning data selection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0131] In addition, an embodiment of the present invention further proposes an energy federated learning system, comprising an edge server and at least two terminal devices;

[0132] The terminal device has terminal data for global model training;

[0133] The edge server selects global model training data from the terminal data sent by the terminal device using the method described above.

[0134] In summary, the embodiments of the present invention propose an energy federated learning data selection method, device and energy federated learning system. The method obtains the terminal data sent by each terminal device in the current communication round, and clusters the terminal data according to data similarity to obtain several clustering clusters; selects a feasible data set from the clustering clusters according to feasible constraints; and iteratively updates the feasible data set according to the overhead minimization criterion to obtain global model training data. The data selection method provided by the present invention can adapt to the network status, alleviate the terminal scheduling problem under the conditions of network resources and terminal power constraints, effectively improve the data diversity involved in the model update, and quickly achieve high-accuracy learning performance.

[0135] Each embodiment in this specification is described in a progressive manner, and the same or similar parts of each embodiment can be directly referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0136] The above-mentioned embodiments only express several preferred implementation modes of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in the technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention, and these improvements and substitutions should also be regarded as the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be based on the protection scope of the claims.

Claims

1. A data selection method for energy federated learning, It is characterized in that The method comprises: Acquire terminal data sent by each terminal device in the current communication round, and cluster the terminal data according to data similarity to obtain a plurality of clustering clusters; Selecting a feasible data set from the cluster according to feasible constraints; Iteratively updating the feasible data set according to a cost minimization criterion to obtain global model training data; The step of iteratively updating the feasible data set according to the cost minimization criterion to obtain global model training data comprises: A set of new terminal data that meets feasible constraints and is different from feasible data is randomly selected from the randomly selected clusters; Extracting the corresponding feasible data that is in the same cluster as the new terminal data from the feasible data set, and obtaining the selection overhead of the corresponding feasible data and the new terminal data respectively, wherein the selection overhead is calculated according to the sample size of the data, the selection energy consumption and the length of the local virtual energy queue; According to the cost minimization criterion, the feasible data set is updated for multiple rounds of iterations using the new terminal data to obtain global model training data; The selected energy consumption is calculated using the following formula: In the formula, e kl (t) represents the energy consumed by selecting the lth group of data in the kth cluster in the tth round of communication, x kl (t) indicates whether the lth group of data in the kth cluster is selected in the tth round of communication. represents the sample size of the lth group of data in the kth cluster, represents the energy consumption of training a sample locally for the lth group of data in the kth cluster in the tth round of communication, B represents the size of the training model, represents the communication rate of uploading the lth group of data in the kth cluster to the edge server in the tth round of communication, represents the power value when the lth group of data in the kth cluster is uploaded to the edge server; The local virtual energy queue length is calculated using the following formula: In the formula, q kl (t+1) represents the length of the local virtual energy queue of the lth group of data in the kth cluster in the t+1th round of communication, Indicates the average energy consumption threshold; The selection cost is calculated using the following formula: In the formula, K represents the number of clusters, L k represents the number of groups of data in the kth cluster, and V represents the weight coefficient.

2. The energy federated learning data selection method according to claim 1, It is characterized in that The step of selecting a feasible data set from the cluster according to the feasible constraint condition comprises: Randomly select a group of terminal data from each cluster, determine whether the terminal data meets the feasible constraint conditions, until the terminal data that meets the feasible constraint conditions is obtained, and use the terminal data as feasible data; The feasible data in each cluster are combined into a feasible data set.

3. The energy federated learning data selection method according to claim 2, It is characterized in that The step of judging whether the terminal data satisfies the feasible constraint condition, until the terminal data satisfying the feasible constraint condition is obtained, and taking the terminal data as the feasible data comprises: Establishing a convex optimization problem according to feasible constraints, and solving the convex optimization problem according to the terminal data to obtain an optimal solution; It is determined whether the optimal solution is greater than the delay threshold. If not, the terminal data is used as feasible data. If yes, the terminal data is reselected from the clustering cluster, and the solution and judgment are performed until feasible data is obtained.

4. The energy federated learning data selection method according to claim 1, It is characterized in that The step of performing multiple rounds of iterative updates on the feasible data set using new terminal data according to the overhead minimization criterion comprises: Subtract the selection cost of the corresponding feasible data from the selection cost of the new terminal data to obtain a cost difference, and determine whether the cost difference is greater than zero; If not, the feasible data is updated with the new terminal data; If so, the selection probability is calculated according to the number of executions of selecting the new terminal data, and the corresponding feasible data is replaced with the new terminal data according to the selection probability to obtain an updated feasible data set; Continue to select new terminal data to update the feasible data set until the preset iteration stop condition is reached.

5. The energy federated learning data selection method according to claim 4, It is characterized in that The step of calculating the selection probability according to the number of executions of selecting new terminal data comprises: Calculate the probability control parameter according to the number of executions of selecting new terminal data; The selection probability is calculated according to the cost difference and the probability control parameter.

6. The energy federated learning data selection method according to claim 5, It is characterized in that The probability control parameter is calculated using the following formula: In the formula, represents the initial probability control parameter, and n represents the number of executions of selecting new terminal data; The selection probability is calculated using the following formula: Where △ represents the cost difference, and P represents the probability of selecting to update the feasible data using the new terminal data.

7. An energy federated learning data selection device, It is characterized in that The device comprises: A data clustering module is used to obtain terminal data sent by each terminal device in the current communication round, and cluster the terminal data according to data similarity to obtain a number of clusters; A first data selection module, configured to select a feasible data set from the cluster according to feasible constraints; A second data selection module is used to iteratively update the feasible data set according to the cost minimization criterion to obtain global model training data; The step of iteratively updating the feasible data set according to the cost minimization criterion to obtain global model training data comprises: A set of new terminal data that meets feasible constraints and is different from feasible data is randomly selected from the randomly selected clusters; Extracting the corresponding feasible data that is in the same cluster as the new terminal data from the feasible data set, and obtaining the selection overhead of the corresponding feasible data and the new terminal data respectively, wherein the selection overhead is calculated according to the sample size of the data, the selection energy consumption and the length of the local virtual energy queue; According to the cost minimization criterion, the feasible data set is updated for multiple rounds of iterations using the new terminal data to obtain global model training data; The selected energy consumption is calculated using the following formula: In the formula, e kl (t) represents the energy consumed by selecting the lth group of data in the kth cluster in the tth round of communication, x kl (t) indicates whether the lth group of data in the kth cluster is selected in the tth round of communication. represents the sample size of the lth group of data in the kth cluster, represents the energy consumption of training a sample locally for the lth group of data in the kth cluster in the tth round of communication, B represents the size of the training model, represents the communication rate of uploading the lth group of data in the kth cluster to the edge server in the tth round of communication, represents the power value when the lth group of data in the kth cluster is uploaded to the edge server; The local virtual energy queue length is calculated using the following formula: In the formula, q kl (t+1) represents the length of the local virtual energy queue of the lth group of data in the kth cluster in the t+1th round of communication, Indicates the average energy consumption threshold; The selection cost is calculated using the following formula: In the formula, K represents the number of clusters, L k represents the number of groups of data in the kth cluster, and V represents the weight coefficient.

8. An energy federated learning system, It is characterized in that The system comprises: An edge server and at least two end devices; The terminal device has terminal data for global model training; The edge server selects global model training data from the terminal data sent by the terminal device using the method described in any one of claims 1 to 6.