Vehicle federated learning method and system based on clustering and calculation unloading

By adopting the vehicle federated learning method of clustering and computation offloading in the intelligent transportation system, the communication congestion and privacy protection problems in vehicle federated learning are solved, the training efficiency and model accuracy are improved, and efficient task completion and privacy protection are achieved.

CN118714537AActive Publication Date: 2024-09-27SHANDONG NORMAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411184249.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-09-27
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

In intelligent transportation systems, communication congestion and high communication costs of vehicle federated learning due to scarcity of wireless resources and non-independent and identically distributed data lead to low training efficiency, reduced model accuracy, and difficult to achieve user privacy protection.

Method used

A vehicle federated learning method based on clustering and computation offloading is adopted. The improved K-means algorithm is used to cluster vehicles and select the cluster head vehicle, implement hierarchical federated learning, and perform computation offloading within the cluster to optimize task completion time.

Benefits of technology

It reduces communication overhead, improves task completion speed, reduces overall task completion time, and effectively protects user privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118714537A
    Figure CN118714537A
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle networking wireless communication, and provides a vehicle federated learning method and system based on clustering and calculation unloading, and the method comprises the following steps: constructing a vehicle federated learning system network model comprising a plurality of vehicles and a base station with a server; clustering the vehicles based on an improved K-means algorithm, and selecting the vehicle with the highest score in each cluster as a cluster head vehicle through comprehensive scores; establishing a calculation unloading model and a time delay model according to local calculation and communication conditions of each cluster after clustering; determining that the optimization problem is minimum task completion time; the unloading decision is optimized, and the task completion time is minimized. According to the method, the vehicles are clustered, and the clustered vehicles do not need to frequently transmit model parameters with the remote base station, so that the communication overhead is reduced; and the calculation task part of the vehicle with the slow model training is unloaded to other vehicles with the fast model training in the cluster for calculation, so that the task completion time is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of wireless communication technology for vehicle networks, and in particular to a vehicle federated learning method and system based on clustering and computation offloading. Background Art

[0002] As an important emerging technology in the 6G era, Intelligent Transportation System (ITS) combines artificial intelligence (AI) and vehicle edge computing (VEC), giving rise to future vehicle networks that can support autonomous driving and some vehicle applications, further expanding the potential value of vehicle data. Autonomous vehicles collect a large amount of important data by equipping them with lidar sensors, camera sensors, and radar sensors, and share them with vehicle networks. Artificial intelligence (AI) can use this data to achieve a variety of applications such as object detection and tracking, traffic sign classification, lane flow estimation, trajectory route planning, and high-definition map generation. However, in recent years, with the increasing awareness of personal privacy protection, vehicle users are reluctant to expose their information to other users, nor are they willing to upload data to edge computing (MEC) servers or the cloud, as this may lead to malicious interception and abuse of vehicle user information.

[0003] Federated learning (FL), as an emerging distributed machine learning paradigm, allows vehicle users to train local models on their private datasets and upload the trained models to the base station (central server) for global aggregation. The aggregated global model is broadcast to users for the next iteration of FL training, and the iteration process continues until it converges to a certain global federated learning model accuracy. Unlike uploading raw data, FL allows distributed users to train global models by uploading local models to a central server, thereby reducing communication overhead and protecting user privacy.

[0004] In intelligent transportation systems, some Internet of Vehicles tasks involve vehicle safety control and protection, and vehicles need to respond and process tasks accurately and quickly. However, due to the scarcity of wireless resources, a large number of vehicle users participating in federated learning (FL) training at the same time will cause communication congestion, resulting in low FL training efficiency. Moreover, the distance between vehicle users and base stations is far, and frequent uploading and downloading of models will sharply increase the overall communication overhead. In addition, the current FL algorithm also faces the challenge of non-independent and identically distributed (Non-IID) data. The higher the degree of Non-IID in the data, the slower the convergence speed of the FL algorithm, resulting in high communication costs and reduced model accuracy. Summary of the invention

[0005] In view of the problems existing in the prior art, the present invention provides a vehicle federated learning method and system based on clustering and computation offloading. The improved K-means method is used to divide vehicle users into multiple clusters and select cluster head vehicles to perform hierarchical federated learning (HFL). In order to speed up the completion of tasks, an intra-cluster computation offloading strategy is introduced to offload part of the tasks of vehicles that complete tasks slowly to other vehicles in the cluster that complete tasks quickly, thereby increasing the speed at which the slowest vehicle completes the task, thereby reducing the overall task completion time.

