Multi-user edge computing resource isomerism balancing method based on federal learning

Through the multi-user edge computing resource heterogeneity balancing method based on federated learning, the training sample size and task allocation are dynamically adjusted, resource scheduling is optimized, and the problems of uneven resource utilization and unreasonable task allocation in multi-user edge computing are solved, achieving efficient resource utilization and improved model training efficiency.

CN120670140APending Publication Date: 2025-09-19INST OF WAR STUDIES ACAD OF MILITARY SCI OF THE CHINESE PEOPLES LIBERATION ARMY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510646591.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies have problems with uneven resource utilization and unreasonable task allocation in multi-user edge computing, resulting in idle resources and inefficient task execution. In particular, it is difficult to achieve accurate matching and flexible scheduling in an environment with significant resource heterogeneity.

Method used

A multi-user edge computing resource heterogeneity balancing method based on federated learning is adopted. The sample data set size and network bandwidth of terminal devices are collected in real time through device logs and storage monitoring tools, and the training sample size and task allocation are dynamically adjusted. In combination with asynchronous communication optimization algorithms and reinforcement learning agents, resource scheduling and model transmission order are optimized.

Benefits of technology

It achieves accurate monitoring and efficient utilization of edge device resources, significantly improves model training efficiency and convergence speed, optimizes the distribution and update process of global model parameters, reduces waiting time, and improves the overall performance of the edge computing system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670140A_ABST
    Figure CN120670140A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-user edge computing resource isomerism balancing method based on federated learning, which relates to the technical field of edge computing, and comprises the following steps of: acquiring terminal data and preprocessing characteristics through equipment logs, storage monitoring and network flow monitoring, adopting a dynamic sampling and resource allocation strategy, and combining asynchronous communication optimization; training tasks are dynamically adjusted, model parameters are efficiently distributed through an MEC server coordinator, the transmission sequence is optimized, and the resource utilization rate and the training efficiency are improved. Through fine monitoring and intelligent scheduling, the utilization rate of heterogeneous resources in a multi-user edge computing environment is remarkably improved, model training convergence is accelerated, and the system time cost is reduced. Meanwhile, by means of asynchronous communication optimization and application of the MEC server coordinator, efficient distribution and updating of model parameters are ensured, and the overall performance and the response speed of the edge computing system are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing technology, and in particular to a method for balancing heterogeneity of multi-user edge computing resources based on federated learning. Background Art

[0002] Multi-user edge computing resource heterogeneity refers to the diversity and differences in computing power, storage resources, and network bandwidth among the various user devices and resources involved in computing within an edge computing environment. This heterogeneity presents more complex resource management and scheduling challenges for edge computing systems, but it also provides them with richer and more flexible computing resources. Therefore, when designing and implementing edge computing systems, resource heterogeneity must be fully considered, and flexible strategies must be adopted to optimize resource utilization and task execution efficiency.

[0003] To address the problems of uneven resource utilization and irrational task allocation in multi-user edge computing, existing technologies primarily employ static resource allocation and task scheduling strategies. However, this approach can still lead to inaccurate resource matching and inflexible task allocation in edge computing environments with significant resource heterogeneity, resulting in idle resources and inefficient task execution. In light of this situation, a method for balancing resource heterogeneity in multi-user edge computing based on federated learning is proposed. Summary of the Invention

[0004] The purpose of the present invention is to provide a multi-user edge computing resource heterogeneity balancing method based on federated learning to solve the problems raised in the above background technology.

[0005] To solve the above technical problems, the technical solution adopted by the present invention is: a multi-user edge computing resource heterogeneity balancing method based on federated learning, comprising the following steps:

[0006] S1. Use device logs and storage monitoring tools to collect the size of the terminal device sample data set, use the psutil library to collect the terminal device's CPU computing frequency, and use network traffic monitoring tools to monitor the terminal device's network bandwidth in real time.

[0007] S2. Preprocess the collected local data and extract device category, network quality level, and computing resource status as features;

