A non-identically distributed data-oriented multi-stage federated learning method for internet of vehicles

CN117787440BActive Publication Date: 2026-06-23CAPITAL NORMAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CAPITAL NORMAL UNIVERSITY
Filing Date
2023-12-22
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

When faced with non-independent and identically distributed data, the aggregation process of federated learning models requires more communication rounds and iterations to converge, and the model performance is affected by data imbalance, resulting in unsatisfactory training results. How can we improve the convergence efficiency of the model while protecting vehicle privacy?

Method used

A multi-stage federated learning approach is adopted, including a federated average multi-party computation stage, a federated weighted multi-party computation stage, and a personalized computation stage. Combined with a transmission control strategy, vehicles participating in federated learning are selected, model aggregation is optimized through FedAvg and federated weighted algorithms, and local data fine-tuning is performed in the personalized computation stage.

Benefits of technology

It achieves rapid convergence of the local vehicle model, improves model accuracy, reduces computational and communication overhead, makes full use of communication resources, and enhances model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117787440B_ABST
    Figure CN117787440B_ABST
Patent Text Reader

Abstract

The application provides a kind of Internet of Vehicles multi-stage federated learning method for non-independent and identically distributed data, comprising: obtaining the global model of the vehicle participating in federated learning from the roadside unit as the initial local model;According to the local data of the vehicle, the initial local model is trained to obtain a one-stage local model, and the one-stage local model is uploaded to the roadside unit, so that the roadside unit aggregates the one-stage local model according to the FedAvg algorithm to obtain a one-stage global model;According to the local data, the one-stage global model is trained to obtain a two-stage local model, and the two-stage local model is uploaded to the roadside unit, so that the roadside unit aggregates the two-stage local model according to the federated weighted algorithm to obtain a two-stage global model;According to the local data, the two-stage global model is iteratively trained to obtain a three-stage local model.By the method proposed in the application, for non-independent and identically distributed data, the model performance of federated learning can be effectively improved under the premise of protecting the privacy of vehicles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information processing technology. Background Technology

[0002] With the development of intelligent connected vehicles, many vehicles are equipped with efficient communication and computing devices. Meanwhile, with the rapid growth in demand for edge computing, federated learning has attracted widespread attention in the industry. Unlike traditional centralized learning, edge learning does not require uploading large amounts of data to the cloud. Instead, it trains machine learning models locally on mobile edge devices and then uploads the models to the cloud for global aggregation. Federated learning effectively solves the data silo problem by separating the machine learning capabilities of each participant from the need for cloud servers to collect all data. This allows data providers to jointly model data without sharing existing data, thus effectively protecting user data privacy and security.

[0003] In real-world scenarios, due to differences in the equipment used by vehicles to collect data, the training data they collect varies significantly, resulting in non-independent, identically distributed (Non-IID) data. When dealing with NID data, the federated learning model aggregation process may require more communication rounds and iterations to converge, and the model's performance can be negatively impacted by data imbalance. For example, factors such as smaller amounts or lower-quality data from participating vehicles can lead to less than ideal training results. Therefore, improving model convergence efficiency within a limited number of communication rounds and a shorter timeframe, while ensuring user privacy and security, is a pressing issue when dealing with NID data. Summary of the Invention

[0004] The present invention aims to at least partially solve one of the technical problems in the related art.

[0005] Therefore, the purpose of this invention is to propose a multi-stage federated learning method for vehicle-to-everything (V2X) data with non-independent and identically distributed data, which can improve the performance of federated learning models while protecting vehicle privacy.

[0006] To achieve the above objectives, a first aspect of the present invention proposes a multi-stage federated learning method for vehicle-to-everything (V2X) data with non-independent and identically distributed data, comprising:

[0007] S101: Obtain the global model of the vehicles participating in federated learning from the roadside unit as the initial local model;

[0008] S102: Train the initial local model based on the local data of the vehicle to obtain a first-stage local model, and upload the first-stage local model to the roadside unit so that the roadside unit can aggregate the first-stage local model according to the FedAvg algorithm to obtain a first-stage global model.

[0009] S103: Train the first-stage global model based on the local data to obtain the second-stage local model, and upload the second-stage local model to the roadside unit so that the roadside unit can aggregate the second-stage local model according to the federated weighted algorithm to obtain the second-stage global model.