[0006] To achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a vehicle federated learning method based on clustering and computation offloading, the method comprising: Construct a system network model of vehicle federated learning that includes multiple vehicles and a base station with a server; The vehicles are clustered based on the improved K-means algorithm, and the vehicle with the highest score in each cluster is selected as the cluster head vehicle through comprehensive scoring; According to the local computing and communication conditions of each cluster after clustering, a computing offloading model and a latency model are established; The optimization problem is to minimize the time to complete the task; Optimize offloading decisions to minimize task completion time.

[0007] In a possible implementation, the vehicles are clustered based on the improved K-means algorithm, and the vehicle with the highest score in each cluster is selected as the cluster head vehicle through comprehensive scoring, which specifically includes: S21: Collect from vehicle Random selection K The car is used as the initial mass , forming the initial K Intermediate Cluster ; S22: Calculate vehicles separately n and K Each intermediate cluster Distance ; S23: According to the distance The value of the vehicle n Add to distance in the smallest middle cluster; S24: Repeat S22-S23 until all vehicles are added to the cluster and the final K Cluster ; S25: In each cluster The fraction of each vehicle that becomes the cluster head is calculated separately , select score The largest vehicle is the cluster head vehicle.

[0008] In a possible implementation, the distance The calculation formula is as follows: , in, , , , Indicates vehicle n With the middle cluster The average relative distance of all vehicles in; Represents the middle cluster The number of vehicles in Indicates vehicle n With the middle cluster Medium Vehicle m The relative distance between Indicates vehicle n With the middle cluster The average relative speed of all vehicles in ; Indicates vehicle n speed; Represents the middle cluster Medium Vehicle m speed; Indicates that if the vehicle n Cluster to the middle cluster Middle cluster The degree of Non-IID; c Indicates different categories, , Represents the set of all categories; Indicates vehicle m The data involved in FL training c The proportion of the categories; Indicates that the data are independent and identically distributed. c The proportion of the categories; , and Represents the weighting coefficient.

[0009] In one possible implementation, the score The calculation formula is as follows: , in, , , , , , , Indicates vehicle n CPU frequency for local computing; Indicates vehicle n The number of CPU cycles required to calculate a sample of data; Indicates vehicle n The transmission power of the uploaded model parameters; Representation Cluster The number of vehicles in Representation Cluster Medium Vehicle n With vehicle m The relative distance between Representation Cluster Medium Vehicle n With vehicle m The relative speed of Indicates vehicle n With cluster Other vehicles m Link lifetime; Indicates vehicle n speed; Indicates vehicle m speed; TR Indicates the transmission range; is the weight factor, and .

[0010] In a possible implementation, the computation offloading model is specifically: In cluster In the case of unloading, the number of vehicles to be unloaded needs to be calculated. n You can select a vehicle within the cluster m To uninstall, in the cluster Medium Vehicle n The amount of data involved in model training for: , in, Indicates vehicle n The size of the local data; Indicates vehicle n Select the vehicle m The computation offloading decision is made if , indicating vehicle n Select the vehicle mTo offload the calculation, if , indicating vehicle n No option to send vehicle m Perform computational offloading; Indicates vehicle n To the vehicle m The proportion of computational offloading; Indicates vehicle m Select the vehicle n The computation offloading decision is made if , indicating vehicle m Select the vehicle n To offload the calculation, if , indicating vehicle m No option to send vehicle n Perform computational offloading; Indicates vehicle m To the vehicle n The proportion of computational offloading, Indicates vehicle m The size of the local data.

[0011] In a possible implementation, the delay model is specifically: The total time spent on the entire HFL training process for: , in, Represents the total number of global iterations; Represents the set of different clusters after clustering; Indicated in j The cluster in the global iteration Vehicles involved I The time taken for the local iteration; Indicated in j The delay of cluster head vehicles uploading local aggregation models in the first global iteration; The calculation formula is: , in, Representation Cluster The computation offloading delay of Indicates that in each local iteration, the vehicle n Local model training latency; Indicates that in the first global iteration and the first local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay I Represents the total number of local iterations; Indicates that in the first global iterationi In the local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay Indicated in j Global iteration No. i In the local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay The calculation formula is: , in, L Indicates the number of rounds of local training; Indicates vehicle n The amount of data involved in model training; Indicates vehicle n The number of CPU cycles required to calculate a sample of data; Indicates vehicle n CPU frequency for local computing; The calculation formula is: , in, Z represents the size of the model parameters, Indicates j Global iteration No. i In the local iteration, from the vehicle n Upload to cluster head vehicle The transmission model; The calculation formula is: , in, represents the cluster head vehicle; represents the set of cluster head vehicles; Z Indicates the size of the model parameters; Indicated in j Transmission model of cluster head vehicles uploading local aggregation models in the first global iteration.

[0012] In one possible implementation, the cluster Computation offloading latency The calculation formula is: , in, Representation Cluster Inside vehicle n To the vehicle m Data unloading delay for unloading local data, , in, Indicates vehicle n Select the vehicle m Making a computation offloading decision for computation offloading; Indicates vehicle n To the vehicle m The proportion of computational offloading; Indicates vehicle n The size of the local data; represents the transmission model, , in, B Indicates the total bandwidth; N Represents the number of all vehicles participating in federated learning; Indicates vehicle n The transmission power of the uploaded model parameters; Indicates vehicle n and vehicles m The channel gain between represents the noise power density.

[0013] In a possible implementation, the explicit optimization problem is to minimize the time to complete the task, specifically: , St , , , , , in, represents the computational unloading decision matrix for each vehicle; represents the calculated unloading amount vector for each vehicle; Indicates vehicle n Select the vehicle m Making a computation offloading decision for computation offloading; Indicates vehicle m Select the vehicle n Making a computation offloading decision for computation offloading; Indicates vehicle n To the vehicle m Proportion of computational offloading; Constraints and Indicates that the vehicle can only select one vehicle in the cluster for computation offloading; constraint Indicates that the vehicle can only be used as an unloading vehicle or a service vehicle to avoid two vehicles unloading each other and forming a loop; Constraints Indicates that the vehicle can only select vehicles within the cluster for computational offloading and cannot select vehicles outside the cluster; constraint Represents the unloading ratio constraint.

[0014] In a possible implementation, the optimizing the offloading decision specifically comprises: optimizing the offloading decision by using a deep deterministic policy gradient algorithm.

[0015] In a second aspect, the present invention provides a vehicle federated learning system based on clustering and computation offloading, the system comprising: A data acquisition module is configured to acquire vehicle status data; The clustering and cluster head vehicle selection module is configured to cluster the vehicles based on the improved K-means algorithm, and select the vehicle with the highest score in each cluster as the cluster head vehicle through comprehensive scoring; A model building module is configured to build a computing offloading model and a latency model according to the local computing and communication conditions of each cluster after clustering; The problem determination module is configured to minimize the task completion time while satisfying the constraints; The optimization module is configured to use the DDPG algorithm to solve the optimization problem and minimize the task completion time.

[0016] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention utilizes an improved K-means method to divide vehicle users into multiple clusters and select cluster head vehicles to perform hierarchical federated learning (HFL) to prevent a large number of vehicles from uploading model parameters at the same time, causing communication congestion. In order to speed up task completion, vehicles do not need to frequently transmit model parameters to distant base stations, reducing communication overhead.

[0017] (2) The present invention uses an intra-cluster computing offloading strategy to offload part of the tasks of vehicles that complete tasks slowly to other vehicles in the cluster that complete tasks quickly, thereby increasing the speed at which the slowest vehicle completes its tasks and thereby reducing the overall task completion time.

[0018] Advantages of additional aspects of the present invention will be given in part in the description that follows, and in part will be obvious from the description that follows, or will be learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A schematic flow chart of a vehicle federated learning method based on clustering and computation offloading provided in an embodiment of the present invention; Figure 2 A wireless network model diagram of a vehicle federated learning method based on clustering and computation offloading provided in an embodiment of the present invention; Figure 3 A schematic diagram of a process of clustering and selecting cluster head vehicles using an improved K-means method in a vehicle federated learning method based on clustering and computation offloading provided by an embodiment of the present invention; Figure 4 This is the average reward convergence graph of computational offloading obtained by using the DDPG algorithm in an embodiment of the present invention; Figure 5 A comparison diagram of task accuracy between a vehicle clustering and intra-cluster computing offloading method and a clustering-only without offloading method in an embodiment of the present invention; Figure 6 It is a comparison chart of the task completion time of the vehicle clustering and intra-cluster computing unloading method, the clustering without unloading method and the non-clustering and non-unloading method in the embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0022] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] See also Figure 1 , is a flow chart of a vehicle federated learning method based on clustering and computation offloading provided by an embodiment of the present invention. Figure 1 As shown, the method includes: Step S1: Construct a system network model of vehicle federated learning including multiple vehicles and a base station with a server, and describe in detail the infrastructure and equipment of the wireless network under vehicle federated learning.