[0008] S3. Dynamically adjust the sample size of large-sample device training through a dynamic sampling algorithm. Introduce a dynamic resource allocation strategy, combine real-time network bandwidth and device computing power, dynamically adjust device training task allocation, and use an asynchronous communication optimization algorithm to set hybrid hyperparameters and device weights to reduce the weight of lagging devices.

[0009] S4. Compare and analyze loss functions and accuracy, verify the impact of dynamic sampling and resource allocation strategies on convergence speed, evaluate resource utilization optimization effects through system time cost, calculate cumulative discounted rewards through Markov decision process modeling, and evaluate the long-term benefits of reinforcement learning agents in resource scheduling;

[0010] S5. Utilize the MEC server coordinator and asynchronous threads to achieve global model parameter distribution, device status monitoring, and update model aggregation. Through the timestamp synchronization mechanism and priority queue management, optimize the model transmission order of high-bandwidth devices and reduce waiting time.

[0011] A further improvement of the technical solution of the present invention is that in S1, the process of collecting the size of the terminal device sample data set through the device log and storage monitoring tool, collecting the CPU cycle frequency of the terminal device through the system monitoring tool, and monitoring the network bandwidth of the terminal device in real time through the network traffic monitoring tool includes:

[0012] Deploy terminal devices in the same network environment and connect them to the MEC server. The terminal devices include smartphones, tablets, and sensor nodes. Configure logging tools, storage monitoring tools, Python environments, and network traffic monitoring tools on the terminal devices, and install the psutil library using pip.

[0013] The logging tool regularly scans the storage directory on the terminal device, obtains the file size in the directory, accumulates the size of related files, and obtains the total sample data set size. , write a Python script, use the psutil.cpu_freq() function to obtain the CPU frequency of the current terminal device, and the network traffic monitoring tool monitors the network interface of the terminal device to capture the data packets entering and leaving the device in real time, record the sending and receiving time and data packet size of each data packet, and calculate the average bandwidth usage in the time period based on the number and size of data packets in a period of time. Before each iteration, the local sample data set size, CPU calculation frequency and network bandwidth data are reported to the MEC server.

[0014] A further improvement of the technical solution of the present invention is that in S2, the process of preprocessing the collected local data and extracting the device category, computing resource status and network quality level as features includes:

[0015] The 3σ principle is used to remove noise data from the local sample dataset size, CPU cycle frequency, and network bandwidth. Linear interpolation is used to fill missing values ​​in the local sample dataset and CPU cycle frequency. The network bandwidth of each terminal device is recorded and checked to see if it is within a reasonable range. If there are data points that deviate from the expected value, statistical methods are used to identify and remove outliers, and the corresponding missing data is filled with the mean value of the terminal device's network bandwidth.

[0016] Based on the Pareto principle, the sample data size threshold is set as , calculate the cumulative distribution function of the data set size, set is the 80% quantile of the sample data set size, if , then the device belongs to the large sample, if , then the device belongs to a small sample;

[0017] Comprehensive CPU frequency and sample data set size to define the comprehensive score and its threshold range and , divide the device into different computing resource states according to the comprehensive score. h , then the device is considered to have high computing power. , then the device is considered to have medium computing power. , then the device is considered to have low computing power;

[0018] Based on the calculated average bandwidth, devices are classified into different network quality levels, which are divided into high bandwidth, medium bandwidth and low bandwidth. An average bandwidth threshold range is set. If the average bandwidth exceeds 100 Mbps, it is high bandwidth; if the average bandwidth is between 50 Mbps and 100 Mbps, it is medium bandwidth; if the average bandwidth is less than 50 Mbps, it is low bandwidth.

[0019] A further improvement of the technical solution of the present invention is that in S3, the process of dynamically adjusting the sample size of the large sample device training sample by the dynamic sampling algorithm includes:

[0020] If the terminal device is a large-sample device, 50% of the full sample size is set as the initial sample size and initial loss function value of the large-sample device, and the training sample size of the large-sample device is dynamically adjusted. The dynamic adjustment process includes dynamically adjusting the number of samples used in the next iteration based on the change of the loss function of the current training. If the current sample subset is used to reduce the loss function, the sample subset continues to be used. If the current sample subset is used to increase the loss function, the number of samples is increased and retrained. At the beginning of each iteration, the new sample size is calculated according to the dynamic adjustment step, and the training sample size of the large-sample device is dynamically adjusted and applied to the local model training until the sample subset size that makes the loss function optimal is found. If the terminal device is a small-sample device, all its data is used for training.

