A federated learning method for privacy security of internet of vehicles
By employing a federated learning method with multi-key semi-homomorphic encryption and differential privacy Gaussian mechanism in the Internet of Vehicles (IoV), the problems of large number of parameters and heterogeneous models in IoV are solved, thereby improving security and intelligent service capabilities and realizing intelligent traffic management and vehicle control.
Patent Information
- Application Number
- CN202310455763.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-25
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-04-25
AI Technical Summary
Existing federated learning solutions in the Internet of Vehicles (IoV) suffer from problems such as large number of parameters and heterogeneous models, and are vulnerable to reconstruction attacks, poisoning attacks and member inference attacks, which affect the intelligent services and security of the IoV.
Employing a multi-key semi-homomorphic encryption algorithm and the Gaussian mechanism in differential privacy, the system generates public and private keys and splits the private key into subkeys. The vehicle trains a model based on local data and global prototype vectors. The cloud performs encrypted local prototype vector operations and transmission, and the vehicle performs partial decryption to finally calculate the global prototype vector.
This reduces the number of parameters in the communication process, alleviates the problem of model heterogeneity, improves the security and effectiveness of federated learning in vehicle networks, and realizes intelligent traffic management and intelligent vehicle control.
Smart Images

Figure CN116489642B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of vehicle networking and big data, and specifically to a federated learning method for vehicle networking privacy and security. Background Technology
[0002] The rapid development of mobile communication technology has provided ultra-low latency and high reliability support for vehicle-to-everything (V2X) communication, giving rise to intelligent services such as autonomous driving and intelligent transportation. However, intelligent services require a large amount of data from mobile terminals, and the private data provided is likely to be sensitive and heterogeneous. Therefore, solving the security and non-independent, homogeneous distribution issues of private data in V2X scenarios is crucial. V2X scenarios consist of three parts: mobile terminals (vehicles), edge devices (roadside units, RSUs), and the cloud. The continuous communication and interaction between these components provides intelligent services to the mobile terminals.
[0003] Concerns about personal data privacy breaches have led car owners to avoid uploading their data to data centers, hindering data flow and impacting the development of the connected vehicle industry. Federated learning-based data privacy protection technology offers significant advantages. Federated learning-based connected vehicle technology achieves collaborative training without requiring data to be stored locally. Furthermore, highly dynamic vehicles only need to transmit the trained model parameters to roadside units, without sharing the entire original dataset, thus avoiding privacy risks. Therefore, federated learning-based connected vehicle technology has significant practical research value. For example, Chinese patent document CN112700639A discloses an intelligent traffic path planning method based on federated learning and digital twins.
[0004] However, most current federated learning schemes employ gradient space-based aggregation methods, which have several drawbacks. First, they involve a large number of transmitted parameters, do not support heterogeneous models, and cannot be widely applied in scenarios such as connected vehicles. Second, these methods are vulnerable to threats such as reconstruction attacks, poisoning attacks, and member inference attacks. Therefore, there is an urgent need to design a new federated learning scheme that can improve the robustness of the overall federated learning process while ensuring its security. Summary of the Invention
[0005] To address the shortcomings of the existing technologies, the technical problem this invention aims to solve is: how to provide a federated learning method for privacy and security in the Internet of Vehicles (IoV), which aims to reduce the number of parameters transmitted during the federated learning communication process, alleviate the problem of model heterogeneity, and protect the privacy of data of federated learning participants through multi-key semi-homomorphic encryption algorithms and Gaussian mechanisms in differential privacy, thereby improving the effectiveness and security of federated learning in the IoV, and further helping to enhance the analysis and processing capabilities of intelligent services provided by the IoV, ultimately realizing intelligent traffic management, intelligent dynamic information services, and intelligent vehicle control.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0007] A federated learning method for privacy and security in connected vehicles includes:
[0008] S1: Generate public and private keys, divide the private key into a corresponding number of subkeys, and then distribute the public key and the corresponding subkeys to each vehicle participating in federated learning;
[0009] S2: For a single vehicle: First, obtain the global prototype vector of federated learning; then train the local model based on the local data and the global prototype vector, and calculate the local prototype vector for each class of data; finally, encrypt the local prototype vector using the public key to generate the encrypted local prototype vector.
[0010] S3: Perform homomorphic addition on the encrypted local prototype vectors of each vehicle to generate the sum of the encrypted local prototype vectors;
[0011] S4: Randomly select a preset number of vehicles and send the sum of encrypted local prototype vectors to each vehicle in turn, so that each vehicle can partially decrypt the sum of encrypted local prototype vectors in turn based on its own subkey until the sum of local prototype vectors is completely decrypted.
[0012] S5: Calculate the global prototype vector based on the sum of the local prototype vectors and distribute it to each vehicle participating in federated learning.
[0013] S6: Repeat steps S2 to S5 until the local models for each vehicle converge.
[0014] Preferably, the public and private keys are generated through the following steps:
[0015] S101: Choose two large prime numbers p and q such that p ≠ q, and calculate the integer n;
[0016] The formula is described as follows:
[0017] n = p * q;
[0018] N = n 2 ;
[0019] S102: Calculate the least common multiple λ of p-1 and q-1;
[0020] The formula is described as follows:
[0021] λ = lcm(p-1, q-1);
[0022] Where lcm is the least common multiple function;
[0023] S103: Select a positive integer g less than N such that gcd(g λmod N,n)=1;
[0024] Where gcd is the greatest common divisor function, and it exists μ=L(g λ mod n 2 ) -1 mod n;
[0025] S104: Generate public and private keys;
[0026] Public key: pk = (n, g); Private key: sk = (λ, μ).
[0027] Preferably, the private key is divided through the following steps:
[0028] S111: Set a threshold t and construct a polynomial f(x) of degree t;
[0029] The formula is described as follows:
[0030] f(x) = sk + a1*x + a2*x 2 +…+a t-1 *x t-1 ;
[0031] Where f(0) = sk; a1 to a t-1 Let be a random integer, satisfying a i <sk,n> t;
[0032] S112: Define the owners of n vehicles as P1, P2...P... n P i The assigned subkey is sk i =f(i).
[0033] Preferably, the vehicle's local data D i =(X i ,Y i ), where X i =(x i1 ,x i2 ,…,x in ), Y i =(y i1 ,y i2 ,…,y in ); X i Y represents the sample of vehicle i. i The label data represents vehicle i, where i represents the vehicle number, i = 1, 2, ..., n ∈ R.
[0034] Preferably, the vehicle trains the local model through the following steps:
[0035] S201: Sample x and label y belong to local data Di That is, (x,y)∈D i Vehicle i according to parameter φ i h i The function computes the local prototype vector of sample x, and based on the parameter v i g of the transformation i The function calculates the prediction results;
[0036] The formula is described as follows:
[0037]
[0038] In the formula: Represents the local prototype vector of vehicle i; Indicates the prediction result; D i,j h represents the j-th type of local data for vehicle i; i g represents the dimensionality reduction part of the local model of vehicle i; i This represents the prediction portion in the local model for vehicle i;
[0039] S202: Vehicle i optimizes the parameters φ of its local model using the backpropagation algorithm based on the loss function. i and parameter v i ;
[0040] The loss function is expressed as:
[0041]
[0042] In the formula: L represents the loss function of the local model; L S L represents the supervised loss function; R Represents a regular term; |C| represents the global prototype vector of class j; |C| represents the number of types of local prototype vectors; D i Let N represent the i-th local dataset; N represents the number of samples in all local datasets; N j This represents the number of samples of class j in all local datasets.
[0043] Preferably, the encrypted local prototype vector is generated through the following steps:
[0044] S211: Local prototype vector of vehicle i Add Gaussian noise to generate a local prototype vector of noise;
[0045] The formula is described as follows:
[0046]
[0047] In the formula: Represents the local prototype vector of noise; Represents the local prototype vector of vehicle i; This indicates that the expected value is 0 and the standard deviation is 0. Gaussian noise; σ represents the sensitivity of the local model; σ represents the noise variance; t represents the threshold for participating in decryption.
[0048] S212: Noise local prototype vector of vehicle i via public key pk Encryption is performed to generate an encrypted local prototype vector;
[0049] The formula is described as follows:
[0050]
[0051] In the formula: Represents the encrypted local prototype vector; represents the local prototype vector of noise; Enc represents the encryption function.
[0052] Preferably, homomorphic addition is performed using the following formula:
[0053]
[0054] In the formula: R j R represents the sum of encrypted local prototype vectors; n j This represents the encrypted local prototype vector of the nth vehicle.
[0055] Preferably, n-t+1 vehicles are randomly selected, and the sum of encrypted local prototype vectors is sent to each vehicle in sequence.
[0056] Preferably, the sum of the encrypted local prototype vectors is partially decrypted using the following formula:
[0057]
[0058] In the formula: R j S represents the sum of encrypted local prototype vectors; j sk represents the sum of the local prototype vectors after complete decryption; i represents the subkey of vehicle i; Dec represents the decryption function.
[0059] Preferably, the global prototype vector is calculated using the following formula:
[0060]
[0061] In the formula: S represents the global prototype vector; j represents the sum of the local prototype vectors after complete decryption; n represents the number of vehicles participating in federated learning.
[0062] Compared with existing technologies, the federated learning method for privacy and security in the Internet of Vehicles (IoV) of this invention has the following advantages:
[0063] In this invention, the cloud (or roadside unit) does not directly collect vehicle data, but only collects the latest local prototypes. Each vehicle participating in federated learning trains its local model based on local data and global prototype vectors distributed from the cloud. After training, the local prototype vector for each type of data is calculated and uploaded to update the global prototype vectors stored in the cloud. On the one hand, this invention can ensure the effectiveness of machine learning and model training in the Internet of Vehicles (IoV) scenario through federated learning, and can break down data silos between vehicles, thereby helping to improve the analysis and processing capabilities of intelligent services provided by IoV, ultimately realizing intelligent traffic management, intelligent dynamic information services, and intelligent vehicle control. On the other hand, this invention adopts a prototype-based and model-heterogeneous federated learning aggregation method, reducing the number of parameters transmitted during communication, alleviating the model heterogeneity problem in federated learning, and allowing terminals (vehicles) with limited computing resources to participate in federated learning, thereby improving the effectiveness of IoV federated learning.
[0064] In this invention, the cloud generates public and private keys and divides the private key into corresponding sub-keys, distributing them to each vehicle participating in federated learning. Each vehicle calculates a local prototype vector for each data type and encrypts it. The cloud (or roadside unit) directly performs homomorphic addition on the encrypted local prototype vectors to generate a sum of encrypted local prototype vectors. This sum is then sequentially transmitted to multiple vehicles, which use their respective sub-keys (secret shares) to perform partial decryption. After multiple partial decryptions, the cloud obtains the sum of decrypted local prototype vectors and calculates the global prototype vector to complete the federated learning. This invention protects the privacy of data from federated learning participants (vehicles) through a multi-key semi-homomorphic encryption algorithm and the Gaussian mechanism in differential privacy, addressing threats such as reconstruction attacks, poisoning attacks, and member inference attacks, thereby improving the security of federated learning in vehicle-to-everything (V2X) networks. Furthermore, a practical case analysis in a V2X scenario shows that the federated learning method of this invention is applicable to both local and joint training processes for vehicles, effectively finding the convergence direction of the local model without leaking local vehicle data. Attached Figure Description
[0065] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will now be described in further detail with reference to the accompanying drawings, wherein:
[0066] Figure 1 An overall architecture diagram of a federated learning method for privacy and security in the Internet of Vehicles;
[0067] Figure 2This is a schematic diagram of the environment for a real-world case study;
[0068] Figure 3 This is a schematic diagram illustrating non-independent and identically distributed data. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but only to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0070] It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the figures, or the orientation or positional relationship commonly used when the product is in use. They are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance. In addition, the terms "horizontal," "vertical," etc., do not mean that the component is required to be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted. In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0071] The following detailed explanation illustrates the specific implementation methods:
[0072] Example:
[0073] This embodiment discloses a federated learning method for privacy and security in the Internet of Vehicles.
[0074] like Figure 1 As shown, the federated learning method for privacy and security in connected vehicles includes:
[0075] S1: (Cloud) Generate public and private keys, divide the private key into a corresponding number of subkeys, and then distribute the public key and the corresponding subkeys to each vehicle participating in federated learning;
[0076] S2: (Vehicle) obtains the global prototype vector of federated learning (roadside units send the global prototype vector to the vehicle); then trains the local model based on local data and the global prototype vector, and calculates the local prototype vector for each type of data; finally, the local prototype vector is encrypted using the public key to generate an encrypted local prototype vector.
[0077] S3: (Roadside unit or cloud) Performs homomorphic addition on the encrypted local prototype vectors of each vehicle to generate the sum of the encrypted local prototype vectors;
[0078] S4: (Roadside unit or cloud) Randomly select a preset number of vehicles and send the sum of encrypted local prototype vectors to each vehicle in turn, so that each vehicle can partially decrypt the sum of encrypted local prototype vectors in turn based on its own subkey until the sum of local prototype vectors is completely decrypted.
[0079] S5: (Roadside unit or cloud) Calculates the global prototype vector based on the sum of local prototype vectors and distributes it to each vehicle participating in federated learning;
[0080] S6: Repeat steps S2 to S5 until the local models for each vehicle converge.
[0081] In this invention, the cloud (or roadside unit) does not directly collect vehicle data, but only collects the latest local prototypes. Each vehicle participating in federated learning trains its local model based on local data and global prototype vectors distributed from the cloud. After training, the local prototype vector for each type of data is calculated and uploaded to update the global prototype vectors stored in the cloud. On the one hand, this invention can ensure the effectiveness of machine learning and model training in the Internet of Vehicles (IoV) scenario through federated learning, and can break down data silos between vehicles, thereby helping to improve the analysis and processing capabilities of intelligent services provided by IoV, ultimately realizing intelligent traffic management, intelligent dynamic information services, and intelligent vehicle control. On the other hand, this invention adopts a prototype-based and model-heterogeneous federated learning aggregation method, reducing the number of parameters transmitted during communication, alleviating the model heterogeneity problem in federated learning, and allowing terminals (vehicles) with limited computing resources to participate in federated learning, thereby improving the effectiveness of IoV federated learning.
[0082] In this invention, the cloud generates public and private keys and divides the private key into corresponding sub-keys, distributing them to each vehicle participating in federated learning. Each vehicle calculates a local prototype vector for each data type and encrypts it. The cloud (or roadside unit) directly performs homomorphic addition on the encrypted local prototype vectors to generate a sum of encrypted local prototype vectors. This sum is then sequentially transmitted to multiple vehicles, which use their respective sub-keys (secret shares) to perform partial decryption. After multiple partial decryptions, the cloud obtains the sum of decrypted local prototype vectors and calculates the global prototype vector to complete the federated learning. This invention protects the privacy of data from federated learning participants (vehicles) through a multi-key semi-homomorphic encryption algorithm and the Gaussian mechanism in differential privacy, addressing threats such as reconstruction attacks, poisoning attacks, and member inference attacks, thereby improving the security of federated learning in vehicle-to-everything (V2X) networks. Furthermore, a practical case analysis in a V2X scenario shows that the federated learning method of this invention is applicable to both local and joint training processes for vehicles, effectively finding the convergence direction of the local model without leaking local vehicle data.
[0083] In practical applications, the vehicle, roadside unit, and cloud constitute the Internet of Vehicles (IoV), playing the roles of terminal, aggregation device, and trusted third party, respectively. Figure 2 As shown.
[0084] In practice, a trusted third party generates public and private keys, and a secret sharing algorithm is used to divide the private key into multiple secret shares (i.e., subkeys). Then, the trusted third party distributes the public key and the divided secret shares to each vehicle.
[0085] In this embodiment, when the cloud receives requests from n vehicles, it runs the Paillier algorithm to generate a public-private key (pk, sk), and then performs Shamir secret partitioning on the private key sk: sk = {sk1, ..., sk}. n Finally, it returns the public key pk and the secret share sk. i Send to vehicle i.
[0086] Table 1. Algorithm flow of federated learning method
[0087]
[0088] Based on Table 1, the public and private keys are generated through the following steps:
[0089] S101: Choose two large prime numbers p and q such that p ≠ q, and calculate the integer n;
[0090] The formula is described as follows:
[0091] n = p * q;
[0092] N = n 2 ;
[0093] S102: Calculate the least common multiple λ of p-1 and q-1;
[0094] The formula is described as follows:
[0095] λ = lcm(p-1, q-1);
[0096] Where lcm is the least common multiple function;
[0097] S103: Select a positive integer g less than N such that gcd(g λ mod N,n)=1;
[0098] Where gcd is the greatest common divisor function, and it exists μ=L(g λ mod n 2 ) -1 mod n;
[0099] S104: Generate public and private keys;
[0100] Public key: pk = (n, g); Private key: sk = (λ, μ).
[0101] The public and private keys generated by the above steps in this invention are semantically secure. Semantic security means that without obtaining the private key, an attacker cannot deduce any useful information from the plaintext through the ciphertext, thereby helping to improve the security of vehicle network federated learning.
[0102] The private key is split using the following steps:
[0103] S111: Set the threshold t and construct a t-degree polynomial f(x);
[0104] In this embodiment, setting the threshold t ensures that at least t participants are required to complete the decryption operation.
[0105] The formula description is:
[0106] f(x) = sk + a1 * x + a2 * x 2 + … + a t-1 * x t-1 ;
[0107] where f(0) = sk; a1 to a t-1 are random integers satisfying a i < sk; r is a random integer satisfying n > t;
[0108] S112: Define the holders corresponding to n vehicles as P1, P2 … P n , P i The sub-key assigned to is sk i = f(i).
[0109] Finally, send (pk, sk i ) to the corresponding vehicle i participating in federated learning.
[0110] In the specific implementation process, the vehicle trains the local model according to the local data and calculates the local prototype vector of each category of data. When encrypting the local prototype vector, first apply the Gaussian mechanism to add the scaled noise to the local prototype vector, then use the public key to encrypt the local prototype vector, and finally upload the encrypted local prototype vector to the cloud.
[0111] Specifically:
[0112] 1) The vehicle i has a good current network status and sends requests to the cloud and the roadside unit to participate in federated learning.
[0113] 2) The roadside unit receives the request from vehicle i and sends the global prototype vector to vehicle i.
[0114] 3) Vehicle i receives the global prototype The loss function optimizes the parameter φ i of the h function and the parameter v i of the g i function according to the local data D i and the global prototype vector i and calculates the local prototype vector of each data category (i represents vehicle i, j represents the data category).
[0115] 4) Vehicle i first uses the Gaussian mechanism in differential privacy to give a local prototype vector. Adding noise scaled down by t-1 yields the local prototype vector of the noise. Then, use the public key pk to complete the encryption and obtain the encrypted local prototype vector. Send encrypted local prototype vector To the roadside unit.
[0116] Vehicle local data D i =(X i ,Y i ), where X i =(x i1 ,x i2 ,…,x in ), Y i =(y i1 ,y i2 ,…,y in ); X i Y represents the sample (feature data) of vehicle i. i This represents the label data for vehicle i, where i represents the vehicle's serial number, i = 1, 2, ..., n, n ∈ R. However, in real-world vehicle networking scenarios, different local datasets D... i The number of its data categories |Y i |and the number of samples in each data category|X i The data are not identical; this phenomenon is called non-independent and identically distributed data, such as... Figure 3 As shown.
[0117] The vehicle trains the local model through the following steps:
[0118] S201: Sample x and label y belong to local data D i That is, (x,y)∈D i Vehicle i according to parameter φ i h i The function computes the local prototype vector of sample x, and based on the parameter v i g of the transformation i The function calculates the prediction results;
[0119] The formula is described as follows:
[0120]
[0121] In the formula: Represents the local prototype vector of vehicle i; Indicates the prediction result; D i,j h represents the j-th type of local data for vehicle i; iThis represents the dimensionality reduction part in the local model of vehicle i. The role of this dimensionality reduction part is to perform dimensionality reduction processing on the input high-dimensional feature data; g i This represents the prediction part in the local model of vehicle i. The role of the prediction part is to predict low-dimensional feature data.
[0122] S202: Vehicle i optimizes the parameters φ of its local model using the backpropagation algorithm based on the loss function. i and parameter v i ;
[0123] The loss function is expressed as:
[0124]
[0125] In the formula: L represents the loss function of the local model; L S L represents the supervised loss function; R Represents a regular term; |C| represents the global prototype vector of class j; |C| represents the number of types of local prototype vectors; D i Let N represent the i-th local dataset; N represents the number of samples in all local datasets; N j This represents the number of samples of class j in all local datasets.
[0126] Generate the encrypted local prototype vector using the following steps:
[0127] S211: Local prototype vector of vehicle i Add Gaussian noise to generate a local prototype vector of noise;
[0128] The formula is described as follows:
[0129]
[0130] In the formula: Represents the local prototype vector of noise; Represents the local prototype vector of vehicle i; This indicates that the expected value is 0 and the standard deviation is 0. Gaussian noise; σ represents the sensitivity of the local model; σ represents the noise variance; t represents the threshold for participating in decryption.
[0131] S212: Noise local prototype vector of vehicle i via public key pk Encryption is performed, generating an encrypted local prototype vector;
[0132] The formula is described as follows:
[0133]
[0134] In the formula: Represents the encrypted local prototype vector; represents the local prototype vector of noise; Enc represents the encryption function.
[0135] Finally, the encrypted local prototype vector of vehicle i is obtained. And send it to the cloud.
[0136] When encrypting the local prototype vector, this invention first applies a Gaussian mechanism to add scaled noise to the local prototype vector, and then uses a public key to encrypt the local prototype vector. This can protect the privacy of data of federated learning participants (vehicles) through a multi-key semi-homomorphic encryption algorithm and the Gaussian mechanism in differential privacy, and can solve threats such as reconstruction attacks, poisoning attacks, and member inference attacks, thereby further improving the security of federated learning in the Internet of Vehicles.
[0137] In practice, the cloud (or roadside unit) does not decrypt the encrypted local prototype vector. In the case of directly applying local prototype vectors of the same category j Perform a summation operation. Then randomly select n-t+1 vehicles and sequentially send the encrypted local prototype vector sum R, with vehicle i using a secret share sk. i Decryption is performed sequentially. The sum of local prototype vectors satisfying differential privacy for each of the n-t+1 vehicles is sent to the cloud, and the global prototype vector is calculated based on the sum of the local prototype vectors.
[0138] Specifically:
[0139] 1) The roadside unit receives encrypted local prototype vectors {R0} sent by n vehicles. j R1 j ,...,R n j}
[0140] 2) Based on the homomorphism of Paillier's algorithm, multiplication operations in ciphertext are mapped to addition operations in plaintext. After computation... The roadside unit obtains the sum of encrypted local prototype vectors R. j .
[0141] 3) The roadside unit randomly selects n-t+1 vehicles and sequentially sends the sum of encrypted local prototype vectors R. j .
[0142] 4) Vehicle i receives the sum of encrypted local prototype vectors R j Using its own subkey sk i Partial decryption is performed, and the decryption result is returned to the roadside unit.
[0143] 5) The roadside unit receives the fully decrypted sum of local vectors S j(but S) j Because it satisfies the property of differential privacy, the roadside unit cannot infer valid information.
[0144] 6) The roadside unit is based on the sum of local vectors S j Calculate the global prototype vector Send global prototype vector To nearby vehicles.
[0145] Homomorphic addition is performed using the following formula:
[0146]
[0147] In the formula: R j R represents the sum of encrypted local prototype vectors; n j This represents the encrypted local prototype vector of the nth vehicle.
[0148] Based on the homomorphism of the Paillier algorithm, multiplication operations on ciphertext are mapped to addition operations on plaintext.
[0149] Randomly select n-t+1 vehicles (where t is the threshold for participating in decryption), and sequentially send the sum of encrypted local prototype vectors to each vehicle. This allows complete decryption to be achieved through partial decryption by the n-t+1 vehicles in sequence.
[0150] Partial decryption of the sum of encrypted local prototype vectors is performed using the following formula:
[0151]
[0152] In the formula: R j S represents the sum of encrypted local prototype vectors; j sk represents the sum of the local prototype vectors after complete decryption; i represents the subkey of vehicle i; Dec represents the decryption function.
[0153] The global prototype vector is calculated using the following formula:
[0154]
[0155] In the formula: S represents the global prototype vector; j represents the sum of the local prototype vectors after complete decryption; n represents the number of vehicles participating in federated learning.
[0156] In this invention, the cloud (or roadside unit) directly performs multiplication on the encrypted local prototype vectors (i.e., adds the plaintext corresponding to the ciphertext) to generate a sum of encrypted local prototype vectors. This sum is then sequentially transmitted to multiple vehicles, which use a subkey (secret share) of their private key for partial decryption. After multiple partial decryptions, the cloud obtains the decrypted sum of local prototype vectors and calculates the global prototype vector to complete federated learning. Although the cloud can obtain the decrypted sum of local prototype vectors, this sum contains noise and satisfies differential privacy, preventing the cloud (or roadside unit) from inferring valid information. This better addresses threats such as reconstruction attacks, poisoning attacks, and member inference attacks, thereby further improving the security of vehicle-to-everything (V2X) federated learning.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit the technical solutions. Those skilled in the art should understand that any modifications or equivalent substitutions to the technical solutions of the present invention without departing from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.
Claims
1. A federated learning method for privacy and security in vehicle-to-everything (V2X) networks, characterized in that, include: S1: Generate public and private keys in the cloud, divide the private key into a corresponding number of subkeys, and then distribute the public key and the corresponding subkeys to each vehicle participating in federated learning; S2: For a single vehicle: First, obtain the global prototype vector of federated learning; then train the local model based on the local data and the global prototype vector, and calculate the local prototype vector for each class of data; finally, encrypt the local prototype vector using the public key to generate the encrypted local prototype vector. S3: The roadside unit or cloud performs homomorphic addition on the encrypted local prototype vectors of each vehicle to generate the sum of the encrypted local prototype vectors; S4: The roadside unit or cloud randomly selects a preset number of vehicles and sends the sum of encrypted local prototype vectors to each vehicle in turn, so that each vehicle can partially decrypt the sum of encrypted local prototype vectors in turn based on its own subkey until the sum of local prototype vectors is completely decrypted. S5: The roadside unit or cloud calculates the global prototype vector based on the sum of the local prototype vectors and distributes it to each vehicle participating in federated learning. S6: Repeat steps S2 to S5 until the local models for each vehicle converge.
2. The federated learning method for privacy and security in vehicle networking as described in claim 1, characterized in that, In step S1, public and private keys are generated through the following steps: S101: Choose two large prime numbers p and q such that p ≠ q, and calculate the integer n; The formula is described as follows: n = p * q; N=n 2 ; S102: Calculate the least common multiple λ of p-1 and q-1; The formula is described as follows: λ = lcm(p-1, q-1); Where lcm is the least common multiple function; S103: Select a positive integer g less than N such that gcd(g λ mod N,n)=1; Where gcd is the greatest common divisor function, and it exists μ=L(g λ mod n 2 ) -1 mod n; S104: Generate public and private keys; Public key: pk = (n, g); Private key: sk = (λ, μ).
3. The federated learning method for privacy and security in vehicle networking as described in claim 2, characterized in that, The private key is split using the following steps: S111: Set a threshold t and construct a polynomial f(x) of degree t; The formula is described as follows: f(x)=sk+a1*x+a2*x 2 +…+a t-1 *x t-1 ; Where f(0) = sk; a1 to a t-1 Let be a random integer, satisfying a i <sk,n> t; S112: Define the owners of n vehicles as P1, P2...P... n P i The assigned subkey is sk i =f(i).
4. The federated learning method for privacy and security in vehicle networking as described in claim 1, characterized in that, In step S2, the vehicle's local data D i =(X i ,Y i ), where X i =(x i1 ,x i2 ,…,x in ), Y i =(y i1 ,y i2 ,…,y in ); X i Y represents the sample of vehicle i. i The label data represents vehicle i, where i represents the vehicle number, i = 1, 2, ..., n ∈ R.
5. The federated learning method for privacy and security in vehicle networking as described in claim 1, characterized in that, In step S2, the vehicle trains the local model through the following steps: S201: Sample x and label y belong to the local data D of the vehicle. i Vehicle i according to parameter φ i h i The function computes the local prototype vector of sample x, and based on the parameter v i g of the transformation i The function calculates the prediction results; The formula is described as follows: In the formula: Represents the local prototype vector of vehicle i; Indicates the prediction result; D i,j h represents the j-th type of local data for vehicle i; i g represents the dimensionality reduction part of the local model of vehicle i; i This represents the prediction portion in the local model for vehicle i; S202: Vehicle i optimizes the parameters φ of its local model using the backpropagation algorithm based on the loss function. i and parameter v i ; The loss function is expressed as: In the formula: L represents the loss function of the local model; L S L represents the supervised loss function; R Represents a regular term; |C| represents the global prototype vector of class j; |C| represents the number of types of local prototype vectors; D i Let N represent the i-th local dataset; N represents the number of samples in all local datasets; N j This represents the number of samples of class j in all local datasets.
6. The federated learning method for privacy and security in vehicle networking as described in claim 5, characterized in that, In step S2, the encrypted local prototype vector is generated through the following steps: S211: Local prototype vector of vehicle i Add Gaussian noise to generate a local prototype vector of noise; The formula is described as follows: In the formula: r i j Represents the local prototype vector of noise; Represents the local prototype vector of vehicle i; This indicates that the expected value is 0 and the standard deviation is 0. Gaussian noise; σ represents the sensitivity of the local model; σ represents the noise variance; t represents the threshold for participating in decryption. S212: Using the public key pk to obtain the noise local prototype vector r of vehicle i i j Encryption is performed to generate an encrypted local prototype vector; The formula is described as follows: In the formula: Represents the encrypted local prototype vector; r i j represents the local prototype vector of noise; Enc represents the encryption function.
7. The federated learning method for privacy and security in vehicle networking as described in claim 1, characterized in that, In step S3, homomorphic addition is performed using the following formula: In the formula: R j R represents the sum of encrypted local prototype vectors; n j This represents the encrypted local prototype vector of the nth vehicle.
8. The federated learning method for privacy and security in vehicle networking as described in claim 1, characterized in that, In step S4, n-t+1 vehicles are randomly selected, and the sum of encrypted local prototype vectors is sent to each vehicle in turn.
9. The federated learning method for privacy and security in vehicle networking as described in claim 1, characterized in that, In step S4, the sum of the encrypted local prototype vectors is partially decrypted using the following formula: In the formula: R j S represents the sum of encrypted local prototype vectors; j sk represents the sum of the local prototype vectors after complete decryption; i represents the subkey of vehicle i; Dec represents the decryption function.
10. The federated learning method for privacy and security in vehicle networking as described in claim 1, characterized in that, In step S5, the global prototype vector is calculated using the following formula: In the formula: S represents the global prototype vector; j represents the sum of the local prototype vectors after complete decryption; n represents the number of vehicles participating in federated learning.
Citation Information
Patent Citations
Intelligent traffic path planning method based on federated learning and digital twinning
CN112700639A
Federated learning training data privacy enhancement method and system
CN110572253A
Federal learning privacy protection method based on homomorphic encryption
CN113434873A