[0010] S104: Iteratively train the two-stage global model based on the local data to obtain the three-stage local model.

[0011] In addition, the multi-stage federated learning method for vehicle networking oriented to non-independent and identically distributed data according to the above embodiments of the present invention may also have the following additional technical features:

[0012] Furthermore, in one embodiment of the present invention, before obtaining the global model of the vehicles participating in federated learning from the roadside unit, the following steps are included:

[0013] Selecting specific vehicles to participate in federated learning means that when a vehicle's dwell time within its current roadside cell communication range exceeds the total time required to complete model download, local training, and model upload, vehicle v... k Those selected to participate in federated learning will not participate in this round of federated learning, as expressed by the formula:

[0014]

[0015] in, For vehicle v k Duration of stay within the communication range of the roadside unit Vehicle v in round t k The transfer time for downloading the model. Vehicle v in round t k Local training time, For vehicle v in round t k The transmission time of the uploaded model.

[0016] Furthermore, in one embodiment of the present invention, the step of aggregating the one-stage local model by the roadside unit according to the FedAvg algorithm is expressed as:

[0017]

[0018] Where, ω t ω is the global model parameter in round t. t-1Here, represents the global model parameters for round t-1, N is the number of vehicles participating in federated learning, and η is the local model learning rate. It is the t-th round vehicle v k The local model loss function.

[0019] Furthermore, in one embodiment of the present invention, after obtaining a one-stage global model, the method further includes:

[0020] The first-stage global model is used as a new first-stage local model, and S102 is iterated until the first-stage global model converges.

[0021] Furthermore, in one embodiment of the present invention, the step of aggregating the two-stage local model by the roadside unit according to the federated weighted algorithm is expressed as:

[0022]

[0023] in, It is the t-th round vehicle v k The local model accuracy is given by A, where A is the highest local model accuracy among all participating vehicles. It is the t-th round vehicle v k The richness of data used in local training, while DS represents the richness of data across all vehicles. It is the t-th round vehicle v k The amount of data used for local training is DQ, which is the total amount of data for all vehicles. The weights are 0 ≤ α, β, γ ≤ 1 and α + β + γ = 1.

[0024] Furthermore, in one embodiment of the present invention, the step of having the roadside unit aggregate the two-stage local model according to the federated weighted algorithm further includes reducing vehicle communication overhead by introducing an upload and download transmission mechanism:

[0025] If vehicle v k If there is a significant difference between the local model parameters in round t and the global aggregated model in round t-1, the local model parameters for this round will not be uploaded. The difference between the two models is calculated using the L2 norm.

[0026]

[0027] in, It is the t-th round vehicle v k The local model parameters, and ω t-1 These are the global model parameters for the (t-1)th round. When δ is a hyperparameter, it indicates that the differences between models are large, and the local model needs to be uploaded; otherwise, it does not need to be uploaded.

[0028] If vehicle v kA local model was uploaded in round t, and it has a relatively large weight in the global model aggregation, i.e. If is a hyperparameter, then the roadside unit does not distribute the global aggregation model of round t to the vehicle.

[0029] Furthermore, in one embodiment of the present invention, after obtaining the two-stage global model, the method further includes:

[0030] The two-stage global model is used as a new two-stage local model, and S103 is iterated until the two-stage global model converges.

[0031] Furthermore, in one embodiment of the present invention, after obtaining the three-stage local model, the method further includes:

[0032] When the performance of the three-stage local model degrades, fine-tuning and optimization are performed using local data to obtain the local model with the best performance.

[0033] To achieve the above objectives, a second aspect of the present invention proposes a multi-stage federated learning device for vehicle-to-everything (V2X) data with non-independent and identically distributed data, comprising the following modules:

[0034] The acquisition module is used to acquire the global model of the vehicles participating in federated learning from the roadside units as the initial local model;

[0035] The FedAvg multi-party computation module is used to train the initial local model based on the local data of the vehicle to obtain a one-stage local model, and upload the one-stage local model to the roadside unit so that the roadside unit can aggregate the one-stage local model according to the FedAvg algorithm to obtain a one-stage global model.

[0036] The federated weighted multi-party computation module is used to train the first-stage global model based on the local data to obtain the second-stage local model, and upload the second-stage local model to the roadside unit so that the roadside unit can aggregate the second-stage local model according to the federated weighted algorithm to obtain the second-stage global model.