[0021] A further improvement of the technical solution of the present invention is that in S3, a dynamic resource allocation strategy is introduced to dynamically adjust the allocation of device training tasks by combining real-time network bandwidth and device computing power. The process includes:

[0022] If the terminal device has low computing power and low bandwidth, a low-priority task is assigned; if the terminal device has high computing power and medium bandwidth, medium computing power and high bandwidth, or medium computing power and medium bandwidth, a medium-priority task is assigned; if the terminal device has high computing power and high bandwidth, a high-priority task is assigned.

[0023] A further improvement of the technical solution of the present invention is that in S3, the process of setting hybrid hyperparameters and device weights through the asynchronous communication optimization algorithm and reducing the weight of the lagging device includes:

[0024] Setting a delay threshold and hybrid hyperparameters, including weight coefficients and learning rates. At the beginning of each iteration, the MEC server classifies the devices based on the local sample dataset size, CPU cycle frequency, and network bandwidth data reported by the terminal devices, and checks whether the local update training time of each terminal device exceeds the delay threshold. If the local update training time of a terminal device exceeds the delay threshold, it is marked as a lagging device. If the local update training time of a terminal device does not exceed the delay threshold, it is marked as a non-lagging device.

[0025] Calculate the weight coefficients of the lagging devices and multiply the model parameters of the lagging devices by their corresponding weight coefficients to obtain the downgraded model parameters. Dynamically adjust the device's hyperparameters based on the device's computing resource status and network quality level. Aggregate the model parameters of non-lagging devices with the downgraded model parameters of the lagging devices to generate a new global model.

[0026] The MEC server asynchronously distributes the aggregated global model parameters to each terminal device. Each terminal device receives the global model parameters sent by the MEC server and uses them as the initial model parameters for the next round of iteration.

[0027] A further improvement of the technical solution of the present invention is that in S4, the process of comparing and analyzing the loss function and the accuracy, verifying the influence of dynamic sampling and resource allocation strategies on the convergence speed, and evaluating the resource utilization optimization effect through the system time cost includes:

[0028] During each iteration, the MEC server collects the loss function value and accuracy of the terminal device, calculates the global loss function value through weighted average, and calculates the global accuracy through simple average. The loss function value and accuracy change trends before and after the dynamic strategy are compared to verify the impact of the dynamic strategy on the model convergence speed.

[0029] During each iteration, the local training time of the terminal device is recorded, and the maximum training time is calculated to measure the total time cost of the system. The total time cost of the system before and after using the dynamic strategy is compared to evaluate the optimization effect of resource utilization.

[0030] A further improvement of the technical solution of the present invention is that in S4, the process of calculating the cumulative discounted reward through Markov decision process modeling and evaluating the long-term benefits of the reinforcement learning agent in resource scheduling includes:

[0031] A Markov decision system consisting of a state set, an action set, a transition probability matrix and a reward function is introduced to define the device state. The device state includes the sample dataset size, CPU frequency and network bandwidth as key performance indicators, and the dynamic adjustment of task allocation strategy, setting hyperparameters and weight coefficients as the action set. The probability of transitioning from one state to another is calculated based on historical data. The immediate reward is calculated using the loss function value, accuracy and total system time cost as indicators. The long-term benefit is calculated using the cumulative discounted reward formula. The reinforcement learning agent strategy is optimized through iterative policy evaluation and policy improvement until convergence.

[0032] A further improvement of the technical solution of the present invention is that in S5, the process of using the MEC server coordinator and asynchronous thread to achieve global model parameter distribution, device status monitoring and update model aggregation includes:

[0033] The MEC server creates a thread pool to concurrently process requests from terminal devices. Based on the number of terminal devices, sample data set size, CPU frequency, and network bandwidth, it assigns the tasks of receiving data, aggregating models, and distributing models to different threads. The MEC server performs a weighted average of the local model parameters uploaded by all terminal devices to generate new global model parameters. It uses asynchronous HTTP requests to distribute the global model parameters to each terminal device, listens for upload requests from terminal devices, receives their local model parameters, and stores the received local model parameters in a temporary buffer. After completing the local update, each terminal device uploads the model parameters to the MEC server. The MEC server places the request in the update thread waiting queue. The coordinator processes the requests in the waiting queue on a first-come, first-served basis and aggregates the model parameters in turn. The MEC server asynchronously distributes the aggregated global model parameters to each terminal device. Each terminal device receives the global model parameters issued by the MEC server and uses them as the initial model parameters for the next round of iteration.

[0034] A further improvement of the technical solution of the present invention is that in S5, the process of optimizing the model transmission order of high-bandwidth devices and reducing waiting time through the timestamp synchronization mechanism and priority queue management includes:

[0035] Obtain the timestamp of the device and synchronize it. Set a priority queue based on the network bandwidth and computing power of each device. Devices with high bandwidth and high computing power are given higher priority. Parallel processing is achieved through asynchronous thread technology. Global model parameters are distributed to devices with higher priority first to reduce waiting time.

[0036] Due to the adoption of the above technical solution, the present invention has the following technical advancements compared to the prior art:

[0037] 1. This invention provides a federated learning-based method for balancing heterogeneous multi-user edge computing resources, enabling precise monitoring and efficient utilization of edge device resources. By integrating device logs, storage monitoring, and network traffic monitoring tools, it collects and analyzes the sample dataset size, CPU computing frequency, and network bandwidth of terminal devices in real time, achieving comprehensive awareness of the resource status of edge devices. This facilitates dynamic adjustment of training sample size and task allocation, ensuring maximum resource utilization and avoiding idle and wasted resources.

[0038] 2. This invention provides a method for balancing heterogeneous multi-user edge computing resources based on federated learning, significantly improving model training efficiency and convergence speed. By introducing a dynamic sampling algorithm and resource allocation strategy, combined with an asynchronous communication optimization algorithm, this invention can intelligently adjust device training tasks, reducing the weight of lagging devices, thereby accelerating model convergence. Furthermore, by comparing and analyzing loss functions and accuracy, this invention can evaluate training results in real time, ensuring optimized model performance.

[0039] 3. This invention provides a method for balancing heterogeneous multi-user edge computing resources based on federated learning, optimizing the distribution and update process of global model parameters and reducing waiting time. Leveraging the MEC server coordinator and asynchronous threads, this invention achieves efficient distribution of global model parameters and device status monitoring. Through a timestamp synchronization mechanism and priority queue management, this invention further optimizes the model transmission sequence for high-bandwidth devices, significantly shortening the model update cycle and improving the overall performance of the edge computing system. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0041] Figure 1 Flowchart of the present invention. DETAILED DESCRIPTION

[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0043] Examples, such as Figure 1 As shown, the present invention provides a multi-user edge computing resource heterogeneity balancing method based on federated learning, and the multi-user edge computing resource heterogeneity balancing method based on federated learning is characterized by comprising the following steps:

[0044] S1. Collect the size of the sample data set of the terminal device through device logs and storage monitoring tools. Collect the CPU computing frequency of the terminal device through the psutil library. Monitor the network bandwidth of the terminal device in real time through the network traffic monitoring tool. Deploy the terminal devices in the same network environment and connect them to the MEC server. The terminal devices include smartphones, tablets, and sensor nodes. Configure logging tools, storage monitoring tools, Python environment, and network traffic monitoring tools on the terminal devices, and install the psutil library through pip. The logging tool regularly scans the storage directory on the terminal device, obtains the file size in the directory, and accumulates the sizes of related files to obtain the total sample data set size. , write a Python script and use the psutil.cpu_freq() function to obtain the CPU frequency of the current terminal device. The network traffic monitoring tool monitors the network interface of the terminal device, captures the data packets entering and leaving the device in real time, records the sending and receiving time and data packet size of each data packet, and calculates the average bandwidth usage within a period of time based on the number and size of data packets in that period. Before each iteration, the local sample data set size, CPU computing frequency, and network bandwidth data are reported to the MEC server;

