Federal learning-driven computing power elasticity scheduling method
By generating dynamic resource vectors through real-time monitoring of device computing power indicators, and combining reinforcement learning and privacy protection technologies, the problems of insufficient computing power awareness and low resource utilization efficiency in federated learning are solved, achieving efficient training and privacy protection, and improving the robustness and training efficiency of the system.
Patent Information
- Application Number
- CN202510930302.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-07
AI Technical Summary
In existing federated learning scenarios, insufficient computing power awareness, rigid model sharding strategies, poor dynamic scheduling adaptability, imbalance between privacy protection and aggregation efficiency, and low resource utilization efficiency lead to low training efficiency and privacy risks.
By generating dynamic resource vectors through real-time monitoring of device computing power indicators, introducing reinforcement learning modules to optimize weight coefficients, performing elastic sharding generation and adaptive scheduling, and combining device health assessment and privacy protection technologies, efficient utilization of computing resources and privacy protection are achieved.
It achieves precise computing power perception, elastic sharding, adaptive scheduling, and efficient aggregation, improving training efficiency and system robustness, and ensuring device health and data privacy and security.
Smart Images

Figure CN120806069A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of public transport systems, in particular to a federated learning driven computing power elastic scheduling method. BACKGROUND
[0002] In the federated learning (Federated Learning) scenario, the devices participating in the training (such as terminal devices, edge servers, etc.) usually have heterogeneity, which is manifested as significant differences in resources such as computing power, memory, battery capacity and network bandwidth. The existing computing power scheduling methods generally have the following technical bottlenecks: 1. Insufficient computing power awareness: traditional methods mostly use static computing power evaluation models, which cannot respond to device computing power fluctuations (such as CPU load changes, battery power consumption fluctuations) in real time, resulting in inaccurate resource vector representation, which in turn affects subsequent scheduling decisions; 2. Model slicing strategy is rigid: in the global model slicing process, there is a lack of differentiated consideration of device architecture (such as CPU, GPU, NPU) and data sensitivity, making it difficult to achieve precise matching of computationally intensive tasks and device advantages, resulting in low training efficiency; 3. Poor adaptability of dynamic scheduling: when device computing power fluctuates, the network is unstable or the temperature is abnormal, the existing scheduling mechanism cannot quickly trigger task migration or slicing resegmentation, which is prone to cause training timeout or device failure, affecting the continuity of federated learning; 4. Imbalance between privacy protection and aggregation efficiency: in the gradient aggregation process, traditional methods either do not consider the impact of computing power differences on aggregation weights, resulting in slow model convergence; or lack a dynamic privacy risk assessment mechanism, which poses a risk of sensitive information leakage; 5. Low resource utilization efficiency: the device health assessment system is missing, which cannot identify faulty devices or resource bottlenecks in a timely manner, which is prone to cause task accumulation or resource waste, making it difficult to achieve elastic scheduling of computing power resources. SUMMARY
[0003] In view of the deficiencies of the prior art, the present application provides a federated learning driven computing power elastic scheduling method, which solves the problems in the background art.
[0004] To achieve the above purpose, the present application is implemented by the following technical scheme: a federated learning driven computing power elastic scheduling method, comprising the following steps: S1 Dynamic computing power perception: real-time monitoring of computing power indicators of federated learning participating devices, generating a dynamic resource vector; S2 Elastic slicing generation: according to the dynamic resource vector, the global federated model is split into differentiated sub-model slices; S3 Adaptive scheduling: based on device computing power fluctuations and slicing computation complexity, dynamically assigning sub-model slices to matching devices; S4 federated training execution: the device trains the assigned sub-model shard locally, generating local gradient updates; S5 incremental aggregation update: aggregate local gradient updates, generate global model and trigger the next round of elastic scheduling iteration.
[0005] Preferably, the dynamic resource vector in step S1 is represented as: ; Wherein: is the comprehensive computing power index of the device , calculated by the following formula: ; Wherein: is the weight coefficient; is the battery attenuation factor; is the current battery power consumption rate; is the current available memory; is the remaining battery capacity; is the real-time network uplink bandwidth.
[0006] Introduce reinforcement learning module, take dynamic resource vector as state input, combine historical scheduling data, and optimize computing power index weight coefficient and through reward function; at the same time, when the device is in different working modes, automatically switch the corresponding computing power evaluation strategy, realize more accurate computing power perception.
[0007] Preferably, the step S1 calculates the comprehensive computing power index includes the following steps: Step S1.1: real-time acquisition of device , , , , and data; Step S1.2: according to the formula ; Substitute the weight coefficient and the battery attenuation factor , calculate the comprehensive computing power index of the device ; Step S1.3: combine the calculated with , , into a dynamic resource vector ; The reinforcement learning module optimizes the weight coefficient, including the following steps: Step S1.4: the dynamic resource vector , the historical scheduling scheme and the corresponding training result are taken as the input of the reinforcement learning model; Step S1.5: the reward value of this scheduling is calculated by a reward function, and a positive reward is given if the training efficiency is improved or the energy consumption is reduced, and vice versa; Step S1.6: the weight coefficient is updated by using the reinforcement learning algorithm and , so that the subsequent computing power evaluation is more in line with the actual training demand; Step S1.7: repeat steps S1.4 to S1.6 to continuously optimize the weight coefficient.
[0008] Preferably, the sub-model slice size in step S2 matches the target device computing power: ; Wherein: is the maximum slice size allowed by the device; is the load balancing coefficient, and ; is the current available device set; is the total parameter quantity of the global model; Increase the heterogeneous device cooperative slicing strategy. For devices with different architectures, the model is sliced according to its computing advantage. At the same time, model sensitivity analysis is introduced. For the model part related to sensitive data, it is preferentially allocated to trusted devices for training, and homomorphic encryption technology is used to protect the data during training.
[0009] Preferably, the elastic slicing generation in step S2 includes the following steps: Step S2.1: analyze the structure of the global federated model to determine the computing characteristics and data sensitivity of each layer; Step S2.2: traverse the current available device set According to the formula: ; Calculate the sub-model slice size that each device can bear; Step S2.3: according to the device architecture, the model layer with high computing intensity (such as convolution layer) is preferentially allocated to GPU device, and the logical processing layer is allocated to CPU device, forming a preliminary slicing scheme; Step S2.4: for the model part containing sensitive data, filter out the trusted device set, and reassign the related slices to the trusted devices; Step S2.5: For the sub-model shards assigned to the device, homomorphic encryption technology is used to encrypt the data to generate the final differentiated sub-model shards.
[0010] Preferably, the adaptive scheduling in step S3 introduces a shard-device matching function: ; in: Sharding for sub-models The theoretical calculation of Positive correlation; For sharding The amount of gradient data; The scheduler selects the device-shard combination with the highest matching degree and satisfies , is a dynamic threshold; in addition, an equipment health evaluation system is established to calculate the equipment health by comprehensively considering factors such as equipment operation time and failure rate. When the device health is below the threshold When a server is running, it is restricted from taking on new sharding tasks and the shards it is processing are migrated to healthy devices first; The step S3 of performing adaptive scheduling includes the following steps: Step S3.1: Segment size based on sub-model , combined with the device computing power parameters, calculate each sub-model shard On each device The theoretical calculation time on ; Step S3.2: Estimate each sub-model shard The amount of gradient data ; Step S3.3: According to the formula ; Calculate each device Sharding with sub-models Matching degree ; Step S3.4: Calculate the current set of available devices Median comprehensive computing power index of medium-sized devices , confirm that A subset of devices; Step S3.5: From the subset of devices that meet the conditions, select the device-shard combination that has the highest matching degree with each sub-model shard for task allocation; Step S3.6: Calculate the equipment health based on the equipment's operating time, historical failure rate, and other data ; Step S3.7: If the device health Below threshold Migrate the shard being processed by the device to a device with high health, and limit it from taking on new shard tasks.
[0011] Preferably, step S3 further comprises training time consumption prediction: ; Wherein The cost of model unit parameters (device-independent constant) is calculated, and actual training timeout triggers shard re-partitioning; when the network is unstable during device training, if the network packet loss rate exceeds the threshold , automatically switch the current training task to local cache mode, after the network recovers, synchronize the training results to the server, and re-evaluate the matching degree of the device and the shard; at the same time, when the device temperature exceeds the safety threshold , automatically reduce the training load of the device or suspend training, and continue training after the temperature returns to normal; The training time consumption prediction and abnormal handling in step S3 includes the following steps: Step S3.8: According to the formula: ; Calculate the predicted training time consumption of each device training sub-model shard ; ; Step S3.9: During device training, real-time monitor the training duration, if it exceeds the predicted training time consumption , trigger shard re-partitioning operation: Step S3.9.1: The timeout sub-model shard is divided into multiple smaller sub-shards according to the preset rules; Step S3.9.2: Recalculate the matching degree of each sub-shard with other devices, and assign the sub-shard to the appropriate device for continuous training; Step S3.10: Real-time monitor the device network status, if the network packet loss rate exceeds the threshold : Step S3.10.1: Switch the current training task to local cache mode, and suspend data upload; Step S3.10.2: After the network recovers, synchronize the local training results to the server; Step S3.10.3: Re-evaluate the matching degree of the device and the shard, and adjust the task allocation according to the situation; Step S3.11: Real-time monitor the device temperature, if it exceeds the safety threshold ; Step S3.11.1: Automatically reduce the training load of the device to reduce the amount of computing tasks; Step S3.11.2: If the temperature is persistently too high, suspend training; Step S3.11.3: Continue training task after device temperature returns to normal.
[0012] Preferably, the dynamic updating of the computing power index in step S1 is The formula is: ; Wherein, is a smoothing factor; The method comprises the following steps: Step S1.8: After each training cycle , the comprehensive computing power index of the device for the next cycle is calculated according to the formula ; Step S1.9: Obtain the industry average computing power index of the same type of device, and compare it with the computing power index of the device ; Step S1.10: If the computing power index of the device continuously falls below the industry average, and no hardware fault is found; Step S1.10.1: Automatically trigger the device software optimization process to clean up system cache; Step S1.10.2: Close unnecessary background processes on the device; Step S1.10.3: Recalculate the computing power index of the device to evaluate the optimization effect. Preferably, in step S5, the incremental aggregation adopts a computing power weighted strategy formula:
[0013] ; Wherein, is the set of devices that complete the training on time; The method comprises the following steps: Step S5.1: Count the set of devices that complete the training on time ; Step S5.2: Calculate the global model parameter update amount according to the formula ; Step S5.3: Analyze the convergence speed of the global model and the stability of the device computing power, and dynamically adjust the aggregation frequency: Step S5.3.1: If the model converges slowly, reduce the aggregation frequency and increase the number of local training of the device; Step S5.3.2: If the device computing power fluctuates greatly, increase the aggregation frequency to synchronize the model update in time; Step S5.4: Before aggregation, perform privacy risk assessment on the local gradient update uploaded by each device; Step S5.4.1: Analyze whether there is a risk of sensitive information leakage in the gradient update using a privacy risk assessment algorithm; Step S5.4.2: If a privacy leakage risk is detected, use gradient compression and obfuscation techniques to process the gradient; Step S5.4.3: The processed gradient is used in the aggregation calculation.
[0014] Preferably, when the device computing power fluctuation exceeds the threshold, the fragmentation migration mechanism is triggered, and the unfinished sub-model fragments are migrated to the device that meets the ; Migration gain coefficient; comprising the following steps: Step S8.1: Real-time monitoring of device computing power changes, if the device computing power fluctuation exceeds the preset threshold: Step S8.1.1: Determine the unfinished sub-model fragments on the degraded device; Step S8.1.2: Traverse other available devices, calculate the matching degree of each device and the unfinished sub-model fragments ; Step S8.1.3: Select the target device set that meets ; Step S8.2: Resource pre-allocation detection on the target device; Step S8.2.1: Simulate the resource usage of the target device after receiving the unfinished sub-model fragments; Step S8.2.2: If the target device is insufficient in resources, exclude the device.
[0015] The present application provides a kind of federated learning driven computing power elasticity scheduling method, with the following beneficial effects: 1. Accurate computing power perception and dynamic optimization: by real-time monitoring of CPU utilization, memory occupation, battery power consumption and network bandwidth, etc. Index, generate dynamic resource vector containing comprehensive computing power index (CEI), combined with the adaptive optimization of weight coefficient by reinforcement learning module, reduce the error of computing power evaluation, effectively solve the problem of inaccurate representation of heterogeneous device computing power;Introduce device working mode automatic switching mechanism (such as power saving mode / high performance mode), match the computing power evaluation strategy in different scenarios, improve the robustness of perception.
[0016] 2. Elastic fragmentation cooperates with heterogeneous devices: Based on dynamic resource vector calculation sub-model fragmentation size, combined with load balancing coefficient λ to realize power proportion allocation, so as to reduce device load imbalance degree and avoid training blockage caused by "power bottleneck" device; According to the calculation advantage of CPU, GPU, NPU and other heterogeneous devices (such as convolution layer distribution to GPU), the efficiency of calculation intensive task is improved by more than 2 times; At the same time, sensitive data fragments are protected by homomorphic encryption technology to meet the privacy requirements of federated learning.
[0017] 3. Adaptive scheduling and fault tolerance: The power, calculation time and network bandwidth are comprehensively considered by using fragmentation-device matching function (Match), so that the accuracy of scheduling decision is improved, and the optimal matching of task and device is ensured; The mechanisms such as training time prediction, network packet buffering and temperature abnormality processing are integrated, when the device training is overtime or the network is interrupted, the fragmentation is automatically resegmented or the task is automatically migrated, so as to ensure the continuity of training process and reduce the efficiency loss caused by training interruption.
[0018] 4. Efficient aggregation and privacy enhancement: The power weighted aggregation strategy is adopted, so that the device with strong power contributes more weight to the global model update, and the model convergence speed is accelerated; The aggregation frequency is dynamically adjusted, the aggregation frequency is reduced when the model converges slowly, and the communication overhead is reduced; The gradient privacy risk assessment and confusion technology are introduced, which can reduce the privacy leakage risk through homomorphic encryption and gradient compression while ensuring the aggregation efficiency, and meet the data security specification of federated learning.
[0019] 5. Resource health management and elastic migration: A device health evaluation system is established, and the task allocation is dynamically adjusted combined with running time, failure rate and other indicators, when the device health is lower than the threshold, the task is automatically migrated to reduce the system failure rate; The differential transmission technology is adopted to optimize the fragmentation migration process, only the update data is transmitted, the network bandwidth consumption is reduced, and the system reliability is improved by avoiding overload of target device through resource pre-allocation detection.
[0020] In summary, through the whole process optimization of dynamic perception, elastic fragmentation, intelligent scheduling and safe aggregation, the efficient utilization of power resources, adaptive allocation of tasks and strengthened protection of data privacy in federated learning scenario are realized, and the performance and robustness of distributed machine learning system are significantly improved. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 A flowchart of a federated learning driven power elasticity scheduling method is described in the application; Figure 2 A principle block diagram of a federated learning driven power elasticity scheduling system is described in the application. DETAILED DESCRIPTION
[0022] With reference to the drawings and embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0023] As shown in Figure 1 , the present application provides a technical solution: a federated learning driven computing power elastic scheduling method, comprising the following steps: S1 Dynamic computing power perception: real-time monitoring of computing power indicators of federated learning participating devices, generating a dynamic resource vector; S2 Elastic fragmentation generation: according to the dynamic resource vector, the global federated model is split into differentiated sub-model fragments; S3 Adaptive scheduling: based on device computing power fluctuation and fragment computing complexity, dynamically allocate sub-model fragments to matching devices; S4 Federated training execution: devices train the allocated sub-model fragments locally to generate local gradient updates; S5 Incremental aggregation update: aggregate local gradient updates to generate a global model and trigger the next round of elastic scheduling iteration.
[0024] More specifically, the dynamic resource vector in step S1 is represented as: ; Wherein: is the comprehensive computing power index of the device , which is calculated by the following formula: ; Wherein: is the weight coefficient; is the battery attenuation factor; is the current battery power consumption rate; is the current available memory; is the remaining battery capacity; is the real-time network uplink bandwidth.
[0025] Introduce reinforcement learning module, take dynamic resource vector as state input, combine historical scheduling data, optimize computing power index weight coefficient and through reward function (such as training efficiency improvement, energy consumption reduction); at the same time, when the device is in different working modes (such as power saving mode, high performance mode), automatically switch the corresponding computing power evaluation strategy, realize more accurate computing power perception.
[0026] More specifically, the comprehensive computing power index in step S1 is calculated comprising the following steps: The steps are implemented as follows: Step S1.1: Real-time collection of device hardware state data, including: CPU core usage, where: is the number of idle CPU cores, is the total number of CPU cores; memory usage, where: is the free memory capacity, is the total memory capacity; battery usage, where: is the current battery power consumption rate (unit: mW), calculated by battery charge and discharge current voltage monitoring; Step S1.2: Substitute the preset weight coefficients and the battery attenuation factor , where , typical values are , to calculate the comprehensive evaluation index ; Step S1.3: Combine with real-time collected (memory usage), (battery usage), and possibly other indicators (such as network bandwidth, if applicable) into a four-dimensional dynamic resource vector as the state input for subsequent scheduling; The reinforcement learning optimization module is implemented: The computing power evaluation parameters are dynamically optimized through a deep reinforcement learning algorithm, with the specific mechanism as follows: State space: The dynamic resource vector , historical scheduling schemes (such as shard allocation results), and training results (such as convergence speed, energy consumption data) are used as input states; Action space: The adjustment values of the weight coefficients and are output, with an adjustment step size of (typical value); Reward function: Positive reward if the training efficiency improves by more than 5% or the energy consumption decreases by more than 10%, with a reward value of ; negative reward if the training is timed out or the device overheats, with a reward value of ; Step S1.4: Input the state data into a deep Q-network (DQN) model to generate the optimal action (parameter adjustment scheme); Step S1.5: Calculate the reward value of the current policy according to the reward function and update the experience replay buffer; Step S1.6: Update the neural network parameters by gradient descent method, iteratively optimize the weight coefficients; Step S1.7: Re-evaluate the parameters every 50 training cycles (configurable) to form a closed-loop optimization.
[0027] Mode adaptive switching: when the device working mode changes (such as user manual switching or system automatic triggering), the following strategies are executed: Power saving mode: increase battery related parameter weight (such as setting to 0.5), reduce CPU and memory weight, reduce performance loss in computing power evaluation; high performance mode: increase CPU and memory weight (such as setting ), ignore battery decay factor , prioritize computing efficiency; switching trigger condition: monitor power management state or user input through system API, trigger real-time switching of computing power evaluation strategy, switching delay does not exceed 100ms (typical value).
[0028] More specifically, the sub-model slice size in step S2 matches the computing power of the target device: ; Where: is the maximum slice size allowed by the device; is the load balancing coefficient, and ; is the current available device set; is the total parameter quantity of the global model; Increase the heterogeneous device cooperative slicing strategy, for devices with different architectures (such as CPU, GPU, NPU), according to their computing advantages, perform hierarchical slicing on the model; at the same time, introduce model sensitivity analysis, for sensitive data related model part, preferentially allocate to trusted device for training, and use homomorphic encryption technology to protect data during training.
[0029] More specifically, the elastic slicing generation in step S2 includes the following steps: Step S2.1: Perform structural analysis on the global federated model to determine the computing characteristics and data sensitivity of each layer; Step S2.2: Calculate the sub-model slice size: Calculate the slice size that the device can carry dynamically by the following formula: ; The implementation steps are as follows: Parameter definition: is the maximum slice size limited by the device hardware (such as GPU memory limit is 1GB); Load balancing coefficient (typical value 1.2, ensure that the load distribution is slightly higher than the computing power ratio, avoid resource waste); The total sum of the computing power index of the current available device set ; The total parameter quantity of the global model (unit: million parameters); Traverse the calculation process: For each device , first calculate the computing power ratio , multiply and to get the theoretical shard size, and then take the minimum value with to ensure that it does not exceed the device carrying capacity.
[0030] Step S2.3: Heterogeneous device hierarchical slicing: According to the device architecture characteristics, allocate the model layer, the specific strategy is as follows: Device architecture identification: Obtain the hardware type (such as CPU, GPU, NPU) and computing capability parameters (such as the floating point operation peak value of GPU) through the device driver interface.
[0031] Model layer characteristic analysis: compute-intensive layers (such as CNN convolution layers): preferentially allocate to GPU / NPU devices, take advantage of parallel computing; logical processing layers (such as recurrent neural networks RNN): allocate to CPU devices, take advantage of logical control unit.
[0032] Example: The global model contains 10 convolution layers and 5 fully connected layers, allocate the convolution layers to GPU devices according to the computing power ratio, and allocate the fully connected layers to CPU devices to form a preliminary slicing scheme.
[0033] Step S2.4: Sensitive data slicing redistribution: The following mechanisms are used to protect data privacy: Trusted device screening: Establish a device trust scoring system, scoring factors include device authentication status, historical privacy leakage record, and administrator preset trust level.
[0034] Redistribution logic: For model slices containing sensitive data such as medical and financial data, only allocate to devices with a trust score ≥ 80 (out of 100) and record the allocation log.
[0035] Step S2.5: Homomorphic encryption processing: Use additive homomorphic encryption technology (such as Paillier cryptography system) to encrypt the sliced data: Encryption process: The server generates an encryption public key and a private key , encrypts the sliced data Distribute to devices; devices use To allocated sub-model shard data Encryption, get ciphertext .
[0036] Performance optimization: lightweight encryption (such as AES) is used for non-sensitive data shards, and homomorphic encryption is used for sensitive data shards, balancing privacy protection and computational efficiency.
[0037] Step S3: adaptive scheduling and health management: This step realizes the dynamic allocation and migration of sub-model shards through matching degree function and device health assessment, and the specific implementation is as follows: Steps S3.1-S3.3: shard-device matching degree calculation: 1.1 Theoretical calculation time consumption Calculation (step S3.1): ; Calculate the cost of model unit parameters (typical value: seconds / parameter, which can be adjusted according to the model type); The number of shard parameters; The device comprehensive computing power index.
[0038] Step S3.21.2: Gradient data volume Estimation: ; The number of single-precision floating-point numbers; The gradient compression rate (typical value 0.3, i.e. compress 30%).
[0039] 1.3 Matching degree function calculation (step S3.3): ; Characterize the compensation ability of device computing power to calculation time consumption; Characterize the adaptability of network bandwidth to gradient transmission.
[0040] Steps S3.4-S3.5: device subset screening and task allocation: Dynamic threshold Determination: Dynamically adjust according to the proportion of the current training round to the total training round, with an initial value of 0.8 and gradually increasing to 1.0.
[0041] Task allocation example: device set , , , only when devices participate in allocation.
[0042] Step S3.6-S3.7: Device health assessment and migration: 3.1 Health degree Calculation: ; 3.2 Sharding migration mechanism: When (typical value 0.6), traverse other devices, filter target devices that meet , and perform resource pre-allocation detection.
[0043] More specifically, step S3 also includes training time consumption prediction: ; Wherein is the model unit parameter calculation cost (device-independent constant), and actual training timeout triggers sharding re-partitioning; when the device has network instability during training, if the network packet loss rate exceeds the threshold , automatically switch the current training task to local cache mode, after the network is restored, synchronize the training result to the server, and re-evaluate the matching degree of the device and the sharding; at the same time, when the device temperature exceeds the safety threshold , automatically reduce the training load of the device or pause the training, and continue the training after the temperature returns to normal; The training time consumption prediction and abnormality handling in step S3 includes the following steps: This step guarantees the stability of the federated learning training process through dynamic time consumption prediction and multi-dimensional abnormality response mechanism, and the specific implementation details are as follows: Step S3.8: Training time consumption prediction; The theoretical time consumption of device training sharding is calculated by the following formula: Parameter definition and calculation logic: : Sub-model sharding parameter quantity (unit: million parameters), calculated by step S2.2; : Model unit parameter calculation cost (typical value seconds / parameter, based on ResNet-50 model measurement); : Device comprehensive computing power index, updated in real time by step S1.2; : Sharding gradient data volume (unit: MB), estimated by step S3.2; : Real-time network uplink bandwidth (unit: MB / s), obtained by monitoring the network interface.
[0044] Implementation examples: If the number of parameters is , , MB, MB / s, then: ; Step S3.9: Timeout triggers sharding re-partitioning; Timeout detection mechanism: Real-time monitoring of device training duration, when the actual time consumption exceeds times (configurable timeout difference coefficient), trigger re-partitioning.
[0045] Sharding re-partitioning implementation steps: Step S3.9.1: Split the shard according to the preset rule; Equal division method: divide the timeout shard into sub-shards (4 is a typical value) according to the parameter quantity; Take the current available device number, and the typical value is 4; Computing power ratio method: according to the device proportion, the device with high computing power undertakes larger sub-shards.
[0046] Step S3.9.2: Recalculate the matching degree of sub-shards; Call the matching degree function of step S3.3 , assign the sub-shards to the device with the highest matching degree, and ensure that the time consumption of the newly assigned device meets .
[0047] Step S3.10: Network packet loss exception handling; Packet loss rate monitoring: Send probe packets through ICMP protocol and calculate the packet loss rate , when (typical threshold is 15%) triggers the cache mode.
[0048] Local cache mode implementation: Step S3.10.1: Switch to local cache; Store the intermediate results (such as gradient, optimizer state) of training locally on the device, and pause uploading data to the server; Step S3.10.2: Network recovery synchronization; When the packet loss rate drops to below, synchronize the cached data through differential transmission technology, and only upload the difference part with the latest model on the server; Step S3.10.3: Re-evaluate the matching degree; Recalculate the device and shard The matching degree, if If the drop exceeds 30%, the shard will be migrated to a device with better network quality.
[0049] Step S3.11: Handling abnormal device temperature; Temperature monitoring and threshold setting: Real-time collection of CPU / GPU core temperature and safety threshold through device temperature sensors Set to 85°C (can be adjusted depending on the device model).
[0050] Hierarchical load adjustment strategy: Step S3.11.1: When the temperature exceeds the threshold for the first time; Reduce the computational load: Reduce the number of allocated shard parameters by 20%, or reduce the model training accuracy (for example, from FP32 to FP16). Adjust training parameters: increase the learning rate decay factor and reduce the number of iterations.
[0051] Step S3.11.2: When the temperature exceeds the threshold value continuously (e.g., for more than 5 minutes); Pause the training task, record the current iteration status to the checkpoint file, and shut down non-essential computing units (such as GPU streaming multiprocessors).
[0052] Step S3.11.3: Temperature recovery post-processing; When the temperature drops to When the value is below 0, resume training from the checkpoint and re-evaluate the device computing power index. If the computing power drops by more than 15% due to high temperature, the computing power index dynamic update in step S1.8 is triggered.
[0053] More specifically, in step S1, the computing power index is dynamically updated. The formula is: ; in, is the smoothing factor; The following steps are involved: Step S1.8: In each training cycle After the end, calculate the device according to the formula Comprehensive computing power index for the next cycle ; Step S1.9: Obtain the industry average computing power index of the same type of equipment and compare it with the equipment of Make a comparison; Step S1.10: If the device The computing power index continues to be lower than the industry average, and hardware testing shows no faults; Step S1.10.1: Automatically trigger the device software optimization process and clean the system cache; Step S1.10.2: Close unnecessary background processes on your device. Step S1.10.3: Recalculate the device computing power index and evaluate the optimization effect.
[0054] More specifically, when performing incremental aggregation in step S5, the computing power weighted strategy formula is: ; in, Equipment collection to complete training on time; The following steps are involved: Through computing power weighted aggregation strategy, dynamic frequency adjustment and privacy risk assessment, efficient update and secure aggregation of the global model are achieved. The specific implementation details are as follows: Computing power weighted aggregation strategy Step S5.1: Complete the equipment collection statistics on time; Completion criteria on time: The device is in the preset training cycle Sharding training is completed within 30 seconds (typically 30 seconds), and the gradient update data integrity check (such as MD5 hash check) passes.
[0055] Example of set generation: If there are 10 participating devices, 8 of them are in If the training is completed within .
[0056] Step S5.2: Calculation of global parameter update amount; The weighted aggregate local gradients are calculated using the following formula: ; Parameter Description: For devices The computing power weight ensures that devices with strong computing power contribute more to global updates; For devices The local gradient update is generated by step S4 training.
[0057] Calculation example: Device A , device B , the local updates are , ,but: ; Step S5.3: Dynamic aggregation frequency adjustment; Convergence indicator calculation: calculate the global loss function descent rate after each round of aggregation ,in For the Round loss value.
[0058] Slow convergence triggering condition: If 3 consecutive rounds (Configurable), if convergence is determined to be slow, proceed to step S5.3.1.
[0059] Fluctuation amplitude calculation: computing equipment collection The standard deviation of the computing power index ,in is the mean.
[0060] High volatility trigger conditions: If , it is determined that the computing power fluctuation is large, and step S5.3.2 is executed.
[0061] Step S5.3.1: Reduce the aggregation frequency: Aggregation cycle from Extended to , and increase the number of device local training rounds to , reducing communication overhead.
[0062] Step S5.3.2: Increase the aggregation frequency: The polymerization cycle is shortened to , ensuring that the model is updated and synchronized in time when computing power fluctuates, and avoiding gradient outdatedness.
[0063] Step S5.4: Privacy risk assessment and gradient processing; Step S5.4.1: Privacy risk assessment algorithm; Sensitive information detection dimensions: Gradient variance analysis: Calculate the variance of each dimension of the gradient vector. If the variance of a dimension exceeds 3 times the global mean, it is determined to contain sensitive features. Gradient correlation with training data: through mutual information algorithm Calculating gradients With the original data The correlation threshold is set to 0.2 (bits).
[0064] Risk level classification: High risk: There are two or more high variance dimensions or ; Medium risk: 1 high variance dimension and ; Low risk: None of the above characteristics.
[0065] S5.4.2: Gradient compression and obfuscation techniques; High-risk processing: using differential privacy to add Laplace noise: ; in (privacy budget), (sensitivity).
[0066] Medium risk processing: Implement gradient sparsification, only keep the top 30% of gradient components with absolute value, and set the rest to zero.
[0067] Low risk processing: Use lightweight compression (such as FP16 quantization) to reduce communication volume.
[0068] Step S5.4.3: Aggregation after processing; For the processed gradient Perform weighted aggregation of step S5.2 to ensure balance between privacy protection and model accuracy.
[0069] More specifically, when the device computing power fluctuation exceeds the threshold, the sharding migration mechanism is triggered to migrate the unfinished sub-model shards to the device that meets ; Migration gain coefficient; Including the following steps: Step S8: Sharding migration mechanism triggered by computing power fluctuation; This step triggers the adaptive migration of unfinished shards by monitoring the device computing power fluctuation in real time, ensuring the continuity of federated learning training tasks. The specific implementation details are as follows: Step S8.1: Fluctuation monitoring and triggering; The fluctuation threshold uses a dynamic percentage threshold: ; Where, is the fluctuation coefficient (typical value 0.2, i.e. when the computing power drops by more than 20%, migration is triggered).
[0070] Real-time monitoring implementation: Collect the device's comprehensive computing power index every 500ms (configurable) Compare with the average of the previous 10 rounds (configurable). If the current , it is determined that the computing power has degraded.
[0071] Step S8.1.1: Identification of unfinished shards on degraded devices; Query the shard list currently carried by the device through the task scheduling log, and filter the set of sub-model shards that are in the "training" state and have not been completed .
[0072] Step S8.1.2-S8.1.3: Target device matching degree calculation and screening; Matching degree function application: For each unfinished shard , iterate through other available devices , calculate the matching degree: ; in, For sharding On the device The theoretical calculation time is calculated according to step S3.1.
[0073] Migration gain coefficient setting: Take 1.2 (typical value) to ensure that the target device matches significantly better than the original device, that is: ; Target device collection generation: Example: Original Equipment Shard The matching degree is 2.5, the device The matching degree is 3.0 (>2.5×1.2=3.0), the device is 2.8 (<3.0), then the target set is .
[0074] Step S8.2: resource pre-allocation detection; Resource usage simulation: for target devices , perform the following tests: Memory usage simulation: calculating receiving fragments Post-memory usage (Assuming each parameter occupies 4 bytes), requirements (Leave a 20% buffer).
[0075] Computing load simulation: Calculating the computing power index after adding new shards ,Require ( This is to reserve computing time, typically 1 second).
[0076] Insufficient resources handling: If the target device If the above conditions are not met, the device is excluded and the next target device is detected.
[0077] Data transmission optimization: using differential transmission technology to transmit only fragments The parameter update since the last synchronization reduces the network transmission volume. For example, if the total parameter size of a shard is 10MB and only 1MB is updated, the transmission volume is reduced by 90%.
[0078] Post-migration task recovery: target device After receiving the fragment, The training checkpoint is restored to the state, the training task is continued, and the task distribution log is updated to the server.
[0079] like Figure 2As shown, more specifically, according to a federal learning driven computing power elasticity scheduling method, a federal learning driven computing power elasticity scheduling system is proposed, comprising: a dynamic computing power perception module, an elastic fragmentation generation module, an adaptive scheduling module, a federal training execution module and an incremental aggregation update module; the dynamic computing power perception module is used for real-time monitoring of the computing power index of the federal learning participating device, and generating a dynamic resource vector; the elastic fragmentation generation module is used for splitting the global federal model into differentiated sub-model fragments according to the dynamic resource vector; the adaptive scheduling module is used for dynamically distributing the sub-model fragments to the matching devices based on the device computing power fluctuation and the fragmentation calculation complexity; the federal training execution module is used for the device to train the distributed sub-model fragments locally, and generate local gradient updates; the incremental aggregation update module is used for aggregating the local gradient updates, generating a global model and triggering the next round of elasticity scheduling iteration.
[0080] Although embodiments of the present application have been shown and described, it is to be understood that various modifications, substitutions, replacements and changes can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. A method for flexible computing power scheduling driven by federated learning, characterized in that: The following steps are involved: S1 Dynamic Computing Power Perception: monitors the computing power indicators of federated learning participating devices in real time and generates dynamic resource vectors; S2 elastic shard generation: split the global federated model into differentiated sub-model shards based on the dynamic resource vector; S3 adaptive scheduling: Dynamically allocates sub-model shards to matching devices based on device computing power fluctuations and shard computation complexity; S4 federated training execution: The device locally trains the assigned sub-model shards and generates local gradient updates; S5 incremental aggregation update: Aggregates local gradient updates, generates a global model, and triggers the next round of elastic scheduling iteration.
2. A method for flexible computing power scheduling driven by federated learning according to claim 1, characterized in that: The dynamic resource vector in step S1 is expressed as: ; in: For devices The comprehensive computing power index is calculated using the following formula: ; in: is the weight coefficient; is the battery attenuation factor; is the current battery power consumption rate; is the currently available memory; is the remaining battery capacity; It is the real-time network uplink bandwidth; Introducing a reinforcement learning module, using dynamic resource vectors as state input, combined with historical scheduling data, and optimizing the computing power index weight coefficient through a reward function and At the same time, when the device is in different working modes, it automatically switches to the corresponding computing power evaluation strategy to achieve more accurate computing power perception.
3. The method for flexible computing power scheduling driven by federated learning according to claim 2, characterized in that: In step S1, the comprehensive computing power index is calculated The following steps are involved: Step S1.1: Real-time acquisition of equipment of 、 、 、 and data; Step S1.2: According to the formula ; Substitute the weight coefficient and battery degradation factor , calculate the device Comprehensive computing power index ; Step S1.3: The calculated and 、 、 Combined into dynamic resource vectors ; The reinforcement learning module optimizes the weight coefficients including the following steps: Step S1.4: Dynamic resource vector ,historical scheduling plans and corresponding training results are used as inputs of the reinforcement learning model; Step S1.5: Calculate the reward value for this scheduling using the reward function. If the training efficiency is improved or the energy consumption is reduced, a positive reward is given; otherwise, a negative reward is given. Step S1.6: Update the weight coefficients using reinforcement learning algorithm and , so that the subsequent computing power evaluation is more in line with actual training needs; Step S1.7: Repeat steps S1.4 to S1.6 to continuously optimize the weight coefficient.
4. The method for flexible computing power scheduling driven by federated learning according to claim 3, characterized in that: The sub-model shard size in step S2 Match the target device computing power: ; in: The maximum fragment size allowed by the device; is the load balancing coefficient, and ; A collection of currently available devices; is the total number of parameters of the global model; Add a collaborative sharding strategy for heterogeneous devices. For devices with different architectures, the model is layered and sharded according to their computing advantages. At the same time, model sensitivity analysis is introduced. For model parts related to sensitive data, they are preferentially assigned to trusted devices for training, and homomorphic encryption technology is used to protect the data during the training process.
5. The method for flexible computing power scheduling driven by federated learning according to claim 4, characterized in that: The elastic sharding generation in step S2 includes the following steps: Step S2.1: Perform structural analysis on the global federated model to determine the computational characteristics and data sensitivity of each layer; Step S2.2: Traverse the currently available device set , according to the formula: ; Calculate the sub-model shard size that each device can carry ; Step S2.3: Based on the device architecture, the computationally intensive model layers are preferentially assigned to the GPU devices, and the logic processing layers are assigned to the CPU devices, forming a preliminary sharding scheme. Step S2.4: For the model part containing sensitive data, filter out the trusted device set and reallocate the relevant shards to the trusted devices; Step S2.5: For the sub-model shards assigned to the device, homomorphic encryption technology is used to encrypt the data to generate the final differentiated sub-model shards.
6. A method for flexible computing power scheduling driven by federated learning according to claim 5, characterized in that: The adaptive scheduling in step S3 introduces the shard-device matching function: ; in: Sharding for sub-models The theoretical calculation of Positive correlation; For sharding The amount of gradient data; The scheduler selects the device-shard combination with the highest matching degree and satisfies , is a dynamic threshold; in addition, an equipment health evaluation system is established to calculate the equipment health by comprehensively considering factors such as equipment operation time and failure rate. When the device health is below the threshold When a server is running, it is restricted from taking on new sharding tasks and the shards it is processing are migrated to healthy devices first; The step S3 of performing adaptive scheduling includes the following steps: Step S3.1: Slice the sub-model according to its size , combined with the device computing power parameters, calculate each sub-model shard On each device The theoretical calculation time on ; Step S3.2: Estimate each sub-model shard The amount of gradient data ; Step S3.3: According to the formula ; Calculate each device Sharding with sub-models Matching degree ; Step S3.4: Calculate the current set of available devices Median comprehensive computing power index of medium-sized devices , confirm that A subset of devices; Step S3.5: From the subset of devices that meet the conditions, select the device-shard combination that has the highest matching degree with each sub-model shard for task allocation; Step S3.6: Calculate the equipment health based on the equipment's operating time, historical failure rate, and other data ; Step S3.7: If the device health Below threshold , migrate the shards being processed by the device to a device with higher health, and restrict it from taking on new shard tasks.
7. The method for flexible computing power scheduling driven by federated learning according to claim 6, characterized in that: Step S3 also includes training time prediction: ; in Calculate the cost of the model unit parameters. The actual training timeout triggers the sharding re-segmentation. When the device encounters network instability during training, if the network packet loss rate exceeds the threshold , automatically switches the current training task to local cache mode, and after the network is restored, synchronizes the training results to the server and re-evaluates the matching degree between the device and the shard; at the same time, when it is detected that the device temperature exceeds the safety threshold When the temperature drops, the device's training load will be automatically reduced or training will be paused, and training will resume after the temperature returns to normal. The training time prediction and exception handling in step S3 include the following steps: Step S3.8: According to the formula: ; Calculate each device Training sub-model shards The prediction training time ; Step S3.9: During the equipment training process, the training time is monitored in real time. If it exceeds the predicted training time, , triggering the shard re-splitting operation: Step S3.9.1: Split the timed-out sub-model fragment into multiple smaller sub-fragments according to a preset rule; Step S3.9.2: Recalculate the matching degree of each sub-shard with other devices and assign the sub-shard to the appropriate device to continue training; Step S3.10: Real-time monitoring of the device network status, if the network packet loss rate exceeds the threshold : Step S3.10.1: Switch the current training task to local cache mode and suspend data upload; Step S3.10.2: After the network is restored, synchronize the local training results to the server; Step S3.10.3: Re-evaluate the matching degree between the device and the shard, and adjust the task allocation according to the situation; Step S3.11: Monitor the device temperature in real time, and if it exceeds the safety threshold ; Step S3.11.1: Automatically reduce the training load of the device and the amount of computing tasks; Step S3.11.2: If the temperature remains too high, suspend training; Step S3.11.3: After the device temperature returns to normal, continue the training task.
8. The method for flexible computing power scheduling driven by federated learning according to claim 7, characterized in that: Dynamically update the computing power index in step S1 The formula is: ; in, is the smoothing factor; The following steps are involved: Step S1.8: In each training cycle After the end, calculate the device according to the formula Comprehensive computing power index for the next cycle ; Step S1.9: Get the industry average computing power index of the same type of equipment and compare it with the equipment of Make a comparison; Step S1.10: If the device The computing power index continues to be lower than the industry average, and hardware testing shows no faults; Step S1.10.1: Automatically trigger the device software optimization process and clean the system cache; Step S1.10.2: Close unnecessary background processes on your device. Step S1.10.3: Recalculate the device computing power index and evaluate the optimization effect.
9. The method for flexible computing power scheduling driven by federated learning according to claim 8, characterized in that: When performing incremental aggregation in step S5, the computing power weighted strategy formula is: ; in, Equipment collection to complete training on time; The following steps are involved: Step S5.1: Count the number of devices that completed training on time ; Step S5.2: Calculate the global model parameter update amount according to the formula ; Step S5.3: Analyze the convergence speed of the global model and the stability of the device computing power, and dynamically adjust the aggregation frequency: Step S5.3.1: If the model converges slowly, reduce the aggregation frequency and increase the number of local training times on the device; Step S5.3.2: If the computing power of the device fluctuates greatly, increase the aggregation frequency and synchronize the model updates in time; Step S5.4: Before aggregation, update the local gradient uploaded by each device Conduct privacy risk assessments; Step S5.4.1: Use the privacy risk assessment algorithm to analyze whether there is a risk of sensitive information leakage in the gradient update; Step S5.4.2: If a privacy leakage risk is detected, the gradient is processed using gradient compression and obfuscation techniques; Step S5.4.3: The processed gradient is involved in the aggregation calculation.
10. A method for flexible computing power scheduling driven by federated learning according to claim 9, characterized in that: When the computing power fluctuation of the device exceeds the threshold, the shard migration mechanism is triggered to migrate the unfinished sub-model shards to meet the Equipment ; is the migration gain coefficient; The following steps are involved: Step S8.1: Real-time monitoring of device computing power changes. If the fluctuation of device computing power exceeds the preset threshold: Step S8.1.1: Determine the unfinished sub-model shards on the degraded device; Step S8.1.2: Traverse other available devices and calculate the matching degree between each device and the unfinished sub-model fragment ; Step S8.1.3: Filter out The target device collection; Step S8.2: Perform resource pre-allocation detection on the target device; Step S8.2.1: Simulate the resource usage of the target device after receiving the unfinished sub-model fragment; Step S8.2.2: If the target device has insufficient resources, exclude the device.
Citation Information
Patent Citations
Model training method and device and electronic equipment
CN116957107A
Adaptive federated learning method and system based on heterogeneous edge-end equipment
CN118194976A
Agent policy learning method with privacy protection in mobile edge computing
WO2024254892A1
Cited By
Data development and utilization method and system based on federal learning framework
CN121365417A
Data development and utilization method and system based on federated learning framework
CN121365417B