CN114827198B - Multi-layer center asynchronous federal learning method applied to Internet of vehicles - Google Patents
Multi-layer center asynchronous federal learning method applied to Internet of vehicles Download PDFInfo
- Publication number
- CN114827198B CN114827198B CN202210345422.7A CN202210345422A CN114827198B CN 114827198 B CN114827198 B CN 114827198B CN 202210345422 A CN202210345422 A CN 202210345422A CN 114827198 B CN114827198 B CN 114827198B
- Authority
- CN
- China
- Prior art keywords
- model
- vehicle
- local
- training
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000012549 training Methods 0.000 claims abstract description 77
- 230000002776 aggregation Effects 0.000 claims abstract description 42
- 238000004220 aggregation Methods 0.000 claims abstract description 42
- 238000004364 calculation method Methods 0.000 claims abstract description 21
- 230000006870 function Effects 0.000 claims abstract description 11
- 230000008569 process Effects 0.000 claims description 17
- 238000004422 calculation algorithm Methods 0.000 claims description 13
- 230000003993 interaction Effects 0.000 claims description 10
- 230000004931 aggregating effect Effects 0.000 claims description 4
- 238000009826 distribution Methods 0.000 claims description 4
- 238000006116 polymerization reaction Methods 0.000 claims description 4
- 230000006855 networking Effects 0.000 claims description 2
- 230000005540 biological transmission Effects 0.000 abstract description 5
- 238000005516 engineering process Methods 0.000 abstract description 5
- 238000010801 machine learning Methods 0.000 abstract description 4
- 230000009365 direct transmission Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 12
- 230000006854 communication Effects 0.000 description 10
- 238000004891 communication Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 5
- 238000013499 data model Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000003860 storage Methods 0.000 description 4
- 238000005457 optimization Methods 0.000 description 3
- 238000007405 data analysis Methods 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 230000001010 compromised effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 229920000642 polymer Polymers 0.000 description 1
- 238000011002 quantification Methods 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/142—Network analysis or design using statistical or mathematical methods
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/145—Network analysis or design involving simulating, designing, planning or modelling of a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1074—Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mathematical Physics (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Medical Informatics (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Health & Medical Sciences (AREA)
- Probability & Statistics with Applications (AREA)
- Pure & Applied Mathematics (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Algebra (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Traffic Control Systems (AREA)
Abstract
The invention discloses a multi-layer center asynchronous federation learning method applied to the Internet of vehicles, which utilizes federation learning technology to provide an asynchronous federation learning framework, comprising vehicle nodes, edge calculation servers and a center cloud server, wherein each vehicle participant carries out local model training on the vehicle itself and uploads the model, the edge calculation servers and the center cloud server sequentially carry out twice aggregation and broadcast the aggregated model to each edge calculation server, and the vehicle participant responds to the request of the vehicle participant on the model directly from the cloud server. Under the invention, a machine learning model is finally generated in the learning framework, and the model can output a result according to the data of the vehicle as input so as to realize the functions of prediction and the like. The direct transmission of the data is replaced by a sharing model, so that the privacy protection can be realized, and more efficient data application can be realized. Meanwhile, compared with the original data, the model has smaller data size, and can greatly reduce network load during transmission.
Description
Technical Field
The invention relates to the field of deep learning, in particular to a multi-layer center asynchronous federal learning method applied to the Internet of vehicles.
Background
The development of technologies such as cloud computing, edge computing, internet of things and 5G lays a foundation for the field application of the Internet of vehicles, and meanwhile, the continuous increase of the number of global road vehicles provides a platform for the application of the Internet of vehicles, so that the field application and popularization of the Internet of vehicles have important significance for building intelligent traffic and intelligent cities. In the vehicle-mounted network, due to the limitation of computing resources and network bandwidth resources, it is a challenge for vehicles to utilize and process massive data to improve the service quality of services such as travel traffic prediction and automatic driving of the vehicles.
In the on-vehicle network, mass data generated in the running process of the vehicle can be more effectively processed and shared by using the AI technology. The edge calculation can effectively solve the problem of limited resources, and the artificial intelligence algorithm enables the edge nodes to process and analyze diversified data and classify and predict the data. However, on edge nodes in an edge computing scenario such as the internet of vehicles, distributed machine learning remains a challenging task. The data owned by each vehicle unit naturally forms independent data islands, and traditional machine learning needs to perform data fusion first, but the data fusion directly exposes privacy information of each vehicle user, and meanwhile, resource limitation is also a main problem. That is, there are two problems that cannot be compromised:
in the traditional scheme for carrying out data sharing by means of encryption and trust model construction, the service quality of a vehicle is limited due to the limitation of computing resources and network bandwidth resources;
the introduction of AI technology replaces shared data in a shared model manner, so that the network bandwidth of resource transmission is greatly reduced, but the data owned by each vehicle form individual data islands, and the data concentration is required in the traditional machine learning. The process of collecting data carries the risk of security and privacy leakage of the data of the vehicle itself.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a multi-layer center asynchronous federal learning method applied to the Internet of vehicles.
In order to achieve the aim of the invention, the invention adopts the following technical scheme:
a multi-layer center asynchronous federal learning method applied to the Internet of vehicles comprises the following steps:
s1, constructing an internet of vehicles model based on asynchronous federal learning, wherein in each training process, each vehicle participant operates a gradient descent algorithm according to data acquired by the vehicle participant to obtain a local model;
s2, uploading the obtained local model by each vehicle participant to an edge server in the coverage area of the vehicle, asynchronously receiving the local model uploaded by each vehicle participant by the edge server, and obtaining a new model after aggregation;
and S3, uploading the new model obtained in the step S2 to a cloud server by an edge server, asynchronously receiving the model by the cloud server, and then aggregating the model, and transmitting the aggregated model to each edge server or transmitting the aggregated model to a vehicle participant after a vehicle participant requests.
Further, the S1 specifically includes:
s11, initializing a global model M 0 Initial timestampAnd issued to idle vehicles V i In the ith wheel interaction, the idle vehicle V i Active edge server E j Sending a training request;
s12, judging whether the number of the vehicle participants in the current round is smaller than the number N.C of the vehicle participants participating in aggregation in the current round, wherein C is a proportionality coefficient, and the vehicle participants pass through an edge server E j To an idle vehicle V i Responding to the latest global model M i-1 And update V i Is a local model of the present round of (a)
S13, randomly extracting a plurality of data in the local data set of the vehicle participant as a training set of current round interaction
S14, iterating by using a gradient descent algorithm to obtain an idle vehicle V i Local training model of this round
S15, local training model of the roundUploading to edge server E j And recording by the edge server receive time stamp +/based on the upload time of the local training model>Calculating a time difference from the accepted time stamp and the initial time stamp +.>And meanwhile, calculating the average square error of the local model uploaded by the vehicle participant in the current round.
Further, the gradient descent algorithm in S15 is expressed as:
wherein , and />Respectively representing update parameters, ζ, of a model in the kth and the kth-1 local training in the ith round of interaction k,k-1 Represents learning rate in kth training, < >>Expressed in terms of model parameters>From the extracted dataset when updating +.>The kth training set of (c), L (M, x (D)) represents the set of data/>Loss function on model parameters M during training, +.>Is the first derivative with respect to M, x (D) represents the data set D n Is a data set of the data set.
Further, the average square error calculation formula in S15 is as follows:
where MSE is the average squared error, y i For the output of the ith round of local model, x i For the input of the i-th round of local model, N represents the number of vehicle participants participating in training that are maximally supported at full load.
Further, the step S2 specifically includes:
s21, initializing a buffer factor rho E (0, 1), and receiving a local training model of the current turn uploaded by a vehicle participantTime stamp T k ;
S22, judging whether the length of the edge server cache queue is smaller than N.rho, if yes, locally training a modelPut into the cache degree column; if not, caching all elements in the queue by the edge server, clearing the cache queue, distributing weights of the local models uploaded by all vehicle participants according to the model aggregation weighting weights, and updating the global model;
s23, uploading the global model updated in the step S22 to a central server for cloud synchronization.
Further, in the step S22, the specific calculation method for performing weight distribution on the local model uploaded by each vehicle participant according to the model aggregation weighting weight is as follows:
wherein ,weighting of local models uploaded for vehicle participants at aggregation, which are influenced by different time stamps, +.>Weighting, gamma, of local models uploaded by vehicle participants at polymerization due to performance differences i For final weight assignment, α is a weight parameter.
Further, the calculation manner of updating the global model in S22 is as follows:
wherein M (i+1) is polymerized with parameters from the ith round to the (i+1) th round represented by M (i), M j Representing the jth updated model parameters received by the edge server in the ith round of parameter aggregation.
Further, the step S3 specifically includes:
s31, initializing an upper limit cap of capacity and a maximum waiting period T of a cache queue of a central server, and receiving a model aggregated by an edge serverAnd entering a cache queue for waiting to aggregate;
s32, judging whether the number of the models in the cache queue of the central server reaches the capacity upper limit cap or whether the waiting interval time reaches the maximum waiting period T, if not, continuing to put the models and executing waiting;
and S33, if the cache queue of the central server overflows or the waiting time interval exceeds the maximum waiting period, extracting all models in the cache queue, clearing the cache queue of the central server, distributing weights to the local models uploaded by each edge server according to the model aggregation weighting weights, and updating the global model according to the average square error.
Further, in S33, the calculation method for updating the global model according to the average square error is as follows:
wherein ,γP Aggregation weights assigned to MSE according to model uploaded by edge server, M (i+1) and aggregation of parameters from ith round to ith+1 round represented by M (i), M j Representing the jth updated model parameters received by the central server in the ith round of parameter aggregation.
The invention has the following beneficial effects:
1. accuracy of data sharing: the invention uses AI technology to replace the direct transmission of data with shared data model, which needs to restore the information content of original data. Compared with direct data transmission (including encryption transmission), the method for sharing the data model completes the screening and analysis of the original data, directly outputs the results in the forms of prediction and the like, and can realize more accurate data application.
2. Privacy protection: the invention avoids the problem of privacy disclosure caused by the data transmission process or the receiving party because the direct sharing of the data of each vehicle is not involved in the whole process.
3. Global data sharing: the invention considers vehicle nodes, edge computing servers and a central cloud server. Vehicles with strong or weak computing power can be stimulated to participate in the training of the whole model, the coverage range of the vehicle is wide, and the vehicle data sharing in a certain area is not limited.
Drawings
Fig. 1 is a schematic flow chart of a multi-layer center asynchronous federal learning method applied to the internet of vehicles.
Fig. 2 is a schematic diagram of a multi-layer center federal learning model for internet of vehicles according to an embodiment of the present invention.
FIG. 3 is a schematic diagram of an asynchronous federal learning model structure according to an embodiment of the present invention.
FIG. 4 is an exemplary diagram of communication between nodes in asynchronous federal learning according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of a vehicle participation model training request and an uploading policy according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of communication between central servers according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and all the inventions which make use of the inventive concept are protected by the spirit and scope of the present invention as defined and defined in the appended claims to those skilled in the art.
A multi-layer center asynchronous federal learning method applied to the Internet of vehicles, as shown in figure 1, comprises the following steps:
s1, constructing an internet of vehicles model based on asynchronous federal learning, wherein in each training process, each vehicle participant operates a gradient descent algorithm according to data acquired by the vehicle participant to obtain a local model;
as shown in fig. 2, the entire internet of vehicles is composed of a cloud server, a mobile edge computing (edge computing) server, and vehicles. Each vehicle in the internet of vehicles comprises an on-board unit (OBU), has data acquisition and sensing capabilities, and has certain computing and storage capabilities, but the computing power and storage capabilities of each vehicle are different. The computing of the edge computing server is more powerful in vehicles than the storage capacity, and can perform computing and buffering of a larger task amount. The edge computing server communicates directly with vehicles covered by the roadside units through the roadside units, and communicates directly with the cloud server through an uplink. The cloud server has the most powerful computing and storage capacity in the Internet of vehicles, can perform a large number of computing and caching tasks, and is far away from the logic distance of the vehicle in network topology. Vehicles participating in the federal learning framework perform calculations and training in concert by their own independent training and federal collaboration during processing or computing tasks (e.g., training a machine-learned regression model).
In each training process, each vehicle participant first runs a gradient descent algorithm according to the relevant data acquired by itself to obtain a local model. For a single vehicle in the internet of vehicles, there are three network communication channels: vehicle-to-vehicle (V-V), vehicle-to-RSU (V-R), and vehicle-to-cloud server (V-C). And uploading the model to an edge calculation server of a road side unit in the covered area of the vehicle by the vehicle, asynchronously receiving the model uploaded by each vehicle by the edge calculation server, and acquiring a new model after one-round aggregation. The model will continue to be uploaded to a cloud server that is more central in logical and physical location, while the model may be sent to the vehicle upon request by the vehicle participant. The cloud server transmits the asynchronously received models from the edge computing servers to the edge computing servers after aggregation, and the models can be transmitted to the vehicle after the vehicle participants request. In addition, the original data of the vehicle in federal learning can be only kept locally for training and other data analysis, so that the protection of the user information privacy can be ensured. Fig. 3 shows a multi-layer central heterogeneous federal learning framework in a car networking scenario proposed in this chapter, where the whole framework includes three modules of "participant independent training", "participant parameter update", and "convergence rate improvement"
Federal learning is a new approach to data analysis and sharing in edge computing. The federal learning scheme provided by the application is mainly oriented to a scene of data security sharing in a vehicle-mounted network. In data sharing, all vehicle users train a global data model by writing related data through a federal learning algorithm, and the data model is shared to replace the shared original data. The data model contains effective information of the request data and protects the privacy of the data owner. In view of the advantages of federal learning, federal learning is applied to the internet of vehicles, so that the training tasks related to data sharing are realized.
The federal learning is applied to related calculation tasks in the safe sharing of the data of the Internet of vehicles, so that the problems of efficient sharing and privacy protection of the data are solved. The cloud server is denoted as C, the set of wayside units is denoted as r= { R1, R2, …, rn }, and the set of vehicle participants is denoted as v= { V 1 ,V 2 ,…,V n }. Each vehicle participant vi has a local data set di= { (x) 1 ,y 1 ),(x 2 ,y 2 ),…,(x n ,y n ) Where xi is the input of the trained model and yi is the output of the model (i.e., the label of xi). Di is taken as a local data set of a vehicle participant and is a subset of the whole data set D= { D1 U.D2 U. … U.Dn } comprising data sets held by all vehicle participants and an edge calculation server.
Unlike the learning framework in which a traditional unified data set is trained, federal learning involves multiple communication processes of vehicle participants with an edge computing server and a cloud server, and the number of communication times has a great influence on the convergence speed of the model. As shown in fig. 4, the communication process between the vehicle participant and the mobile edge server and the cloud server in a single parameter update is illustrated. Wherein, (I) represents a process that each vehicle participant performs local model training on the vehicle itself, (II) represents a parameter uploading stage, which includes that the vehicle participant transmits the model to an edge computing server after multiple rounds of local training, the edge computing server aggregates the collected models and uploads the collected models to a more central cloud server, and (III) represents a parameter issuing stage, which includes that the cloud server aggregates the models uploaded by the edge computing server, broadcasts the aggregated models to each edge computing server, and responds to a request of the vehicle participant to the models directly from the cloud server. The following describes the process of local training of the vehicle participant and updating of parameters of each node in detail by taking a certain round of communication process in the training process as an example, and specifically comprises the following steps:
s11, initializing a global model M 0 In the ith wheel interaction, the idle vehicle V i Active edge server E j Send training requestSolving;
as shown in fig. 5, the vehicle V k Computing server E at entry edge j When the coverage area of (2) is within, the rest of the calculation force can participate in training. At this time, the vehicle V k To E j Actively send training request, E j Responsive to receipt of a request, i.e. to send the initial modelIf the time T passes 1 ,T 1 Is a generic term with no special meaning for the purposes of the following description. Vehicle V k And (5) completing the training of the local model. At this time, the vehicle V k While at edge computing server E j and Ej+1 Is within the coverage area of (a). Due to V in this round of training k Is from E j The initial model obtained will therefore be uploaded with priority to update the model +.>To E to j . And vehicle V k And E is connected with j A reliable communication connection is established between the two, if V k Unconfirmed E j Has received the model->Will resend. Repeating the uploading E j If not, the update model is uploaded>To E to j+1 . If the time T passes 1 + 2 Vehicle V k And (5) completing the training of the local model. At this time vehicle V k Has completely driven away E 1 Entering E through coverage of E j+1 Is of the vehicle V k Upload update model->To E to j+1 From E j+1 Completion of update modelIs a polymer of (a).
S12, judging whether the number of the vehicle participants in the current round is smaller than the number N.C of the vehicle participants participating in aggregation in the current round, wherein C is a proportionality coefficient, and the vehicle participants pass through an edge server E j To an idle vehicle V i Responding to the latest global model M i-1 And update V i Is a local model of the present round of (a)
S13, randomly extracting a plurality of data in the local data set of the vehicle participant as a training set of current round interaction
The idle vehicle actively transmits a training request to a surrounding edge computing server to acquire an initial modelAfter that, vehicle V k I.e. training of local models from local data sets, recording vehicle V k Is D n . During the movement of the vehicle, its own sensor will sense and collect the relevant data in real time and update the local data set D n . In each local training t different batches of data sets were randomly extracted, denoted +.>Collectively called->The t data sets have a consistent data distribution and similar data amounts. Completing vehicle unit V from the t data sets k The local model of the ith round of interaction is trained.
S14, iterating by using a gradient descent algorithm to obtain an idle vehicle V i Local training model of this roundAnd record the current timestamp T i ;
The optimization of the model parameters is generally performed in a mode of minimizing an objective function, wherein an optimization result is obtained for minimizing a loss function, and the optimization algorithm in this chapter adopts a random gradient descent (Stochastic Gradient Descent, SGD), and the i-th round of local model update can be expressed mathematically as:
wherein , and />Update parameters of the model in the kth and kth-1 local training during the ith round of interaction, expressed mathematically as vector +.>Or tensor, ζ k,k-1 Indicating learning rate in the kth training round, < >>Expressed in terms of model parameters>In the case of an update, the data set extracted is +.>The kth training set of (2), L (M, x (D)) represents +.>A loss function for the model parameters M when training is performed. x (D) represents a data set D n Is a data set of the data set. In order to ensure training effect, the size of the data set randomly selected in each round needs to be fixedSetting, i.e. setting->The size of (2) is a fixed value N m . After the training of the local model of each vehicle participant is completed, a time stamp of the time of completion of the training needs to be recorded, and performance indexes of the own model need to be provided for the server. In an asynchronously updated strategy, the time stamps of the individual local models are different and the performance differences will directly affect the weight distribution of the central aggregation.
S15, local training model of the roundUploading to edge server E j And recording by the edge server receive time stamp +/based on the upload time of the local training model>Calculating a time difference from the accepted time stamp and the initial time stamp +.>And meanwhile, calculating the average square error of the local model uploaded by the vehicle participant in the current round.
The performance difference is represented on the dataset of the current round training, expressed in Mean Square Error (MSE), i.e., L 2 The norm loss, expressed as:
in this embodiment, the smaller the MSE, the better the quality of the representation model.
S2, uploading the obtained local model by each vehicle participant to an edge server in the coverage area of the vehicle, asynchronously receiving the local model uploaded by each vehicle participant by the edge server, and obtaining a new model after aggregation;
as shown in fig. 4, in the internet of vehicles scenario, considering the limited coverage of the edge calculation server, the mobility of the vehicle, and the dropped situation caused by communication reasons. In each training round, there are many real situations such as that the vehicle taking part in training is driven out of the range of the current edge calculation server, a new vehicle is driven in and a training request is sent, and the vehicle taking part in training is disconnected due to communication and the like. In order to alleviate the above-described problem, the present embodiment performs aggregation in an edge server in the following manner.
S21, initializing a buffer factor rho E (0, 1), and receiving a local training model of the current turn uploaded by a vehicle participantTime stamp T k ;
The edge calculation server sets a buffer queue Q, and controls the capacity of Q by a buffer factor ρ, that is, has an upper limit of the capacity size n·ρ. Each time a model sent from a vehicle participant is received, a cache queue is entered waiting for aggregation.
S22, judging whether the length of the edge server cache queue is smaller than N.rho, if yes, locally training a modelPut into the cache degree column; if not, caching all elements in the queue by the edge server, clearing the cache queue, distributing weights of the local models uploaded by all vehicle participants according to the model aggregation weighting weights, and updating the global model;
detecting whether the real-time length len of the cache queue is larger than or equal to N.rho, if yes, acquiring data in Q to start aggregation and emptying Q. The vehicle is required to carry both the time stamp and the performance index of the local model update while transmitting the updated model. When the server aggregates, the timestamp of the model will affect its aggregate weight, expressed as:
wherein ,t1 ,t 2 ,…,t Nρ representing the corresponding time stamp of the model (note: the model is enqueued once in time in the present scenario),is the weight that each local model affects due to the different timestamps when aggregated. In addition, there is a performance difference between the models received by the server during each iteration. For models with different performance, it is not fair to assign different weights only considering time differences. Meanwhile, in order to accelerate the convergence of the models, the influence caused by the performance difference needs to be considered when the weights are allocated to different models. For the situation that malicious participants exist in the training process, different weights are distributed according to the performance, so that the probability of damaging training of a malicious model can be effectively reduced, and the training is expressed as follows:
wherein ,representing the weight of each local model affected by the performance difference during aggregation, MSE i I.e. a quantitative representation of the performance of the respective local model, sum has the meaning of
sum is the reciprocal sum of the quantification of the performances of each local model, and when the performances of the models are represented by MSE, the smaller the MSE is, the smaller the representation difference between the results of the models and the data set labels is, and the better the quality of the models is. The better the quality model will be assigned a higher weight during the aggregation process, and therefore,weighting is performed according to the inverse relationship of the MSEs of the local model. Final weight assignment of local model, e.g.
In the formula, the time stamp and the performance are dynamically adjusted by alpha, and the final weight of each local model is allocated.
S23, uploading the global model updated in the step S22 to a central server for cloud synchronization.
The numerical value of the polymerization process is expressed as
Wherein M (i+1) is polymerized with parameters of the ith to (i+1) th rounds represented by M (i), wherein M j Representing the j-th updated model parameter received by the edge computation server in the i-th round of parameter aggregation. After each round of updating is completed, the edge computing server sends the model to the central server.
And S3, uploading the new model obtained in the step S2 to a cloud server by an edge server, asynchronously receiving the model by the cloud server, and then aggregating the model, and transmitting the aggregated model to each edge server or transmitting the aggregated model to a vehicle participant after a vehicle participant requests.
As shown in fig. 4, the different edge computing servers are also asynchronous with respect to each round of model aggregate updates due to the differences in subordinate vehicle participants. The connection medium between the edge computing servers is the central cloud server. In order to ensure that the latest training model is obtained when the vehicle makes a training request to the edge computing server, the convergence speed is increased. The central cloud server is required to aggregate and synchronize the updated models of the aggregation of the edge computing servers again. In addition, in a partial road scene, the arrangement of edge computing servers or the functions of itself are limited due to environmental limitations. When a vehicle with residual computing power is to participate in federal learning training, the edge computing server needs to be skipped, and a training request is directly sent to the center server. In this embodiment, an aggregate synchronization diagram of an upload model of an edge computing server in a central server is shown in fig. 6, and specifically includes the following steps:
s31, initializing an upper limit cap of capacity and a maximum waiting period T of a cache queue of a central server, and receiving a model aggregated by an edge serverAnd entering a cache queue for waiting to aggregate;
the central server continuously receives the aggregated model from the edge computing servers over timeSince the process of receiving is asynchronous, like the edge computation server, the +.>First, a buffer queue Q is entered to wait for aggregation.
S32, judging whether the number of the models in the cache queue of the central server reaches the capacity upper limit cap or whether the waiting interval time reaches the maximum waiting period T, if not, continuing to put the models and executing waiting;
the operations of receiving the model and training requests, aggregating the model and issuing the model are waited and executed before convergence. Aggregation is performed when the number of models in Q touches the capacity cap, while Q itself empties to store the newly received models.
And S33, if the cache queue of the central server overflows or the waiting time interval exceeds the maximum waiting period, extracting all models in the cache queue, clearing the cache queue of the central server, distributing weights to the local models uploaded by each edge server according to the model aggregation weighting weights, and updating the global model according to the average square error.
Due to V k Uploading update model to E i, and Ei Again uploading the aggregation model to C, there will be two delays. If the aggregation operation is only executed when the cache queue overflows, the central server does not execute the aggregation operation for a long time, and each node cannot obtain the whole federation learningThe latest model in the process results in a slow convergence rate. Thus, the parameter T, i.e. the maximum waiting period, is initialized in the central server to limit the waiting time of the server before each round of aggregation. The aggregate operation begins when Q overflows or the wait time interval T reaches T. In the aggregation of the central server, the weighting of the model aggregation is determined only with the respective performances without considering the influence of the weighting due to the time difference of the received models.
With MSE as a quantization index for model performance, the edge computation server will compute the model from its own dataset after each round of aggregate updatesTogether with the MSE to the central server. In this algorithm, considering that the models received in the central server are taken from the edge computation server only, the authenticity of the MSE of the model is directly trusted, and thus the aggregate of the individual models is expressed as:
wherein ,γP Aggregate weights assigned to MSEs according to the respective models. After the central server completes the aggregate update, a new model M C And the data are issued to all edge computing servers to realize synchronization of the latest training model in the whole framework.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.
Those of ordinary skill in the art will recognize that the embodiments described herein are for the purpose of aiding the reader in understanding the principles of the present invention and should be understood that the scope of the invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific modifications and combinations from the teachings of the present disclosure without departing from the spirit thereof, and such modifications and combinations remain within the scope of the present disclosure.
Claims (7)
1. The multi-layer center asynchronous federal learning method applied to the Internet of vehicles is characterized by comprising the following steps of:
s1, constructing an internet of vehicles model based on asynchronous federal learning, wherein in each training process, each vehicle participant operates a gradient descent algorithm according to data acquired by the vehicle participant to obtain a local model, and the method specifically comprises the following steps:
s11, initializing a global model M 0 Initial timestampAnd issued to idle vehicles V i In the ith wheel interaction, the idle vehicle V i Active edge server E j Sending a training request;
s12, judging whether the number of the vehicle participants in the current round is smaller than the number N.C of the vehicle participants participating in aggregation in the current round, wherein C is a proportionality coefficient, and the vehicle participants pass through an edge server E j To an idle vehicle V i Responding to the latest global model M i-1 And update V i Is a local model of the present round of (a)
S13, randomly extracting a plurality of data in the local data set of the vehicle participant as a training set of current round interaction
S14, iterating by using a gradient descent algorithm to obtain an idle vehicle V i Local training model of this roundThe gradient descent algorithm is expressed as:
wherein , and />Respectively representing update parameters, ζ, of a model in the kth and the kth-1 local training in the ith round of interaction k,k-1 Represents learning rate in kth training, < >>Expressed in terms of model parameters>From the extracted dataset when updating +.>The kth training set of (2), L (M, x (D)) represents +.>Loss function on model parameters M during training, +.>Is the first derivative with respect to M, x (D) represents the data set D n Data in (a);
s15, local training model of the roundUploading to edge server E j And recording by the edge server receive time stamp +/based on the upload time of the local training model>Calculating a time difference from the accepted time stamp and the initial time stamp +.>Local module for simultaneously calculating uploading of current-round vehicle participantsAverage square error of the pattern;
s2, uploading the obtained local model to an edge server in the coverage area of the vehicle by each vehicle participant, asynchronously receiving the model uploaded by each vehicle participant by the edge server, and obtaining a new model after aggregation;
and S3, uploading the new model obtained in the step S2 to a cloud server by an edge server, asynchronously receiving the model by the cloud server, and then aggregating the model, and transmitting the aggregated model to each edge server or transmitting the aggregated model to a vehicle participant after a vehicle participant requests.
2. The multi-layer center asynchronous federal learning method for use in the internet of vehicles according to claim 1, wherein the average square error calculation formula in S15 is:
where MSE is the average squared error, y i For the output of the ith round of local model, x i For the input of the i-th round of local model, N represents the number of vehicle participants participating in training that are maximally supported at full load.
3. The multi-layer central asynchronous federal learning method for use in the internet of vehicles according to claim 1, wherein S2 specifically comprises:
s21, initializing a buffer factor rho E (0, 1), and receiving a local training model of the current turn uploaded by a vehicle participantRecording the timestamp on reception +.>
S22, judging whether the length of the edge server cache queue is smaller than N.rho, if yes, locally training a modelPut into the cache degree column; if not, caching all elements in the queue by the edge server, clearing the cache queue, distributing weights of the local models uploaded by all vehicle participants according to the model aggregation weighting weights, and updating the global model;
s23, uploading the global model updated in the step S22 to a central server for cloud synchronization.
4. The multi-layer central asynchronous federal learning method for vehicle networking according to claim 3, wherein the specific calculation mode for performing weight distribution on the local model uploaded by each vehicle participant according to the model aggregation weighting in S22 is as follows:
wherein ,weighting of local models uploaded for vehicle participants in the polymerization, which are influenced by time differences, respectively>Weighting, gamma, of local models uploaded by vehicle participants at polymerization due to performance differences i For final weight assignment, α is a weight parameter.
5. The multi-layer central asynchronous federal learning method for internet of vehicles according to claim 3, wherein the calculation mode of updating the global model in S22 is as follows:
wherein M (i+1) is polymerized with parameters from the ith round to the (i+1) th round represented by M (i), M j Representing the jth updated model parameters received by the edge server in the ith round of parameter aggregation.
6. The multi-layer central asynchronous federal learning method for use in the internet of vehicles according to claim 1, wherein S3 specifically comprises:
s31, initializing an upper limit cap of capacity and a maximum waiting period T of a cache queue of a central server, and receiving a model aggregated by an edge serverAnd entering a cache queue for waiting to aggregate;
s32, judging whether the number of the models in the cache queue of the central server reaches the capacity upper limit cap or whether the waiting interval time reaches the maximum waiting period T, if not, continuing to put the models and executing waiting;
and S33, if the cache queue of the central server overflows or the waiting time interval exceeds the maximum waiting period, extracting all models in the cache queue, clearing the cache queue of the central server, distributing weights to the local models uploaded by each edge server according to the model aggregation weighting weights, and updating the global model according to the average square error.
7. The multi-layer central asynchronous federal learning method for internet of vehicles according to claim 6, wherein the calculation mode of updating the global model according to the average square error in S33 is as follows:
wherein ,γP Aggregation weights assigned to MSE according to model uploaded by edge server, M (i+1) and aggregation of parameters from ith round to ith+1 round represented by M (i), M j Representing center in parameter aggregation of ith roundThe server receives the j-th updated model parameters.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210345422.7A CN114827198B (en) | 2022-03-31 | 2022-03-31 | Multi-layer center asynchronous federal learning method applied to Internet of vehicles |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210345422.7A CN114827198B (en) | 2022-03-31 | 2022-03-31 | Multi-layer center asynchronous federal learning method applied to Internet of vehicles |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114827198A CN114827198A (en) | 2022-07-29 |
CN114827198B true CN114827198B (en) | 2023-04-28 |
Family
ID=82533654
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210345422.7A Active CN114827198B (en) | 2022-03-31 | 2022-03-31 | Multi-layer center asynchronous federal learning method applied to Internet of vehicles |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114827198B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116580448B (en) * | 2023-04-11 | 2024-04-16 | 深圳市大数据研究院 | Behavior prediction method, system, electronic equipment and storage medium |
CN116506829B (en) * | 2023-04-25 | 2024-05-10 | 广东北斗烽火台卫星定位科技有限公司 | Federal edge learning vehicle selection method based on C-V2X communication |
CN116346863B (en) * | 2023-05-29 | 2023-08-01 | 湘江实验室 | Vehicle-mounted network data processing method, device, equipment and medium based on federal learning |
CN116546429B (en) * | 2023-06-06 | 2024-01-16 | 杭州一诺科创信息技术有限公司 | Vehicle selection method and system in federal learning of Internet of vehicles |
CN116681126B (en) * | 2023-06-06 | 2024-03-12 | 重庆邮电大学空间通信研究院 | Asynchronous weighted federation learning method capable of adapting to waiting time |
CN117010485B (en) * | 2023-10-08 | 2024-01-26 | 之江实验室 | Distributed model training system and gradient protocol method in edge scene |
CN118114750A (en) * | 2024-04-30 | 2024-05-31 | 齐鲁工业大学(山东省科学院) | Federal learning method and device based on bi-component second-order aggregation and re-optimization classifier part and computer readable storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102020129306A1 (en) * | 2019-11-06 | 2021-05-06 | Intel Corporation | TRANSMISSION OF PAGING SUPPORT INFORMATION FOR NOTIFICATION OF THE CALLER IDENTIFICATION (CID) |
CN114116198A (en) * | 2021-10-21 | 2022-03-01 | 西安电子科技大学 | Asynchronous federal learning method, system, equipment and terminal for mobile vehicle |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2020101613A4 (en) * | 2020-08-02 | 2020-09-10 | B.P.R.V.S, Priyatham MR | Collaborative federative learning approach for internet of vehicles traffic prediction |
-
2022
- 2022-03-31 CN CN202210345422.7A patent/CN114827198B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102020129306A1 (en) * | 2019-11-06 | 2021-05-06 | Intel Corporation | TRANSMISSION OF PAGING SUPPORT INFORMATION FOR NOTIFICATION OF THE CALLER IDENTIFICATION (CID) |
CN114116198A (en) * | 2021-10-21 | 2022-03-01 | 西安电子科技大学 | Asynchronous federal learning method, system, equipment and terminal for mobile vehicle |
Also Published As
Publication number | Publication date |
---|---|
CN114827198A (en) | 2022-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114827198B (en) | Multi-layer center asynchronous federal learning method applied to Internet of vehicles | |
Wang et al. | A novel reputation-aware client selection scheme for federated learning within mobile environments | |
CN111629380B (en) | Dynamic resource allocation method for high concurrency multi-service industrial 5G network | |
CN113132943B (en) | Task unloading scheduling and resource allocation method for vehicle-side cooperation in Internet of vehicles | |
CN110839075A (en) | Service migration method based on particle swarm in edge computing environment | |
CN114301935B (en) | Reputation-based internet of things edge cloud collaborative federal learning node selection method | |
CN113099418B (en) | Optimization method of block chain task for data transmission of Internet of vehicles | |
CN111491312A (en) | Method and equipment for predicting, allocating, acquiring and training neural network of wireless resources | |
CN111182048A (en) | Intelligent traffic management method based on crowd sensing enabled by block chain | |
Li et al. | FEEL: Federated end-to-end learning with non-IID data for vehicular ad hoc networks | |
CN114374949B (en) | Information freshness optimization-based power control mechanism in Internet of vehicles | |
CN113094180B (en) | Wireless federal learning scheduling optimization method and device | |
Liu et al. | FedSSC: Joint client selection and resource management for communication-efficient federated vehicular networks | |
CN111710153B (en) | Traffic flow prediction method, device, equipment and computer storage medium | |
Sun et al. | Task offloading method of internet of vehicles based on cloud-edge computing | |
CN116017348B (en) | Big data cloud computing real-time distribution operation and maintenance system and method based on 5G communication | |
CN115208892B (en) | Vehicle-road collaborative online task scheduling method and system based on dynamic resource demand | |
CN114979145B (en) | Content distribution method integrating sensing, communication and caching in Internet of vehicles | |
CN113269339B (en) | Method and system for automatically creating and distributing network appointment tasks | |
Yang et al. | Data synchronization for vehicular digital twin network | |
CN115080249B (en) | Vehicle networking multidimensional resource allocation method and system based on federal learning | |
Mirzaee et al. | CHFL: A collaborative hierarchical federated intrusion detection system for vehicular networks | |
Xu et al. | Intelligent Transportation Vehicle Road Collaboration and Task Scheduling Based on Deep Learning in Augmented Internet of Things | |
CN117812564B (en) | Federal learning method, device, equipment and medium applied to Internet of vehicles | |
WANG et al. | Air-ground integrated low ground integrated low-energy federated learning for secure federated learning for secure 6g communications |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |