A federated learning driven computing power elasticity scheduling method
By generating dynamic resource vectors through real-time monitoring of device computing power indicators, and performing elastic sharding and adaptive scheduling, 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 performance of the system.
Patent Information
- Application Number
- CN202510930302.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-07-07
AI Technical Summary
In existing federated learning scenarios, there are shortcomings such as insufficient computing power awareness, rigid model sharding strategies, poor dynamic scheduling adaptability, an imbalance between privacy protection and aggregation efficiency, and low resource utilization efficiency, resulting in low training efficiency and privacy risks.
By generating dynamic resource vectors through real-time monitoring of device computing power indicators, elastic sharding and adaptive scheduling are performed. Reinforcement learning is combined to optimize weight coefficients, and heterogeneous device collaborative sharding strategies and homomorphic encryption technology are introduced to establish a device health assessment system, dynamically adjusting aggregation frequency and privacy risk assessment.
It achieves precise computing power perception, improves training efficiency, ensures the continuity of the training process, increases resource utilization, enhances privacy protection, and significantly improves the performance and robustness of distributed machine learning systems.
Smart Images

Figure CN120806069B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of public transportation system technology, specifically to a federated learning-driven method for elastic scheduling of computing power. Background Technology
[0002] In federated learning scenarios, the devices participating in training (such as terminal devices and edge servers) are typically heterogeneous, exhibiting significant differences in resources such as computing power, memory, battery capacity, and network bandwidth. Existing computing power scheduling methods generally suffer from the following technical bottlenecks:
[0003] 1. Insufficient computing power awareness: Traditional methods mostly use static computing power assessment models, which cannot respond to device computing power fluctuations (such as changes in CPU load and battery power consumption) in real time, resulting in inaccurate resource vector representation, which in turn affects subsequent scheduling decisions;
[0004] 2. Rigid model sharding strategy: In the process of global model sharding, there is a lack of differentiated consideration of device architecture (such as CPU, GPU, NPU) and data sensitivity, making it difficult to achieve accurate matching between computationally intensive tasks and device advantages, resulting in low training efficiency;
[0005] 3. Poor adaptability of dynamic scheduling: When the computing power of the device fluctuates, the network is unstable or the temperature is abnormal, the existing scheduling mechanism cannot quickly trigger task migration or fragmentation and re-splitting, which can easily cause training timeouts or equipment failures, affecting the continuity of federated learning.
[0006] 4. Imbalance between privacy protection and aggregation efficiency: In the gradient aggregation process, traditional methods either fail to consider the impact of differences in computing power on the aggregation weights, resulting in slow model convergence; or they lack a dynamic privacy risk assessment mechanism, posing a risk of sensitive information leakage.
[0007] 5. Low resource utilization efficiency: The lack of a device health assessment system makes it impossible to identify faulty devices or resource bottlenecks in a timely manner, which can easily lead to task backlog or resource waste and make it difficult to achieve elastic scheduling of computing resources. Summary of the Invention
[0008] To address the shortcomings of existing technologies, this invention provides a federated learning-driven elastic scheduling method for computing power, which solves the problems mentioned in the background.
[0009] To achieve the above objectives, the present invention provides the following technical solution: a federated learning-driven elastic scheduling method for computing power, comprising the following steps:
[0010] S1 Dynamic Computing Power Awareness: Real-time monitoring of computing power metrics of devices participating in federated learning, generating dynamic resource vectors;
[0011] S2 Elastic Sharding Generation: Based on the dynamic resource vector, the global federated model is split into differentiated sub-model shards;
[0012] S3 Adaptive Scheduling: Based on device computing power fluctuations and sharding computational complexity, it dynamically allocates sub-model shards to matching devices;
[0013] S4 Federated Training Execution: The device trains the allocated sub-model slices locally and generates local gradient updates;
[0014] S5 Incremental Aggregation Update: Aggregates local gradient updates, generates a global model, and triggers the next round of elastic scheduling iteration.
[0015] Preferably, the dynamic resource vector in step S1 is represented as follows:
[0016] ;
[0017] in: For equipment The overall computing power index is calculated using the following formula:
[0018] ;
[0019] in: These are the weighting coefficients; Battery degradation factor; This represents the current battery power consumption rate.
[0020] Currently available memory; This refers to the remaining battery capacity. This refers to the real-time network uplink bandwidth.
[0021] A reinforcement learning module is introduced, using a dynamic resource vector as the state input and combining it with historical scheduling data to optimize the weight coefficients of computing power indicators through a reward function. and Meanwhile, when the device is in different working modes, the corresponding computing power assessment strategy is automatically switched to achieve more accurate computing power perception.
[0022] Preferably, in step S1, the comprehensive computing power index is calculated. Includes the following steps:
[0023] Step S1.1: Real-time device acquisition of , , , and data;
[0024] Step S1.2: According to the formula
[0025] ;
[0026] Substitute the weighting coefficients and battery degradation factor Calculate the equipment Comprehensive computing power index ;
[0027] Step S1.3: Calculate the... and , , Combined into dynamic resource vectors ;
[0028] The reinforcement learning module optimizes the weight coefficients by the following steps:
[0029] Step S1.4: Transfer the dynamic resource vector Historical scheduling schemes and corresponding training results are used as inputs to the reinforcement learning model;
[0030] 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.
[0031] Step S1.6: Update the weight coefficients using a reinforcement learning algorithm. and This makes subsequent computing power assessments more aligned with actual training needs;
[0032] Step S1.7: Repeat steps S1.4 to S1.6 to continuously optimize the weight coefficients.
[0033] Preferably, the sub-model piece size in step S2 Matching the computing power of the target device:
[0034] ;
[0035] in: This is the maximum slice size allowed by the device; is the load balancing coefficient, and ; The set of currently available devices; This represents the total number of parameters in the global model.
[0036] A heterogeneous device collaborative sharding strategy is added. For devices with different architectures, the model is sharded in layers according to their computing advantages. At the same time, model sensitivity analysis is introduced. For model parts related to sensitive data, they are preferentially allocated to trusted devices for training, and homomorphic encryption technology is used to protect the data during the training process.
[0037] Preferably, the flexible segmentation generation in step S2 includes the following steps:
[0038] Step S2.1: Perform structural analysis on the global federated model to determine the computational characteristics and data sensitivity of each layer;
[0039] Step S2.2: Traverse the set of currently available devices According to the formula:
[0040] ;
[0041] Calculate the sub-model fragment size that each device can support. ;
[0042] Step S2.3: Based on the device architecture, prioritize allocating computationally intensive model layers (such as convolutional layers) to GPU devices and logic processing layers to CPU devices to form a preliminary sharding scheme;
[0043] Step S2.4: For the model portion containing sensitive data, filter out the set of trusted devices and reallocate the relevant shards to trusted devices;
[0044] Step S2.5: For the sub-model shards allocated to the device, use homomorphic encryption technology to encrypt the data and generate the final differentiated sub-model shards.
[0045] Preferably, the adaptive scheduling in step S3 introduces a fragmentation-device matching function:
[0046] ;
[0047] in: Slicing the sub-model The theoretical calculation time is long, and it is comparable to Positive correlation; For fragmentation The amount of gradient data;
[0048] The scheduling selects the device-shard combination with the highest matching degree, and satisfies... , A dynamic threshold is used; in addition, an equipment health assessment system is established to calculate equipment health based on factors such as equipment runtime and failure rate. When the device health level is below the threshold When this happens, limit it from accepting new sharding tasks and prioritize migrating the shards it is currently processing to healthy devices;
[0049] Step S3, adaptive scheduling, includes the following steps:
[0050] Step S3.1: Based on the sub-model piece size Based on the device's computing power parameters, calculate the partitions of each sub-model. In each device Theoretical calculation time ;
[0051] Step S3.2: Estimate the fragments of each sub-model Gradient data volume ;
[0052] Step S3.3: According to the formula
[0053] ;
[0054] Calculate each device With sub-model partitioning Matching degree ;
[0055] Step S3.4: Calculate the current set of available devices Median of the overall computing power index of medium-sized devices Determine whether it meets the requirements. A subset of devices;
[0056] Step S3.5: From the subset of devices that meet the conditions, select the device-shard combination with the highest matching degree with each sub-model shard for task allocation;
[0057] Step S3.6: Calculate the equipment health status based on data such as equipment runtime and historical failure rate. ;
[0058] Step S3.7: If the device health is... Below the threshold The device is migrating the shards it is currently processing to a device with higher health, and restricting it from accepting new shard tasks.
[0059] Preferably, step S3 further includes training time prediction:
[0060] ;
[0061] in Calculate the cost per unit parameter of the model (a device-independent constant); if the actual training times out, trigger a re-splitting of the data; if the network becomes unstable during training and the network packet loss rate exceeds a threshold... The system automatically switches the current training task to local caching mode. Once the network recovers, the training results are synchronized to the server, and the device's compatibility with the data slices is reassessed. Simultaneously, if the device temperature exceeds a safe threshold, the system will automatically switch back to local caching mode. When the temperature returns to normal, the device will automatically reduce its training load or pause training, and resume training once the temperature returns to normal.
[0062] The training time prediction and anomaly handling in step S3 include the following steps:
[0063] Step S3.8: According to the formula:
[0064] ;
[0065] Calculate each device Training sub-model slices Prediction training time ;
[0066] Step S3.9: During the device training process, monitor the training duration in real time. If it exceeds the predicted training time... This triggers the fragmentation and re-splitting operation:
[0067] Step S3.9.1: Divide the timed-out sub-model fragments into multiple smaller sub-fragments according to preset rules;
[0068] Step S3.9.2: Recalculate the matching degree of each sub-segment with other devices, and assign the sub-segments to appropriate devices to continue training;
[0069] Step S3.10: Monitor the device network status in real time. If the network packet loss rate exceeds the threshold... :
[0070] Step S3.10.1: Switch the current training task to local caching mode and pause data upload;
[0071] Step S3.10.2: After the network is restored, synchronize the local training results to the server;
[0072] Step S3.10.3: Reassess the compatibility between the device and the shards, and adjust task allocation accordingly; Step S3.11: Monitor the device temperature in real time, and if it exceeds the safety threshold... ;
[0073] Step S3.11.1: Automatically reduce the training load on the device and reduce the amount of computational tasks;
[0074] Step S3.11.2: If the temperature remains too high, pause the training;
[0075] Step S3.11.3: After the equipment temperature returns to normal, continue the training task.
[0076] Preferably, the computing power index is dynamically updated in step S1. The formula is:
[0077] ;
[0078] in, It is a smoothing factor;
[0079] Includes the following steps:
[0080] Step S1.8: In each training cycle After completion, calculate the equipment according to the formula. Comprehensive computing power index for the next cycle ;
[0081] Step S1.9: Obtain the industry average computing power index for similar equipment and compare it with the equipment's performance index. of Compare;
[0082] Step S1.10: If the device Its computing power index has consistently been lower than the industry average, and no hardware faults have been detected.
[0083] Step S1.10.1: Automatically trigger the device software optimization process and clear the system cache;
[0084] Step S1.10.2: Close unnecessary background processes on the device;
[0085] Step S1.10.3: Recalculate the device computing power index and evaluate the optimization effect.
[0086] Preferably, when performing incremental aggregation in step S5, the computing power weighting strategy formula is as follows:
[0087] ;
[0088] in, The equipment set was prepared to complete the training on time.
[0089] Includes the following steps:
[0090] Step S5.1: Count the set of devices that completed training on time. ;
[0091] Step S5.2: Calculate the global model parameter update amount according to the formula. ;
[0092] Step S5.3: Analyze the convergence speed of the global model and the stability of the device's computing power, and dynamically adjust the aggregation frequency:
[0093] Step S5.3.1: If the model converges slowly, reduce the aggregation frequency and increase the number of local training sessions on the device;
[0094] Step S5.3.2: If the computing power of the equipment fluctuates greatly, increase the aggregation frequency and update the model in a timely manner;
[0095] Step S5.4: Before aggregation, update the local gradient uploaded by each device. Conduct a privacy risk assessment;
[0096] Step S5.4.1: Use a privacy risk assessment algorithm to analyze whether there is a risk of sensitive information leakage during gradient updates;
[0097] Step S5.4.2: If a privacy risk is detected, gradient compression and obfuscation techniques are used to process the gradient;
[0098] Step S5.4.3: Incorporate the processed gradients into the aggregation calculation.
[0099] Preferably, when the device's computing power fluctuation exceeds a threshold, a sharding migration mechanism is triggered to migrate the incomplete sub-models to shards that meet the threshold. equipment ; This is the migration gain coefficient;
[0100] Includes the following steps:
[0101] Step S8.1: Monitor the changes in device computing power in real time. If the fluctuation in device computing power exceeds a preset threshold:
[0102] Step S8.1.1: Identify the incomplete sub-model fragments on the downgraded device;
[0103] Step S8.1.2: Traverse other available devices and calculate the matching degree between each device and the incomplete sub-model fragment. ;
[0104] Step S8.1.3: Filter out those that meet the requirements The target equipment set;
[0105] Step S8.2: Perform resource pre-allocation detection on the target device;
[0106] Step S8.2.1: Simulate the resource usage of the target device after the incomplete sub-model fragmentation;
[0107] Step S8.2.2: If the target device has insufficient resources, exclude the device.
[0108] This invention provides a federated learning-driven method for elastic scheduling of computing power, which has the following advantages:
[0109] 1. Precise Computing Power Awareness and Dynamic Optimization: By monitoring indicators such as CPU utilization, memory usage, battery power consumption, and network bandwidth in real time, a dynamic resource vector containing the Comprehensive Computing Power Index (CEI) is generated. Combined with the adaptive optimization of weight coefficients by the reinforcement learning module, the computing power assessment error is reduced, effectively solving the problem of inaccurate computing power representation of heterogeneous devices. An automatic switching mechanism for device working modes (such as power saving mode / high performance mode) is introduced to match computing power assessment strategies under different scenarios, thereby improving the robustness of awareness.
[0110] 2. Elastic Sharding and Heterogeneous Device Collaboration: The sub-model shard size is calculated based on dynamic resource vectors, and the computing power is proportionally allocated by combining the load balancing coefficient λ, which reduces the load imbalance between devices and avoids training blockage caused by "computing power bottleneck" devices; hierarchical sharding is performed based on the computing advantages of heterogeneous devices such as CPUs, GPUs, and NPUs (e.g., convolutional layers are allocated to GPUs), which improves the efficiency of computationally intensive tasks by more than 2 times; at the same time, homomorphic encryption technology is used to protect sensitive data shards and meet the privacy requirements of federated learning.
[0111] 3. Adaptive Scheduling and Fault Tolerance: By utilizing the shard-device matching function (Match) to comprehensively consider computing power, computation time, and network bandwidth, the accuracy of scheduling decisions is improved, ensuring optimal matching between tasks and devices. Mechanisms such as training time prediction, network packet loss caching, and temperature anomaly handling are integrated. When device training times out or network interruption occurs, shard re-splitting or task migration is automatically triggered to ensure the continuity of the training process and reduce efficiency loss caused by training interruption.
[0112] 4. Efficient Aggregation and Privacy Enhancement: A computing power-weighted aggregation strategy is adopted, which enables devices with strong computing power to contribute more weight to global model updates, thereby accelerating model convergence. The aggregation frequency is dynamically adjusted to reduce the number of aggregations when model convergence is slow, thereby reducing communication overhead. Gradient privacy risk assessment and obfuscation technology are introduced to ensure aggregation efficiency while reducing the risk of privacy leakage through homomorphic encryption and gradient compression, thus meeting the data security specifications for federated learning.
[0113] 5. Resource Health Management and Elastic Migration: Establish an equipment health assessment system, dynamically adjust task allocation based on indicators such as runtime and failure rate, and automatically migrate tasks when equipment health falls below the threshold to reduce system failure rate; adopt differential transmission technology to optimize the fragment migration process, transmit only updated data to reduce network bandwidth consumption, and at the same time avoid target device overload through resource pre-allocation detection to improve system reliability.
[0114] In summary, this invention achieves efficient utilization of computing resources, adaptive task allocation, and enhanced data privacy protection in federated learning scenarios through end-to-end optimization of dynamic perception, elastic sharding, intelligent scheduling, and secure aggregation, significantly improving the performance and robustness of distributed machine learning systems. Attached Figure Description
[0115] Figure 1 This is a schematic diagram of a federated learning-driven elastic scheduling method for computing power as described in this invention.
[0116] Figure 2 This is a block diagram illustrating the principle of a federated learning-driven elastic scheduling system for computing power, as described in this invention. Detailed Implementation
[0117] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0118] like Figure 1 As shown, this invention provides a technical solution: a federated learning-driven elastic scheduling method for computing power, comprising the following steps:
[0119] S1 Dynamic Computing Power Awareness: Real-time monitoring of computing power metrics of devices participating in federated learning, generating dynamic resource vectors;
[0120] S2 Elastic Sharding Generation: Based on the dynamic resource vector, the global federated model is split into differentiated sub-model shards;
[0121] S3 Adaptive Scheduling: Based on device computing power fluctuations and sharding computational complexity, it dynamically allocates sub-model shards to matching devices;
[0122] S4 Federated Training Execution: The device trains the allocated sub-model slices locally and generates local gradient updates;
[0123] S5 Incremental Aggregation Update: Aggregates local gradient updates, generates a global model, and triggers the next round of elastic scheduling iteration.
[0124] More specifically, the dynamic resource vector in step S1 is represented as:
[0125] ;
[0126] in: For equipment The overall computing power index is calculated using the following formula:
[0127] ;
[0128] in: These are the weighting coefficients; Battery degradation factor; This represents the current battery power consumption rate.
[0129] Currently available memory; This refers to the remaining battery capacity. This refers to the real-time network uplink bandwidth.
[0130] A reinforcement learning module is introduced, using a dynamic resource vector as the state input and combining it with historical scheduling data. The module optimizes the weighting coefficients of computing power metrics through a reward function (such as improved training efficiency or reduced energy consumption). and Meanwhile, when the device is in different working modes (such as power saving mode and high performance mode), the corresponding computing power assessment strategy is automatically switched to achieve more accurate computing power perception.
[0131] More specifically, in step S1, the comprehensive computing power index is calculated. Includes the following steps:
[0132] The implementation steps are as follows:
[0133] Step S1.1: Collect device hardware status data in real time, including:
[0134] CPU core usage, including: The number of idle CPU cores. This represents the total number of CPU cores.
[0135] Memory usage, including: Free memory capacity This represents the total memory capacity.
[0136] Battery usage, including: The current battery power consumption rate (unit: mW) is calculated by monitoring the battery charging and discharging current and voltage.
[0137] Step S1.2: Substitute in the preset weighting coefficients and battery degradation factor ,in Typical values are as follows The comprehensive evaluation index was calculated. ;
[0138] Step S1.3: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] With real-time data collection (Memory usage) (Battery usage), and other possible indicators (e.g., network bandwidth, if applicable) combined into a four-dimensional dynamic resource vector. This serves as the status input for subsequent scheduling.
[0139] Implementation of reinforcement learning optimization module:
[0140] The computing power evaluation parameters are dynamically optimized using deep reinforcement learning algorithms. The specific mechanism is as follows:
[0141] State space: based on dynamic resource vectors Historical scheduling schemes (such as partitioning allocation results) and training results (such as convergence speed and energy consumption data) are used as input states;
[0142] Action space: Output weight coefficients and The adjustment value, the adjustment step size is (Typical value);
[0143] Reward function: Positive reward: If training efficiency improves by more than 5% or energy consumption decreases by more than 10%, the reward value is... Negative rewards are applied if training exceeds the allotted time or the equipment overheats. ;
[0144] Step S1.4: Input the state data into the deep Q-network (DQN) model to generate the optimal action (parameter adjustment scheme).
[0145] Step S1.5: Calculate the reward value of the current strategy according to the reward function and update the experience replay buffer;
[0146] Step S1.6: Update the neural network parameters using gradient descent and iteratively optimize the weight coefficients;
[0147] Step S1.7: Re-evaluate the parameters every 50 training cycles (configurable) to form a closed-loop optimization.
[0148] Adaptive switching of operating modes: When the device's operating mode changes (e.g., manually switched by the user or automatically triggered by the system), the following strategy is executed:
[0149] Power saving mode: Increases the weight of battery-related parameters (such as...) Adjust to 0.5), reduce CPU and memory weights to decrease performance loss in computing power evaluation; High-performance mode: increase CPU and memory weights (e.g., make...). Ignore battery degradation factor Prioritize computational efficiency; Switching trigger conditions: Real-time switching of computing power evaluation strategy is triggered by monitoring power management status through system API or user input, with a switching delay of no more than 100ms (typical value).
[0150] More specifically, the sub-model piece size in step S2 Matching the computing power of the target device:
[0151] ;
[0152] in: This is the maximum slice size allowed by the device; is the load balancing coefficient, and ; The set of currently available devices; This represents the total number of parameters in the global model.
[0153] A heterogeneous device collaborative sharding strategy is added. For devices with different architectures (such as CPU, GPU, NPU), the model is sharded in layers according to their computing advantages. At the same time, model sensitivity analysis is introduced. For model parts related to sensitive data, they are preferentially allocated to trusted devices for training, and homomorphic encryption technology is used to protect the data during the training process.
[0154] More specifically, the elastic sharding generation in step S2 includes the following steps:
[0155] Step S2.1: Perform structural analysis on the global federated model to determine the computational characteristics and data sensitivity of each layer;
[0156] Step S2.2: Calculation of sub-model piece size:
[0157] The maximum size of the fragments that the device can handle is dynamically calculated using the following formula:
[0158] ;
[0159] The implementation steps are as follows:
[0160] Parameter definition:
[0161] The maximum slice size is limited by the device hardware (e.g., GPU memory is limited to 1GB).
[0162] This is the load balancing factor (typically 1.2, to ensure that the load distribution is slightly higher than the computing power ratio, avoiding resource waste).
[0163] The set of currently available devices The sum of computing power indices;
[0164] Total number of parameters in the global model (unit: millions of parameters);
[0165] Traversal and calculation process:
[0166] For each device First calculate the computing power ratio. multiplied by and Obtain the theoretical fragment size, and then combine it with... Take the minimum value to ensure it does not exceed the equipment's load-bearing capacity.
[0167] Step S2.3: Layering and sharding heterogeneous devices:
[0168] The model layer is allocated based on the characteristics of the device architecture, with the following specific strategy:
[0169] Device architecture identification: Obtain hardware type (such as CPU, GPU, NPU) and computing power parameters (such as the peak floating-point operation of GPU) through the device driver interface.
[0170] Model layer characteristic analysis: Computationally intensive layers (such as CNN convolutional layers): preferentially allocated to GPU / NPU devices to take advantage of parallel computing; logic processing layers (such as recurrent neural networks (RNNs): allocated to CPU devices to take advantage of logic control unit.
[0171] Example: The global model contains 10 convolutional layers and 5 fully connected layers. The convolutional layers are allocated to GPU devices according to the computing power ratio, and the fully connected layers are allocated to CPU devices, forming a preliminary sharding scheme.
[0172] Step S2.4: Sensitive data fragment reallocation:
[0173] Data privacy is protected through the following mechanisms:
[0174] Trusted Device Screening: Establish a device trust rating system, with rating factors including device authentication status, historical privacy breach records, and administrator-preset trust level.
[0175] Reassignment logic: Model shards containing sensitive data such as medical and financial data are only assigned to devices with a trust score of ≥80 (out of 100), and the assignment log is recorded.
[0176] Step S2.5: Homomorphic encryption processing:
[0177] Use additive homomorphic encryption techniques (such as the Paillier cryptosystem) to encrypt fragmented data:
[0178] Encryption process: The server generates the encryption public key. and private key ,Will Distributed to equipment; equipment use Data fragments for the assigned sub-model Encryption, obtaining ciphertext .
[0179] Performance optimization: Lightweight encryption (such as AES) is used for non-sensitive data sharding, while homomorphic encryption is used for sensitive data sharding, balancing privacy protection and computational efficiency.
[0180] Step S3: Adaptive Scheduling and Health Management
[0181] This step uses a matching degree function and device health assessment to achieve dynamic allocation and migration of sub-model fragments. The specific implementation is as follows:
[0182] Steps S3.1-S3.3: Fragmentation-Device Matching Degree Calculation:
[0183] 1.1 Theoretical calculation time Calculation (Step S3.1):
[0184] ;
[0185] Calculate the cost per unit parameter of the model (typical value: (seconds / parameter, adjustable depending on model type) This refers to the number of fragmentation parameters; This is the overall computing power index of the equipment.
[0186] Step S3.21.2: Gradient data volume Estimate:
[0187] ;
[0188] The number of single-precision floating-point numbers; This is the gradient compression ratio (typically 0.3, which means 30% compression).
[0189] 1.3 Calculation of the matching degree function (step S3.3):
[0190] ;
[0191] Characterizes the ability of a device's computing power to compensate for computation time.
[0192] It characterizes the network bandwidth's adaptability to gradient transmission.
[0193] Steps S3.4-S3.5: Equipment subset selection and task allocation:
[0194] Dynamic threshold Sure:
[0195] The value is dynamically adjusted based on the proportion of the current training round to the total training rounds, with an initial value of 0.8 and a gradual increase to 1.0.
[0196] Task assignment example: device set , , Then only if The equipment participates in the allocation.
[0197] Steps S3.6-S3.7: Equipment Health Assessment and Migration
[0198] 3.1 Health calculate:
[0199] ;
[0200] 3.2 Fragmentation Migration Mechanism:
[0201] when When the typical value is 0.6, iterate through other devices and filter those that meet the requirements. The target equipment is identified, and resource pre-allocation detection is performed.
[0202] More specifically, step S3 also includes predicting training time:
[0203] ;
[0204] in Calculate the cost per unit parameter of the model (a device-independent constant); if the actual training times out, trigger a re-splitting of the data; if the network becomes unstable during training and the network packet loss rate exceeds a threshold... The system automatically switches the current training task to local caching mode. Once the network recovers, the training results are synchronized to the server, and the device's compatibility with the data slices is reassessed. Simultaneously, if the device temperature exceeds a safe threshold, the system will automatically switch back to local caching mode. When the temperature returns to normal, the device will automatically reduce its training load or pause training, and resume training once the temperature returns to normal.
[0205] The training time prediction and anomaly handling in step S3 include the following steps:
[0206] This step ensures the stability of the federated learning training process through dynamic time consumption prediction and a multi-dimensional anomaly response mechanism. The specific implementation details are as follows:
[0207] Step S3.8: Predict training time;
[0208] The theoretical time required to train a data segment is calculated using the following formula:
[0209] Parameter definition and calculation logic:
[0210] The number of parameters in a sub-model segment (unit: millions of parameters) is calculated from step S2.2;
[0211] Calculation cost per unit parameter of the model (typical value) (seconds / parameters, based on real-world measurements using the ResNet-50 model)
[0212] The overall computing power index of the equipment is updated in real time by step S1.2;
[0213] The size of the gradient data in each piece (in MB) is estimated in step S3.2.
[0214] Real-time network uplink bandwidth (unit: MB / s), obtained through network interface monitoring.
[0215] Implementation example:
[0216] like Millions of parameters , , MB MB / s, then:
[0217] ;
[0218] Step S3.9: Timeout triggers re-sharding;
[0219] Timeout detection mechanism: Real-time monitoring of equipment training time; when the actual time exceeds... When the timeout error factor is configurable, a re-segmentation is triggered.
[0220] Fragmentation and re-segmentation implementation steps:
[0221] Step S3.9.1: Divide the data into segments according to preset rules;
[0222] Equal partitioning method: Divide the timeout fragments into equal parts based on the number of parameters. Individual segments ( (The number of currently available devices is typically 4).
[0223] Computing power ratio method: based on equipment Proportional partitioning allows high-performance computing devices to handle larger sub-shards.
[0224] Step S3.9.2: Recalculate the sub-fragment matching degree;
[0225] Call the matching degree function in step S3.3. The sub-shard is assigned to the device with the highest matching degree, ensuring that the newly assigned time meets the requirements. .
[0226] Step S3.10: Handling network packet loss anomalies;
[0227] Packet loss rate monitoring: Calculates the packet loss rate by sending probe packets via the ICMP protocol. ,when The caching mode is triggered when the typical threshold is 15%.
[0228] Local caching mode implementation:
[0229] Step S3.10.1: Switch to local cache;
[0230] Store intermediate training results (such as gradients and optimizer states) locally on the device and pause data uploads to the server.
[0231] Step S3.10.2: Restore network synchronization;
[0232] When the packet loss rate drops to In the following cases, data is synchronously cached using differential transmission technology, and only the parts that differ from the latest model on the server are uploaded;
[0233] Step S3.10.3: Reassess the matching degree;
[0234] Recalculate equipment With fragmentation The degree of matching, if If the drop exceeds 30%, the fragments will be migrated to devices with better network quality.
[0235] Step S3.11: Handling abnormal equipment temperature;
[0236] Temperature monitoring and threshold setting: Real-time acquisition of CPU / GPU core temperature via device temperature sensor, setting a safety threshold. Set to 85°C (can be adjusted according to equipment model).
[0237] Tiered load balancing strategy:
[0238] Step S3.11.1: When the temperature first exceeds the threshold;
[0239] Reduce computational load: reduce the number of allocated slice parameters by 20%, or reduce the model training accuracy (e.g., from FP32 to FP16).
[0240] Adjust training parameters: Increase the learning rate decay factor and reduce the number of iterations.
[0241] Step S3.11.2: When the temperature continues to exceed the threshold (e.g., for more than 5 minutes);
[0242] Pause the training task, record the current iteration state to the checkpoint file, and shut down unnecessary computing units (such as GPU streaming multiprocessors).
[0243] Step S3.11.3: Post-temperature recovery processing;
[0244] When the temperature drops At this point, training resumes from the checkpoint, and the device's computing power index is reassessed. If the computing power drops by more than 15% due to high temperature, the computing power index will be dynamically updated in step S1.8.
[0245] More specifically, in step S1, the computing power index is dynamically updated. The formula is:
[0246] ;
[0247] in, It is a smoothing factor;
[0248] Includes the following steps:
[0249] Step S1.8: In each training cycle After completion, calculate the equipment according to the formula. Comprehensive computing power index for the next cycle ;
[0250] Step S1.9: Obtain the industry average computing power index for similar equipment and compare it with the equipment's performance index. of Compare;
[0251] Step S1.10: If the device Its computing power index has consistently been lower than the industry average, and no hardware faults have been detected.
[0252] Step S1.10.1: Automatically trigger the device software optimization process and clear the system cache;
[0253] Step S1.10.2: Close unnecessary background processes on the device;
[0254] Step S1.10.3: Recalculate the device computing power index and evaluate the optimization effect.
[0255] More specifically, during incremental aggregation in step S5, the computational power weighting strategy formula is as follows:
[0256] ;
[0257] in, The equipment set was prepared to complete the training on time.
[0258] Includes the following steps:
[0259] By employing a computing power weighted aggregation strategy, dynamic frequency adjustment, and privacy risk assessment, efficient updates and secure aggregation of the global model are achieved. Specific implementation details are as follows:
[0260] Computing power weighted aggregation strategy
[0261] Step S5.1: Complete the equipment collection statistics on time;
[0262] Criteria for timely completion:
[0263] The equipment is in a preset training cycle The training of each slice is completed within 30 seconds (typically 30 seconds), and the integrity of the gradient update data is verified (e.g., MD5 hash verification).
[0264] Example of set generation: If the total number of participating devices is 10, and 8 of them are in... If the training is completed within the specified time, then .
[0265] Step S5.2: Calculate the global parameter update amount;
[0266] Local gradients are weighted and aggregated using the following formula:
[0267] ;
[0268] Parameter description: For equipment The computing power weight is determined to ensure that devices with strong computing power contribute more to the global update. For equipment The local gradient update is generated by training in step S4.
[0269] Calculation example: Device A Device B The partial updates are respectively , ,but:
[0270] ;
[0271] Step S5.3: Dynamic aggregation frequency adjustment;
[0272] Convergence metric calculation: Calculate the rate of decrease of the global loss function after each round of aggregation. ,in For the first Wheel loss value.
[0273] Slow convergence trigger condition: If there are 3 consecutive rounds (Configurable) If the convergence is slow, proceed to step S5.3.1.
[0274] Fluctuation Amplitude Calculation: Set of Computing Devices Standard deviation of computing power index ,in This is the mean.
[0275] High volatility triggering conditions: If If the computing power is determined to be fluctuating significantly, proceed to step S5.3.2.
[0276] Step S5.3.1: Reduce polymerization frequency:
[0277] The polymerization cycle starts from Extended to And increase the number of local training rounds for the equipment to This reduces communication overhead.
[0278] Step S5.3.2: Increase the polymerization frequency:
[0279] The polymerization cycle is shortened to This ensures timely synchronization of model updates when computing power fluctuates, preventing gradients from becoming outdated.
[0280] Step S5.4: Privacy risk assessment and gradient processing;
[0281] Step S5.4.1: Privacy risk assessment algorithm;
[0282] Sensitive information detection dimensions:
[0283] Gradient variance analysis: Calculate the variance of each dimension of the gradient vector. If the variance of a certain dimension exceeds 3 times the global mean, it is determined that it may contain sensitive features.
[0284] Gradient correlation with training data: through mutual information algorithm Calculate gradient Compared with the original data The correlation threshold is set to 0.2 (bits).
[0285] Risk level classification:
[0286] High risk: There are more than two high variance dimensions or ;
[0287] Medium risk: 1 high variance dimension and ;
[0288] Low risk: None of the above characteristics exist.
[0289] S5.4.2: Gradient compression and obfuscation techniques;
[0290] High-risk handling: Differential privacy is used to add Laplace noise.
[0291] ;
[0292] in (Privacy Budget) (Sensitivity).
[0293] Medium-risk handling: Implement gradient sparsity, retaining only the top 30% of gradient components by absolute value, and setting the rest to zero.
[0294] Low-risk processing: Use lightweight compression (such as FP16 quantization) to reduce communication volume.
[0295] Step S5.4.3: Post-processing polymerization;
[0296] The processed gradient Perform the weighted aggregation in step S5.2 to ensure a balance between privacy protection and model accuracy.
[0297] More specifically, when the device's computing power fluctuates beyond a threshold, a sharding migration mechanism is triggered, migrating unfinished sub-models to shards that meet the threshold. equipment ; This is the migration gain coefficient;
[0298] Includes the following steps:
[0299] Step S8: Sharding migration mechanism triggered by computing power fluctuations;
[0300] This step involves real-time monitoring of device computing power fluctuations to trigger adaptive migration of unfinished shards, ensuring the continuity of federated learning training tasks. Specific implementation details are as follows:
[0301] Step S8.1: Monitoring and triggering computing power fluctuations;
[0302] The fluctuation threshold uses a dynamic percentage threshold:
[0303] ;
[0304] in, This is the fluctuation coefficient (typically 0.2, meaning migration is triggered when computing power drops by more than 20%).
[0305] Real-time monitoring implementation:
[0306] The device's overall computing power index is collected every 500ms (configurable). Compared with the average of the previous 10 rounds (configurable), if the current If so, it is determined as a degradation of computing power.
[0307] Step S8.1.1: The downgraded device has not completed fragment identification;
[0308] Query the task scheduling log to find the list of shards currently being used by the device, and filter for the set of sub-model shards that are in the "training" state and have not yet been completed. .
[0309] Steps S8.1.2-S8.1.3: Calculation and screening of target equipment matching degree;
[0310] Application of the matching degree function: for each incomplete fragment Iterate through other available devices Calculate the matching degree:
[0311] ;
[0312] in, For fragmentation In the equipment The theoretical calculation time is calculated according to step S3.1.
[0313] Migration gain factor setting: Use 1.2 (typical value) to ensure that the target device's matching degree is significantly higher than that of the original device, that is:
[0314] ;
[0315] Target device set generation:
[0316] Example: Original equipment For fragments The matching degree is 2.5, device The matching degree is 3.0 (>2.5×1.2=3.0), device If the value is 2.8 (<3.0), then the target set is... .
[0317] Step S8.2: Resource pre-allocation detection;
[0318] Resource usage simulation: for target device Perform the following tests:
[0319] Memory usage simulation: Calculating receive fragments Post-memory usage (Assuming each parameter occupies 4 bytes), the requirements are... (Reserve a 20% buffer).
[0320] Computing load simulation: Calculating the computing power index after adding a new shard ,Require ( To allow for calculation time, a typical value of 1 second is provided.
[0321] Resource insufficiency handling: If the target device If the above conditions are not met, the device is excluded, and the next target device is tested.
[0322] Data transmission optimization: Differential transmission technology is used to transmit only fragments. The parameter update portion since the last synchronization reduces network transmission volume. For example, if the total parameter size of a fragment is 10MB, updating only 1MB reduces transmission volume by 90%.
[0323] Post-migration task recovery: target device After receiving the fragments, from the original device The training checkpoint is restored to its original state, the training task continues, and the task assignment log is updated to the server.
[0324] like Figure 2 More specifically, based on a federated learning-driven elastic scheduling method for computing power, a federated learning-driven elastic scheduling system for computing power is proposed, comprising: a dynamic computing power awareness module, an elastic sharding generation module, an adaptive scheduling module, a federated training execution module, and an incremental aggregation update module; the dynamic computing power awareness module is used to monitor the computing power indicators of devices participating in federated learning in real time and generate dynamic resource vectors; the elastic sharding generation module is used to split the global federated model into differentiated sub-model shards according to the dynamic resource vectors; the adaptive scheduling module is used to dynamically allocate sub-model shards to matching devices based on device computing power fluctuations and sharding computational complexity; the federated training execution module is used to generate local gradient updates for the sub-model shards allocated by the devices for local training; and the incremental aggregation update module is used to aggregate local gradient updates, generate a global model, and trigger the next round of elastic scheduling iterations.
[0325] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A federated learning-driven method for elastic scheduling of computing power, characterized in that, Includes the following steps: S1 Dynamic Computing Power Awareness: Real-time monitoring of computing power metrics of devices participating in federated learning, generating dynamic resource vectors; S2 Elastic Sharding Generation: Based on the dynamic resource vector, the global federated model is split into differentiated sub-model shards; S3 Adaptive Scheduling: Based on device computing power fluctuations and sharding computational complexity, it dynamically allocates sub-model shards to matching devices; S4 Federated Training Execution: The device trains the allocated sub-model slices locally 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; The dynamic resource vector in step S1 is represented as follows: ; in: For equipment The overall computing power index is calculated using the following formula: ; in: These are the weighting coefficients; Battery degradation factor; This represents the current battery power consumption rate. Currently available memory; This refers to the remaining battery capacity. For real-time network uplink bandwidth; The number of idle CPU cores. Total number of CPU cores Free memory capacity Total memory capacity This represents the current battery power consumption rate. A reinforcement learning module is introduced, using dynamic resource vectors as state input and combining historical scheduling data to optimize the weight coefficients of computing power indicators through a reward function. and Meanwhile, when the device is in different working modes, the corresponding computing power assessment strategy is automatically switched to achieve more accurate computing power perception. Sub-model piece size in step S2 Matching the computing power of the target device: ; in: This is the maximum slice size allowed by the device; is the load balancing coefficient, and ; The set of currently available devices; This represents the total number of parameters in the global model. A heterogeneous device collaborative sharding strategy is added. For devices with different architectures, the model is sharded in layers according to their computing advantages. At the same time, model sensitivity analysis is introduced. For model parts related to sensitive data, they are preferentially allocated to trusted devices for training, and homomorphic encryption technology is used to protect the data during the training process. Step S3's adaptive scheduling introduces a fragmentation-device matching function: ; in: Slicing the sub-model The theoretical calculation time is long, and it is comparable to Positive correlation; For fragmentation The amount of gradient data; The scheduling selects the device-shard combination with the highest matching degree, and satisfies... , A dynamic threshold is used; in addition, an equipment health assessment system is established to calculate equipment health by comprehensively considering factors such as equipment runtime and failure rate. When the device health level is below the threshold When this happens, limit it from accepting new sharding tasks and prioritize migrating the shards it is currently processing to healthy devices; Step S3, adaptive scheduling, includes the following steps: Step S3.1: Based on the sub-model piece size Based on the device's computing power parameters, calculate the partitions of each sub-model. In each device Theoretical calculation time ; Step S3.2: Estimate the fragments of each sub-model Gradient data volume ; Step S3.3: According to the formula ; Calculate each device With sub-model partitioning Matching degree ; Step S3.4: Calculate the current set of available devices Median of the overall computing power index of medium-sized devices Determine whether it meets the requirements. A subset of devices; Step S3.5: From the subset of devices that meet the conditions, select the device-shard combination with the highest matching degree with each sub-model shard for task allocation; Step S3.6: Calculate the equipment health status based on the equipment's runtime and historical failure rate data. ; Step S3.7: If the device health is... Below the threshold The device is migrating the shards it is currently processing to a device with higher health, and restricting it from accepting new shard tasks.
2. The federated learning-driven elastic scheduling method for computing power according to claim 1, characterized in that, In step S1, the comprehensive computing power index is calculated. Includes the following steps: Step S1.1: Real-time device acquisition of , , , and data; Step S1.2: According to the formula: ; Substitute the weighting coefficients and battery degradation factor Calculate the equipment Comprehensive computing power index ; Step S1.3: Calculate the... and , , Combined into dynamic resource vectors ; The reinforcement learning module optimizes the weight coefficients by the following steps: Step S1.4: Transfer the dynamic resource vector Historical scheduling schemes and corresponding training results are used as inputs to 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 a reinforcement learning algorithm. and This makes subsequent computing power assessments more aligned with actual training needs; Step S1.7: Repeat steps S1.4 to S1.6 to continuously optimize the weight coefficients.
3. The federated learning-driven elastic scheduling method for computing power according to claim 2, characterized in that, The elastic fragment 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 set of currently available devices According to the formula: ; Calculate the sub-model fragment size that each device can support. ; Step S2.3: Based on the device architecture, prioritize allocating the computationally intensive model layer to the GPU device and the logic processing layer to the CPU device to form a preliminary sharding scheme; Step S2.4: For the model portion containing sensitive data, filter out the set of trusted devices and reallocate the relevant shards to trusted devices; Step S2.5: For the sub-model shards allocated to the device, use homomorphic encryption technology to encrypt the data and generate the final differentiated sub-model shards.
4. The federated learning-driven elastic scheduling method for computing power according to claim 3, characterized in that, Step S3 also includes training time prediction: ; in The cost is calculated per unit parameter of the model; if the actual training times out, the data is re-segmented. If network instability occurs during training and the network packet loss rate exceeds a threshold... The system automatically switches the current training task to local caching mode. Once the network recovers, the training results are synchronized to the server, and the device's compatibility with the data slices is reassessed. Simultaneously, if the device temperature exceeds a safe threshold, the system will automatically switch back to local caching mode. When the temperature returns to normal, the device will automatically reduce its training load or pause training, and resume training once the temperature returns to normal. The training time prediction and anomaly handling in step S3 include the following steps: Step S3.8: According to the formula: ; Calculate each device Training sub-model slices Prediction training time ; Step S3.9: During the device training process, monitor the training duration in real time. If it exceeds the predicted training time... This triggers the fragmentation and re-splitting operation: Step S3.9.1: Divide the timed-out sub-model fragments into multiple smaller sub-fragments according to preset rules; Step S3.9.2: Recalculate the matching degree of each sub-segment with other devices, and assign the sub-segments to appropriate devices to continue training; Step S3.10: Monitor the device network status in real time. If the network packet loss rate exceeds the threshold... : Step S3.10.1: Switch the current training task to local caching mode and pause data upload; Step S3.10.2: After the network is restored, synchronize the local training results to the server; Step S3.10.3: Reassess the compatibility between the device and the fragment, and adjust the task allocation as needed; Step S3.11: Monitor the equipment temperature in real time. If it exceeds the safety threshold... ; Step S3.11.1: Automatically reduce the training load on the device and reduce the amount of computational tasks; Step S3.11.2: If the temperature remains too high, pause the training; Step S3.11.3: After the equipment temperature returns to normal, continue the training task.
5. The federated learning-driven elastic scheduling method for computing power according to claim 4, characterized in that, Step S1 also includes dynamically updating the computing power index. The formula is: ; in, It is a smoothing factor; Includes the following steps: Step S1.8: In each training cycle After completion, calculate the equipment according to the formula. Comprehensive computing power index for the next cycle ; Step S1.9: Obtain the industry average computing power index for similar equipment and compare it with the equipment's performance index. of Compare; Step S1.10: If the device Its computing power index has consistently been lower than the industry average, and no hardware faults have been detected. Step S1.10.1: Automatically trigger the device software optimization process and clear the system cache; Step S1.10.2: Close unnecessary background processes on the device; Step S1.10.3: Recalculate the device computing power index and evaluate the optimization effect.
6. The federated learning-driven elastic scheduling method for computing power according to claim 5, characterized in that, When performing incremental aggregation in step S5, the computational power weighting strategy formula is as follows: ; in, The equipment set was prepared to complete the training on time. Includes the following steps: Step S5.1: Count the set 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's 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 sessions on the device; Step S5.3.2: If the computing power of the device fluctuates greatly, that is, if the computing power fluctuation is greater than the first threshold, increase the aggregation frequency and synchronize the model update in a timely manner; Step S5.4: Before aggregation, update the local gradient uploaded by each device. Conduct a privacy risk assessment; Step S5.4.1: Use a privacy risk assessment algorithm to analyze whether there is a risk of sensitive information leakage during gradient updates; Step S5.4.2: If a privacy risk is detected, gradient compression and obfuscation techniques are used to process the gradient; Step S5.4.3: Incorporate the processed gradients into the aggregation calculation.
7. The federated learning-driven elastic scheduling method for computing power according to claim 6, characterized in that, When the device's computing power fluctuates beyond a threshold, the sharding migration mechanism is triggered, migrating unfinished sub-models to shards that meet the threshold. equipment ; This is the migration gain coefficient; Includes the following steps: Step S8.1: Monitoring and triggering computing power fluctuations; Step S8.1.1: Monitor the changes in device computing power in real time. If the fluctuation of device computing power exceeds the preset second threshold, it is determined to be a computing power degradation. Step S8.1.2: Identify incomplete sub-model fragments on the downgraded device; Step S8.1.3: Traverse other available devices and calculate the matching degree between each device and the incomplete sub-model fragment. ; Step S8.1.4: Filter out those that meet the requirements The target equipment set; 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 the incomplete sub-model fragmentation; 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
Agent policy learning method with privacy protection in mobile edge computing
WO2024254892A1