A method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory

A two-phase dynamic contract model is constructed through dynamic contract theory, which solves the problem that static contracts in the existing technology cannot meet the long-term cooperation of federated learning, realizes an incentive mechanism under the condition of information asymmetry, reduces resource waste and communication costs, and improves efficiency. utility.

CN114647982BActive Publication Date: 2024-10-22NORTHEASTERN UNIV CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210331207.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2024-10-22
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

The existing federated learning incentive mechanism based on contract theory is mainly a static contract, which cannot meet the needs of long-term cooperation between the federated learning server and the Internet of Vehicles client. Especially in the case of information asymmetry, static contracts lead to resource waste and high communication. cost.

Method used

Using an incentive method based on dynamic contract theory, by constructing a two-phase dynamic contract model to satisfy the IR, IC, IIR and IIC constraints, an optimal dynamic contract is established to promote long-term cooperation and maximized resource utilization of Internet of Vehicles clients.

Benefits of technology

It achieves long-term cooperation incentives under information asymmetry, reduces resource waste and communication costs, improves the effectiveness of federated learning servers and Internet of Vehicles clients, and is suitable for long-term cooperation scenarios of federated learning in Internet of Vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647982B_ABST
    Figure CN114647982B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for incentivizing federated learning of Internet of Vehicles based on dynamic contract theory, which relates to the field of federated learning; a federated learning architecture is adopted to train data locally, thereby ensuring the privacy and security of the data. On the basis of adopting the federated learning architecture, a two-phase dynamic contract incentive mechanism is established for the federated learning server and the Internet of Vehicles client. In the case of asymmetric information, the utility of the federated learning server is maximized, so that the Internet of Vehicles client selects a contract corresponding to its own private information. When the Internet of Vehicles client selects a contract corresponding to its own type, the Internet of Vehicles client obtains the highest utility. Under long-term cooperation, the dynamic changes of private information of Internet of Vehicles federated learning are taken into consideration, and a dynamic contract incentive mechanism is adopted, which is more suitable for long-term cooperation between the federated learning server and the Internet of Vehicles edge device. Under the dynamic contract incentive mechanism, the federated learning server and the Internet of Vehicles edge device will obtain higher benefits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning, and in particular to a method for motivating federated learning in Internet of Vehicles based on dynamic contract theory. Background Art

[0002] As a secure distributed machine learning architecture, federated learning protects the privacy and security of local data, allowing IoV clients to train federated learning models without leaving the local data. IoV clients need to consume certain resources in the process of model training, and rational IoV clients are unwilling to contribute their resources for free. Therefore, federated learning should provide an incentive mechanism to promote the participation of IoV clients. However, there is an information asymmetry problem in the cooperation between the federated learning server and the IoV client. The IoV client trains the federated learning task model based on local data, and the federated learning server cannot access the authenticity of its work. The incentive mechanism based on contract theory is an effective way to promote honest behavior, especially in the case of information asymmetry.

[0003] Most of the current incentive mechanisms for federated learning based on contract theory are for static contracts. However, in the application of federated learning in the Internet of Vehicles, the federated learning server hopes that the edge devices of the Internet of Vehicles can continue to participate. However, as the cooperation progresses over a long period of time, the environment of cooperation will change, and the current contract may no longer be applicable to the current partnership. In addition, signing repeated static contracts in resource-constrained IoT scenarios will cause a lot of communication costs. The dynamic contract model supports the signing of contracts for two or more rounds of federated learning training, so a dynamic contract theory incentive mechanism is more suitable for the scenario of long-term cooperation in federated learning in the Internet of Vehicles.

[0004] The incentive mechanism based on contract theory is mainly to solve the problem that clients, as rational individuals, are unwilling to participate in the training of federated learning models under the condition of information asymmetry. This incentive mechanism induces clients to maximize their own resources by giving different rewards. The incentive mechanism based on contract theory in federated learning is mainly aimed at promoting cooperation between federated learning servers and clients. This cooperation is often long-term, but contracts are often static contracts. Static contracts can only provide a one-time contract for federated learning servers and clients, which cannot satisfy the long-term cooperation relationship between federated learning servers and clients. Summary of the invention