[0024] See also Figure 2, is a wireless network model diagram of a vehicle federated learning method based on clustering and computation offloading provided by an embodiment of the present invention. Figure 2 As shown in the figure, consider a wireless network system consisting of multiple vehicle users and a base station (with a server) on a two-way two-lane highway. N Vehicle, vehicle collection Indicates that these vehicles are within the coverage of the base station during the entire Hierarchical Federated Learning (HFL) process. The vehicles can be divided into K Clusters are used to collaboratively participate in HFL training, and the formed clusters can last for a period of time sufficient to support the entire HFL process.

[0025] vehicle n The dataset involved in HFL training is represented as ,in represents the training data, yes The corresponding label, It is a vehicle n The amount of training data, vehicles n Each data sample i From the training data and its corresponding label These on-board data are generated by vehicles during daily operation and can be applied to various machine learning tasks, such as traffic sign classification, lane flow estimation, trajectory route planning, and high-definition map generation.

[0026] Step S2: Cluster the vehicles according to their relative positions, relative speeds and the Non-IID characteristics of the data, and determine the cluster head vehicle of each cluster by comprehensively considering the computing power, communication capability, relative position, relative speed and sustainability of the communication link of the vehicles.

[0027] See also Figure 3 , is a flow chart of clustering and selecting cluster head vehicles using an improved K-means method in a vehicle federated learning method based on clustering and computation offloading provided by an embodiment of the present invention. Figure 3 As shown, Step S21: From the vehicle collection Random selection K The car is used as the initial mass , forming the initial K Intermediate Cluster , .

[0028] Step S22: Calculate the vehicle n and K Each intermediate cluster Distance , the calculation formula is as follows: , in, , , , Indicates vehicle n With the middle cluster The average relative distance of all vehicles in; Represents the middle cluster The number of vehicles in Indicates vehicle n With the middle cluster Medium Vehicle m The relative distance between Indicates vehicle n With the middle cluster The average relative speed of all vehicles in ; Indicates vehicle n speed; Represents the middle cluster Medium Vehicle m speed; If the vehicle n Cluster to the middle cluster Middle cluster The degree of Non-IID; c Indicates different categories, , Represents the set of all categories; Indicates vehicle m The data involved in FL training c The proportion of the categories; When the data is independent and identically distributed (IID), c The proportion of the categories; The calculation formula is: , C Indicates the number of categories; , and Represents the weighting coefficient.

[0029] It should be noted that in this embodiment In essence, the difference between non-independent identically distributed (Non-IID) and IID data distributions is used to represent data offset, which in turn affects the accuracy of the model. In this embodiment, the task of FL training is to perform category recognition. For example, the cifar-10 dataset (containing 60,000 color images of 10 categories, 6,000 images per category, and the categories are airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks) is used for training. The trained model can be used to recognize these categories.

[0030] Step S23: According to the vehicle n and K Each middle cluster in Distance , the vehicle n Add to distance The smallest middle cluster.

[0031] Step S24: Repeat steps S22-S23 until all vehicles are added to the cluster and the final K Cluster .

[0032] Step S25: In each cluster The fraction of each vehicle that becomes the cluster head is calculated separately , select score The largest vehicle is the cluster head vehicle.

[0033] Fraction The calculation formula is as follows: , in, , , , , , , For vehicles n Locally calculated CPU frequency and vehicle n The ratio of the number of CPU cycles required to calculate a sample of data indicates the cluster Vehicles in n computing power; Indicates vehicle n CPU frequency for local computing; Indicates vehicle n The number of CPU cycles required to calculate a sample of data; Representation Cluster Medium Vehicle n communication capabilities; Indicates vehicle n The transmission power of the uploaded model parameters; For vehicles n With cluster Other vehicles m The reciprocal of the average relative distance; Representation Cluster The number of vehicles in Representation Cluster Medium Vehicle n With vehicle m The relative distance between For vehicles n With cluster Other vehicles m The reciprocal of the average relative velocity; Representation Cluster Medium Vehicle n With vehicle m The relative speed of Indicates vehicle n With cluster Other vehicles m The average link lifetime of Indicates vehicle n With cluster Other vehicles m Link lifetime; Indicates vehicle n speed; Indicates vehicle m speed; TR Indicates the transmission range; is the weight factor, and .