[0037] A personalized computing module is used to train the two-stage global model based on the local data to obtain a three-stage local model.

[0038] To achieve the above objectives, a third aspect of the present invention provides a computer device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a multi-stage federated learning method for vehicle networking oriented to non-independent and identically distributed data as described above.

[0039] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements a multi-stage federated learning method for vehicle networking oriented to non-independent and identically distributed data as described above.

[0040] The multi-stage federated learning method for vehicle-to-everything (V2X) data proposed in this invention improves upon the weakness of federated learning in model convergence when dealing with non-independent, identically distributed (IID) data. Through a three-stage federated learning mechanism—federated average multi-party computation, federated weighted multi-party computation, and personalized computation—it achieves rapid convergence of the vehicle's local model, resulting in higher accuracy. Combined with a transmission control strategy, it selects vehicles to participate in the federated learning, fully utilizing communication resources and reducing computational and communication overhead. Attached Figure Description

[0041] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0042] Figure 1 This is a flowchart illustrating a multi-stage federated learning method for vehicle-to-everything (V2X) data with non-independent and identically distributed data, as provided in an embodiment of the present invention.

[0043] Figure 2 This is a schematic diagram of a federated learning scenario in the Internet of Vehicles provided in an embodiment of the present invention;

[0044] Figure 3 This is a schematic diagram illustrating a multi-stage federated learning method provided in an embodiment of the present invention;

[0045] Figure 4 This is a schematic diagram of the structure of a multi-stage federated learning device for vehicle networking oriented to non-independent and identically distributed data, provided in an embodiment of the present invention. Detailed Implementation

[0046] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0047] The following describes a multi-stage federated learning method for vehicle-to-everything (V2X) data with non-independent and identically distributed data, according to an embodiment of the present invention, with reference to the accompanying drawings.

[0048] Figure 1 This is a flowchart illustrating a multi-stage federated learning method for vehicle-to-everything (V2X) data with non-independent and identically distributed data, as provided in an embodiment of the present invention.

[0049] like Figure 1 As shown, this multi-stage federated learning method for vehicle-to-everything (V2X) data with non-independent and identically distributed data includes the following steps:

[0050] S101: Obtain the global model of the vehicles participating in federated learning from the roadside unit as the initial local model;

[0051] S102: Train an initial local model based on the vehicle's local data to obtain a first-stage local model. Upload the first-stage local model to the roadside unit so that the roadside unit can aggregate the first-stage local model according to the FedAvg algorithm to obtain a first-stage global model.

[0052] S103: Train a one-stage global model based on local data to obtain a two-stage local model. Upload the two-stage local model to the roadside unit so that the roadside unit can aggregate the two-stage local model according to the federated weighted algorithm to obtain the two-stage global model.

[0053] S104: Iteratively train the two-stage global model based on local data to obtain the three-stage local model.

[0054] like Figure 2 As shown, vehicles communicate with Roadside Units (RSUs) for federated learning computation. Vehicles train their models locally and upload their local model parameters after each round. The Roadside Units then perform global aggregation, and the new aggregated model is distributed to participating vehicles. Considering the rapid movement of vehicles, to avoid resource waste caused by vehicles leaving the Roadside Unit's communication range before completing a round of federated learning, the Roadside Unit selects specific vehicles to participate in federated learning. Specifically, if the time a vehicle spends within its current Roadside Unit's communication range exceeds the total time for model download, local training, and model upload, the vehicle is selected to participate in federated learning. k You will be selected to participate in federal learning; otherwise, you will not participate in this round of federal learning.

[0055] Furthermore, in one embodiment of the present invention, before obtaining the global model of the vehicles participating in federated learning from the roadside unit, the following steps are included:

[0056] Selecting specific vehicles to participate in federated learning means that when a vehicle's dwell time within its current roadside cell communication range exceeds the total time required to complete model download, local training, and model upload, vehicle v... k Those selected to participate in federated learning will not participate in this round of federated learning, as expressed by the formula:

[0057]

[0058] in, For vehicle v k Duration of stay within the communication range of the roadside unit Vehicle v in round t k The transfer time for downloading the model. Vehicle v in round t k Local training time, For vehicle v in round t k The transmission time of the uploaded model.

[0059] Based on this, a multi-stage federated learning mechanism, FedWO, is proposed, consisting of three stages: Stage 1, Federated Average Multi-Party Computation; Stage 2, Federated Weighted Multi-Party Computation; and Stage 3, Personalized Computation. The following sections will elaborate on how each stage works. (See diagram below.) Figure 3 As shown.

[0060] In the initial stage of data collection, when the roadside units have not yet obtained a relatively stable global model, federated learning requires a large number of participants to contribute data. To achieve this goal, in the first stage, the FedAvg algorithm is chosen to aggregate the global model, with all vehicles' local models having the same weights.

[0061] Furthermore, in one embodiment of the present invention, the roadside units are aggregated into a one-stage local model according to the FedAvg algorithm, as follows:

[0062]

[0063] Where, ω t ω is the global model parameter in round t. t-1 Here, represents the global model parameters for round t-1, N is the number of vehicles participating in federated learning, and η is the local model learning rate. It is the t-th round vehicle v k The local model loss function.

[0064] Furthermore, in one embodiment of the present invention, after obtaining a one-stage global model, the method further includes:

[0065] The first-stage global model is used as a new first-stage local model, and S102 is iterated until the first-stage global model converges.

[0066] Server-side model performance will be considered an important indicator for entering the second phase of the research. When the server-side model accuracy approaches a stable value, it indicates that the second phase can proceed.

[0067] Considering the non-independent and identically distributed (Non-IID) nature of vehicle data, continued use of the FedAvg algorithm will make it difficult for the global model to achieve the goal of optimizing training accuracy. To address this issue, we propose allocating weights for different vehicles during global model aggregation. The determination of weights is influenced by the following three variables: (1) Model accuracy: Vehicles with higher model accuracy will be assigned a higher weight in global model aggregation. (2) Dataset richness: Vehicles with richer datasets will have greater weights in the global model. (3) Dataset size: The larger the amount of data from participating vehicles, the greater their weights in the global model. By combining these three variables, we optimize the generalization ability of the global model by assigning different weights to the local models of different vehicles during global aggregation.

[0068] Furthermore, in one embodiment of the present invention, the roadside units are aggregated into a two-stage local model according to a federated weighted algorithm, as follows:

[0069]

[0070] in, It is the t-th round vehicle v k The local model accuracy is given by A, where A is the highest local model accuracy among all participating vehicles. It is the t-th round vehicle v k The richness of data used in local training, while DS represents the richness of data across all vehicles. It is the t-th round vehicle v k The amount of data used for local training is DQ, which is the total amount of data for all vehicles. The weights are 0 ≤ α, β, γ ≤ 1 and α + β + γ = 1.

[0071] In the federated weighted multi-party computation phase, to optimize the utilization of computing and communication resources, a transmission control strategy is proposed to reduce transmission overhead by selecting vehicles participating in federated learning. The selection of participants in federated learning needs to be evaluated from two dimensions: first, the uploading of the vehicle's local model; and second, the distribution of the roadside unit's model.

[0072] Furthermore, in one embodiment of the present invention, enabling roadside units to aggregate two-stage local models according to a federated weighted algorithm also includes reducing vehicle communication overhead by introducing an upload and download transmission mechanism:

[0073] If vehicle v k If there is a significant difference between the local model parameters in round t and the global aggregated model in round t-1, the local model parameters for this round will not be uploaded. The difference between the two models is calculated using the L2 norm.

[0074]

[0075] in, It is the t-th round vehicle v k The local model parameters, and ω t-1 These are the global model parameters for the (t-1)th round. When δ is a hyperparameter, it indicates that the differences between models are large, and the local model needs to be uploaded; otherwise, it does not need to be uploaded.

[0076] If vehicle v k A local model was uploaded in round t, and it has a relatively large weight in the global model aggregation, i.e. If is a hyperparameter, then the roadside unit does not distribute the global aggregation model of round t to the vehicle.

[0077] Furthermore, in one embodiment of the present invention, after obtaining the two-stage global model, the method further includes:

[0078] The two-stage global model is used as a new two-stage local model, and S103 is iterated until the two-stage global model converges.

[0079] The aforementioned participant selection mechanism guides the behavior of vehicles and roadside units during the federated weighted multi-party computation process, reducing unnecessary data transmission and improving resource utilization. Simultaneously, to ensure consistency between the local and global models, two rules are set: 1) In each iteration, each vehicle must participate in at least one of the model parameter uploads or downloads. Vehicles are not allowed to remain completely uninterrupted to the server in the same iteration. 2) If, in iteration t, the roadside unit does not transmit model parameters to vehicle v... k If a global model is distributed, then in round t+1, the vehicle must actively participate in uploading its local model parameters. This rule ensures the smooth operation of the federated weighted multi-party computation process while improving the transmission efficiency between vehicles and roadside units.

[0080] Traditional federated computation methods, such as federated averaging and federated weighted computing, may face challenges when dealing with non-independent and identically distributed (Non-IID) data. Especially after these computational stages, the resulting general model obtained through global aggregation may fail to capture the unique data characteristics of a specific data source (e.g., a particular vehicle) compared to other data sources. This loss can prevent further optimization of specific local models and sometimes even lead to a decline in model performance. To address this issue, we propose fine-tuning the general model using local data characteristics to better adapt it to the local data distribution. This fine-tuning based on local characteristics can effectively enhance model performance, especially when dealing with local data that differs from the overall data distribution. We call this stage of fine-tuning based on local data characteristics the "personalized computation" stage. The goal of this stage is to ensure that the model accurately captures and utilizes the unique information of each data source, thereby achieving the best performance on local data.

[0081] Furthermore, in one embodiment of the present invention, after obtaining the three-stage local model, the method further includes:

[0082] When the performance of the three-stage local model degrades, fine-tuning and optimization are performed using local data to obtain the local model with the best performance.

[0083] This strategy ensures that the model better adapts to the specific data distribution of the vehicle, thereby achieving higher model accuracy. In this "personalized computation" phase, the primary goal is to maximize the accuracy of the local model. This requires a focus on the characteristics of the local data, ensuring that the model can fully utilize these characteristics for effective prediction or classification, thus achieving optimal performance in specific application scenarios.

[0084] The multi-stage federated learning method for vehicle-to-everything (V2X) data proposed in this invention improves upon the weakness of federated learning in model convergence when dealing with non-independent, identically distributed (IID) data. Through a three-stage federated learning mechanism—federated average multi-party computation, federated weighted multi-party computation, and personalized computation—it achieves rapid convergence of the vehicle's local model, resulting in higher accuracy. Combined with a transmission control strategy, it selects vehicles to participate in the federated learning, fully utilizing communication resources and reducing computational and communication overhead.

[0085] To achieve the above embodiments, the present invention also proposes a multi-stage federated learning device for vehicle networking oriented to non-independent and identically distributed data.

[0086] Figure 4 This is a schematic diagram of the structure of a multi-stage federated learning device for vehicle networking oriented to non-independent and identically distributed data, provided in an embodiment of the present invention.

[0087] like Figure 4 As shown, this multi-stage federated learning device for vehicle-to-everything (V2X) data with non-independent and identically distributed data includes: an acquisition module 100, a federated average multi-party computation module 200, a federated weighted multi-party computation module 300, and a personalized computation module 400.

[0088] The acquisition module is used to acquire the global model of the vehicles participating in federated learning from the roadside units as the initial local model;

[0089] The FedAvg multi-party computation module is used to train an initial local model based on the vehicle's local data to obtain a first-stage local model. The first-stage local model is then uploaded to the roadside unit so that the roadside unit can aggregate the first-stage local model according to the FedAvg algorithm to obtain a first-stage global model.

[0090] The federated weighted multi-party computation module is used to train a first-stage global model based on local data to obtain a second-stage local model. The second-stage local model is then uploaded to the roadside unit so that the roadside unit can aggregate the second-stage local model according to the federated weighted algorithm to obtain the second-stage global model.

[0091] The personalized computing module is used to train a two-stage global model based on local data to obtain a three-stage local model.

[0092] To achieve the above objectives, a third aspect of the present invention provides a computer device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the multi-stage federated learning method for vehicle networking oriented to non-independent and identically distributed data as described above.

[0093] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the multi-stage federated learning method for vehicle networking oriented to non-independent and identically distributed data as described above.