[0005] In order to address the deficiencies in the prior art, the present invention provides an Internet of Vehicles federated learning incentive method based on dynamic contract theory. Based on the Internet of Vehicles, a dynamic contract incentive mechanism is established for a federated learning server and an Internet of Vehicles client to solve the long-term cooperation incentive problem between the federated learning server and the Internet of Vehicles client under the condition of information asymmetry.

[0006] The technical solution adopted by the present invention is:

[0007] A method for encouraging federated learning in Internet of Vehicles based on dynamic contract theory includes the following steps:

[0008] Step 1: Establish the utility model of the Internet of Vehicles client and the federated learning server, and construct a two-period dynamic contract model by satisfying the constraints of IR (Individual Rationality), IC (Incentive Compatibility), IIR (Intertemporal Individually Rational) and IIC (Intertemporal Incentive Compatibility) to obtain the optimal dynamic contract;

[0009] Step 2: Use the optimal dynamic contract obtained in step 1 to sign a contract with the Internet of Vehicles client;

[0010] Step 3: In the first stage of the dynamic contract, the contracted IoV client downloads the global model from the federated learning server, performs local training on the global model to obtain a local model, and uploads the trained local model to the federated learning server;

[0011] Step 4: The federated learning server determines whether the accuracy of the local model uploaded by the IoV client meets the set accuracy threshold. If so, the federated learning server receives the local model uploaded by the IoV client and issues corresponding rewards according to the optimal dynamic contract in the first stage. Otherwise, the local model uploaded by the IoV client is not received and no reward is issued.

[0012] Step 5: In the second stage of the dynamic contract, the contracted IoV client downloads the global model from the federated learning server, performs local training on the global model to obtain a local model, and uploads the trained local model to the federated learning server;

[0013] Step 6: The federated learning server determines whether the accuracy of the local model uploaded by the IoV client meets the set accuracy threshold. If so, the federated learning server receives the local model uploaded by the IoV client and issues corresponding rewards according to the optimal dynamic contract in the second phase. Otherwise, the local model uploaded by the IoV client is not received and no reward is issued.

[0014] The specific process of step 1 includes the following steps:

[0015] Step 1.1: Establish the cost model and utility model of the Internet of Vehicles client, and establish the utility model of the federated learning server;

[0016] Set the data size of the vehicle networking client training of type m to D m , the training deadline is T m , the CPU frequency of its training data is f m , the cost of each round of CPU cycles is Where k is a constant; when the data size of the vehicle networking client training of type m is D m When the CPU cycle consumed is pD m , where p is a constant; the CPU frequency of the vehicle type is m The specific steps include:

[0017] Step 1.1.1: Establish a cost model for a type m IoV client, as shown in formula (1):

[0018]

[0019] Set μ = kp 3 , where μ is a constant; It is defined as the private information of the type m IOV client, which indicates the data training capability of the type m IOV client based on the training time. The cost model of the type m IOV client is shown in formula (2):

[0020] C m =μθ m [D m ] 3 (2)

[0021] Step 1.1.2: Establish the utility model U of the IoV client of type m v , as shown in formula (3):

[0022] U v =R m -C m =R m -μθ m [D m ] 3 (3)

[0023] Among them, R m is the reward received by the IoV client of type m from the federated learning server;

[0024] Step 1.1.3: The benefit G obtained by the federated learning server from the local model uploaded by the IoV client of type m m , as shown in formula (4):

[0025] G m =σlog(1+αD m ) (4)

[0026] Among them, σ and α determine the impact of model accuracy on the benefits of the federated learning server based on the data size;

[0027] Establishing the utility model U of the federated learning server s , as shown in formula (5):

[0028]

[0029] Among them, N represents that there are N Internet of Vehicles clients participating in the federated learning training, q m represents the prior probability distribution of the type m of the Internet of Vehicles client, R m The reward issued by the federated learning server to the IoV client of type m;

[0030] Step 1.2: Establish the utility model of the IoV client in the second and first phases of the dynamic contract and the optimal contract model for the two phases; specifically, it is divided into the following steps:

[0031] Step 1.2.1: Establish the utility model of the second-stage type n IoV client, as shown in formula (6):

[0032]

[0033] in, Represents the private information of the IoV client whose first stage type is m and second stage type is n;

[0034] In the second stage, the type n of the Internet of Vehicles client selects the contract When , non-negative utility is obtained, satisfying the IR (Individual Rationality) constraint, as shown in formula (7):

[0035]

[0036] Among them, X is a constant, which represents the minimum acceptable utility of the IoV client of type n in the second stage;

[0037] In the second stage, the type of the Internet of Vehicles client is n, and it selects the same contract as itself. When , the maximum utility is obtained and the IC (Incentive Compatibility) constraint is satisfied, as shown in formula (8):

[0038]

[0039] in, and To select the second-stage reward and training data size that best suits your contract; and To select the rewards and training data size for the second phase under other contract conditions;

[0040] Step 1.2.2: Establish the inter-period utility model of the first-stage IoV client of type m, as shown in formula (9):

[0041]

[0042] in, is the private information of the IoV client of type m in the first phase; δ is the discount factor; represents the second stage prior probability distribution;

[0043] In the first stage, the type m of the Internet of Vehicles client should satisfy the IIR (Intertemporal Individually Rational) constraint, as shown in formula (10):

[0044]

[0045] At the same time, the IIC (Intertemporal Incentive Compatibility) constraint is satisfied, as shown in formula (11):

[0046]

[0047] When the two phases satisfy the IR, IC, IIR and IIC constraints, the optimization problem of the two-phase dynamic contract is as shown in Equation (12) to Equation (16):

[0048]

[0049]

[0050]

[0051]

[0052]

[0053] in, is the utility of the federated learning server in the first phase, The utility of the federated learning server in the second phase;

[0054] Step 1.3: Relax the IR, IC, IIR, and IIC constraints to obtain the optimal dynamic contract between the federated learning server and the IoV client.

[0055] Relax the IR constraint in step 1.2, as shown in formula (17):

[0056]

[0057] Relax the IC constraint in step 1.2, as shown in formula (18):

[0058]

[0059] Relax the IIR constraints in step 1.2, as shown in formula (19):

[0060]

[0061] Relax the IIC constraint in step 1.2, as shown in formula (20):

[0062]

[0063] By relaxing the constraints in step 1.2, the optimization problem of the two-period dynamic contract is shown in Equations (21) to (25):

[0064]

[0065]

[0066]

[0067]

[0068]

[0069] Under the relaxed constraint conditions, Equations (21) to (25) can obtain the final optimal dynamic contract through the Lagrangian function.

[0070] The specific process of step 2 includes the following steps:

[0071] Step 2.1: The federated learning server broadcasts the optimal dynamic contract to the IoV client;

[0072] The federated learning server broadcasts the optimal dynamic contract obtained in step 1.3 to all participating IoV clients;

[0073] Step 2.2: The IoV client chooses whether to sign the optimal dynamic contract. If yes, it proceeds to step 3. If no, it exits the cooperation.

[0074] The specific process of step 3 includes the following steps:

[0075] Step 3.1: The IoV client downloads the global model from the federated learning server;

[0076] Step 3.2: The IoV client uses local data to train the global model downloaded from the federated learning server, training the corresponding amount of data according to the selected contract, and executes step 3.3 after the training is completed;

[0077] Step 3.3: The IoV client uploads the trained local model to the federated learning server.

[0078] The global model is a model that the federated learning server needs to train with the Internet of Vehicles client.

[0079] The specific process of step 4 includes the following steps:

[0080] Step 4.1: The federated learning server verifies the local model uploaded by the IoV client and sets the accuracy threshold Ψ. If the test accuracy of the model is greater than or equal to the accuracy threshold Ψ, the model is received through verification and step 4.2 is executed. If it is less than the accuracy threshold Ψ, the model is rejected.

[0081] Step 4.2: The federated learning server issues corresponding rewards to the IoV client that accepts the model according to the optimal dynamic contract signed in the first phase.

[0082] The specific process of step 5 includes the following steps:

[0083] Step 5.1: The IoV client downloads the global model from the federated learning server;

[0084] Step 5.2: The IoV client uses local data to train the global model downloaded from the federated learning server, training the corresponding amount of data according to the selected contract, and executes step 5.3 after the training is completed;

[0085] Step 5.3: The IoV client uploads the trained local model to the federated learning server.

[0086] The specific process of step 6 includes the following steps:

[0087] Step 6.1: The federated learning server verifies the local model uploaded by the IoV client and sets the accuracy threshold Ψ. If the test accuracy of the model is greater than or equal to the accuracy threshold Ψ, the model is received through verification and step 6.2 is executed. If it is less than the accuracy threshold Ψ, the model is rejected.

[0088] Step 6.2: The federated learning server issues corresponding rewards to the IoV client that accepts the model according to the signed second-stage optimal dynamic contract.

[0089] Beneficial technical effects

[0090] 1. The present invention provides a method for incentivizing federated learning of Internet of Vehicles based on dynamic contract theory, which adopts a federated learning architecture to train data locally, thereby ensuring the privacy and security of data. On the basis of adopting the federated learning architecture, a two-phase dynamic contract incentive mechanism is established for the federated learning server and the Internet of Vehicles client. In the case of asymmetric information, the Internet of Vehicles client selects the contract corresponding to its own private information to obtain the maximum utility, thereby maximizing the utility of the federated learning server. When the Internet of Vehicles client selects the contract corresponding to its own type, the utility of the Internet of Vehicles client is the highest.

[0091] 2. Under long-term cooperation, the dynamic changes of private information of Internet of Vehicles federated learning are taken into consideration, and a dynamic contract incentive mechanism is adopted. Compared with the static contract incentive mechanism, it is more suitable for long-term cooperation between federated learning servers and Internet of Vehicles edge devices. Compared with static contracts, under the dynamic contract incentive mechanism, federated learning servers and Internet of Vehicles edge devices will obtain higher benefits. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] Figure 1 A flowchart of cooperation between a federated learning server and an Internet of Vehicles client provided in an embodiment of the present invention;

[0093] Figure 2 A schematic diagram of the utility of selecting different types of contracts in the second phase of a vehicle networking client according to an embodiment of the present invention;

[0094] Figure 3 A schematic diagram of the utility of selecting different types of contracts by a vehicle networking client in the first stage according to an embodiment of the present invention. DETAILED DESCRIPTION

[0095] The specific implementation of the present invention is further described in detail below in conjunction with the drawings and examples.

[0096] In order to address the deficiencies in the prior art, the present invention provides an Internet of Vehicles federated learning incentive method based on dynamic contract theory. Based on the Internet of Vehicles, a dynamic contract incentive mechanism is established for a federated learning server and an Internet of Vehicles client to solve the long-term cooperation incentive problem between the federated learning server and the Internet of Vehicles client under the condition of information asymmetry.

[0097] The technical solution adopted by the present invention is:

[0098] A method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory, such as Figure 1 As shown, the following steps are included:

[0099] Step 1: Establish the utility model of the Internet of Vehicles client and the federated learning server, and build a two-period dynamic contract model by satisfying the constraints of IR (Individual Rationality), IC (Incentive Compatibility), IIR (Intertemporal Individually Rational) and IIC (Intertemporal Incentive Compatibility) to obtain the optimal dynamic contract; it is divided into the following steps:

[0100] Step 1.1: In order to promote the long-term cooperation between the federated learning server and the IoV client, the federated learning server establishes a cost model and a utility model for the IoV client, and also establishes a utility model for the federated learning server;

[0101] Set the data size of the vehicle networking client training of type m to D m , the training deadline is T m , the CPU frequency of its training data is f m , the cost of each round of CPU cycles is Where k is a constant; when the data size of the vehicle networking client training of type m is D m When the CPU cycle consumed is pD m , where p is a constant; the CPU frequency of the vehicle type is m The specific steps include:

[0102] Step 1.1.1: The size of the training data of the IoV client of type m is D m The cost of data is C m , as shown in formula (1):

[0103]

[0104] Set μ = kp 3 , where μ is a constant; It is defined as the private information of the type m IOV client, which indicates the data training capability of the type m IOV client based on the training time. The cost model of the type m IOV client is shown in formula (2):

[0105] C m =μθ m [D m ] 3 (2)

[0106] Step 1.1.2: Utility model U of a connected car client of type m v Represents the reward R mSubtract its training cost C m , as shown in formula (3):

[0107] U v =R m -C m =R m -μθ m [D m ] 3 (3)

[0108] Among them, R m is the reward received by the IoV client of type m from the federated learning server;

[0109] Step 1.1.3: The benefit G obtained by the federated learning server from the local model uploaded by the IoV client of type m m , as shown in formula (4):

[0110] G m =σlog(1+αD m ) (4)

[0111] Among them, σ and α determine the impact of model accuracy on the benefits of the federated learning server based on the data size;

[0112] Utility model U of federated learning server s It represents the total revenue it obtains minus the total reward it issues to the Internet of Vehicles clients, as shown in formula (5):

[0113]

[0114] Among them, N represents that there are N Internet of Vehicles clients participating in the federated learning training, q m represents the prior probability distribution of the IoV client of type m, q m ∈[0,1], R m The reward issued by the federated learning server to the IoV client of type m;

[0115] Step 1.2: Establish the utility model of the IoV client in the second and first phases of the dynamic contract and the optimal contract model for the two phases; specifically, it is divided into the following steps:

[0116] Step 1.2.1: Based on the idea of ​​reverse induction, first establish the utility model of the second-stage type n Internet of Vehicles client, as shown in formula (6):

[0117]

[0118] in, It is the private information of the IoV client whose first stage type is m and second stage type is n; It is the private information of the IoV client of type m in the first phase;

[0119] In order to ensure that the second phase type n car networking client selects the contract To obtain non-negative utility, the IR (Individual Rationality) constraint should be satisfied, as shown in formula (7):

[0120]

[0121] Where X is a constant, which represents the minimum acceptable utility of the type n IoV client in the second stage; the utility of the type n IoV client in the second stage is greater than or equal to X;

[0122] In order to ensure that the second phase type n car networking client selects the contract To obtain the maximum utility, the IC (Incentive Compatibility) constraint should be satisfied, as shown in formula (8):

[0123]

[0124] in, and To select the second-stage reward and training data size that best suits your contract; and is the reward and training data size for the second stage under other contract conditions; when the IoV client of type n in the second stage selects a contract of type n, the maximum utility is obtained, such as Figure 2 As shown; according to the above IC constraints, the contract can motivate the IoV client to reflect its true private information by selecting the corresponding contract, and the federated learning server can use this to understand the true private information of the IoV client;

[0125] Step 1.2.2: Establish the inter-period utility model of the first-stage IoV client of type m, as shown in formula (9):

[0126]

[0127] in, is the private information of the IoV client of type m in the first phase; δ is the discount factor; represents the second stage prior probability distribution;

[0128] In order to ensure that the first phase type m of the Internet of Vehicles client selects the contract To obtain non-negative intertemporal utility, the IIR (Intertemporal Individually Rational) constraint should be satisfied, as shown in formula (10):

[0129]

[0130] In the first stage, the intertemporal utility of the IoV client of type m is greater than or equal to X+δX;

[0131] At the same time, in order to ensure that the first stage type m car networking client selects To obtain the maximum intertemporal utility, the IIC (Intertemporal Incentive Compatibility) constraint should be satisfied, as shown in formula (11):

[0132]

[0133] When the IoV client of type m in the first stage selects a contract of type m, the maximum intertemporal utility is obtained, such as Figure 3 As shown;

[0134] When the two stages satisfy the IR, IC, IIR and IIC constraints, the maximum expected utility of the federated learning server is as shown in Equations (12) to (16):

[0135]

[0136]

[0137]

[0138]

[0139]

[0140] in, is the utility of the federated learning server in the first phase, The utility of the federated learning server in the second phase;

[0141] Step 1.3: Relax the IR, IC, IIR, and IIC constraints to obtain the optimal dynamic contract between the federated learning server and the IoV client.