[0034] Step S3: Model and analyze the wireless communication network of hierarchical federated learning (HFL) in the clustered vehicle network, and build corresponding computing offloading models and delay models for vehicle local calculations and uplinks of model parameter transmission from cluster member vehicles to cluster head vehicles and from cluster head vehicles to base stations.

[0035] Due to limited computing and communication capabilities, the latency of some vehicles participating in overall federated learning may be too long, and the performance of federated learning will be affected accordingly. Offloading the computing tasks of vehicles with slow model training to other vehicles with fast model training in the cluster can reduce the task completion time.

[0036] In cluster In the case of unloading, the number of vehicles to be unloaded needs to be calculated. n You can select a vehicle within the cluster m Uninstall. Definition Calculate the unloading decision for the vehicle if , then the vehicle n (i.e. unloading vehicle) Select to m (i.e. service vehicle) to perform calculation unloading, otherwise , then the vehicle n No option to send vehicle m Perform computational offloading. Definition Cluster Medium Vehicle n (i.e. unloading vehicle) to the vehicle m (i.e., service vehicle) calculates the unloading ratio. Medium Vehicle n The amount of data involved in model training for: , in, Indicates vehicle n The size of the local data, Indicates vehicle n Select the vehicle m Make a computation offloading decision to offload computation, Indicates vehicle n To the vehicle m The proportion of calculation offloading, Indicates vehicle m Select the vehicle n Make a computation offloading decision to offload computation, Indicates vehicle m To the vehicle n The proportion of calculation offloading, Indicates vehicle m The size of the local data.

[0037] The learning delay in the local-cluster head vehicle aggregation phase consists of three parts: computation offloading delay, local model training delay, and local model upload to cluster head vehicle. The time delay of cluster head vehicle aggregation and the time delay of model parameters after aggregation are not considered here because the time delay of cluster head vehicle aggregation and model delivery is very short. The synchronous model aggregation mechanism is adopted in both the local-cluster head vehicle aggregation stage and the cluster head vehicle-base station aggregation stage.

[0038] In cluster In, if , then the vehicles in the cluster n Need to vehicle m Uninstall some local data, the amount of uninstallation is In this embodiment, orthogonal frequency division multiple access (OFDMA) is used for data transmission. Inside vehicle nTo the vehicle m Data unloading delay for unloading local data for: , in, Represents the transfer model.

[0039] Transmission Model for: , B Indicates the total bandwidth; N Represents the number of all vehicles participating in federated learning; Indicates vehicle n The transmission power of the uploaded model parameters; Indicates vehicle n and vehicles m The channel gain between them takes into account the large-scale fading and small-scale fading of the channel between them, and the path loss model of large-scale fading , small-scale fading obeys Rayleigh distribution, which indicates Rayleigh fading. Indicates vehicle n When unloading data and vehicle m The distance between represents the noise power density.

[0040] Cluster Computation offloading latency for: , In each local iteration, the vehicle n Local model training latency for: , in, L Indicates the number of rounds of local training; Indicates vehicle n The amount of data involved in model training; Indicates vehicle n The number of CPU cycles required to calculate a sample of data, It is determined by the learning task and the computing power of the mobile device; Indicates vehicle n The CPU frequency for local computing.

[0041] In cluster The cluster member vehicles in n The cluster head vehicle is sent using Orthogonal Frequency Division Multiple Access (OFDMA) Upload its local training model parameters and define Z Represents the size of the model parameters, then in thej Global iteration No. i In the local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay for: , in, Indicates j Global iteration No. i In the local iteration, from the vehicle n Upload to cluster head vehicle The transmission model, its calculation formula and transmission model same.

[0042] In the j In the global iteration, the cluster Total number of vehicles involved I The time spent on local iterations for: , in, I represents the total number of local iterations, Indicates that in the first global iteration and the first local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay I Represents the total number of local iterations; Indicates that in the first global iteration i In the local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle delay.

[0043] The time delay of cluster head vehicle-base station aggregation stage is mainly determined by the cluster head vehicle uploading the local aggregation model. Due to the strong computing and communication capabilities of the base station, the time delay of global model aggregation and downloading is also ignored. j The cluster head vehicle in the global iteration Delay in uploading local aggregate models for: , in, represents the cluster head vehicle; represents the set of cluster head vehicles; Z Indicates the size of the model parameters; bs represents a base station; Indicated in j The transmission model of the cluster head vehicle uploading the local aggregation model in the global iteration, and its calculation formula and transmission model same.

[0044] The total time spent on the entire HFL training process for:

[0045] in, Represents the total number of global iterations; Represents the set of different clusters after clustering.

[0046] Step S4: Problem modeling, clarifying that the system optimization goal is to minimize the time to complete the task.

[0047] Clearly define the system optimization goal and minimize the task completion time by optimizing the offloading decision. The optimization problem can be modeled as: , St , , , , , in, represents the computational unloading decision matrix for each vehicle, represents the computational offloading decision vector of each vehicle in the cluster, Represents the calculated unloading amount vector for each vehicle.

[0048] Constraints and Indicates that the vehicle can only select one vehicle in the cluster for computation offloading. Constraints Indicates that the vehicle can only be an unloading vehicle or a service vehicle, to avoid two vehicles unloading each other and forming a loop. Constraints Indicates that the vehicle can only select vehicles within the cluster for computation offloading and cannot select vehicles outside the cluster. Constraints Represents an unloading ratio constraint.

[0049] Step S5: Use the deep deterministic policy gradient (DDPG) algorithm to optimize the offloading decision to minimize the task completion time.

[0050] Define the state space, action space and reward function, and build the DDPG model.

[0051] State space: The state set is: ,in , contains the information of all vehicle users in the entire network, that is, vehicle iThe amount of data, the number of CPU cycles required to process 1 bit of data, the CPU frequency of calculation, the transmission power, speed and location information.

[0052] Action space: The action set is: , the specific accepting vehicle action can be described as: , namely uninstall association and uninstall ratio.

[0053] Reward function: In order to minimize the time of the entire FL training process, the reward function is defined as: .

[0054] The specific algorithm process is: Step 1: Initialize the critic network , actor network Parameters , , Step 2: Initialize the target network , Parameters , , Step 3: Initialize Replay Buffer R, Step4: for episode=1, M do, Step 5: Initialize the random process To perform motion exploration and observe the initial state , Step 6: Select actions based on current strategy and exploration. Step 7: Execute the action And observe the rewards and the new state , Step 8: In the Replay Buffer R Medium Storage , Step 9: R Randomly select a batch N Samples , Step 10: Settings , Step 11: Update Critic by minimizing the loss function: , Step 12: Use the sampled policy gradient to update the Actor: , Step 13: Update target network parameters: , , Step 14: end for like Figure 4 As shown in FIG. 1 , it is the average reward convergence diagram of computational offloading obtained by using the DDPG algorithm in an embodiment of the present invention. Figure 5 As shown in FIG. 1 , it is a comparison chart of the task accuracy of the vehicle clustering and in-cluster computing offloading method and the clustering-only without offloading method in the embodiment of the present invention. Figure 6 As shown in FIG. 1 , it is a comparison chart of the task completion time of the vehicle clustering and in-cluster computing offloading method, the clustering without offloading method, and the non-clustering without offloading method in an embodiment of the present invention. Figures 4 to 6 It can be seen that the vehicle federated learning method based on clustering and computation offloading proposed in the embodiment of the present invention can obtain higher accuracy of federated learning and better convergence effect, alleviate the impact of the Non-IID characteristics of the data on the training accuracy, and shorten the task completion time.

[0055] Corresponding to the above embodiment, the present invention further provides a vehicle federated learning system based on clustering and computation offloading, comprising: A data acquisition module is configured to acquire vehicle status data; The clustering and cluster head vehicle selection module is configured to cluster the vehicles based on the improved K-means algorithm, and select the vehicle with the highest score in each cluster as the cluster head vehicle through comprehensive scoring; The model building module is configured to establish a wireless communication network model of the HFL by acquiring vehicle status data and vehicle clustering conditions, and to build corresponding calculation offloading and delay models for vehicle local calculations and uplinks of model parameter transmission from cluster member vehicles to cluster head vehicles and from cluster head vehicles to base stations; The problem determination module is configured to minimize the time to complete the task under the premise of satisfying the constraints that only one vehicle can be selected in the cluster for computational unloading, the vehicle can only be an unloading vehicle or a service vehicle, and the unloading ratio can only be within [0,1]; The optimization module is configured to use the DDPG algorithm to solve the optimization problem and minimize the task completion time.

[0056] Corresponding to the above embodiment, an embodiment of the present invention further provides an electronic device. The electronic device may include: a processor, a memory, and a communication unit. These components communicate through one or more buses. Those skilled in the art can understand that the electronic device structure can be a bus structure or a star structure, and can also include more or fewer components than above, or combine certain components, or arrange components differently.

[0057] The communication unit is used to establish a communication channel so that the electronic device can communicate with other devices.

[0058] The processor is the control center of the electronic device. It uses various interfaces and lines to connect the various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory, and calls the data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor can only include a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0059] Memory, used to store the execution instructions of the processor. The memory can be implemented by any type of volatile or non-volatile storage device or a combination of them, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0060] When the execution instructions in the memory are executed by the processor, the electronic device is enabled to execute part or all of the steps in the above method embodiments.

[0061] Corresponding to the above embodiment, the embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium may store a program, wherein when the program is running, the device where the computer-readable storage medium is located may be controlled to execute some or all of the steps in the above method embodiment. In a specific implementation, the computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0062] Corresponding to the above embodiment, an embodiment of the present invention further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes part or all of the steps in the above method embodiment.

[0063] In the embodiments of the present invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. A and B may be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may be represented by: a, b, c, ab, ac, bc or abc, where a, b, c may be single or multiple.

[0064] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0065] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0066] In several embodiments provided by the present invention, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0067] The above is only a specific embodiment of the present invention. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A vehicle federated learning method based on clustering and computation offloading, characterized in that: The method comprises: Construct a system network model of vehicle federated learning that includes multiple vehicles and a base station with a server; The vehicles are clustered based on the improved K-means algorithm, and the vehicle with the highest score in each cluster is selected as the cluster head vehicle through comprehensive scoring; According to the local computing and communication conditions of each cluster after clustering, a computing offloading model and a latency model are established; The optimization problem is to minimize the time to complete the task; Optimize offloading decisions to minimize task completion time.

2. The vehicle federated learning method based on clustering and computation offloading according to claim 1, characterized in that: The vehicles are clustered based on the improved K-means algorithm, and the vehicle with the highest score in each cluster is selected as the cluster head vehicle through comprehensive scoring, including: S21: Collect from vehicle Random selection K The car is used as the initial mass , forming the initial K Intermediate Cluster ; S22: Calculate vehicles separately n and K Each intermediate cluster Distance ; S23: According to the distance The value of the vehicle n Add to distance in the smallest middle cluster; S24: Repeat S22-S23 until all vehicles are added to the cluster and the final K Cluster ; S25: In each cluster The fraction of each vehicle that becomes the cluster head is calculated separately , select score The largest vehicle is the cluster head vehicle.

3. The vehicle federated learning method based on clustering and computation offloading according to claim 2 is characterized in that: The distance The calculation formula is as follows: , in, , , , Indicates vehicle n With the middle cluster The average relative distance of all vehicles in; Represents the middle cluster The number of vehicles in Indicates vehicle n With the middle cluster Medium Vehicle m The relative distance between Indicates vehicle n With the middle cluster The average relative speed of all vehicles in ; Indicates vehicle n speed; Represents the middle cluster Medium Vehicle m speed; If the vehicle n Cluster to the middle cluster Middle cluster The degree of Non-IID; c Indicates different categories, , Represents the set of all categories; Indicates vehicle m The data involved in FL training c The proportion of the categories; Indicates that the data are independent and identically distributed. c The proportion of the categories; , and Represents the weighting coefficient.

4. The vehicle federated learning method based on clustering and computation offloading according to claim 2, characterized in that: The score The calculation formula is as follows: , in, , , , , , , Indicates vehicle n CPU frequency for local computing; Indicates vehicle n The number of CPU cycles required to calculate a sample of data; Indicates vehicle n The transmission power of the uploaded model parameters; Representation Cluster The number of vehicles in Representation Cluster Medium Vehicle n With vehicle m The relative distance between Representation Cluster Medium Vehicle n With vehicle m The relative speed of Indicates vehicle n With cluster Other vehicles m Link lifetime; Indicates vehicle n speed; Indicates vehicle m speed; TR Indicates the transmission range; is the weight factor, and .

5. The vehicle federated learning method based on clustering and computation offloading according to claim 1, characterized in that: The calculation offloading model is specifically: In cluster In the case of unloading, the number of vehicles to be unloaded needs to be calculated. n You can select a vehicle within the cluster m To uninstall, in the cluster Medium Vehicle n The amount of data involved in model training for: , in, Indicates vehicle n The size of the local data; Indicates vehicle n Select the vehicle m The computation offloading decision is made if , indicating vehicle n Select the vehicle m To offload the calculation, if , indicating vehicle n No option to send vehicle m Perform computational offloading; Indicates vehicle n To the vehicle m The proportion of computational offloading; Indicates vehicle m Select the vehicle n The computation offloading decision is made if , indicating vehicle m Select the vehicle n To offload the calculation, if , indicating vehicle m No option to send vehicle n Perform computational offloading; Indicates vehicle m To the vehicle n The proportion of computational offloading, Indicates vehicle m The size of the local data.