[0045] S2. Preprocess the collected local data and extract the device category, network quality level and computing resource status as features. Use the 3σ principle to remove noise data in the local sample data set size, CPU cycle frequency and network bandwidth. Use linear interpolation to fill the missing values ​​in the local sample data set and CPU cycle frequency. Record the network bandwidth of each terminal device and check whether it is within a reasonable range. If there are data points that deviate from the expected value, use statistical methods to identify and remove outliers. Use the mean value of the terminal device network bandwidth to fill the corresponding missing data. Set the sample data size threshold based on the Pareto principle. , calculate the cumulative distribution function of the data set size, set is the 80% quantile of the sample data set size, if , then the device belongs to the large sample, if , then the device belongs to a small sample, and the comprehensive score is defined based on the CPU frequency and sample data set size. and its threshold range and , divide the device into different computing resource states according to the comprehensive score. h , then the device is considered to have high computing power. , then the device is considered to have medium computing power. , the device is considered to have low computing power. Based on the calculated average bandwidth, the device is classified into different network quality levels, which are high bandwidth, medium bandwidth, and low bandwidth. The average bandwidth threshold range is set. If the average bandwidth exceeds 100 Mbps, it is considered high bandwidth; if the average bandwidth is between 50 Mbps and 100 Mbps, it is considered medium bandwidth; if the average bandwidth is less than 50 Mbps, it is considered low bandwidth;

[0046] S3. Dynamically adjust the sample size of large-sample device training through a dynamic sampling algorithm, introduce a dynamic resource allocation strategy, combine real-time network bandwidth with device computing power, dynamically adjust device training task allocation, set hybrid hyperparameters and device weights through an asynchronous communication optimization algorithm, and reduce the weight of lagging devices. If the terminal device is a large-sample device, set 50% of the full sample size as the initial sample size and initial loss function value of the large-sample device, and dynamically adjust the training sample size of the large-sample device. The dynamic adjustment process includes dynamically adjusting the number of samples used in the next iteration based on changes in the loss function of the current training. If the current sample subset is used to reduce the loss function, continue to use the sample subset. If the current sample subset is used to increase the loss function, increase the number of samples and retrain. At the beginning of each iteration, calculate the new sample size according to the dynamic adjustment step, dynamically adjust the training sample size of the large sample device, and apply it to the local model training until the sample subset size that makes the loss function optimal is found. If the terminal device is a small sample device, use all its data for training. If the terminal device has low computing power and low bandwidth, assign low priority tasks. If the terminal device has high computing power and medium bandwidth, or medium computing power and high bandwidth, assign low priority tasks. If the terminal device has wide and medium computing power and medium bandwidth, medium priority tasks are assigned. If the terminal device has high computing power and high bandwidth, high priority tasks are assigned. A delay threshold and hybrid hyperparameters are set. The hybrid hyperparameters include weight coefficients and learning rates. At the beginning of each iteration, the MEC server classifies the devices according to the local sample data set size, CPU cycle frequency, and network bandwidth data reported by the terminal device, and checks whether the local update training time of each terminal device exceeds the delay threshold. If the local update training time of a terminal device exceeds the delay threshold, it is marked as a lagging device. If the local update training time of the terminal device does not exceed the delay threshold, it is marked as a non-lagging device. The weight coefficient of the lagging device is calculated, and the model parameters of the lagging device are multiplied by their corresponding weight coefficients to obtain the downgraded model parameters. The hyperparameters of the device are dynamically adjusted according to the computing resource status of the device and the network quality level. The model parameters of the non-lagging device are aggregated with the downgraded model parameters of the lagging device to generate a new global model. The MEC server asynchronously distributes the aggregated global model parameters to each terminal device. Each terminal device receives the global model parameters sent by the MEC server and uses them as the initial model parameters for the next iteration.

[0047] S4. Compare and analyze the loss function and accuracy, verify the impact of dynamic sampling and resource allocation strategies on convergence speed, evaluate the resource utilization optimization effect through system time cost, calculate the cumulative discount reward through Markov decision process modeling, and evaluate the long-term benefits of reinforcement learning agents in resource scheduling. During each iteration, the MEC server collects the loss function value and accuracy of the terminal device, calculates the global loss function value through weighted average, and calculates the global accuracy through simple average. Compare the loss function value and accuracy change trend before and after using the dynamic strategy to verify the impact of the dynamic strategy on the model convergence speed. During each iteration, record the local training time of the terminal device and calculate the maximum training time to measure the total time of the system. Cost: Compare the total system time cost before and after using dynamic strategies to evaluate the optimization effect of resource utilization. A Markov decision system consisting of a state set, an action set, a transition probability matrix, and a reward function is introduced to define the device state. The device state includes the sample data set size, CPU frequency, and network bandwidth as key performance indicators. Dynamically adjust the task allocation strategy, set hyperparameters, and weight coefficients as the action set. The probability of transitioning from one state to another is calculated based on historical data. The loss function value, accuracy, and total system time cost are used as indicators to calculate the immediate reward. The long-term benefit is calculated using the cumulative discounted reward formula. Through iterative policy evaluation and policy improvement, the reinforcement learning agent strategy is optimized until convergence.

[0048] S5. Utilize the MEC server coordinator and asynchronous threads to realize the distribution of global model parameters, device status monitoring, and update model aggregation. Through the timestamp synchronization mechanism and priority queue management, the model transmission order of high-bandwidth devices is optimized to reduce waiting time. The MEC server creates a thread pool to concurrently process requests from terminal devices. According to the number of terminal devices, sample data set size, CPU frequency, and network bandwidth, the tasks of receiving data, aggregating models, and distributing models are assigned to different threads. The MEC server performs a weighted average of the local model parameters uploaded by all terminal devices to generate new global model parameters. It uses asynchronous HTTP requests to distribute the global model parameters to each terminal device, listens for upload requests from terminal devices, receives their local model parameters, and sends the received local model parameters to the MEC server. The data is stored in a temporary buffer. After completing the local update, each terminal device uploads the model parameters to the MEC server. The MEC server puts the request into the update thread waiting queue. The coordinator processes the requests in the waiting queue according to the first-come-first-served principle and aggregates the model parameters in turn. The MEC server asynchronously distributes the aggregated global model parameters to each terminal device. Each terminal device receives the global model parameters sent by the MEC server and uses them as the initial model parameters for the next round of iteration. It obtains the device's timestamp and synchronizes it. A priority queue is set according to the network bandwidth and computing power of each device. Devices with high bandwidth and high computing power have higher priority. Parallel processing is achieved through asynchronous thread technology, and global model parameters are distributed to devices with higher priority first, reducing waiting time.

[0049] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A multi-user edge computing resource heterogeneity balancing method based on federated learning, characterized by: The following steps are involved: S1. Use device logs and storage monitoring tools to collect the size of the terminal device sample data set, use the psutil library to collect the terminal device's CPU computing frequency, and use network traffic monitoring tools to monitor the terminal device's network bandwidth in real time. S2. Preprocess the collected local data and extract device category, network quality level, and computing resource status as features; S3. Dynamically adjust the sample size of large-sample device training through a dynamic sampling algorithm. Introduce a dynamic resource allocation strategy, combine real-time network bandwidth and device computing power, dynamically adjust device training task allocation, and use an asynchronous communication optimization algorithm to set hybrid hyperparameters and device weights to reduce the weight of lagging devices. S4. Compare and analyze loss functions and accuracy, verify the impact of dynamic sampling and resource allocation strategies on convergence speed, evaluate resource utilization optimization effects through system time cost, calculate cumulative discounted rewards through Markov decision process modeling, and evaluate the long-term benefits of reinforcement learning agents in resource scheduling; S5. Utilize the MEC server coordinator and asynchronous threads to achieve global model parameter distribution, device status monitoring, and update model aggregation. Through the timestamp synchronization mechanism and priority queue management, optimize the model transmission order of high-bandwidth devices and reduce waiting time.

2. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 1 is characterized in that: In S1, the process of collecting the size of a sample data set of the terminal device through the device log and storage monitoring tool, collecting the CPU cycle frequency of the terminal device through the system monitoring tool, and monitoring the network bandwidth of the terminal device in real time through the network traffic monitoring tool includes: Deploy terminal devices in the same network environment and connect them to the MEC server. The terminal devices include smartphones, tablets, and sensor nodes. Configure logging tools, storage monitoring tools, Python environments, and network traffic monitoring tools on the terminal devices, and install the psutil library using pip. The logging tool regularly scans the storage directory on the terminal device, obtains the file size in the directory, accumulates the size of related files, and obtains the total sample data set size. , write a Python script and use the psutil.cpu_freq() function to obtain the CPU frequency of the current terminal device. The network traffic monitoring tool monitors the network interface of the terminal device, captures the data packets entering and leaving the device in real time, records the sending and receiving time and data packet size of each data packet, and calculates the average bandwidth usage in the time period based on the number and size of data packets in a period of time. Before each iteration, the local sample data set size, CPU calculation frequency and network bandwidth data are reported to the MEC server.

3. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 2, characterized in that: In S2, the process of preprocessing the collected local data and extracting the device category, computing resource status, and network quality level as features includes: The 3σ principle is used to remove noise data from the local sample dataset size, CPU cycle frequency, and network bandwidth. Linear interpolation is used to fill missing values ​​in the local sample dataset and CPU cycle frequency. The network bandwidth of each terminal device is recorded and checked to see if it is within a reasonable range. If there are data points that deviate from the expected value, statistical methods are used to identify and remove outliers, and the corresponding missing data is filled with the mean value of the terminal device's network bandwidth. Based on the Pareto principle, the sample data size threshold is set as , calculate the cumulative distribution function of the data set size, set is the 80% quantile of the sample data set size, if , then the device belongs to the large sample, if , then the device belongs to a small sample; Comprehensive CPU frequency and sample data set size to define the comprehensive score and its threshold range and , divide the device into different computing resource states according to the comprehensive score. h , then the device is considered to have high computing power. , then the device is considered to have medium computing power. , then the device is considered to have low computing power; Based on the calculated average bandwidth, devices are classified into different network quality levels, which are divided into high bandwidth, medium bandwidth and low bandwidth. An average bandwidth threshold range is set. If the average bandwidth exceeds 100 Mbps, it is high bandwidth; if the average bandwidth is between 50 Mbps and 100 Mbps, it is medium bandwidth; if the average bandwidth is less than 50 Mbps, it is low bandwidth.

4. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 3 is characterized by: In S3, the process of dynamically adjusting the sample size of large sample device training by using a dynamic sampling algorithm includes: If the terminal device is a large-sample device, 50% of the full sample size is set as the initial sample size and initial loss function value of the large-sample device, and the training sample size of the large-sample device is dynamically adjusted. The dynamic adjustment process includes dynamically adjusting the number of samples used in the next iteration based on the change of the loss function of the current training. If the current sample subset is used to reduce the loss function, the sample subset continues to be used. If the current sample subset is used to increase the loss function, the number of samples is increased and retrained. At the beginning of each iteration, the new sample size is calculated according to the dynamic adjustment step, and the training sample size of the large-sample device is dynamically adjusted and applied to the local model training until the sample subset size that makes the loss function optimal is found. If the terminal device is a small-sample device, all its data is used for training.

5. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 4 is characterized in that: In S3, a dynamic resource allocation strategy is introduced to dynamically adjust the allocation of training tasks to devices by combining real-time network bandwidth and device computing capabilities. The process includes: If the terminal device has low computing power and low bandwidth, a low-priority task is assigned; if the terminal device has high computing power and medium bandwidth, medium computing power and high bandwidth, or medium computing power and medium bandwidth, a medium-priority task is assigned; if the terminal device has high computing power and high bandwidth, a high-priority task is assigned.

6. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 5, characterized in that: In S3, the process of setting hybrid hyperparameters and device weights through the asynchronous communication optimization algorithm and reducing the weight of lagging devices includes: Setting a delay threshold and hybrid hyperparameters, including weight coefficients and learning rates. At the beginning of each iteration, the MEC server classifies the devices based on the local sample dataset size, CPU cycle frequency, and network bandwidth data reported by the terminal devices, and checks whether the local update training time of each terminal device exceeds the delay threshold. If the local update training time of a terminal device exceeds the delay threshold, it is marked as a lagging device. If the local update training time of a terminal device does not exceed the delay threshold, it is marked as a non-lagging device. Calculate the weight coefficients of the lagging devices and multiply the model parameters of the lagging devices by their corresponding weight coefficients to obtain the downgraded model parameters. Dynamically adjust the device's hyperparameters based on the device's computing resource status and network quality level. Aggregate the model parameters of non-lagging devices with the downgraded model parameters of the lagging devices to generate a new global model. The MEC server asynchronously distributes the aggregated global model parameters to each terminal device. Each terminal device receives the global model parameters sent by the MEC server and uses them as the initial model parameters for the next round of iteration.

7. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 6, characterized in that: In S4, the process of comparing and analyzing the loss function and accuracy, verifying the impact of dynamic sampling and resource allocation strategies on convergence speed, and evaluating the resource utilization optimization effect through system time cost includes: During each iteration, the MEC server collects the loss function value and accuracy of the terminal device, calculates the global loss function value through weighted average, and calculates the global accuracy through simple average. The loss function value and accuracy change trends before and after the dynamic strategy are compared to verify the impact of the dynamic strategy on the model convergence speed. During each iteration, the local training time of the terminal device is recorded, and the maximum training time is calculated to measure the total time cost of the system. The total time cost of the system before and after using the dynamic strategy is compared to evaluate the optimization effect of resource utilization.

8. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 7, characterized in that: In S4, the process of calculating the cumulative discounted reward through Markov decision process modeling and evaluating the long-term benefits of the reinforcement learning agent in resource scheduling includes: A Markov decision system consisting of a state set, an action set, a transition probability matrix and a reward function is introduced to define the device state. The device state includes the sample dataset size, CPU frequency and network bandwidth as key performance indicators, and the dynamic adjustment of task allocation strategy, setting hyperparameters and weight coefficients as the action set. The probability of transitioning from one state to another is calculated based on historical data. The immediate reward is calculated using the loss function value, accuracy and total system time cost as indicators. The long-term benefit is calculated using the cumulative discounted reward formula. The reinforcement learning agent strategy is optimized through iterative policy evaluation and policy improvement until convergence.

9. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 8, characterized in that: In S5, the process of using the MEC server coordinator and asynchronous threads to achieve global model parameter distribution, device status monitoring, and update model aggregation includes: The MEC server creates a thread pool to concurrently process requests from terminal devices. Based on the number of terminal devices, sample data set size, CPU frequency, and network bandwidth, it assigns the tasks of receiving data, aggregating models, and distributing models to different threads. The MEC server performs a weighted average of the local model parameters uploaded by all terminal devices to generate new global model parameters. It uses asynchronous HTTP requests to distribute the global model parameters to each terminal device, listens for upload requests from terminal devices, receives their local model parameters, and stores the received local model parameters in a temporary buffer. After completing the local update, each terminal device uploads the model parameters to the MEC server. The MEC server places the request in the update thread waiting queue. The coordinator processes the requests in the waiting queue on a first-come, first-served basis and aggregates the model parameters in turn. The MEC server asynchronously distributes the aggregated global model parameters to each terminal device. Each terminal device receives the global model parameters issued by the MEC server and uses them as the initial model parameters for the next round of iteration.

10. The method for balancing heterogeneity of multi-user edge computing resources based on federated learning according to claim 9, characterized in that: In S5, the process of optimizing the model transmission order of high-bandwidth devices and reducing waiting time through the timestamp synchronization mechanism and priority queue management includes: Obtain the timestamp of the device and synchronize it. Set a priority queue based on the network bandwidth and computing power of each device. Devices with high bandwidth and high computing power are given higher priority. Parallel processing is achieved through asynchronous thread technology. Global model parameters are distributed to devices with higher priority first to reduce waiting time.