[0142] Relax the IR constraint in step 1.2, as shown in formula (17):

[0143]

[0144] Satisfying the constraint condition of formula (17), all other types of IoV clients in the second stage satisfy the IR constraint condition;

[0145] Relax the IC constraint in step 1.2, as shown in formula (18):

[0146]

[0147] Satisfying the constraint condition of formula (18), all other types of IoV clients in the second stage satisfy the IC constraint condition;

[0148] Relax the IIR constraints in step 1.2, as shown in formula (19):

[0149]

[0150] Satisfying the constraint condition of formula (19), all other types of IoV clients in the first stage satisfy the IIR constraint condition; the IIC constraint in step 1.2 is relaxed, as shown in formula (20):

[0151]

[0152] Satisfying the constraint condition of formula (20), all other types of IoV clients in the first stage satisfy the IIC constraint condition;

[0153] By relaxing the constraints in step 1.2, the optimization problem of the two-period dynamic contract is shown in Equations (21) to (25):

[0154]

[0155]

[0156]

[0157]

[0158]

[0159] Under the relaxed constraint conditions, the utility function of the federated learning server is a convex function, Equation (21)-Equation (25), and the final optimal dynamic contract can be obtained through the Lagrangian function;

[0160] Step 2: Use the optimal dynamic contract obtained in step 1 to sign a contract with the Internet of Vehicles client;

[0161] The federated learning server broadcasts the optimal dynamic contract to the IoV client; the IoV client chooses whether to sign the optimal dynamic contract. If yes, it executes step 3; if no, it exits the cooperation, which specifically includes the following steps:

[0162] Step 2.1: The federated learning server broadcasts the optimal dynamic contract to the IoV client;

[0163] The federated learning server broadcasts the optimal dynamic contract obtained in step 1.3 to all participating IoV clients;

[0164] Step 2.2: The IoV client chooses whether to sign the optimal dynamic contract. If yes, the IoV client will choose to sign and return it to the federated learning server to execute step 3. If no, the cooperation will be withdrawn.

[0165] Step 3: In the first stage of the dynamic contract, the IoV client downloads the global model from the federated learning server, trains the local model, and uploads the trained local model to the federated learning server, which specifically includes the following steps:

[0166] Step 3.1: The IoV client downloads the global model from the federated learning server;

[0167] The global model is a model that the federated learning server needs the IoV client to train;

[0168] Step 3.2: The IoV client uses local data to train the global model downloaded from the federated learning server, training the corresponding amount of data according to the selected contract, and executes step 3.3 after the training is completed;

[0169] Step 3.3: The IoV client uploads the trained local model to the federated learning server;

[0170] Step 4: The federated learning server verifies the local model uploaded by the IoV client and issues corresponding rewards according to the optimal dynamic contract in the first phase;

[0171] Step 4.1: In order to prevent the IoV client from uploading an unreal local model, the federated learning server will verify the local model uploaded by the IoV client and set the accuracy threshold Ψ; if the test accuracy of the model is greater than or equal to the accuracy threshold Ψ, the model will be received through verification and step 4.2 will be executed; if it is less than the accuracy threshold Ψ, the model will be rejected;

[0172] Step 4.2: The federated learning server issues corresponding rewards to the IoV client that receives the model according to the optimal dynamic contract in the first phase of the contract;

[0173] Step 5: In the second stage of the dynamic contract, the IoV client downloads the global model from the federated learning server, trains the local model, and uploads the trained local model to the federated learning server, which specifically includes the following steps:

[0174] Step 5.1: The IoV client downloads the global model from the federated learning server;

[0175] The global model is a model that the federated learning server needs the IoV client to train;

[0176] Step 5.2: The IoV client uses local data to train the global model downloaded from the federated learning server, training the corresponding amount of data according to the selected contract, and executes step 5.3 after the training is completed;

[0177] Step 5.3: The IoV client uploads the trained local model to the federated learning server;

[0178] Step 6: The federated learning server verifies the local model uploaded by the IoV client and issues corresponding rewards according to the optimal dynamic contract in the second phase;

[0179] Step 6.1: The federated learning server verifies the local model uploaded by the IoV client and sets the accuracy threshold Ψ. If the test accuracy of the model is greater than or equal to the accuracy threshold Ψ, the model is received through verification and step 6.2 is executed. If it is less than the accuracy threshold Ψ, the model is rejected.

[0180] Step 6.2: The federated learning server issues corresponding rewards to the IoV client that receives the model according to the signed second-phase optimal dynamic contract.

Claims

1. A method for encouraging federated learning in Internet of Vehicles based on dynamic contract theory, characterized by: The following steps are involved: Step 1: Establish the utility model of the Internet of Vehicles client and the federated learning server, build a two-period dynamic contract model by satisfying the IR, IC, IIR and IIC constraints, and obtain the optimal dynamic contract; Step 1.1: Establish the cost model and utility model of the Internet of Vehicles client, and establish the utility model of the federated learning server; Set the data size of the vehicle networking client training of type m to D m , the training deadline is T m , the CPU frequency of its training data is f m , the cost of each round of CPU cycles is Where k is a constant; when the data size of the vehicle networking client training of type m is D m When the CPU cycle consumed is pD m , where p is a constant; the CPU frequency of the vehicle type is m The specific steps include: Step 1.1.1: Establish a cost model for a type m IoV client, as shown in formula (1): Set μ = kp 3 , where μ is a constant; It is defined as the private information of the type m IOV client, which indicates the data training capability of the type m IOV client based on the training time. The cost model of the type m IOV client is shown in formula (2): C m =μθ m [D m ] 3 (2) Step 1.1.2: Establish the utility model Uv of the Internet of Vehicles client of type m, as shown in formula (3): U v =R m -C m =R m -μθ m [D m ] 3 (3) Among them, R m is the reward received by the IoV client of type m from the federated learning server; Step 1.1.3: The benefit G obtained by the federated learning server from the local model uploaded by the IoV client of type m m , as shown in formula (4): G m =σlog(1+αD m ) (4) Among them, σ and α determine the impact of model accuracy on the benefits of the federated learning server based on the data size; Establishing the utility model U of the federated learning server s , as shown in formula (5): Among them, N represents that there are N Internet of Vehicles clients participating in the federated learning training, q m represents the prior probability distribution of the type m of the Internet of Vehicles client, R m The reward issued by the federated learning server to the IoV client of type m; Step 1.2: Establish the utility model of the IoV client in the second and first phases of the dynamic contract and the optimal contract model for the two phases; specifically, it is divided into the following steps: Step 1.2.1: Establish the utility model of the second-stage type n IoV client, as shown in formula (6): in, Represents the private information of the IoV client whose first stage type is m and second stage type is n; In the second stage, the type n of the Internet of Vehicles client selects the contract When , non-negative utility is obtained, satisfying the IR (Individual Rationality) constraint, as shown in formula (7): Among them, X is a constant, which represents the minimum acceptable utility of the IoV client of type n in the second stage; In the second stage, the type of the Internet of Vehicles client is n, and it selects the same contract as itself. When , the maximum utility is obtained and the IC (Incentive Compatibility) constraint is satisfied, as shown in formula (8): in, and To select the second-stage reward and training data size that best suits your contract; and To select the rewards and training data size for the second phase under other contract conditions; Step 1.2.2: Establish the inter-period utility model of the first-stage IoV client of type m, as shown in formula (9): in, is the private information of the IoV client of type m in the first phase; δ is the discount factor; represents the second stage prior probability distribution; In the first stage, the type m of the Internet of Vehicles client should satisfy the IIR (Intertemporal Individually Rational) constraint, as shown in formula (10): At the same time, the IIC (Intertemporal Incentive Compatibility) constraint is satisfied, as shown in formula (11): When the two phases satisfy the IR, IC, IIR and IIC constraints, the optimization problem of the two-phase dynamic contract is as shown in Equation (12) to Equation (16): in, is the utility of the federated learning server in the first phase, The utility of the federated learning server in the second phase; Step 1.3: Relax the IR, IC, IIR, and IIC constraints to obtain the optimal dynamic contract between the federated learning server and the IoV client. Relax the IR constraint in step 1.2, as shown in formula (17): Relax the IC constraint in step 1.2, as shown in formula (18): Relax the IIR constraints in step 1.2, as shown in formula (19): Relax the IIC constraint in step 1.2, as shown in formula (20): By relaxing the constraints in step 1.2, the optimization problem of the two-period dynamic contract is shown in Equations (21) to (25): Under the relaxed constraint conditions, Equations (21) to (25) can obtain the final optimal dynamic contract through the Lagrangian function; Step 2: Use the optimal dynamic contract obtained in step 1 to sign a contract with the Internet of Vehicles client; Step 3: In the first stage of the dynamic contract, the contracted IoV client downloads the global model from the federated learning server, performs local training on the global model to obtain a local model, and uploads the trained local model to the federated learning server; Step 4: The federated learning server determines whether the accuracy of the local model uploaded by the IoV client meets the set accuracy threshold. If so, the federated learning server receives the local model uploaded by the IoV client and issues corresponding rewards according to the optimal dynamic contract in the first stage. Otherwise, the local model uploaded by the IoV client is not received and no reward is issued. Step 5: In the second stage of the dynamic contract, the contracted IoV client downloads the global model from the federated learning server, performs local training on the global model to obtain a local model, and uploads the trained local model to the federated learning server; Step 6: The federated learning server determines whether the accuracy of the local model uploaded by the IoV client meets the set accuracy threshold. If so, the federated learning server receives the local model uploaded by the IoV client and issues corresponding rewards according to the optimal dynamic contract in the second phase. Otherwise, the local model uploaded by the IoV client is not received and no reward is issued.

2. The method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory as claimed in claim 1, characterized in that: The specific process of step 2 includes the following steps: Step 2.1: The federated learning server broadcasts the optimal dynamic contract to the IoV client; The federated learning server broadcasts the optimal dynamic contract obtained in step 1.3 to all participating IoV clients; Step 2.2: The IoV client chooses whether to sign the optimal dynamic contract. If yes, proceed to step 3. If no, exit the cooperation.

3. The method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory as claimed in claim 1, characterized in that: The specific process of step 3 includes the following steps: Step 3.1: The IoV client downloads the global model from the federated learning server; Step 3.2: The IoV client uses local data to train the global model downloaded from the federated learning server, training the corresponding amount of data according to the selected contract, and executes step 3.3 after the training is completed; Step 3.3: The IoV client uploads the trained local model to the federated learning server.

4. The method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory as claimed in claim 1, characterized in that: The specific process of step 4 includes the following steps: Step 4.1: The federated learning server verifies the local model uploaded by the IoV client and sets the accuracy threshold Ψ. If the test accuracy of the model is greater than or equal to the accuracy threshold Ψ, the model is received through verification and step 4.2 is executed. If it is less than the accuracy threshold Ψ, the model is rejected. Step 4.2: The federated learning server issues corresponding rewards to the IoV client that accepts the model according to the optimal dynamic contract signed in the first phase.

5. The method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory as claimed in claim 1, characterized in that: The specific process of step 5 includes the following steps: Step 5.1: The IoV client downloads the global model from the federated learning server; Step 5.2: The IoV client uses local data to train the global model downloaded from the federated learning server, training the corresponding amount of data according to the selected contract, and executes step 5.3 after the training is completed; Step 5.3: The IoV client uploads the trained local model to the federated learning server.

6. The method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory as claimed in claim 1, characterized in that: The specific process of step 6 includes the following steps: Step 6.1: The federated learning server verifies the local model uploaded by the IoV client and sets the accuracy threshold Ψ. If the test accuracy of the model is greater than or equal to the accuracy threshold Ψ, the model is received through verification and step 6.2 is executed. If it is less than the accuracy threshold Ψ, the model is rejected. Step 6.2: The federated learning server issues corresponding rewards to the IoV client that accepts the model according to the signed second-stage optimal dynamic contract.

7. The method for incentivizing federated learning in Internet of Vehicles based on dynamic contract theory as claimed in claim 4, characterized in that: The global model is a model that the federated learning server needs to train with the Internet of Vehicles client.