Mobile terminal resource allocation method and apparatus
Patent Information
- Application Number
- CN202211538198.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-12-01
AI Technical Summary
[0004]本发明提供一种移动终端资源分配方法及装置,用以解决现有技术中在云服务器中引入移动边缘计算时仅考虑对无线资源进行优化导致云服务器对不同车辆设备的资源分配不合理,资源浪费严重的缺陷,提高了移动终端资源分配的准确率
[0028]本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述移动终端资源分配方法。
Smart Images

Figure CN116405977B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of terminal resource allocation technology, and in particular to a method and apparatus for allocating mobile terminal resources. Background Technology
[0002] In the Internet of Vehicles (IoV), mobile vehicles act as terminal devices. When vehicles request tasks, they need to frequently access the Internet or remote servers, which involves a large amount of data exchange. V2I (Vehicle-to-Infrastructure) communication in the IoV link can provide high-quality services for such tasks.
[0003] Related technologies typically introduce mobile edge computing into cloud servers to alleviate the pressure on the core network and solve problems such as unstable communication and high latency. However, when cloud servers allocate wireless resources to different vehicle devices, they only consider optimizing the wireless resources. In reality, the data and computing resources of different vehicle devices are different, resulting in unreasonable resource allocation by cloud servers to different vehicle devices and serious resource waste. Summary of the Invention
[0004] This invention provides a mobile terminal resource allocation method and apparatus to address the shortcomings of existing technologies where only wireless resources are optimized when introducing mobile edge computing into cloud servers, resulting in unreasonable resource allocation and serious resource waste for different vehicle devices by the cloud server. This invention improves the accuracy of mobile terminal resource allocation.
[0005] This invention provides a mobile terminal resource allocation method applied to a roadside unit, wherein the roadside unit includes a federated learning training model, comprising:
[0006] Send a first parameter to the first terminal, where the first terminal is one of the terminals included in the target cooperative domain corresponding to the roadside unit, the first parameter is the initial parameter of the federated learning training model, and the first parameter is used to represent the performance of all terminals in the target cooperative domain;
[0007] The system receives a second parameter and a third parameter sent by the first terminal. The second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal. The third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal. The second terminal is another terminal in the target cooperative domain other than the first terminal.
[0008] Based on the federated learning training model, the second and third parameters are aggregated to obtain the global parameters;
[0009] The federated learning training model is updated based on the global parameters.
[0010] According to a mobile terminal resource allocation method provided by the present invention, before sending the first parameter to the first terminal in the target cooperation domain corresponding to the roadside unit, the method further includes:
[0011] Based on the local data and the first training latency corresponding to the local model of each terminal, the collaborative learning capability of each terminal is obtained, and the terminal corresponding to the maximum value of the collaborative learning capability is determined as the first terminal.
[0012] According to a mobile terminal resource allocation method provided by the present invention, after sending a first parameter to a first terminal and before receiving a second parameter and a third parameter sent by the first terminal, the method further includes:
[0013] Based on the status information of all terminals within the target collaborative domain and the preset unloading strategy, the second terminal is determined. The unloading strategy is determined based on the A3C algorithm and the first training delay corresponding to the local model of each terminal.
[0014] The first terminal is controlled to send the first parameter to the second terminal;
[0015] When the second terminal receives the third parameter, it controls the second terminal to return the third parameter to the first terminal.
[0016] According to a mobile terminal resource allocation method provided by the present invention, receiving the second and third parameters sent by the first terminal includes:
[0017] When the number of training rounds of the local model of the first terminal reaches a preset training number threshold, the first parameter and the second parameter are encrypted and sent to the edge server of the roadside unit based on differential privacy technology.
[0018] According to a mobile terminal resource allocation method provided by the present invention, the first training delay includes parameter download delay, unloading delay, collaborative training delay, parameter feedback delay and parameter upload delay;
[0019] Wherein, the parameter download latency is used to represent the latency of the first terminal receiving the first parameter, the unloading latency is used to represent the latency of the second terminal receiving the first parameter and at least part of the local data sent by the first terminal, the collaborative training latency is used to represent the latency of the second terminal obtaining the third parameter, the parameter feedback latency is used to represent the latency of the first terminal receiving the third parameter sent by the second terminal, and the parameter upload latency is used to represent the latency of receiving the second parameter and the third parameter.
[0020] The present invention also provides a mobile terminal resource allocation device, comprising:
[0021] The sending module is used to send a first parameter to a first terminal, which is one of the terminals included in the target cooperative domain corresponding to the roadside unit. The first parameter is the initial parameter of the federated learning training model and is used to represent the performance of all terminals in the target cooperative domain.
[0022] The receiving module is used to receive a second parameter and a third parameter sent by the first terminal. The second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal. The third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal. The second terminal is another terminal in the target cooperative domain other than the first terminal.
[0023] The first processing module is used to aggregate the second and third parameters based on the federated learning training model to obtain global parameters;
[0024] The second processing module is used to update the federated learning training model based on the global parameters.
[0025] According to a mobile terminal resource allocation device provided by the present invention, the device further includes:
[0026] The terminal determination module is configured to, before sending the first parameter to the first terminal in the target cooperative domain corresponding to the roadside unit, obtain the cooperative learning capability of each terminal based on the local data and the first training delay corresponding to the local model of each terminal, and determine the terminal corresponding to the maximum value of the cooperative learning capability as the first terminal.
[0027] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the mobile terminal resource allocation method described above.
[0028] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the mobile terminal resource allocation method as described above.
[0029] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the mobile terminal resource allocation method as described above.
[0030] The mobile terminal resource allocation method and apparatus provided by the present invention distribute the first parameters of the federated learning training model to the first terminal and the second terminal for collaborative training, and aggregate the second and third parameters obtained from the collaborative training to obtain new global parameters, thereby realizing the full utilization of mobile terminal resources and efficient collaboration of vehicle training, thus optimizing the allocation of vehicle network resources. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0032] Figure 1 This is a flowchart illustrating the mobile terminal resource allocation method provided by the present invention;
[0033] Figure 2 This is one of the interactive schematic diagrams of the mobile terminal resource allocation method provided by the present invention;
[0034] Figure 3 This is the second interactive schematic diagram of the mobile terminal resource allocation method provided by the present invention;
[0035] Figure 4 This is a schematic diagram of the structure of the mobile terminal resource allocation device provided by the present invention;
[0036] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided by the present invention. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0038] The following is combined Figures 1-4 The present invention describes a mobile terminal resource allocation method and apparatus.
[0039] Figure 1 This is a flowchart illustrating the mobile terminal resource allocation method provided by the present invention, as shown below. Figure 1 As shown, this invention provides a mobile terminal resource allocation method applied to a roadside unit, which includes a federated learning training model and comprises the following steps:
[0040] Step 110: Send the first parameter to the first terminal. The first terminal is one of the terminals included in the target cooperative domain corresponding to the roadside unit. The first parameter is the initial parameter of the federated learning training model. The first parameter is used to represent the performance of all terminals in the target cooperative domain.
[0041] In this step, the roadside unit can be equipment such as traffic lights, streetlights, or signs.
[0042] To perform the training task of the Federated Learning (FL) training model.
[0043] It should be noted that the RSU is equipped with edge servers, and multiple vehicle devices constitute edge nodes, giving the RSU a certain coverage area.
[0044] In this step, multiple cooperative domains can exist within the same RSU coverage area, and the target cooperative domain is one of the multiple cooperative domains.
[0045] In this embodiment, different vehicles within the target cooperative domain can perform training task unloading and data exchange.
[0046] In this step, the first terminal can be a vehicle device under the target cooperative domain. The first terminal is used to receive the first parameter sent by the Road Side Unit (RSU).
[0047] In this embodiment, the set of multiple edge RSUs can be represented by Z. Each RSU can be regarded as an edge server. The edge server z∈Z has certain computing and storage resources and can communicate with vehicles within the coverage area, i.e. I2V (Invisible-to-Visible, vehicle-to-infrastructure) communication.
[0048] It should be noted that RSUs can have the same coverage area, and different RSUs are far apart. Vehicle equipment can only communicate with other vehicle equipment in the same RSU area via V2V (Veichle To Veichle). When vehicles are near RSUs such as traffic lights or toll booths, they move slowly and can complete task training and data transmission before leaving the RSU coverage area.
[0049] In this embodiment, the same target collaboration domain may include vehicles of various types of organizations, such as mobile vehicles, government vehicles, police cars, private cars, ambulances, etc. The computing power and storage resources of the on-board equipment of different organizations may be the same or different.
[0050] In this embodiment, the first terminal is the training vehicle for the federated learning training model. The RSU first determines a suitable vehicle as a training node, and then issues the FL training task and the initial parameters of the FL training model.
[0051] Step 120: Receive the second parameter and the third parameter sent by the first terminal. The second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal. The third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal. The second terminal is any other terminal in the target collaboration domain other than the first terminal.
[0052] In this step, the second terminal can be a vehicle device in the same target collaboration domain as the first terminal, and at least one second terminal exists.
[0053] It should be noted that since the vehicles and equipment belong to different organizations, data transmission between different organizations may pose a risk of privacy leakage, while data transmission within the same organization does not pose a privacy leakage risk. At the same time, considering that the datasets owned by vehicles within the same organization are highly similar and have a lot of overlapping data features, selecting training nodes on an organization-by-organization basis can effectively avoid dataset duplication and energy waste, and maximize the rational utilization and allocation of resources.
[0054] In this step, the local model refers to the model trained on each participating vehicle device. The local model of the first terminal or the second terminal can serve as two branches of the federated learning-based jointly trained model to jointly perform the FL training task.
[0055] In some embodiments, triples can be used <H i ,X i D model,i > represents an FL training task T i , where H i X represents the total dataset (in bits) related to task i. i D represents the CPU processing density of task i (in cycles / bit). model,i This represents the data size (in bits) of the model parameters for task i. The node selection strategy used for FL task i at time t is... Let represent, where β i,d =1 indicates that vehicle numbered d was selected as a training node in this FL task i.
[0056] In this embodiment, after receiving the first parameter, the first terminal performs local calculations on its local model based on the local data stored in the first terminal and the first parameter. Local calculation refers to the calculation performed on the training vehicle. The latency of local model training computations is determined by the training vehicle. The calculations generated by using To indicate training vehicles The computing power (in cycles per second) of the training vehicle The local computation latency is:
[0057]
[0058] Where, α d For training vehicles Uninstallation rate For training vehicles It has a local dataset related to FL training task i.
[0059] In addition, after receiving the first parameter, the second terminal performs collaborative computation on its local model based on the local data stored in the second terminal and the first parameter. Collaborative computation refers to offloading the training task to the service vehicle through a collaborative training mode. The computation process involves collaborative computation latency generated by the service vehicle's calculations. The time delay caused by its calculation is:
[0060]
[0061] in, For service vehicles computing power For training vehicles Unload to service vehicle Unloading rate.
[0062] After the first terminal and the second terminal have completed their training and obtained the second and third parameters, the first terminal transmits the second and third parameters to the RSU.
[0063] Step 130: Based on the federated learning training model, aggregate the second and third parameters to obtain the global parameters.
[0064] In this embodiment, after receiving the first and second parameters through the edge server, RSU uses a federated learning training algorithm to aggregate the parameters from different terminal devices to obtain new global parameters.
[0065] In this embodiment, the federated learning training model is first initialized to obtain the first parameter. The first parameter is then sent to the local model of the first terminal and the local model of the second terminal for joint collaborative training to obtain the second parameter and the third parameter respectively. The second parameter and the third parameter are then uploaded to the federated learning training model of the roadside unit through the edge server for aggregation to complete one training cycle and obtain the aggregation result of this training cycle.
[0066] In this embodiment, the condition for determining whether the training process has ended is whether the phased global model parameters have converged. The convergence of phased global model parameters can also be interpreted as follows: if an algorithm satisfies the property that any initial point X0∈X will produce a converged sequence of points, then the algorithm is globally convergent.
[0067] Step 140: Update the federated learning training model based on global parameters.
[0068] In this embodiment, if the loss function of the federated learning training model converges after this round of training, the allocation of mobile terminal resources is completed.
[0069] In this embodiment, if the loss function of the federated learning training model fails to converge, the global parameters are continued to be sent to the first terminal via the edge server according to the steps of the above embodiment to update the global parameters.
[0070] In this embodiment, the RSU first selects suitable vehicles as training nodes (corresponding to the first terminal) within the target cooperative domain and issues FL training tasks and initial model parameters (corresponding to the first parameters); a set D is used to represent the set of selected training nodes, and the vehicles selected as training nodes are denoted as... That is: training vehicles (training nodes), where k∈K represents the organization code to which the vehicle belongs, and d∈D. Vehicles not selected as training nodes can provide collaborative computing services to training vehicles of the same organization within the same RSU coverage area, and are called service vehicles (corresponding to the second terminal). Let represent , where l∈L, and L represents the set of service vehicles; by FL local training is performed. When the number of local training rounds reaches a certain number, the training model parameters are encrypted and transmitted to the RSU edge server. The RSU then aggregates the models to obtain new global model parameters, which are then distributed to the training vehicles. Complete the next round of FL training until convergence or the training round threshold is reached.
[0071] The mobile terminal resource allocation method provided by this invention distributes the first parameters of the federated learning training model to the first and second terminals for collaborative training, and aggregates the second and third parameters obtained from the collaborative training to obtain new global parameters. This achieves full utilization of mobile terminal resources and efficient collaboration in vehicle training, thereby optimizing the allocation of vehicle network resources.
[0072] In some embodiments, according to a mobile terminal resource allocation method provided by the present invention, before sending the first parameter to the first terminal in the target cooperative domain corresponding to the roadside unit, the method further includes: obtaining the cooperative learning capability of each terminal based on the local data and the first training delay corresponding to the local model of each terminal, and determining the terminal corresponding to the maximum value of the cooperative learning capability as the first terminal.
[0073] In this embodiment, different vehicles have different computing and data resources, and the accuracy of the training model is related to the size of the local dataset of the training node. This embodiment constructs a collaborative learning ability evaluation model, and for vehicle d, its collaborative learning ability is represented by c. d c d Mainly related to the amount of local data for vehicle d and training latency T total,d The steps to acquire the collaborative learning capability of vehicle d are as follows:
[0074] (1) Calculate the data transmission rate and communication delay when the first terminal and the second terminal interact with each other.
[0075] In this embodiment, the averaging method is used to... Service vehicles surrounding (corresponding to the first terminal) (corresponding to the second terminal) are aggregated into a virtual service vehicle Using this aggregated virtual service vehicle to measure the average performance of service vehicles within the collaborative domain, then and Data transfer rate between for:
[0076]
[0077] According to transmission rate The communication latency between the first terminal and the second terminal for data interaction can be obtained.
[0078] (2) Calculate the average collaborative computing power and collaborative training latency of the second terminal in collaboration with the first terminal for training.
[0079] In this embodiment, referring to the averaging method in the communication model, the average collaborative computing power can be expressed as:
[0080]
[0081] Where, β i,d Choose a strategy for the training nodes of task i:
[0082]
[0083]
[0084] Therefore, the average collaborative computing power is:
[0085]
[0086] The latency of collaborative computing is:
[0087]
[0088] (3) Calculate the training latency of the local model of the first terminal and the local model of the second terminal respectively, and then determine the total system latency.
[0089] In this embodiment, the training process of the first terminal includes: downloading the model, local training, and uploading the model. Therefore, the total training latency of the first terminal can be obtained as follows:
[0090] T nmec,d =T download,d +T loc,d +T upload,d ;
[0091] The second terminal collaborates with the first terminal to train the first parameter. The total latency of the collaborative training by the second terminal is:
[0092] T mec,d =T download,d +T offload,d +T coop,d +T return,d +T upload,d ,
[0093] Based on the above formula, the training vehicle The total training latency for completing FL training task i is:
[0094] T total,d =max{T mec,d ,T nmec,d}
[0095] (4) Construct a collaborative learning ability assessment model.
[0096] In this embodiment, the training vehicle Local data volume and total training latency T total,dThis can be used as a parameter affecting the collaborative learning ability of vehicles. By adjusting the weights of the data volume and the total training latency through the weight adjustment parameter θ, we can obtain... Collaborative learning ability is:
[0097]
[0098] in, and T′ total,d for and T total,d After data standardization, the values range from [0,1]. Therefore, the collaborative learning ability c d ∈[0,1], the node is selected according to the size of the node's collaborative learning ability, and the first terminal is the terminal with the largest collaborative learning ability in the target collaborative domain.
[0099] The mobile terminal resource allocation method provided by this invention obtains the collaborative learning capability of different terminals by acquiring the communication latency of different terminals, the training latency of the local model of different terminals, and the amount of data stored in the terminals to construct a collaborative learning capability evaluation model. This improves the accuracy of federated learning training models and avoids the impact of malicious nodes uploading incorrect model parameters.
[0100] In some embodiments, after sending the first parameter to the first terminal and before receiving the second and third parameters sent by the first terminal, the method further includes: determining the second terminal based on the status information of all terminals in the coverage area and a preset offloading strategy, wherein the offloading strategy is determined based on the A3C (Asynchronous Advantage Actor-Critic) algorithm and the first training delay corresponding to the local model of each terminal; controlling the first terminal to send the first parameter to the second terminal; and controlling the second terminal to return the third parameter to the first terminal if the second terminal receives the third parameter.
[0101] In this embodiment, the terminal's status information may include the terminal's available computing resources.
[0102] In this embodiment, the target cooperative domain includes training vehicle equipment and corresponding cooperative training equipment; the available computing resources of the vehicle in the cooperative domain k during the m-th iteration are represented as: The A3C-based FL computation task offloading algorithm is described through the following steps:
[0103] (1) Define the state space. Represent the state space as the available computational resources for training vehicles in the cooperative domain:
[0104]
[0105]
[0106]
[0107] (2) Determine the action space.
[0108] In this embodiment, A(t) is used to define the action set: The specific uninstallation strategy is expressed as follows:
[0109]
[0110]
[0111] This represents the task unloading strategy within the collaboration domain k, i.e., the unloading rate at which training vehicles are unloaded to various service vehicles within this collaboration domain.
[0112] (3) Determine the reward function. The reward function is defined as follows:
[0113]
[0114] Figure 2 This is one of the interactive schematic diagrams of the mobile terminal resource allocation method provided by the present invention. Figure 2 In the described embodiment, when the RSU receives the training task instruction sent by the user, it first obtains the vehicle information of k cooperative domains, determines the corresponding training vehicle (corresponding to the first terminal) in each cooperative domain according to the cooperative learning capability evaluation model, and inputs the state information of each cooperative domain into the global network. It receives the network weights of each training vehicle through the action space and updates them synchronously through the state space to determine the offloading strategy that each training vehicle can execute. According to the offloading strategy, the training vehicles in the k offloading domains offload the training task to the service vehicle, calculate the reward value (determined by the reward function) and the update status of each first parameter, and send the reward value and update status to the RSU. Under the condition of minimizing the training latency, the final offloading strategy is determined. Then, according to the offloading strategy, the training task is offloaded between the first terminal and the second terminal, and federated learning training of the local models of different vehicles in each cooperative domain is performed.
[0115] The mobile terminal resource allocation method provided by this invention optimizes vehicle collaborative training and improves the efficiency of collaborative training by providing an A3C-based FL computing task offloading algorithm.
[0116] In some embodiments, receiving the second and third parameters sent by the first terminal includes: when the number of training rounds of the local model of the first terminal reaches a preset training number threshold, encrypting and sending the first and second parameters to the edge server of the roadside unit based on differential privacy technology.
[0117] In this embodiment, the preset training count threshold can be set according to user needs.
[0118] In this embodiment, the vehicle with the greatest RSU collaborative learning capability is designated as the training node, and FL training tasks and initial model parameters (corresponding to the first parameters) are distributed to the training node. Vehicles not selected as training nodes can provide collaborative computing services to training vehicles of the same organization within the same RSU coverage area, and are referred to as service vehicles. The local model of the training node performs FL local training based on the initial model parameters and the amount of data stored locally. When the number of local training rounds reaches a certain number, the training model parameter results are encrypted and transmitted to the edge server of the RSU through differential privacy. The RSU performs model aggregation to obtain new global model parameters, which are then distributed to the training vehicles to complete the next round of FL training until convergence or the training round threshold is reached.
[0119] The mobile terminal resource allocation method provided by this invention improves the security of parameter transmission and reduces interference from malicious nodes to the collaborative model by using a federated learning training model to transmit training parameters.
[0120] In some embodiments, the first training latency includes parameter download latency, unloading latency, collaborative training latency, parameter feedback latency, and parameter upload latency; wherein, parameter download latency is used to represent the latency generated when the first terminal receives the first parameter and at least part of the local data, collaborative training latency is used to represent the latency when the second terminal obtains the third parameter, parameter feedback latency is used to represent the latency when the first terminal receives the third parameter sent by the second terminal, and parameter upload latency is used to represent the latency of receiving the second parameter and the third parameter.
[0121] Figure 3 This is the second interactive schematic diagram of the mobile terminal resource allocation method provided by the present invention, as shown below. Figure 3 As shown, after adding the collaborative training mode, the FL training process includes the following eight steps: 1. Node selection; 2. Model distribution; 3. Task unloading; 4. Collaborative training; 5. Parameter feedback; 6. Local aggregation; 7. Model upload; 8. Global aggregation.
[0122] In this embodiment, the download latency during collaborative training is determined as follows:
[0123] Assuming RSUs have the same coverage area, but are far apart, vehicles can only communicate with other vehicles within the same RSU area. Furthermore, vehicles move slowly near RSUs such as traffic lights or toll booths, allowing for task training and data transmission to be completed before leaving the RSU coverage area. Using R... d,j To represent the data transmission rate when vehicle d communicates with RSU-j:
[0124]
[0125] Where, ω d,j G represents the channel bandwidth between vehicle d and RSU-j. d,j p represents the channel gain. d,j It is the transmission power, σ 2 Indicates noise power.
[0126] Assume that the initial model data downloaded by vehicle d from RSU-j via I2V communication is of size D. model,i (In bits), the download time is:
[0127]
[0128] In this embodiment, the download latency during collaborative training is determined as follows:
[0129] Training vehicles Tasks and data need to be offloaded and transferred to the service vehicle. Model parameters and data transmission cause unloading delay. The data transmission rate between vehicle d and vehicle l is:
[0130]
[0131] Where, ω d,j g represents the channel bandwidth between vehicle d and l. d,l p represents the channel gain. d,l It is the transmission power, σ 2 Indicates noise power.
[0132] Assumption For training vehicles Unload to service vehicle If the unloading rate is high, then the unloading delay is expressed as:
[0133]
[0134] In this embodiment, the parameter feedback latency during collaborative training is determined as follows:
[0135]
[0136] In this embodiment, the parameter feedback latency during collaborative training is determined as follows:
[0137] In this embodiment, the parameter upload latency during collaborative training is determined in the following way:
[0138] After the training vehicles complete local aggregation, the model is uploaded to RSU-j. The upload latency is then expressed as:
[0139]
[0140] In some embodiments, the constraints on reducing the loss function of a federated learning model include training latency and energy consumption.
[0141] It should be noted that vehicles, as mobile terminal devices in mobile edge computing networks, generate energy consumption during data communication and local model training. Excessive energy consumption can lead to energy waste and seriously affect other functions of the vehicle.
[0142] In this embodiment, the energy consumption of each terminal vehicle includes the following two aspects: 1. Energy consumption caused by training the local FL model; 2. Energy consumption caused by communication such as model transmission and parameter return.
[0143] In local training mode, the energy consumption expression for each terminal device is:
[0144]
[0145] In collaborative training mode, the energy consumption is:
[0146]
[0147] in, X is the clock frequency of the central processing unit (CPU) of each terminal. i This paper assumes that the number of CPU cycles required per bit of data is equal for all vehicles. It is the energy consumption coefficient, which depends on the chip in each vehicle's equipment. In formula (9), This refers to the energy consumption generated by the vehicle during local FL model training, while p d T upload,d This energy consumption is due to the upload of the model to the RSU. Furthermore, since the RSU device can be continuously powered, this solution does not consider the energy consumption generated by RSU communication and computation, but only the energy consumption of terminal devices such as vehicles.
[0148] The mobile terminal resource allocation method provided by this invention improves the effectiveness and accuracy of mobile terminal resource allocation by obtaining the total latency and energy consumption of the first and second terminals respectively under the collaborative training mode, which serve as constraints to reduce the loss function of the federated learning model.
[0149] The mobile terminal resource allocation device provided by the present invention is described below. The mobile terminal resource allocation device described below can be referred to in correspondence with the mobile terminal resource allocation method described above.
[0150] Figure 4 This is a schematic diagram of the structure of the mobile terminal resource allocation device provided by the present invention, as shown below. Figure 4As shown, the present invention also provides a mobile terminal resource allocation device, including a sending module 410, a receiving module 420, a first processing module 430, and a second processing module 440.
[0151] The sending module 410 is used to send a first parameter to the first terminal, which is one of the terminals included in the target cooperative domain corresponding to the roadside unit. The first parameter is the initial parameter of the federated learning training model and is used to represent the performance of all terminals in the target cooperative domain.
[0152] The receiving module 420 is used to receive the second parameter and the third parameter sent by the first terminal. The second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal. The third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal. The second terminal is another terminal in the target collaboration domain other than the first terminal.
[0153] The first processing module 430 is used to aggregate the second and third parameters based on the federated learning training model to obtain global parameters.
[0154] The second processing module 440 is used to update the federated learning training model based on global parameters.
[0155] The mobile terminal resource allocation device provided by the present invention distributes the first parameters of the federated learning training model to the first terminal and the second terminal for collaborative training, and aggregates the second and third parameters obtained from the collaborative training to obtain new global parameters. This realizes the full utilization of resources by the mobile terminal and the efficient collaboration of vehicle training, thereby optimizing the allocation of vehicle network resources.
[0156] According to the present invention, a mobile terminal resource allocation device further includes:
[0157] The terminal determination module is used to obtain the collaborative learning capability of each terminal based on the local data and the first training latency corresponding to the local model of each terminal before sending the first parameter to the first terminal in the target collaborative domain corresponding to the roadside unit, and determine the terminal corresponding to the maximum value of the collaborative learning capability as the first terminal.
[0158] The mobile terminal resource allocation device provided by the present invention obtains the collaborative learning ability of different terminals by acquiring the communication latency of different terminals, the training latency of the local model of different terminals, and the amount of data stored in the terminals to construct a collaborative learning ability evaluation model. This improves the accuracy of federated learning training models and avoids the impact of malicious nodes uploading incorrect model parameters.
[0159] Figure 5An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a mobile terminal resource allocation method, which includes: sending a first parameter to a first terminal, wherein the first terminal is one of the terminals included in the target cooperative domain corresponding to the roadside unit, and the first parameter is the initial parameter of the federated learning training model, which represents the performance of all terminals in the target cooperative domain; receiving a second parameter and a third parameter sent by the first terminal, wherein the second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal, and the third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal, wherein the second terminal is another terminal in the target cooperative domain besides the first terminal; aggregating the second parameter and the third parameter based on the federated learning training model to obtain global parameters; and updating the federated learning training model based on the global parameters.
[0160] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0161] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the mobile terminal resource allocation method provided by the above methods. The method includes: sending a first parameter to a first terminal, wherein the first terminal is one of the terminals included in the target cooperative domain corresponding to the roadside unit, the first parameter is the initial parameter of the federated learning training model, and the first parameter is used to represent the performance of all terminals in the target cooperative domain; receiving a second parameter and a third parameter sent by the first terminal, wherein the second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal, and the third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal, wherein the second terminal is another terminal in the target cooperative domain other than the first terminal; performing aggregation processing on the second parameter and the third parameter based on the federated learning training model to obtain global parameters; and updating the federated learning training model based on the global parameters.
[0162] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the mobile terminal resource allocation method provided by the above methods. The method includes: sending a first parameter to a first terminal, wherein the first terminal is one of the terminals included in the target cooperative domain corresponding to the roadside unit, the first parameter being the initial parameter of a federated learning training model, and the first parameter being used to represent the performance of all terminals in the target cooperative domain; receiving a second parameter and a third parameter sent by the first terminal, wherein the second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal, and the third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal, wherein the second terminal is another terminal in the target cooperative domain besides the first terminal; performing aggregation processing on the second parameter and the third parameter based on the federated learning training model to obtain global parameters; and updating the federated learning training model based on the global parameters.
[0163] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0164] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A mobile terminal resource allocation method, applied to a roadside unit, wherein the roadside unit includes a federated learning training model, characterized in that, include: Send a first parameter to the first terminal, where the first terminal is one of the terminals included in the target cooperative domain corresponding to the roadside unit, the first parameter is the initial parameter of the federated learning training model, and the first parameter is used to represent the performance of all terminals in the target cooperative domain; Based on the status information of all terminals within the target collaborative domain and the preset offloading strategy, a second terminal is determined. The offloading strategy is determined based on the A3C algorithm and the first training delay corresponding to the local model of each terminal. The first terminal is controlled to send the first parameter to the second terminal; When the second terminal receives the third parameter, the second terminal is controlled to return the third parameter to the first terminal; The terminal's state information includes the terminal's available computing resources, the A3C algorithm's state space is the available computing resources of the training cooperative domain vehicles, and the A3C algorithm's action space is the unloading rate of the training vehicles in the cooperative domain to each service vehicle. The system receives a second parameter and a third parameter sent by the first terminal. The second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal. The third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal. The second terminal is another terminal in the target cooperative domain other than the first terminal. Based on the federated learning training model, the second and third parameters are aggregated to obtain the global parameters; The federated learning training model is updated based on the global parameters.
2. The mobile terminal resource allocation method according to claim 1, characterized in that, Before sending the first parameter to the first terminal in the target cooperative domain corresponding to the roadside unit, the method further includes: Based on the local data and the first training latency corresponding to the local model of each terminal, the collaborative learning capability of each terminal is obtained, and the terminal corresponding to the maximum value of the collaborative learning capability is determined as the first terminal.
3. The mobile terminal resource allocation method according to claim 1, characterized in that, The receiving of the second and third parameters sent by the first terminal includes: When the number of training rounds of the local model of the first terminal reaches a preset training number threshold, the first parameter and the second parameter are encrypted and sent to the edge server of the roadside unit based on differential privacy technology.
4. The mobile terminal resource allocation method according to claim 2, characterized in that, The first training latency includes parameter download latency, unloading latency, collaborative training latency, parameter feedback latency, and parameter upload latency; Wherein, the parameter download latency is used to represent the latency of the first terminal receiving the first parameter, the unloading latency is used to represent the latency of the second terminal receiving the first parameter and at least part of the local data sent by the first terminal, the collaborative training latency is used to represent the latency of the second terminal obtaining the third parameter, the parameter feedback latency is used to represent the latency of the first terminal receiving the third parameter sent by the second terminal, and the parameter upload latency is used to represent the latency of receiving the second parameter and the third parameter.
5. A mobile terminal resource allocation device, employing the mobile terminal resource allocation method as described in claim 1, characterized in that, include: The sending module is used to send a first parameter to a first terminal, which is one of the terminals included in the target cooperative domain corresponding to the roadside unit. The first parameter is the initial parameter of the federated learning training model and is used to represent the performance of all terminals in the target cooperative domain. The receiving module is used to receive a second parameter and a third parameter sent by the first terminal. The second parameter is obtained by federated learning training of the local model of the first terminal based on the first parameter and the local data of the first terminal. The third parameter is obtained by federated learning training of the local model of the second terminal based on the first parameter and the local data of the second terminal. The second terminal is another terminal in the target cooperative domain other than the first terminal. The first processing module is used to aggregate the second and third parameters based on the federated learning training model to obtain global parameters; The second processing module is used to update the federated learning training model based on the global parameters.
6. The mobile terminal resource allocation device according to claim 5, characterized in that, The device further includes: The terminal determination module is used to obtain the collaborative learning capability of each terminal based on the local data and the first training delay corresponding to the local model of each terminal before sending the first parameter to the first terminal in the target collaborative domain corresponding to the roadside unit, and to determine the terminal corresponding to the maximum value of the collaborative learning capability as the first terminal.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the mobile terminal resource allocation method as described in any one of claims 1 to 4.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the mobile terminal resource allocation method as described in any one of claims 1 to 4.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the mobile terminal resource allocation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Efficient federal learning method in Internet of Vehicles scene
CN113313264A