Vehicle networking federated learning method based on vehicle client selection
By using a knapsack model based on the importance of data samples and upload time to select vehicle clients in connected vehicle federated learning, the problem of low model training efficiency and poor accuracy caused by random selection in connected vehicles is solved, achieving more efficient and accurate model training.
Patent Information
- Application Number
- CN202411837491.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In existing federated learning for connected vehicles, randomly selecting clients leads to low model training efficiency and poor accuracy, and fails to fully utilize data from different clients. Data bias affects model accuracy and training performance.
Based on the importance of data samples from vehicle clients and the upload time of model parameters, a knapsack model is used to select vehicle clients for training. Prior resource information is collected through roadside base stations to optimize the selection of vehicle clients, ensuring data representativeness and model convergence speed.
It improves the accuracy and training efficiency of the model, reduces resource consumption, enhances the fairness and robustness of the training process, adapts to network instability, and ensures efficient model updates in heterogeneous environments.
Smart Images

Figure CN119729547B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of Internet of Vehicles federated learning, and more specifically relates to an Internet of Vehicles federated learning method based on vehicle client selection. BACKGROUND
[0002] The Internet of Vehicles (IoV) takes cellular Internet of Vehicles (C-V2X) and dedicated short-range communication Internet of Vehicles (DSRC-V2X) as the main protocol standard, and realizes all-around connection and communication of vehicles and vehicles (V2V), vehicles and pedestrians (V2P), and vehicles and traffic infrastructure (V2I). Such all-around connection and communication enables vehicles to continuously detect the surrounding environment and obtain accurate perception results, thereby improving the ability of vehicles in blind spot detection, path planning, and speed limit warning, and realizing more intelligent and safer traffic management and driving experience. However, the massive raw data generated by vehicles contain a large amount of user sensitive information, and there is a risk of privacy leakage in the uploading process. To strengthen the protection of vehicle privacy, the existing work generally adopts a learning framework based on client privacy protection, namely federated learning (FL). Federated learning allows vehicles to perform model training locally and upload updated model parameters to the central server for aggregation, thereby reducing the risk of privacy leakage. However, in the Internet of Vehicles environment, considering the variety and heterogeneous distribution of data, the data bias of different vehicle nodes will greatly affect the accuracy of the global model. At the same time, due to the device heterogeneity among vehicles, such as network transmission delay, memory, computing power, and device availability, if a bad vehicle node is randomly selected, it will lead to a decrease in model accuracy.
[0003] In terms of solving the problems of vehicle data and device heterogeneity, federated learning client selection (or participant selection or device sampling) is considered a feasible strategy. In federated learning, the selection of clients determines which devices participate in each round of training, directly affecting the quality of training samples and the performance of the global model. The method of randomly selecting clients is simple and direct, but it cannot fully reflect the characteristics of the global data distribution, significantly reducing the efficiency and accuracy of model training, especially in the case of data and device heterogeneity. In addition, random selection can also lead to data bias and instability of sample extraction, thereby hindering the global model from quickly acquiring unknown knowledge and slowing down its convergence speed. Therefore, an effective federated learning client selection scheme is crucial, as it can significantly improve the accuracy of the model, enhance fairness and robustness during the training process, and reduce training costs and resource consumption.
[0004] Existing research alleviates the impact of data and device heterogeneity to some extent through client selection methods. However, the current client selection algorithm ignores the potential contribution of the client, resulting in low training efficiency and failing to fully utilize the data of different clients. At the same time, data bias seriously affects client selection, causing the selected clients to be unable to fully represent the overall client group, thereby affecting the training effect. SUMMARY
[0005] The purpose of the present application is to overcome the shortcomings of the prior art and provide a vehicle client selection based vehicle networking federated learning method, which selects vehicle clients based on data sample importance and model parameter upload time, ensures that the data selected in each round of federated learning has higher representativeness and value, thereby accelerating the convergence process of the model and improving the accuracy of the model.
[0006] In order to achieve the above-mentioned purpose of the application, the vehicle client selection based vehicle networking federated learning method of the present application comprises the following steps:
[0007] S1: The central server periodically collects prior resource information of each vehicle client k through the roadside base station, including transmission power, relative distance to the corresponding roadside base station, network bandwidth and channel state, k = 1, 2, …, K, K represents the number of vehicle clients in the vehicle networking;
[0008] S2: The central server initializes the parameters of the model to be learned and takes them as the initial model aggregation parameters W 0 , let the current iteration number t = 1;
[0009] S3: The central server transmits the model aggregation parameters W t-1 and the iteration number t to each vehicle client k through the roadside base station;
[0010] S4: Each vehicle client k initializes the local model parameters according to the aggregation parameters W t-1 issued by the central server, and then trains the local model using the local training data set , calculates the loss function value of each sample training sample x in the local training data set , and further calculates the local loss and updates the local model parameters to obtain the local model parameters At the same time, the data sample importance of the training sample in the current round of training is calculated , and then the data sample importance is uploaded to the central server through the roadside base station;
[0011] S5: The central server receives the data sample importance uploaded by the K vehicle clients Then, the knapsack model is used to select the vehicle clients, and the specific method is as follows:
[0012] According to the prior resource information, the transmission power P of each vehicle client k in the current round is determined k , the relative distance d of the corresponding roadside base station k , the network bandwidth B k and the channel state S k , the time t of the vehicle client k uploading the model parameters is calculated as follows:
[0013]
[0014] Wherein, σ represents the size of the model parameters, η0 represents the propagation factor, P n represents the power of the Gaussian noise in the channel;
[0015] The knapsack model is used to solve the following optimization problem to obtain the selected vehicle client set S = {k1, k2,..., k Q}:
[0016]
[0017] Wherein, k q represents the original serial number of the selected qth vehicle client, t round represents the remaining time of the federated learning in the current round, represents the time spent on uploading the model parameters, and the calculation formula is as follows:
[0018]
[0019] The central server sends the selected identifier to each vehicle client in the selected vehicle client set S = {k1, k2,..., k Q} through the roadside base station;
[0020] S6: Each vehicle client k receiving the selected identifier uploads the local model parameters and the size of the local training data set
[0021] S7: After all the selected vehicle clients complete the uploading of the local model parameters, the central server aggregates the local model parameters of multiple vehicle clients to generate new global model parameters W t :
[0022]
[0023] Wherein, represents the aggregation weight of the vehicle client k, and the calculation formula is as follows:
[0024]
[0025] S8: determining whether the federated learning reaches an end condition, if yes, the federated learning ends, otherwise, entering step S9;
[0026] S9: setting iteration round t = t + 1, and returning to step S3.
[0027] The present application is based on a vehicle client selected Internet of Vehicles federated learning method, a central server periodically collects prior resource information of each vehicle client through a roadside base station, in each round of federated learning, after each vehicle client completes local training, data sample importance is calculated and uploaded to the central server, the central server calculates the time of uploading model parameters of the vehicle client in the current round of federated learning according to the prior resource information, and solves the selected vehicle client set by using a knapsack model according to the data sample importance and the time, and sends a selected identifier to each vehicle client in the selected vehicle client set, and each vehicle client receiving the selected identifier uploads model parameters which are aggregated by the central server.
[0028] The present application comprehensively considers the data sample importance and the time of uploading model parameters in the vehicle client, selects the optimal vehicle client combination to participate in model training, thereby accelerating model convergence and improving accuracy. This method provides a new perspective for client selection, which is helpful for data utilization and model performance in federated learning. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 is a specific embodiment flow chart of the vehicle client selected Internet of Vehicles federated learning method of the present application;
[0030] Figure 2 is a timing diagram of one round of federated learning in the present application;
[0031] Figure 3 is an aggregation accuracy comparison chart of the present application and the comparative method under different heterogeneity in the present embodiment;
[0032] Figure 4 is an aggregation accuracy comparison chart of the present application and the comparative method under different dropouts in the present embodiment;
[0033] Figure 5 is an aggregation accuracy comparison chart of the present application and the comparative method under different local training rounds in the present embodiment. DETAILED DESCRIPTION
[0034] The specific embodiments of the present application are described below with reference to the drawings, so that those skilled in the art can better understand the present application. It should be particularly pointed out that in the following description, when the detailed description of the known functions and designs may obscure the main content of the present application, these descriptions will be omitted here.
[0035] In order to better illustrate the technical solutions of the present application, the principles of the present application are briefly described first.
[0036] One of the goals of federated learning is to mine information in data to train models, and data quality is crucial for model training, directly affecting the accuracy and performance of the model. At the same time, selecting a vehicle client with faster training speed shortens the convergence time of the entire model. The present application found through research that if the data sample importance of the vehicle client and the training time of the client are used as the basis for client selection, additional computational overhead and communication overhead are not required. Therefore, in order to achieve the efficiency of client selection, the present application analyzes the data sample importance and training time of each vehicle client, and establishes a knapsack model to select appropriate clients to participate in training.
[0037] In terms of data sample importance, the commonly used data sample importance R k is calculated as follows:
[0038]
[0039] wherein, represents the gradient of the sample x in the local training data set D k of the vehicle client k, and || ||2 represents the L2 norm.
[0040] Although the data sample importance calculated based on the gradient norm is optimal, at the same time the computational overhead is huge, because when the vehicle client selection is performed using this method, the gradient of each data sample in all possible combinations needs to be calculated. It is found through research that the local loss value obtained by the vehicle client training reflects the prediction ability of the global model for the data uploaded by each vehicle client, and the higher the loss value, the worse the prediction ability. Especially under the non-independent and identically distributed (Non-IID) data, high loss value may mean that the training data of the vehicle client belongs to a minority class, and the proportion in the overall data is small, which needs to be strengthened. Therefore, in order to simplify the calculation of data sample importance, the local loss value can be used instead of the gradient norm, and the calculation formula of the data sample importance R k is improved as follows:
[0041]
[0042] Since the loss for each data sample is available during local training, the computational overhead is significantly reduced. The expression above can be further simplified by calculating the cumulative loss for the data samples from vehicle client k. Therefore, the data sample importance R is ultimately adopted. k The calculation formula is as follows:
[0043]
[0044] Regarding training time, since the central server only initializes the global model and requests resource information from all clients in the first round, the time spent on initialization and resource requests is negligible. For each client, the central server's response time (including the time spent distributing the global model and selecting the client) and the time spent aggregating the global model are fixed constants, so the time spent on these is also negligible. Assume that the training rate of the model locally by all clients follows a uniform distribution. Let K be the number of vehicle clients in the vehicular network, and f be the training time. k D represents the rate at which the vehicle client k trains the model locally, k = 1, 2, ..., K. k Let E represent the amount of data in one local iteration and E represent the number of local iterations. Then, the time it takes for vehicle client k to train the model locally... This can be expressed using the following formula:
[0045]
[0046] Assume that after completing local training, each vehicle client sequentially uploads new model parameters. Specifically, only one vehicle client can upload model parameters at a time. Once a vehicle client completes local model training, if no other vehicle client is uploading its model parameters, that vehicle client immediately begins uploading. Assume the channel state for each vehicle client is stable in each round. Using B... k S represents the channel bandwidth between the vehicle client and the base station, and P represents the average power of the transmitted signal within the channel. n This represents the power of the Gaussian noise within the channel. According to Shannon's theorem, the communication transmission rate C of the vehicle client k... k It can be represented as:
[0047]
[0048] Using P k d represents the transmission power of vehicle client k. k Let ηk represent the relative distance between the vehicle client k and the corresponding roadside base station, and let η0 represent the propagation factor and signal-to-noise ratio. It can be represented as:
[0049]
[0050] Combining the two formulas above, the communication transmission rate C of vehicle client k is... k It can be represented as:
[0051]
[0052] In federated learning, the model parameters σ are of the same size across all vehicle clients, therefore the time for vehicle client k to upload model parameters is... for:
[0053]
[0054] In this invention, each vehicle client first assigns the importance R of the data sample. k The data is uploaded to the central server, which then receives the data samples uploaded by each vehicle client. The importance of these samples is R. k Then, vehicle clients are selected to accelerate model convergence and improve accuracy. Let the set of selected vehicle clients, S = {k1, k2, ..., k...}, be the vehicle client set ultimately selected by the central server. Q} where kq represents the original sequence number of the q-th selected vehicle client, q = 1, 2, ..., Q, and Q represents the number of selected vehicle clients. The pre-set federated learning time T for each round is... round So, the total time T spent by all clients in each round cost Less than the time T per round of federated learning round The vehicle client selection algorithm can be described as follows:
[0055]
[0056] stT cost ≤T round
[0057] Where T cost This can be expressed using the following formula:
[0058]
[0059] The knapsack model, a classic combinatorial optimization problem, is widely used in dynamic programming and greedy algorithms. Its core principle is to select items of different weights and values within a knapsack with limited capacity to maximize the total value. The problem described above is similar to the knapsack model; therefore, we can consider the vehicle client as an item in the knapsack problem, the importance of data samples as the item's value, the time it takes for the client to upload model parameters as the item's weight, and the time allotted for each round of federated learning as the knapsack's capacity. In federated learning, the knapsack model not only supports real-time updates but also effectively handles unstable or interrupted network connections. This allows the client to maintain model updates while uploading updated parameters once the connection is restored, ensuring system stability and real-time performance. Furthermore, the characteristics of the knapsack model allow the client to consider various constraints during selection, such as computing resources and network bandwidth. This flexibility makes the client selection method more efficient and optimizes resource allocation during training. In each training round, the client downloads and updates the model within a preset time. Subsequently, the selected client continues to upload the updated model parameters, assisting the server in efficiently completing the model aggregation process.
[0060] Based on the above analysis, this invention proposes a vehicle-to-everything (V2X) federated learning method based on vehicle client selection. Figure 1 This is a flowchart illustrating a specific implementation of the vehicle-to-everything (V2X) federated learning method based on vehicle client selection, as described in this invention. Figure 1 As shown, the specific steps of the vehicle-to-everything (V2X) federated learning method selected by the vehicle client in this invention include:
[0061] S101: Collect prior resource information:
[0062] In a connected vehicle environment, a federated learning system consists of intelligent connected vehicle clients, roadside base stations, and a central server. Let K intelligent connected vehicles act as clients in the connected vehicle network. Each intelligent connected vehicle is equipped with onboard sensors, which collect local datasets, including data on vehicle status, driving behavior, and traffic information. The intelligent connected vehicles train their local models based on these local datasets. The K intelligent connected vehicles train their local datasets through collaborative learning tasks, transmitting the trained data without transmitting the original data.
[0063] The central server periodically collects prior resource information for each vehicle client k from roadside base stations, including transmission power, relative distance to the corresponding roadside base station, network bandwidth, and channel status, where k = 1, 2, ..., K, and K represents the number of vehicle clients in the vehicular network. This information is crucial for optimizing distributed computing and model training, helping the central server assess the available resources of vehicle clients, thereby allocating tasks rationally and improving overall training efficiency. Furthermore, by monitoring changes in these resources in real time, the central server dynamically adjusts its training strategy to adapt to the computing power and network conditions of different vehicle clients, ensuring the model's robustness under various environments and effectively improving the model's update frequency and accuracy.
[0064] S102: Initialize Federated Learning Data:
[0065] The central server initializes the parameters of the model to be learned and uses them as the initial model aggregation parameters W. 0 Let the current iteration number t = 1.
[0066] S103: Distribute model aggregation parameters:
[0067] The central server aggregates the model parameters W via roadside base stations. t-1 The iteration count t is forwarded to each vehicle client k.
[0068] S104: Local Training
[0069] Each vehicle client k is based on the aggregation parameter W issued by the central server. t-1 Initialize the local model parameters, and then use the local training dataset. Train the local model and compute the local training dataset. The loss function value of each training sample x in the training sample. The local loss is then calculated. And update the local model parameters. Simultaneously, the importance of the training samples in this round of training is calculated. Then the importance of data samples The data is uploaded to the central server via roadside base stations.
[0070] Local loss in this embodiment The calculation formula is:
[0071]
[0072] in, Represents the local training dataset Size of the local training dataset. The sum of the loss functions generated from all training samples divided by the total amount of data from vehicle client k |D k This refers to the average loss function of the local vehicle client. The local model parameters are updated using stochastic gradient descent (SGD), and the parameter update formula can be expressed as follows:
[0073]
[0074] Where η represents the learning rate.
[0075] In this embodiment, the importance of data samples The calculation formula is:
[0076]
[0077] S105: Select vehicle client:
[0078] After receiving the importance of data samples uploaded by K vehicle clients, the central server uses a knapsack model to select the vehicle client. The specific method is as follows:
[0079] The computing power f of each vehicle client k in the current round is determined based on prior resource information. k Transmission power P k The relative distance d between the roadside base station and the corresponding roadside base station k Network bandwidth B k and channel state S k The time it takes for vehicle client k to upload model parameters is calculated. for:
[0080]
[0081] Where σ represents the model parameter size, η0 represents the propagation factor, and P n This indicates the power of the Gaussian noise within the channel;
[0082] The following optimization problem is solved using the knapsack model, resulting in the selected vehicle client set S = {k1, k2, ..., k Q}:
[0083]
[0084] Where, k q This represents the original sequence number of the q-th vehicle client selected, where q = 1, 2, ..., Q, and Q represents the number of vehicle clients selected. round Indicates the remaining time for the current round of federated learning. The time taken to upload model parameters is represented by the following formula:
[0085]
[0086] Since each vehicle client has already completed local training when the central server selects the vehicle client, the conditions for the knapsack model only consider the remaining federated learning time and the time required to upload model parameters. The knapsack model is a commonly used dynamic programming model, and its specific solution process will not be elaborated here.
[0087] The central server sends data to the selected vehicle client set S = {k1,k2,...,k} via roadside base stations. Q Each vehicle client in the group sends a selection flag.
[0088] S106: Upload model parameters:
[0089] Each vehicle client k that receives the selected identifier uploads its local model parameters to the central server via a roadside base station. and local training dataset Size.
[0090] S107: Model parameter aggregation:
[0091] After all selected vehicles have uploaded their local model parameters, the central server aggregates the local model parameters from multiple vehicle clients and generates a new global model parameter W. t :
[0092]
[0093] in, The aggregate weight of vehicle client k is represented by the following formula:
[0094]
[0095] S108: Determine whether the federated learning has met the termination condition. If so, the federated learning ends; otherwise, proceed to step S109.
[0096] The termination conditions for federated learning typically include model convergence, reaching the maximum number of iterations, and reaching the maximum training time. In practical applications, these conditions can be selected according to actual needs.
[0097] S109: Let the iteration number t = t + 1, and return to step S103.
[0098] Figure 2 This is a time sequence diagram of one round of federated learning in this invention. For example... Figure 2As shown, in the first round of federated learning in this invention, each vehicle client performs local training in parallel, and then uploads data samples according to the order in which local training is completed and the importance of the data samples. The central server selects vehicle clients based on the importance of the data samples and the time spent uploading model parameters. The selected vehicle clients upload local model parameters, the central server aggregates the model parameters, and then starts the next round of federated learning.
[0099] To better illustrate the technical effects of this invention, a specific example is used to experimentally verify it. This embodiment validates the invention on the Synthetic, Fashion-MNIST, and CIFAR-10 datasets. The Synthetic(α,β) dataset is a synthetic dataset, where α controls the dissimilarity of the local model and β controls the dissimilarity of data on each device. The Fashion-MNIST dataset contains 70,000 image samples, divided into 10 different object categories. The CIFAR-10 dataset is an object recognition dataset containing 60,000 color images representing different categories of objects such as airplanes, cars, and birds. In this embodiment, FedAvg, FedProx, and Power-of-Choice are selected as comparison algorithms. The aggregation accuracy of the present invention and the comparison methods is evaluated from three aspects: different degrees of heterogeneity, different degrees of disconnection, and different local training epochs.
[0100] To control the dissimilarity between the local model and data on each device, two heterogeneous cases, Synthetic(0,0) and Synthetic(1,1), were set for the Synthetic dataset, with the degree of heterogeneity gradually increasing. A Dirichlet distribution was used to simulate a non-independent identically distributed (Non-IID) setting, and the degree of heterogeneity of client data was controlled by adjusting the parameter α. For the Fashion-MNIST (FMNIST) dataset, two heterogeneous cases, α=5.0 and α=1.0, were set, with the degree of heterogeneity gradually increasing. For the CIFAR-10 dataset, two heterogeneous cases, α=5.0 and α=1.0, were set, with the degree of heterogeneity gradually increasing.
[0101] This embodiment uses `probability_drop` to define the probability that a vehicle will become offline after being selected. This probability reflects the likelihood that a vehicle will not return data after being selected by the client. Based on the Synthetic dataset, experiments were conducted with `probability_drop` set to 0, 0.05, and 0.2, with α=0 and β=0. Under the condition `probability_drop=0`, all vehicles do not disconnect. Under the condition `probability_drop=0.05`, the maximum probability of all vehicles disconnecting does not exceed 5%. Under the condition `probability_drop=0.2`, the maximum probability of all vehicles disconnecting does not exceed 20%.
[0102] To construct a heterogeneous training integrity model, based on the Synthetic dataset with α=0 and β=0, it is assumed that the ratio of vehicle integrity to the original training steps follows a Gaussian distribution with a mean of 1 and a variance of 1, ensuring that the minimum ratio is not less than 0.01 and the maximum ratio does not exceed 2. Furthermore, the vehicle client always has a fixed number of training steps.
[0103] Figure 3 This is a comparison chart of the polymerization accuracy of the present invention and the comparative method under different degrees of heterogeneity in this embodiment. For example... Figure 3 As shown, based on the Synthetic dataset, when α = 0 and β = 0, the present invention improves model accuracy by 2.53% compared to the three comparison methods. When α = 1 and β = 1, the present invention improves model accuracy by 3.07% compared to the three comparison methods. These results demonstrate that the present invention has certain advantages over FedAvg, FedProx, and Power-of-Choice under different α and β conditions. Specifically, the present invention can select vehicle clients participating in training based on the local loss and communication conditions of different vehicle clients, making those clients with better communication conditions and faster convergence speeds more important. By selecting these vehicle clients to participate in model training, the present invention can more effectively utilize the contributions of vehicle clients, thereby improving the overall model performance.
[0104] Figure 4 This is a comparison chart of the aggregation accuracy of the present invention and the comparison method under different degrees of disconnection in this embodiment. Figure 4As shown, under the condition of probability_drop=0, i.e., all vehicles do not disconnect, the algorithm of this invention improves the model accuracy by 1.89% compared to the three comparison methods for 200 training rounds. Under the condition of probability_drop=0.05, i.e., the maximum disconnection probability of all vehicles does not exceed 5%, the algorithm of this invention improves the model accuracy by 2.61% compared to the other three comparison methods for 200 training rounds. Under the condition of probability_drop=0.2, i.e., the maximum disconnection probability of all vehicles does not exceed 20%, the algorithm of this invention improves the model accuracy by 5.28% compared to the other three comparison methods for 200 training rounds.
[0105] Figure 5 This is a comparison chart of the aggregation accuracy of the present invention and the comparison method under different local training rounds in this embodiment. For example... Figure 5 As can be seen, based on the model accuracy results of the Synthetic dataset under the conditions of α=0 and β=0, the present invention improves the model accuracy by 1.97% compared to FedAvg, by 10.12% compared to FedProx, and by 5.67% compared to Power-of-Choice.
[0106] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.
Claims
1. A vehicle-to-everything (V2X) federated learning method based on vehicle client selection, characterized in that, Includes the following steps: S1: The central server periodically collects prior resource information of each vehicle client k through roadside base stations, including transmission power, relative distance to the corresponding roadside base station, network bandwidth and channel status, k = 1, 2, ..., K, where K represents the number of vehicle clients in the vehicle network; S2: The central server initializes the parameters of the model to be learned and uses them as the initial model aggregation parameters W. 0 Let the current iteration number t = 1; S3: The central server aggregates the model parameters W via roadside base stations. t-1 The iteration count t is forwarded to each vehicle client k; S4: Each vehicle client k is based on the aggregation parameter W issued by the central server. t-1 Initialize the local model parameters, and then use the local training dataset. Train the local model and compute the local training dataset. The loss function value of each training sample x in the training sample. The local loss is then calculated. And update the local model parameters. Simultaneously, the importance of the training samples in this round of training is calculated. Then the importance of data samples Uploaded to the central server via roadside base stations; S5: Importance of data samples received by the central server from K vehicle clients Then, the knapsack model is used to select the vehicle client. The specific method is as follows: Based on prior resource information, determine the transmission power P of each vehicle client k in the current round. k The relative distance d between the roadside base station and the corresponding roadside base station k Network bandwidth B k and channel state S k The time it takes for vehicle client k to upload model parameters is calculated. for: Where σ represents the model parameter size, η0 represents the propagation factor, and P n This indicates the power of the Gaussian noise within the channel; The following optimization problem is solved using the knapsack model, resulting in the selected vehicle client set S = {k1, k2, ..., k Q }: Where, k q This represents the original sequence number of the q-th vehicle client selected, where q = 1, 2, ..., Q, and Q represents the number of vehicle clients selected. round Indicates the remaining time for the current round of federated learning. The time taken to upload model parameters is represented by the following formula: The central server sends data to the selected vehicle client set S = {k1,k2,...,k} via roadside base stations. Q Each vehicle client in the group sends a selection flag; S6: Each vehicle client k that receives the selected identifier uploads its local model parameters to the central server via the roadside base station. and local training dataset Size S7: After all selected vehicle clients have completed uploading their local model parameters, the central server aggregates the local model parameters from multiple vehicle clients and generates a new global model parameter W. t : in, The aggregate weight of vehicle client k is represented by the following formula: S8: Determine whether the federated learning has met the termination condition. If yes, the federated learning ends; otherwise, proceed to step S9. S9: Let the iteration number t = t + 1, and return to step S3.
2. The connected vehicle federated learning method according to claim 1, characterized in that, Local loss in step S4 The calculation formula is: in, Represents the local training dataset Size.
3. The connected vehicle federated learning method according to claim 1, characterized in that, Importance of data samples in step S4 The calculation formula is: