Federal learning-based model aggregation method, device and system

Through private data exchange and masking technology between the vehicle ends of new energy vehicles, the problems of data security and efficiency in federated learning are solved, safe and efficient model aggregation and error recovery are achieved, and autonomous driving and intelligent services are ensured. data integrity and accuracy in.

CN119168087APending Publication Date: 2024-12-20CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411212364.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In fields such as autonomous driving and intelligent services, new energy vehicles need to process a large amount of privacy-sensitive data, and existing technologies are difficult to find a balance between security and efficiency, especially in vehicle-side environments with limited resources, traditional federated learning methods exist. Problems of high computational overhead, loss of model accuracy or large usage of communication resources.

Method used

By establishing a communication link between the vehicle ends and using private data exchange and masking technology to safely and efficiently exchange and aggregate model data, ensuring information security and avoiding gradient leakage, an error recovery mechanism is designed to deal with data loss or tampering.

Benefits of technology

It realizes the solution to information security problems in the federated learning process, avoids gradient leakage and gradient attacks, maintains the accuracy and efficiency of the model, and provides a data recovery mechanism when abnormal situations occur, ensuring the integrity of the training results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168087A_ABST
    Figure CN119168087A_ABST
Patent Text Reader

Abstract

The invention provides a federated learning-based model aggregation method, device and system, and the method comprises the steps: receiving an initial global model issued by a server; training the initial global model by adopting local data of the first vehicle end to obtain first vehicle end model data; the first vehicle end model data and a second vehicle end are exchanged to obtain second vehicle end model data of the second vehicle end, the first vehicle end model data and the second vehicle end model data are adopted to generate first model aggregation data, and the first vehicle end and the second vehicle end are participating ends of federal training; and sending the first model aggregation data to the server, so that the server performs aggregation to obtain the target global model. According to the embodiment of the invention, through model data exchange among a plurality of vehicle ends participating in federated training, the danger of gradient leakage and gradient attack in the transmission process of federated learning can be avoided, and the technical problem of low safety of transmitting the model data of the federated training in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a model aggregation method, device and system based on federated learning. Background Art

[0002] Among the related technologies, with the development of the fifth generation of mobile communication technology and big data technology, artificial intelligence technology has made a major breakthrough. Many amazing AI models have emerged, and it can be foreseen that artificial intelligence will become an indispensable auxiliary tool in people's lives in the future. After the birth of new energy vehicles, with the trend of informatization of new energy vehicles, artificial intelligence technology will also be gradually applied to the electric vehicle industry, such as AI driving, human-computer interaction, etc. For personalized services such as autonomous driving and intelligent services, terminals need to provide a large amount of privacy-sensitive data for training. These data are often distributed on different terminals and have the characteristics of non-independent and identically distributed and highly sensitive. How to use these data safely and efficiently has become a problem that needs to be solved urgently.

[0003] A federated learning framework is proposed in related technologies, that is, different companies or institutions can train the model by integrating the local data sets of each client without transmitting training data to obtain a global model. As for the transmitted model data, it can be divided into three categories according to different protection methods. That is, secure multi-party computing, homomorphic encryption, differential privacy and other security technologies. However, the overhead of these methods is not small. Homomorphic encryption has the highest security, but the computational overhead caused by encryption and decryption is inevitable. It is not suitable for the vehicle-side environment with limited resources, and the specific security level cannot be determined. Although differential privacy technology can accurately define the confidentiality level, it will cause irreversible loss to the accuracy of the model. Although secure multi-party computing will not introduce losses, it requires a considerable communication overhead, which seriously occupies the network communication resources of the car.

[0004] With respect to the above-mentioned problems existing in the related technologies, no efficient and accurate solutions have been found yet. Summary of the invention

[0005] The present invention provides a model aggregation method, device and system based on federated learning to solve technical problems in related technologies.

[0006] According to one embodiment of the present invention, a model aggregation method based on federated learning is provided, which is applied to a first vehicle end, and includes: receiving an initial global model sent by a server; using local data of the first vehicle end to train the initial global model to obtain first vehicle end model data; using the first vehicle end model data to exchange with a second vehicle end to obtain second vehicle end model data of the second vehicle end, and using the first vehicle end model data and the second vehicle end model data to generate first model aggregation data, wherein the first vehicle end and the second vehicle end are both participating ends of the federated training; sending the first model aggregation data to the server, so that the server aggregates to obtain the target global model.

[0007] Optionally, the method of exchanging the first vehicle-end model data with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end includes: determining the tag category to which the first vehicle-end belongs; broadcasting a connection request to adjacent clients; receiving a reply message returned by the second vehicle-end in response to the connection request; adding the second vehicle-end to the neighbor set of the first vehicle-end; establishing a communication link between the first vehicle-end and the second vehicle-end for the second vehicle-end in the neighbor set; and based on the communication link, exchanging the first vehicle-end model data with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end.

[0008] Optionally, using the first vehicle-end model data to exchange with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end includes: splitting the first vehicle-end model data into multiple sub-data based on the number of vehicle-ends in the neighbor set, wherein each vehicle-end in the neighbor set corresponds to a sub-data; selecting target sub-data corresponding to the second vehicle-end from the multiple sub-data; sending first privacy data to the second vehicle-end based on the communication link, wherein the first privacy data includes the target sub-data; receiving second privacy data returned by the second vehicle-end based on the first privacy data, wherein the second privacy data includes the second vehicle-end model data; returning third privacy data to the second vehicle-end based on the second privacy data, wherein the third privacy data includes the first vehicle-end model data.

[0009] Optionally, sending the first privacy data to the second vehicle end includes: randomly generating a first mask having the same data size as the target sub-data; fusing the first mask and the target sub-data to generate the first privacy data; and sending the first privacy data to the second vehicle end.

[0010] Optionally, receiving second privacy data returned by the second vehicle end based on the first privacy data includes: receiving second privacy data returned by the second vehicle end based on the first privacy data, wherein the second privacy data includes the first privacy data, a second mask, and the second vehicle end model data, the second mask is randomly generated by the second vehicle end, and the second vehicle end model data; extracting the second vehicle end model data from the second privacy data.

[0011] Optionally, extracting the second vehicle-side model data from the second privacy data includes: randomly splitting the second privacy data into exchange data and mask data, wherein the mask data includes a first mask and a second mask corresponding to the first vehicle-side; and determining the exchange data as the second vehicle-side model data.

[0012] Optionally, returning third privacy data to the second vehicle end based on the second privacy data includes: removing the first mask from the mask data to obtain third privacy data; sending the third privacy data to the second vehicle end so that the second vehicle end obtains the first vehicle end model data exchanged with the first vehicle end from the third privacy data.

[0013] According to one embodiment of the present invention, another model aggregation method based on federated learning is provided, which is applied to a server, including: receiving multiple model aggregation data uploaded by multiple vehicle terminals participating in federated learning, wherein each vehicle terminal uploads a copy of model aggregation data, and each copy of model aggregation data includes vehicle terminal model data obtained by local training of at least two vehicle terminals; detecting whether there is an abnormal vehicle terminal with abnormal model aggregation data; if there is no abnormal vehicle terminal, using the multiple model aggregation data to reconstruct and generate a first target global model.

[0014] Optionally, after detecting whether there is an abnormal vehicle end with abnormal model aggregation data, the method also includes: if there is an abnormal vehicle end, sending an abnormality elimination message to all vehicle ends participating in federated learning, wherein the abnormality elimination message carries the vehicle end identification of the abnormal vehicle end; receiving a data difference sent by a linked vehicle end that exchanges data with the abnormal vehicle end, wherein the data difference is used to represent the data difference between the linked vehicle end and the abnormal vehicle end after the model data is exchanged with the abnormal vehicle end; and reconstructing and generating a second target global model using the multiple model aggregation data and the data difference.

[0015] Optionally, using the multiple models to aggregate data and the data difference to reconstruct and generate a second target global model includes: using the following formula to calculate and reconstruct the second target global model W G : Among them, S jis the set of all linked vehicle terminals j that exchange data with the abnormal vehicle terminal i, w t ′ is the model aggregation data uploaded by vehicle t participating in federated learning, wi′ is the model aggregation data uploaded by abnormal vehicle i, and d ji is the data difference between the linked vehicle j and the abnormal vehicle i after the model data is exchanged, and n is the number of vehicles participating in federated learning.

[0016] According to another embodiment of the present invention, a model aggregation device based on federated learning is provided, which is applied to a first vehicle end, and includes: a receiving module, used to receive an initial global model sent by a server; a training module, used to train the initial global model using local data of the first vehicle end to obtain first vehicle end model data; an exchange module, used to exchange the first vehicle end model data with the second vehicle end to obtain second vehicle end model data of the second vehicle end, and use the first vehicle end model data and the second vehicle end model data to generate first model aggregation data, wherein the first vehicle end and the second vehicle end are both participating ends of the federated training; an aggregation module, used to send the first model aggregation data to the server, so that the server aggregates to obtain the target global model.

[0017] Optionally, the exchange module includes: a determination unit for determining the label category to which the first vehicle terminal belongs; a broadcast unit for broadcasting a connection request to adjacent clients; a receiving unit for receiving a reply message returned by the second vehicle terminal in response to the connection request; an adding unit for adding the second vehicle terminal to the neighbor set of the first vehicle terminal; an establishing unit for establishing a communication link between the first vehicle terminal and the second vehicle terminal for the second vehicle terminal in the neighbor set; and an exchange unit for exchanging the first vehicle terminal model data with the second vehicle terminal based on the communication link to obtain the second vehicle terminal model data of the second vehicle terminal.

[0018] Optionally, the exchange unit includes: a splitting subunit, used to split the first vehicle-end model data into multiple sub-data based on the number of vehicle-ends in the neighbor set, wherein each vehicle-end in the neighbor set corresponds to a sub-data; a selecting subunit, used to select target sub-data corresponding to the second vehicle-end from the multiple sub-data; a sending subunit, used to send first privacy data to the second vehicle-end based on the communication link, wherein the first privacy data includes the target sub-data; a receiving subunit, used to receive second privacy data returned by the second vehicle-end based on the first privacy data, wherein the second privacy data includes the second vehicle-end model data; and a returning subunit, used to return third privacy data to the second vehicle-end based on the second privacy data, wherein the third privacy data includes the first vehicle-end model data.

[0019] Optionally, the sending subunit is further used to: randomly generate a first mask having the same data size as the target sub-data; fuse the first mask and the target sub-data to generate first privacy data; and send the first privacy data to the second vehicle end.

[0020] Optionally, the receiving subunit is also used to: receive second privacy data returned by the second vehicle end based on the first privacy data, wherein the second privacy data includes the first privacy data, a second mask, and the second vehicle end model data, the second mask is randomly generated by the second vehicle end, and the second vehicle end model data; extract the second vehicle end model data from the second privacy data.

[0021] Optionally, the receiving subunit is also used to: randomly split the second privacy data into exchange data and mask data, wherein the mask data includes a first mask and a second mask corresponding to the first vehicle end; and determine the exchange data as the second vehicle end model data.

[0022] Optionally, the receiving subunit is also used to: remove the first mask from the mask data to obtain third privacy data; send the third privacy data to the second vehicle end so that the second vehicle end obtains the first vehicle end model data exchanged with the first vehicle end from the third privacy data.

[0023] According to another embodiment of the present invention, another model aggregation device based on federated learning is provided, which is applied to a server and includes: a receiving module, used to receive multiple model aggregation data uploaded by multiple vehicle terminals participating in federated learning, wherein each vehicle terminal uploads a set of model aggregation data, and each set of model aggregation data includes vehicle terminal model data obtained by local training of at least two vehicle terminals; a detection module, used to detect whether there is an abnormal vehicle terminal with abnormal model aggregation data; and a first reconstruction module, used to reconstruct and generate a first target global model using the multiple model aggregation data if there is no abnormal vehicle terminal.

[0024] Optionally, the device also includes: a sending module, which is used to send an abnormality elimination message to all vehicle terminals participating in federated learning after the detection module detects whether there is an abnormal vehicle terminal with abnormal model aggregation data. If there is an abnormal vehicle terminal, the abnormality elimination message carries the vehicle terminal identification of the abnormal vehicle terminal; a receiving module, which is used to receive a data difference sent by a linked vehicle terminal that exchanges data with the abnormal vehicle terminal, wherein the data difference is used to represent the data difference between the linked vehicle terminal and the abnormal vehicle terminal after the model data is exchanged with the abnormal vehicle terminal; a second reconstruction module, which is used to reconstruct and generate a second target global model using the multiple model aggregation data and the data difference.

[0025] Optionally, the second reconstruction module includes: a generation unit, configured to calculate and reconstruct the second target global model using the following formula: Among them, S j is the set of all linked vehicle terminals j that exchange data with the abnormal vehicle terminal i, w t ′ is the model aggregation data uploaded by vehicle t participating in federated learning, wi′ is the model aggregation data uploaded by abnormal vehicle i, and d ji is the data difference between the linked vehicle j and the abnormal vehicle i after the model data is exchanged, and n is the number of vehicles participating in federated learning.

[0026] According to another aspect of an embodiment of the present application, a model aggregation system based on federated learning is also provided, including a first vehicle end, a second vehicle end, and a server, wherein the first vehicle end includes the device as described in the above embodiment; the server is communicatively connected to the first vehicle end and the second vehicle end, and includes the device as described in the above embodiment.

[0027] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.

[0028] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.

[0029] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.

[0030] Beneficial effects of the present invention:

[0031] 1. Through the exchange of model data between multiple participants, the information security issues in the process of federated learning are resolved, and the risks of gradient leakage and gradient attack in the transmission process of federated learning can be avoided. The additional security processing operations will not cause damage to data accuracy, and the final expected model results are lossless compared to the normal execution results;

[0032] 2. An error recovery mechanism is designed. When abnormal situations such as data loss or tampering occur during the interaction process, this mechanism can be used to eliminate the impact of the error and avoid the failure of the current round of training due to the destruction of results. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0034] Figure 1 is a hardware structure block diagram of a car according to an embodiment of the present invention;

[0035] Figure 2 is a flow chart of a model aggregation method based on federated learning according to an embodiment of the present invention;

[0036] Figure 3 is a flow chart of gradient privacy exchange between participating vehicles in an embodiment of the present invention;

[0037] Figure 4 is a flow chart of establishing a connection between two vehicle ends for privacy exchange in an embodiment of the present invention;

[0038] Figure 5 is a flowchart of another model aggregation method based on federated learning according to an embodiment of the present invention;

[0039] Figure 6 is a data recovery flow chart when the transmitted model data is abnormal in an embodiment of the present invention;

[0040] Figure 7 is an overall execution flow chart of an embodiment of the present invention;

[0041] Figure 8 is a structural block diagram of a model aggregation device based on federated learning according to an embodiment of the present invention;

[0042] Fig. 9 It is a structural block diagram of another model aggregation device based on federated learning according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0045] Example 1

[0046] The method embodiment provided in the first embodiment of the present application can be executed in a car, a server, a controller or a similar processing device. Taking running on a car as an example, Figure 1 1 is a hardware structure diagram of a car according to an embodiment of the present invention. Figure 1 As shown, a car may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above-mentioned automobile may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above-mentioned automobile. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0047] The memory 104 can be used to store automobile programs, for example, software programs and modules of application software, such as an automobile program corresponding to a model aggregation method based on federated learning for an automobile in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the automobile program stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the automobile via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0048] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the car. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0049] In this embodiment, a model aggregation method based on federated learning is provided, which is applied to the first vehicle side. Figure 2 is a flow chart of a model aggregation method based on federated learning according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0050] Step S202, receiving the initial global model sent by the server;

[0051] The federated learning architecture of this embodiment includes a server and multiple car clients (car ends).

[0052] Step S204, using the local data of the first vehicle end to train the initial global model to obtain first vehicle end model data;

[0053] Optionally, the initial global model is the model in the server completed in the previous round of federated learning training. The first vehicle-side model data is the gradient data scattered on the first vehicle-side. Each vehicle-side participating in the training will obtain a copy of the gradient data, which is aggregated on the server to obtain the global model.

[0054] When the first vehicle is training locally, the server at the center will select a group of users as participants in this round of training based on the current availability of the vehicle, the idleness of the vehicle's computing resources, and whether the owner is willing to participate in the optimization model. These users will receive the global model W that needs to be trained from the server. G , and determine the loss function L() to be used. After receiving the global model, the computing unit on the vehicle side optimizes the model through the back propagation algorithm based on the local data set {x, y} generated by the recent automatic recording of the car while driving (i.e. the environmental information x collected by the car and the current behavior y). The optimization target can be expressed as:

[0055]

[0056] Among them, the loss function L() can usually be measured using cross entropy:

[0057]

[0058] n i is the size of the local dataset of participant i, K is the total number of categories included, for sample j, y jk The value of depends on its corresponding label. When the category corresponding to sample j is k, y jk The value of y is 1, otherwise jk The value is 0. jk is the prediction result given by the model, indicating the probability that the model considers sample j to be of category k. After multiple rounds of local training, the vehicles participating in the training obtain a locally optimal model. Before proceeding to the next step, the obtained model needs to be compressed.

[0059] Step S206, using the first vehicle-side model data to exchange with the second vehicle-side model data to obtain the second vehicle-side model data of the second vehicle-side, and using the first vehicle-side model data and the second vehicle-side model data to generate first model aggregation data, wherein the first vehicle-side and the second vehicle-side are both participating terminals of the federated training;

[0060] Optionally, the second vehicle end may be one or more, and the model data exchanged between the first vehicle end and the second vehicle end may be part or all of the model data completed by local training.

[0061] Step S208: sending the first model aggregation data to the server so that the server aggregates the data to obtain a target global model.

[0062] Through the above steps, the initial global model sent by the server is received; the local data of the first vehicle end is used to train the initial global model to obtain the first vehicle end model data; the first vehicle end model data is exchanged with the second vehicle end to obtain the second vehicle end model data of the second vehicle end, and the first vehicle end model data and the second vehicle end model data are used to generate first model aggregate data, wherein the first vehicle end and the second vehicle end are both participating ends of the federated training; the first model aggregate data is sent to the server so that the server aggregates and obtains the target global model. By exchanging model data between multiple vehicle ends participating in the federated training, the risk of gradient leakage and gradient attack during the transmission process of federated learning can be avoided, and the technical problem of low security of model data transmitted for federated training in related technologies is solved.

[0063] In one implementation of the present embodiment, the use of the first vehicle-end model data to exchange with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end includes: determining the tag category to which the first vehicle-end belongs; broadcasting a connection request to adjacent clients; receiving a reply message returned by the second vehicle-end in response to the connection request; adding the second vehicle-end to the neighbor set of the first vehicle-end; for the second vehicle-end in the neighbor set, establishing a communication link between the first vehicle-end and the second vehicle-end; based on the communication link, the first vehicle-end model data is exchanged with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end.

[0064] When the training of a vehicle is completed, due to the privacy and security of data transmitted on the real channel, the training result gradient cannot be uploaded directly, and the calculation results need to be processed. Figure 3 This is a flow chart of gradient privacy exchange between participating vehicles in an embodiment of the present invention. A short communication connection will be established between adjacent nodes in the network to allow data exchange between different nodes. These exchange processes modify part of the data owned by each vehicle-side user while ensuring that the data remains unchanged, so that the exchange operations performed in this stage will not affect the final model results.

[0065] For all participants (cars), their own labels will be randomly marked with a probability of 50%. Through this operation, all participants will be automatically divided into two categories of A and B of equal size. Taking the first car as participant i and the second car as participant j as an example, assuming that participant i is of class A, then for participant i, a request to establish a connection will be sent to the adjacent user. If the user who receives the request is of class A, it can be directly discarded. If the user who receives the request is of class B, the request to establish a connection will be replied with a probability of p. At the same time, class B users will save the users who have successfully replied to their neighbor set, and for class A users, the users who have collected successful replies will be saved to their neighbor set. The probability p is a set hyperparameter used to adjust the burden caused by data interaction. When the p value is larger, the more connections are established between classes A and B, the robustness of the entire system will increase, and at the same time, the total communication overhead of all participants in the system during the exchange will also increase. Figure 4 This is a flow chart of establishing a connection between two vehicle ends for privacy exchange in an embodiment of the present invention. After the connection is established, privacy exchange will be performed for any communication connection.

[0066] In one example, using the first vehicle-side model data to exchange with the second vehicle-side model data to obtain the second vehicle-side model data of the second vehicle-side includes: splitting the first vehicle-side model data into multiple sub-data based on the number of vehicle-sides in the neighbor set, wherein each vehicle-side in the neighbor set corresponds to a sub-data; selecting target sub-data corresponding to the second vehicle-side from the multiple sub-data; sending first privacy data to the second vehicle-side based on the communication link, wherein the first privacy data includes the target sub-data; receiving second privacy data returned by the second vehicle-side based on the first privacy data, wherein the second privacy data includes the second vehicle-side model data; returning third privacy data to the second vehicle-side based on the second privacy data, wherein the third privacy data includes the first vehicle-side model data.

[0067] In order to exchange data with adjacent participants, it is necessary to divide the gradient data (vehicle-side model data) owned by oneself. For the i-th participant, it will divide the gradient data (vehicle-side model data) according to the neighbor set S connected to it. i The size of the model gradient data is divided into its own, assuming that the set S i The size of is n, and participant i will put the model data w he owns i After compression, it is randomly divided into n+1 parts, expressed as:

[0068]

[0069] where w ij represents the data that the i-th participant will exchange with the j-th participant, and w i0 It will be saved locally by participant i and will not be sent to other participants. Considering that the scheme will be calculated in the compressed domain later, the compression processing algorithm can use the compressed sensing algorithm.

[0070] Optionally, sending the first privacy data to the second vehicle end includes: randomly generating a first mask having the same data size as the target sub-data; fusing the first mask and the target sub-data to generate the first privacy data; and sending the first privacy data to the second vehicle end.

[0071] Optionally, receiving second privacy data returned by the second vehicle end based on the first privacy data includes: receiving second privacy data returned by the second vehicle end based on the first privacy data, wherein the second privacy data includes the first privacy data, a second mask, and the second vehicle end model data, the second mask is randomly generated by the second vehicle end, and the second vehicle end model data; extracting the second vehicle end model data from the second privacy data.

[0072] In one example, extracting the second vehicle-side model data from the second privacy data includes: randomly splitting the second privacy data into exchange data and mask data, wherein the mask data includes a first mask and a second mask corresponding to the first vehicle-side; and determining the exchange data as the second vehicle-side model data.

[0073] In one example, returning third privacy data to the second vehicle end based on the second privacy data includes: removing the first mask from the mask data to obtain third privacy data; sending the third privacy data to the second vehicle end so that the second vehicle end obtains the first vehicle end model data exchanged with the first vehicle end from the third privacy data.

[0074] In order to avoid introducing additional errors caused by the algorithm itself during the data exchange stage, the execution of the algorithm needs to ensure "equality". That is, for participants i and j who need to exchange data, they need to exchange data w. ij With data w ji 's transformation, and keep and unchanged, that is:

[0075] w ij +w ji =w i ' j +w j ' i ;

[0076] where w i ' j With w j ' i That is, the model data owned by both parties after the exchange. Next, the entire privacy exchange process will be described in detail. Take the exchange process between participant i and participant j as an example. Figure 3 As shown, it includes three data transmissions:

[0077] (1) First transmission: Participant i randomly generates a mask A The size of the mask is the same as the model data size. Based on the mask A Calculate the data containing the mask messenger1=w ij +mask A The result is signed and sent to participant j, and the mask mask A Save locally.

[0078] (2) Second transmission: When participant j receives the message messenger1 containing the mask, it first verifies its integrity based on the signature, and then randomly generates a mask based on the size of the model data. B, the data messenger2 containing the masks of the two participants is calculated. The calculation process of messenger2 is as follows:

[0079] messenger2=messenger1+w ji +mask B ;

[0080] After calculating messenger2, participant j will sign the calculation result messenger2 and send it to participant i, and save the mask mask locally. B .

[0081] (3) The third transmission: After participant i receives the data messenger2 containing two sets of masks and confirms the integrity, it randomly divides the model data into two parts, expressed as:

[0082] messenger2=w i ' j +w j ′;

[0083] Among them, w i ' j That is, the model data newly owned by participant i and w i ' j ≠w ij , which ensures that the changed parameters are different from the original data, and in w j ′ contains mask mask A With mask B Participant i then adds the mask he / she adds A Remove from the result, and you get messenger3 = w j ′-mask A . Then, messenger3 is signed and sent to participant j. After participant j receives messenger3 and passes the verification, he also sends his own mask mask B Remove it and you can get your new model data w j ' i , expressed as:

[0084] w j ' i =messenger3-mask B ;

[0085] Based on the above steps, it can be concluded that: for the model data owned by the two participants who exchanged data, the "unchanged" characteristics are maintained before and after the changes are executed, and no additional privacy information will be exposed to the other party during the exchange process.

[0086] The data exchange between all participants in this round of training can be carried out in parallel. For participant i, he will transfer his model data w i Partition i will save a portion of its data w locally. i0 , for the remaining n pieces of data w ij , and simultaneously exchange data with n corresponding participants. When all participants have completed data exchange, a round of global privacy protection exchange is completed.

[0087] In this embodiment, a model aggregation method based on federated learning is provided, which is applied to a server. Figure 5 is a flowchart of another model aggregation method based on federated learning according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:

[0088] Step S502, receiving multiple model aggregation data uploaded by multiple vehicle terminals participating in federated learning, wherein each vehicle terminal uploads a set of model aggregation data, and each set of model aggregation data includes vehicle terminal model data obtained by local training of at least two vehicle terminals;

[0089] Step S504, detecting whether there is an abnormal vehicle end with abnormal model aggregation data;

[0090] Step S506: If there is no abnormal vehicle end, the plurality of models are used to aggregate data and reconstruct a first target global model.

[0091] After the privacy-preserving exchange, all participants will get a new model data. Assume that the model data owned by the i-th participant after the exchange is represented as w i ′, participant i needs to process the model information w i ′ is uploaded to the central server. Since all data exchange operations maintain the same nature, the compressed global model finally aggregated by the central server does not introduce additional deviations. The vehicle-side model after a round of global training can be directly reconstructed. That is:

[0092]

[0093] Among them, reconstruction is the reconstruction algorithm in compressed sensing, which is used to reconstruct the original gradient. It can be noted that the model data received by the central server from each participant contains a large number of masks generated during interaction. It has been proved that when these masks are generated, their invariant characteristics are maintained, so these masks will automatically cancel each other out when aggregated. The aggregation process will not affect the final accuracy of the model. However, for any individual model data, the central server or the eavesdropper on the channel cannot obtain the real model based on the model data containing a large number of masks, thereby protecting the security of the model. After the above steps, the model has undergone a round of global training. After several rounds of global training, the final model will reach a convergence state, and the desired driving assistance model will be obtained.

[0094] In one implementation scenario, after detecting whether there is an abnormal vehicle end with abnormal model aggregation data, it also includes: if there is an abnormal vehicle end, sending an abnormality elimination message to all vehicle ends participating in federated learning, wherein the abnormality elimination message carries the vehicle end identification of the abnormal vehicle end; receiving a data difference sent by a linked vehicle end that exchanges data with the abnormal vehicle end, wherein the data difference is used to represent the data difference between the linked vehicle end and the abnormal vehicle end after the model data is exchanged; and reconstructing and generating a second target global model using the multiple model aggregation data and the data difference.

[0095] Optionally, if data transmitted by a vehicle end is lost, or the transmitted data verification fails (such as being tampered with during the transmission process), the vehicle end can be determined to be an abnormal vehicle end.

[0096] In one example, using the multiple model aggregation data and the data difference to reconstruct and generate the second target global model includes: using the following formula to calculate and reconstruct the second target global model W G : Among them, S j is the set of all linked vehicle terminals j that exchange data with the abnormal vehicle terminal i, w t ′ is the model aggregation data uploaded by vehicle t participating in federated learning, wi′ is the model aggregation data uploaded by abnormal vehicle i, and d ji is the data difference between the linked vehicle j and the abnormal vehicle i after the model data is exchanged, and n is the number of vehicles participating in federated learning.

[0097] Figure 6This is a data recovery flow chart when the model data transmitted in the embodiment of the present invention is abnormal. It is a data recovery flow chart when the transmitted model is tampered when the vehicle-side user uploads it to the central server. When it is detected that the received data has been tampered, the server will first try to request resending of the data. When the model tampering is detected three times in a row, the central server will directly discard the data from the participant and broadcast the sequence number i of the participant to all participants. For all users participating in the training, after receiving the sequence number i, they will query the data share corresponding to the participant i according to the user set connected to them, that is, w ji to w j ' i The difference between the changes is calculated as:

[0098] d ji =w ji -w j ' i ;

[0099] The calculated difference d ji Upload to the central server, the central server will collect all the difference data about participant i, when all d ju When all are collected, these differences can be used to remove the influence of participant j from the final result. The calculation formula can be expressed as:

[0100]

[0101] Where S j is the set of all participants j connected to participant i in this round of training, w t ′ is the model data uploaded by participant t.

[0102] Figure 7 This is the overall execution flow chart of the embodiment of the present invention, showing the steps to be performed in each round of training according to this solution, including three main stages, namely local training compression, gradient privacy exchange, and gradient reconstruction aggregation. It includes:

[0103] Selection of training participants: In each round, all users do not need to participate in the model training. Instead, the central server selects a group of users to participate. In this round of training, these users will have corresponding IDs to exchange information with each other. The ID value of each user will be updated in each round of training.

[0104] Security parameter exchange: All entities participating in the training will generate a set of public and private key pairs for signing. The integrity of the information will be confirmed at each transmission to ensure that the data has not been tampered with during the transmission process.

[0105] Model distribution: The server will distribute the initial model used in this training to all participants. After receiving the model, participants need to immediately confirm its integrity and proceed to the next step after confirming that it has not been tampered with.

[0106] Participants train their local models. Each participant trains the model based on the local data set, uses the cross entropy of the model prediction value as the loss function for iterative optimization, and trains using the gradient descent method to obtain a new model after multiple rounds of iterations.

[0107] Model update compression: obtain the gradient update of this round by comparing the new model of this round with the global model, first perform sparse processing on the update, and then use compressed sensing to compress it to obtain the compressed model update;

[0108] Gradient privacy exchange: Participants randomly establish connections to exchange private data. The exchange algorithm ensures that the privacy of data will not be leaked and equality is maintained during the exchange process, so that the exchange operation will not affect the final update aggregation result.

[0109] Gradient aggregation reconstruction: each participant sends the processed updates to the server, and the server aggregates the collected model updates to obtain a new round of global models. The model updates collected by the server are exchanged with each other, and it is no longer possible to infer the model updates of any participant.

[0110] Abnormal exclusion mechanism: During the global model aggregation process, when a participant is unable to upload his / her model update due to network or other problems, since other model updates have exchanged privacy with him / her, it cannot be discarded directly. Instead, the impact needs to be eliminated through the data of other users.

[0111] The scheme of this embodiment is applied in the federated learning framework. Through the protocol interaction between multiple participants, the information security problem in the process of federated learning is solved, and the risk of gradient leakage and gradient attack in the transmission process of federated learning can be avoided. In this scheme, secure multi-party technology is used to replace other privacy processing methods. Compared with the scheme based on homomorphic encryption technology, it has lower computational complexity and lower overhead. According to the sparse characteristics of model updates, a compression scheme is designed to improve channel utilization. When processing complex models, the improvement of channel communication efficiency will be more obvious. Compared with the scheme based on differential privacy technology, the additional security processing operations in this scheme will not cause damage to data accuracy, and the final expected model result is lossless compared to the normal execution result. Therefore, this scheme uses secure multi-party technology to protect the data security of federated learning during transmission, which can not only ensure the requirements on data accuracy, but also will not introduce complex calculation processes. In addition, in response to the problem of data loss due to the network during training, this scheme designs an error recovery mechanism. When unexpected data loss or tampering occurs during the interaction, this mechanism can be used to eliminate the impact of the error and avoid retrying the current round of training due to failed results.

[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0113] Example 2

[0114] In this embodiment, a model aggregation device and system based on federated learning are also provided, which are used to implement the above embodiments and preferred implementation modes, and those that have been described will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0115] Figure 8 is a structural block diagram of a model aggregation device based on federated learning according to an embodiment of the present invention, which is applied to a first vehicle end, such as Figure 8 As shown, the device comprises:

[0116] A receiving module 80 is used to receive an initial global model sent by a server;

[0117] A training module 82, configured to train the initial global model using the local data of the first vehicle end to obtain first vehicle end model data;

[0118] an exchange module 84, configured to exchange the first vehicle-side model data with the second vehicle-side model data to obtain the second vehicle-side model data of the second vehicle-side, and to generate first model aggregation data using the first vehicle-side model data and the second vehicle-side model data, wherein both the first vehicle-side and the second vehicle-side are participating terminals of the federated training;

[0119] The aggregation module 86 is used to send the first model aggregation data to the server so that the server aggregates the data to obtain a target global model.

[0120] Optionally, the exchange module includes: a determination unit for determining the label category to which the first vehicle terminal belongs; a broadcast unit for broadcasting a connection request to adjacent clients; a receiving unit for receiving a reply message returned by the second vehicle terminal in response to the connection request; an adding unit for adding the second vehicle terminal to the neighbor set of the first vehicle terminal; an establishing unit for establishing a communication link between the first vehicle terminal and the second vehicle terminal for the second vehicle terminal in the neighbor set; and an exchange unit for exchanging the first vehicle terminal model data with the second vehicle terminal based on the communication link to obtain the second vehicle terminal model data of the second vehicle terminal.

[0121] Optionally, the exchange unit includes: a splitting subunit, used to split the first vehicle-end model data into multiple sub-data based on the number of vehicle-ends in the neighbor set, wherein each vehicle-end in the neighbor set corresponds to a sub-data; a selecting subunit, used to select target sub-data corresponding to the second vehicle-end from the multiple sub-data; a sending subunit, used to send first privacy data to the second vehicle-end based on the communication link, wherein the first privacy data includes the target sub-data; a receiving subunit, used to receive second privacy data returned by the second vehicle-end based on the first privacy data, wherein the second privacy data includes the second vehicle-end model data; and a returning subunit, used to return third privacy data to the second vehicle-end based on the second privacy data, wherein the third privacy data includes the first vehicle-end model data.

[0122] Optionally, the sending subunit is further used to: randomly generate a first mask having the same data size as the target sub-data; fuse the first mask and the target sub-data to generate first privacy data; and send the first privacy data to the second vehicle end.

[0123] Optionally, the receiving subunit is also used to: receive second privacy data returned by the second vehicle end based on the first privacy data, wherein the second privacy data includes the first privacy data, a second mask, and the second vehicle end model data, the second mask is randomly generated by the second vehicle end, and the second vehicle end model data; extract the second vehicle end model data from the second privacy data.

[0124] Optionally, the receiving subunit is also used to: randomly split the second privacy data into exchange data and mask data, wherein the mask data includes a first mask and a second mask corresponding to the first vehicle end; and determine the exchange data as the second vehicle end model data.

[0125] Optionally, the receiving subunit is also used to: remove the first mask from the mask data to obtain third privacy data; send the third privacy data to the second vehicle end so that the second vehicle end obtains the first vehicle end model data exchanged with the first vehicle end from the third privacy data.

[0126] Fig. 9 is a structural block diagram of a model aggregation device based on federated learning according to an embodiment of the present invention, which is applied to a server, such as Fig. 9 As shown, the device comprises:

[0127] A receiving module 90 is used to receive a plurality of model aggregation data uploaded by a plurality of vehicle terminals participating in federated learning, wherein each vehicle terminal uploads a set of model aggregation data, and each set of model aggregation data includes vehicle terminal model data obtained by local training of at least two vehicle terminals;

[0128] A detection module 92, used to detect whether there is an abnormal vehicle end with abnormal model aggregation data;

[0129] The first reconstruction module 94 is used to reconstruct and generate a first target global model by aggregating data of the multiple models if there is no abnormal vehicle end.

[0130] Optionally, the device also includes: a sending module, which is used to send an abnormality elimination message to all vehicle terminals participating in federated learning after the detection module detects whether there is an abnormal vehicle terminal with abnormal model aggregation data. If there is an abnormal vehicle terminal, the abnormality elimination message carries the vehicle terminal identification of the abnormal vehicle terminal; a receiving module, which is used to receive a data difference sent by a linked vehicle terminal that exchanges data with the abnormal vehicle terminal, wherein the data difference is used to represent the data difference between the linked vehicle terminal and the abnormal vehicle terminal after the model data is exchanged with the abnormal vehicle terminal; a second reconstruction module, which is used to reconstruct and generate a second target global model using the multiple model aggregation data and the data difference.

[0131] Optionally, the second reconstruction module includes: a generation unit, configured to calculate and reconstruct the second target global model using the following formula: Among them, S j is the set of all linked vehicle terminals j that exchange data with the abnormal vehicle terminal i, w t ′ is the model aggregation data uploaded by vehicle t participating in federated learning, wi′ is the model aggregation data uploaded by abnormal vehicle i, and d ji is the data difference between the linked vehicle j and the abnormal vehicle i after the model data is exchanged, and n is the number of vehicles participating in federated learning.

[0132] The solution of this embodiment also provides a model aggregation system based on federated learning, including a first vehicle end, a second vehicle end, and a server, wherein the first vehicle end includes the above-mentioned Figure 8 The device; the server, which is connected to the first vehicle end and the second vehicle end in communication, includes the above Fig. 9 The device described.

[0133] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0134] Example 3

[0135] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0136] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0137] S1, receiving the initial global model sent by the server;

[0138] S2, using the local data of the first vehicle end to train the initial global model to obtain first vehicle end model data;

[0139] S3, using the first vehicle-side model data to exchange with the second vehicle-side model data to obtain the second vehicle-side model data of the second vehicle-side, and using the first vehicle-side model data and the second vehicle-side model data to generate first model aggregation data, wherein the first vehicle-side and the second vehicle-side are both participating terminals of the federated training;

[0140] S4, sending the first model aggregation data to the server, so that the server aggregates to obtain a target global model.

[0141] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0142] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0143] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0144] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0145] S1, receiving the initial global model sent by the server;

[0146] S2, using the local data of the first vehicle end to train the initial global model to obtain first vehicle end model data;

[0147] S3, using the first vehicle-side model data to exchange with the second vehicle-side model data to obtain the second vehicle-side model data of the second vehicle-side, and using the first vehicle-side model data and the second vehicle-side model data to generate first model aggregation data, wherein the first vehicle-side and the second vehicle-side are both participating terminals of the federated training;

[0148] S4, sending the first model aggregation data to the server, so that the server aggregates to obtain a target global model.

[0149] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0150] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0152] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0153] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A model aggregation method based on federated learning, characterized in that: Applications at the first vehicle end include: Receive the initial global model sent by the server; Using the local data of the first vehicle end to train the initial global model to obtain first vehicle end model data; The first vehicle-side model data is exchanged with the second vehicle-side model data to obtain the second vehicle-side model data of the second vehicle-side, and the first vehicle-side model data and the second vehicle-side model data are used to generate first model aggregation data, wherein the first vehicle-side and the second vehicle-side are both participating terminals of the federated training; The first model aggregation data is sent to the server, so that the server aggregates to obtain a target global model.

2. The method according to claim 1, characterized in that Using the first vehicle-end model data to exchange with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end includes: Determining the tag category to which the first vehicle terminal belongs; Broadcast connection requests to neighboring clients; Receiving a reply message returned by the second vehicle end in response to the connection request; Adding the second vehicle end to a neighbor set of the first vehicle end; For a second vehicle terminal in the neighbor set, establishing a communication link between the first vehicle terminal and the second vehicle terminal; Based on the communication link, the first vehicle-end model data is exchanged with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end.

3. The method according to claim 2, characterized in that Using the first vehicle-end model data to exchange with the second vehicle-end to obtain the second vehicle-end model data of the second vehicle-end includes: Splitting the first vehicle-end model data into a plurality of sub-data based on the number of vehicle-ends in the neighbor set, wherein each vehicle-end in the neighbor set corresponds to one sub-data; Selecting target sub-data corresponding to the second vehicle end from the plurality of sub-data; Based on the communication link, sending first private data to the second vehicle end, wherein the first private data includes the target sub-data; Receiving second private data returned by the second vehicle end based on the first private data, wherein the second private data includes the second vehicle end model data; Return third privacy data to the second vehicle end based on the second privacy data, wherein the third privacy data includes the first vehicle end model data.

4. The method according to claim 3, characterized in that Sending the first private data to the second vehicle terminal includes: Randomly generate a first mask having the same data size as the target sub-data; Fusion of the first mask and the target sub-data to generate first private data; The first privacy data is sent to the second vehicle terminal.

5. The method according to claim 3, characterized in that: Receiving the second private data returned by the second vehicle end based on the first private data includes: receiving second privacy data returned by the second vehicle end based on the first privacy data, wherein the second privacy data includes the first privacy data, a second mask, and the second vehicle end model data, the second mask is randomly generated by the second vehicle end, and the second vehicle end model data; The second vehicle-side model data is extracted from the second privacy data.

6. The method according to claim 5, characterized in that Extracting the second vehicle-side model data from the second private data includes: Randomly split the second private data into exchange data and mask data, wherein the mask data includes a first mask and the second mask corresponding to the first vehicle end; The exchange data is determined as the second vehicle-side model data.

7. The method according to claim 6, characterized in that Returning the third private data to the second vehicle end based on the second private data includes: removing the first mask from the mask data to obtain third privacy data; The third privacy data is sent to the second vehicle end, so that the second vehicle end obtains the first vehicle end model data exchanged with the first vehicle end from the third privacy data.

8. A model aggregation method based on federated learning, characterized in that: Applied on the server, including: Receive multiple model aggregation data uploaded by multiple vehicle terminals participating in federated learning, where each vehicle terminal uploads a set of model aggregation data, and each set of model aggregation data includes vehicle terminal model data obtained by local training of at least two vehicle terminals; Detect whether there are abnormal vehicles with abnormal model aggregation data; If there is no abnormal vehicle end, the plurality of models are used to aggregate data and reconstruct a first target global model.

9. The method according to claim 8, characterized in that After detecting whether there is an abnormal vehicle end with abnormal model aggregation data, the method further includes: If there is an abnormal vehicle terminal, an abnormal elimination message is sent to all vehicles terminals participating in the federated learning, wherein the abnormal elimination message carries the vehicle terminal identifier of the abnormal vehicle terminal; Receiving a data difference sent by a linkage vehicle end that exchanges data with the abnormal vehicle end, wherein the data difference is used to represent the data difference after the linkage vehicle end exchanges model data with the abnormal vehicle end; The plurality of models are used to aggregate data and the data difference is reconstructed to generate a second target global model.

10. The method according to claim 9, characterized in that The step of using the multiple models to aggregate data and reconstruct the data difference to generate a second target global model comprises: The second target global model W is calculated and reconstructed using the following formula: G : Among them, S j is the set of all linked vehicle terminals j that exchange data with the abnormal vehicle terminal i, w t ′ is the model aggregation data uploaded by the vehicle t participating in federated learning, w i ′ is the model aggregation data uploaded by abnormal vehicle i, d ji is the data difference between the linked vehicle j and the abnormal vehicle i after the model data is exchanged, and n is the number of vehicles participating in federated learning.

11. A model aggregation device based on federated learning, characterized in that: Applications at the first vehicle end include: A receiving module, used for receiving the initial global model sent by the server; A training module, configured to train the initial global model using the local data of the first vehicle end to obtain first vehicle end model data; an exchange module, configured to exchange the first vehicle-side model data with the second vehicle-side model data to obtain the second vehicle-side model data of the second vehicle-side, and to generate first model aggregate data using the first vehicle-side model data and the second vehicle-side model data, wherein both the first vehicle-side and the second vehicle-side are participating terminals of the federated training; The aggregation module is used to send the first model aggregation data to the server so that the server aggregates the data to obtain a target global model.

12. A model aggregation device based on federated learning, characterized in that: Applied on the server, including: A receiving module is used to receive multiple model aggregation data uploaded by multiple vehicle terminals participating in federated learning, wherein each vehicle terminal uploads a set of model aggregation data, and each set of model aggregation data contains vehicle terminal model data obtained by local training of at least two vehicle terminals; The detection module is used to detect whether there are abnormal vehicles with abnormal model aggregation data; The first reconstruction module is used to reconstruct and generate a first target global model by aggregating data of the multiple models if there is no abnormal vehicle end.

13. A model aggregation system based on federated learning, characterized in that: It includes a first vehicle terminal, a second vehicle terminal, and a server, wherein: The first vehicle end comprises the device as claimed in claim 11; The server is communicatively connected to the first vehicle end and the second vehicle end, and includes the device as described in claim 12.

14. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 10 when executed.

15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 10.