6. The vehicle federated learning method based on clustering and computation offloading according to claim 1, characterized in that: The delay model is specifically: The total time spent on the entire HFL training process for: , in, Represents the total number of global iterations; Represents the set of different clusters after clustering; Indicated in j The cluster in the global iteration Vehicles involved I The time taken for the local iteration; Indicated in j The delay of cluster head vehicles uploading local aggregation models in the first global iteration; The calculation formula is: , in, Representation Cluster The computation offloading delay of Indicates that in each local iteration, the vehicle n Local model training latency; Indicates that in the first global iteration and the first local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay I Represents the total number of local iterations; Indicates that in the first global iteration i In the local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay Indicated in j Global iteration No. i In the local iteration, the model parameters are changed from vehicle n Upload to cluster head vehicle Delay The calculation formula is: , in, L Indicates the number of rounds of local training; Indicates vehicle n The amount of data involved in model training; Indicates vehicle n The number of CPU cycles required to calculate a sample of data; Indicates vehicle n CPU frequency for local computing; The calculation formula is: , in, Z represents the size of the model parameters, represents the jth global iteration i In the local iteration, from the vehicle n Upload to cluster head vehicle The transmission model; The calculation formula is: , in, represents the cluster head vehicle; represents the set of cluster head vehicles; Z Indicates the size of the model parameters; Indicated in j Transmission model of cluster head vehicles uploading local aggregation models in the first global iteration.

7. The vehicle federated learning method based on clustering and computation offloading according to claim 6, characterized in that: cluster Computation offloading latency The calculation formula is: , in, Representation Cluster Inside vehicle n To the vehicle m Data unloading delay for unloading local data, , in, Indicates vehicle n Select the vehicle m Making a computation offloading decision for computation offloading; Indicates vehicle n To the vehicle m The proportion of computational offloading; Indicates vehicle n The size of the local data; represents the transmission model, , in, B Indicates the total bandwidth; N Represents the number of all vehicles participating in federated learning; Indicates vehicle n The transmission power of the uploaded model parameters; Indicates vehicle n and vehicles m The channel gain between represents the noise power density.

8. The vehicle federated learning method based on clustering and computation offloading according to claim 6, characterized in that: The explicit optimization problem is to minimize the time to complete the task, specifically: , St , , , , , in, represents the computational unloading decision matrix for each vehicle; represents the calculated unloading amount vector for each vehicle; Indicates vehicle n Select the vehicle m Making a computation offloading decision for computation offloading; Indicates vehicle m Select the vehicle n Making a computation offloading decision for computation offloading; Indicates vehicle n To the vehicle m Proportion of computational offloading; Constraints and Indicates that the vehicle can only select one vehicle in the cluster for computation offloading; constraint Indicates that the vehicle can only be used as an unloading vehicle or a service vehicle to avoid two vehicles unloading each other and forming a loop; Constraints Indicates that the vehicle can only select vehicles within the cluster for computational offloading and cannot select vehicles outside the cluster; constraint Represents an unloading ratio constraint.

9. The vehicle federated learning method based on clustering and computation offloading according to claim 1, characterized in that: The optimization of the unloading decision is specifically: optimizing the unloading decision by using a deep deterministic policy gradient algorithm.

10. A vehicle federated learning system based on clustering and computation offloading, characterized in that: The system comprises: A data acquisition module is configured to acquire vehicle status data; The clustering and cluster head vehicle selection module is configured to cluster the vehicles based on the improved K-means algorithm, and select the vehicle with the highest score in each cluster as the cluster head vehicle through comprehensive scoring; A model building module is configured to build a computing offloading model and a latency model according to the local computing and communication conditions of each cluster after clustering; The problem determination module is configured to minimize the task completion time while satisfying the constraints; The optimization module is configured to use the DDPG algorithm to solve the optimization problem and minimize the task completion time.

Citation Information

Patent Citations

  • Energy-saving combined computing unloading and resource allocation method for Internet of Vehicles

    CN117062025A

  • Lightweight federated learning framework optimization method oriented to VANET

    CN117195019A

  • Federal learning method and device applied to Internet of Vehicles, equipment and medium

    CN117812564A