[0094] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0095] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0096] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A multi-stage federated learning method for vehicle-to-everything (V2X) data with non-independent and identically distributed data, characterized in that, Includes the following steps: S101: Obtain the global model of the vehicles participating in federated learning from the roadside unit as the initial local model; S102: Train the initial local model based on the local data of the vehicle to obtain a first-stage local model, and upload the first-stage local model to the roadside unit so that the roadside unit can aggregate the first-stage local model according to the FedAvg algorithm to obtain a first-stage global model. S103: Train the first-stage global model based on the local data to obtain the second-stage local model, and upload the second-stage local model to the roadside unit so that the roadside unit can aggregate the second-stage local model according to the federated weighted algorithm to obtain the second-stage global model. S104: Iteratively train the two-stage global model based on the local data to obtain a three-stage local model; This includes, before obtaining the global model of the vehicles participating in federated learning from the roadside units: Specific vehicles are selected to participate in federated learning, meaning that a vehicle's stay within the communication range of its current roadside unit exceeds the total time required to complete model download, local training, and model upload. Those selected to participate in federated learning will not participate in this round of federated learning, as expressed by the formula: , in, , For vehicles Duration of stay within the communication range of the roadside unit Vehicles in round t The transfer time for downloading the model. Vehicles in round t Local training time, For the t-th round vehicle The transmission time of the uploaded model; The process of enabling the roadside units to aggregate the first-stage local model according to the FedAvg algorithm is expressed as follows: , in, It is the first t Round global model parameters, It is the first t -1 round of global model parameters, N It is the number of vehicles participating in federal learning. It is the local model learning rate. It is the first t wheeled vehicles The local model loss function; After obtaining the first-stage global model, the following is also included: The first-stage global model is used as a new first-stage local model, and S102 is iterated until the first-stage global model converges. The process of aggregating the two-stage local model using the roadside unit according to the federated weighted algorithm is expressed as follows: , in, It is the first t wheeled vehicles The accuracy of the local model, It has the highest local model accuracy among all participating vehicles. It is the first t wheeled vehicles The richness of locally trained data It refers to the comprehensive richness of data for all vehicles. It is the first t wheeled vehicles The amount of data used for local training It is the total amount of data for all vehicles, with weights. and .

2. The method according to claim 1, characterized in that, The method of enabling the roadside units to aggregate the two-stage local model according to the federated weighted algorithm also includes reducing vehicle communication overhead by introducing an upload and download transmission mechanism: If vehicle No. t The local model parameters of the wheel and the first t If there are significant differences between the global aggregate models in round -1, the local model parameters for this round will not be uploaded; the difference between the two models is calculated using the L2 norm, i.e. , in, It is the first t wheeled vehicles The local model parameters, and It is the first t -1 round of global model parameters, when hour, These are hyperparameters, indicating significant differences between models, requiring the local model to be uploaded; otherwise, uploading is not necessary. If vehicle In the t The local model was uploaded during the round, and it has a relatively large weight in the global model aggregation, that is... , If it is a hyperparameter, then the roadside unit will not distribute the first [parameter] to the vehicle. t A global aggregation model for wheels.

3. The method according to claim 1, characterized in that, After obtaining the two-stage global model, the following is also included: The two-stage global model is used as a new two-stage local model, and S103 is iterated until the two-stage global model converges.

4. The method according to claim 1, characterized in that, After obtaining the three-stage local model, the following is also included: When the performance of the three-stage local model degrades, fine-tuning and optimization are performed using local data to obtain the local model with the best performance.

5. A multi-stage federated learning device for vehicle-to-everything (V2X) data with non-independent and identically distributed characteristics, characterized in that... The apparatus implements the method as described in claim 1, and the apparatus comprises the following modules: The acquisition module is used to acquire the global model of the vehicles participating in federated learning from the roadside units as the initial local model; The FedAvg multi-party computation module is used to train the initial local model based on the local data of the vehicle to obtain a one-stage local model, and upload the one-stage local model to the roadside unit so that the roadside unit can aggregate the one-stage local model according to the FedAvg algorithm to obtain a one-stage global model. The federated weighted multi-party computation module is used to train the first-stage global model based on the local data to obtain the second-stage local model, and upload the second-stage local model to the roadside unit so that the roadside unit can aggregate the second-stage local model according to the federated weighted algorithm to obtain the second-stage global model. A personalized computing module is used to train the two-stage global model based on the local data to obtain a three-stage local model.

6. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the multi-stage federated learning method for vehicle networking oriented to non-independent and identically distributed data as described in any one of claims 1-4.