A method and system for optimizing offloading of computing tasks in Internet of Vehicles based on federated learning architecture
By using federated learning architecture and reinforcement learning algorithms to optimize computing task offloading, the problem of low computing resource utilization in the Internet of Vehicles is solved, and load balancing and resource efficiency improvement are achieved.
Patent Information
- Application Number
- CN202410756978.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-06-12
AI Technical Summary
In the Internet of Vehicles, the prior art is difficult to effectively optimize the unloading strategy of computing tasks, resulting in low computing resource utilization and difficult to achieve load balancing, which is affected by multiple influences of electric vehicle mobility, residual power, heterogeneous computing resources and communication resource consumption.
Using a method based on the federated learning architecture, an objective function that minimizes the calculation delay and energy consumption is established based on the historical state data of electric vehicles, and the parameters are optimized using reinforcement learning algorithms (such as DDPG) to obtain the optimized unloading model. Output the optimal uninstall scheme and determine the uninstall method of the calculation task.
The load balancing of task computing in the Internet of Vehicles is realized, the utilization rate of computing resources is improved, and the calculation delay and energy consumption are reduced through optimized unloading strategies.
Smart Images

Figure CN118695301B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Vehicles, and in particular, relates to a method and system for optimizing and offloading computing tasks in an Internet of Vehicles based on a federated learning architecture. Background Art
[0002] The computing task offloading strategy in the Internet of Vehicles is a hot research direction. The mobility of electric vehicles, the remaining power of electric vehicles, the size of computing tasks that electric vehicles need to offload, the computing performance of heterogeneous computing resources, and the communication resources consumed by offloading all have a certain degree of influence on the decision of computing task offloading. Due to the many influencing factors, it is difficult to give the optimal method through theoretical deduction. It is necessary to propose a method that can decide which computing task offloading strategy to use according to the environment. Summary of the invention
[0003] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a method and system for optimizing and unloading computing tasks in the Internet of Vehicles based on a federated learning architecture. By optimizing and unloading computing tasks, load balancing of task computing in the Internet of Vehicles is achieved, thereby improving the utilization rate of computing resources.
[0004] According to one aspect of the present invention, the present invention provides a method for optimizing offloading of computing tasks in an Internet of Vehicles based on a federated learning architecture, the method comprising the following steps:
[0005] S1: Build an Internet of Vehicles model based on a federated learning architecture, and establish an objective function that minimizes computing latency and energy consumption based on the historical status data of the electric vehicle; the historical status data includes the location of the electric vehicle, the vehicle speed, the remaining power of the vehicle, and the size of the computing task that the vehicle needs to unload;
[0006] S2: using a reinforcement learning algorithm to solve the objective function and optimize parameters to obtain an optimized unloading model;
[0007] S3: Acquire current state data of the current electric vehicle, input the current state data into the optimization unloading model, and output the optimal unloading solution for the calculation task.
[0008] Preferably, the establishment of an objective function for minimizing computing delay and energy consumption includes:
[0009] The objective function of vehicle unloading is established and the optimization problem is as follows:
[0010]
[0011] stC1:T i ≤T max
[0012] C2:Ei ≤E max
[0013] C3:X i ≤X E , if a i (t) = {Edge}
[0014] C4:a i (t)≠{Cloud}, if EL i (t)≤EL thr
[0015] Among them, T i represents the total delay of the offloaded computing task, E i represents the energy consumed by offloading computing tasks; γ represents the weight of delay, T max is the maximum tolerable delay, E max is the maximum energy consumption value, X E represents the computing capacity of the edge computing unit, EL i (t) represents the remaining power of the vehicle, EL thr Indicates the threshold of the vehicle's remaining power, X i is the size of the computing task that the vehicle needs to unload at time t, a i (t)∈{Local,Edge,Cloud} represents action a i (t) is to offload the computing task to the local Local, edge computing unit Edge or cloud server Cloud.
[0016] Preferably, if the computing task is offloaded to local computing, then:
[0017]
[0018] The latency of local computation for the vehicle, is the energy consumption required for local computing in the vehicle, A is the computing intensity, which indicates the number of CPU cycles required for one bit, and f i is the vehicle CPU speed, κ i Energy consumption parameters when performing computing tasks for electric vehicles.
[0019] Preferably, if the computing task is offloaded to the edge computing unit, then:
[0020]
[0021] The transmission delay of offloading computing tasks to edge computing units, is the computational latency of the computing task in the edge computing unit, P iRepresents the energy consumed per unit time, R i is the transmission rate from the vehicle to the edge computing unit, f E is the CPU frequency of the edge computing unit, The total latency of offloading computing tasks from the vehicle to the edge computing unit, The energy consumed by offloading computing tasks from the vehicle to the edge computing unit.
[0022] Preferably, if the computing task is offloaded to the cloud server Cloud, then:
[0023]
[0024] represents the propagation delay of transmitting the computing task to the cloud server, The energy consumed by offloading computing tasks from electric vehicles to cloud servers, L i represents the distance from the vehicle to the cloud server, C represents the propagation speed of electromagnetic waves in free space, represents the transmission power of the vehicle terminal, Transmission latency of offloading computing tasks from electric vehicles to cloud servers.
[0025] According to another aspect of the present invention, the present invention also provides a system for optimizing and unloading computing tasks in an Internet of Vehicles based on a federated learning architecture, the system comprising:
[0026] A construction module is used to construct a vehicle networking model based on a federated learning architecture, and establish an objective function of minimizing computing delay and energy consumption based on the historical status data of the electric vehicle; the historical status data includes the location of the electric vehicle, the vehicle speed, the remaining power of the vehicle, and the size of the computing task that the vehicle needs to unload;
[0027] An optimization module, used to solve the objective function and optimize parameters by using a reinforcement learning algorithm to obtain an optimized unloading model;
[0028] The unloading module is used to obtain the current state data of the current electric vehicle, input the current state data into the optimized unloading model, and output the optimal unloading solution for the calculation task.
[0029] Preferably, the building module establishes an objective function for minimizing computing delay and energy consumption, including:
[0030] The objective function of vehicle unloading is established and the optimization problem is as follows:
[0031]
[0032] stC1:T i ≤T max
[0033] C2:E i ≤E max
[0034] C3:X i ≤X E , if a i (t) = {Edge}
[0035] C4:a i (t)≠{Cloud}, if EL i (t)≤EL thr
[0036] Among them, T i represents the total delay of the offloaded computing task, E i represents the energy consumed by offloading computing tasks; γ represents the weight of delay, T max is the maximum tolerable delay, E max is the maximum energy consumption value, X E represents the computing capacity of the edge computing unit, EL i (t) represents the remaining power of the vehicle, EL thr Indicates the threshold of the vehicle's remaining power, X i is the size of the computing task that the vehicle needs to unload at time t, a i (t)∈{Local,Edge,Cloud} represents action a i (t) is to offload the computing task to the local Local, edge computing unit Edge or cloud server Cloud.
[0037] Preferably, if the computing task is offloaded to local computing, then:
[0038]
[0039] The latency of local computation for the vehicle, is the energy consumption required for local computing in the vehicle, A is the computing intensity, which indicates the number of CPU cycles required for one bit, fi is the vehicle CPU speed, and κ i Energy consumption parameters when performing computing tasks for electric vehicles.
[0040] Preferably, if the computing task is offloaded to the edge computing unit, then:
[0041]
[0042] The transmission delay of offloading computing tasks to edge computing units, is the computational latency of the computing task in the edge computing unit, P iRepresents the energy consumed per unit time, R i is the transmission rate from the vehicle to the edge computing unit, f E is the CPU frequency of the edge computing unit, The total latency of offloading computing tasks from the vehicle to the edge computing unit, The energy consumed by offloading computing tasks from the vehicle to the edge computing unit.
[0043] Preferably, if the computing task is offloaded to the cloud server, then:
[0044]
[0045] represents the propagation delay of transmitting the computing task to the cloud server, The energy consumed by offloading computing tasks from electric vehicles to cloud servers, L i represents the distance from the vehicle to the cloud server, C represents the propagation speed of electromagnetic waves in free space, represents the transmission power of the vehicle terminal, Transmission latency of offloading computing tasks from electric vehicles to cloud servers.
[0046] Beneficial effects: The present invention constructs a vehicle network model based on a federated learning architecture, establishes an objective function for minimizing computing delay and energy consumption according to the electric vehicle position, vehicle speed, vehicle remaining power and the size of the computing task that the vehicle needs to unload, solves the optimal computing task unloading method, obtains the optimal neural network parameters in the DDPG network, inputs the current electric vehicle position, vehicle speed, vehicle remaining power and the size of the computing task that the vehicle needs to unload, obtains the optimal unloading method to optimize the unloading of computing tasks, realizes load balancing of task computing in the vehicle network, and improves the utilization rate of computing resources.
[0047] The features and advantages of the present invention will become clear through reference to the following drawings and detailed description of specific embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a flow chart of the method for optimizing offloading of computing tasks in the Internet of Vehicles based on the federated learning architecture;
[0049] Figure 2 This is a schematic diagram of the computing task optimization offloading system in the Internet of Vehicles based on the federated learning architecture;
[0050] Figure 3 and Figure 4 This is a comparison of the training loss performance of local training and federated learning architectures. DETAILED DESCRIPTION
[0051] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] Example 1
[0053] Figure 1 This is a flow chart of the method for optimizing offloading of computing tasks in the Internet of Vehicles based on the federated learning architecture. Figure 1 As shown, this embodiment provides a method for optimizing and offloading computing tasks in an Internet of Vehicles based on a federated learning architecture, and the method includes the following steps:
[0054] S1: Build an Internet of Vehicles model based on a federated learning architecture, and establish an objective function that minimizes computing latency and energy consumption based on the historical status data of the electric vehicle; the historical status data includes the location of the electric vehicle, the vehicle speed, the remaining power of the vehicle, and the size of the computing task that the vehicle needs to unload;
[0055] S2: using a reinforcement learning algorithm to solve the objective function and optimize parameters to obtain an optimized unloading model;
[0056] S3: Acquire current state data of the current electric vehicle, input the current state data into the optimization unloading model, and output the optimal unloading solution for the calculation task.
[0057] The method of this embodiment optimizes and unloads computing tasks, thereby achieving load balancing of task computing in the Internet of Vehicles and improving the utilization rate of computing resources.
[0058] In step S1, the objective function of minimizing computing delay and energy consumption is established including:
[0059] The objective function of vehicle unloading is established and the optimization problem is as follows:
[0060]
[0061] stC1:T i ≤T max
[0062] C2:E i ≤E max
[0063] C3:X i ≤X E , if a i (t) = {Edge}
[0064] C4:ai (t)≠{Cloud}, if EL i (t)≤EL thr
[0065] Among them, T i represents the total delay of the offloaded computing task, E i represents the energy consumed by offloading computing tasks; γ represents the weight of delay, T max is the maximum tolerable delay, E max is the maximum energy consumption value, X E represents the computing capacity of the edge computing unit, EL i (t) represents the remaining power of the vehicle, EL thr Indicates the threshold of the vehicle's remaining power, X i is the size of the computing task that the vehicle needs to unload at time t, a i (t)∈{Local,Edge,Cloud} represents action a i (t) is to offload the computing task to the local Local, edge computing unit Edge or cloud server Cloud.
[0066]
[0067] Vehicle remaining power EL i (t) and vehicle speed v i (t), t0 is the length of a time slot, Indicates the power consumption factor of the vehicle.
[0068] In step S1, if the computing task is offloaded to local computing, then:
[0069]
[0070] The latency of local computation for the vehicle, is the energy consumption required for local computing in the vehicle, A is the computing intensity, which indicates the number of CPU cycles required for one bit, and f i is the vehicle CPU speed, κ i Energy consumption parameters when performing computing tasks for electric vehicles.
[0071] Specifically, a network is constructed that includes a base station, a cloud server deployed in the base station, N vehicle terminals, and an edge computing unit. Each vehicle has a speed v i and status information {EL i , X i , L i}, EL i Indicates the remaining power, L i represents the distance from the vehicle terminal to the cloud server, Xi Indicates the size of the computing task that the vehicle needs to offload.
[0072] The latency of local vehicle calculations for:
[0073]
[0074] Among them, X i (t) is the size of the computing task that the vehicle needs to offload at time t, A is the computing intensity, which means the number of CPU cycles required for one bit, and fi is the speed of the vehicle CPU.
[0075] Energy consumption required for:
[0076] Among them, κ i The energy consumption parameter when performing computing tasks for electric vehicles is a constant related to the hardware structure of the computing unit.
[0077] In step S1, if the computing task is offloaded to the edge computing unit, then:
[0078]
[0079] The transmission delay of offloading computing tasks to edge computing units, is the computational latency of the computing task in the edge computing unit, P i Represents the energy consumed per unit time, R i is the transmission rate from the vehicle to the edge computing unit, f E is the CPU frequency of the edge computing unit, The total latency of offloading computing tasks from the vehicle to the edge computing unit, The energy consumed by offloading computing tasks from the vehicle to the edge computing unit.
[0080] Specifically, the latency of offloading computing tasks to edge computing units for:
[0081]
[0082] Among them, X i is the size of the computing task that the vehicle needs to unload at time t, R i is the transmission rate from the vehicle terminal to the edge computing unit, expressed as follows:
[0083]
[0084] Where B is the bandwidth, |{i|a i (t) = {Edge}}| represents the number of tasks offloaded to the edge computing unit, ai (t)∈{Local,Edge,Cloud} represents action a i (t) can be offloaded to the local Local, edge computing unit Edge or cloud server Cloud. Represents the path loss from the vehicle terminal to the edge computing server. represents the transmission power of the vehicle terminal, and N0 is the noise power.
[0085] Computational latency of computing tasks in edge computing units
[0086]
[0087] Among them, f E is the CPU frequency of the edge computing unit.
[0088] The total delay of the vehicle terminal offloading the computing task to the edge computing unit is for
[0089]
[0090] The energy consumed by the vehicle terminal to offload computing tasks to the edge computing unit is
[0091]
[0092] P i Represents the energy consumed per unit time.
[0093] In step S1, if the computing task is offloaded to the cloud server, then:
[0094]
[0095] represents the propagation delay of transmitting the computing task to the cloud server, The energy consumed by offloading computing tasks from electric vehicles to cloud servers, L i represents the distance from the vehicle to the cloud server, C represents the propagation speed of electromagnetic waves in free space, represents the transmission power of the vehicle terminal, Transmission latency of offloading computing tasks from electric vehicles to cloud servers.
[0096] Specifically, the transmission delay of the electric vehicle offloading computing tasks to the cloud server for:
[0097]
[0098] Among them, X i is the size of the offloaded computational task, R iis the transmission rate from the vehicle terminal to the cloud server, expressed as follows:
[0099]
[0100] Where B is the bandwidth, |{i|a i (t) = {Cloud}}| represents the number of tasks offloaded to the cloud server, a i (t)∈{Local, Edge, Cloud}. Represents the path loss from the vehicle terminal to the cloud server. represents the transmission power of the vehicle terminal, and N0 is the noise power.
[0101] The energy consumed by electric vehicles to offload computing tasks to cloud servers is:
[0102]
[0103] When unloading electric vehicles to cloud servers, the propagation delay cannot be ignored. It is expressed as follows:
[0104]
[0105] L i represents the distance from the vehicle terminal to the cloud server, and C represents the propagation speed of electromagnetic waves in free space. In the scenario where electric vehicles are unloaded to the cloud server, the computing delay is negligible.
[0106]
[0107] In step S2, a reinforcement learning algorithm is used to solve the objective function and optimize the parameters. Specifically, a deep deterministic policy gradient algorithm (DDPG) can be used to perform offline training first, and then the optimal neural network parameters in the DDPG network are obtained in a shorter time through a federated learning architecture. The specific process is as follows:
[0108] Define various spaces and functions
[0109] 1. State Space
[0110] The state s(t) of time slot t is: s(t) = {EL i , X i , L i}, i=1....N, where, EL i Indicates the remaining battery power, L i represents the position of the vehicle, X i Indicates the size of the computing task that the vehicle needs to unload. The status includes the current moment, the location of all vehicles, the remaining power, and the size of the computing task that needs to be unloaded.
[0111] 2. Action Space
[0112] Action at time t: a(t) = {a i (t), i = 1....N}, according to the algorithm output value, for a i (t) is quantified as follows
[0113]
[0114] 3. Reward Function
[0115] Modify the above optimization problem and find the optimal action a(t). According to the objective function, the vehicle terminal needs to minimize energy consumption while minimizing the delay. We set the reward value of the vehicle terminal in time slot t as follows:
[0116]
[0117] When the constraints C1, C2, C3, and C4 are met, the vehicle terminal receives a reward. If the constraints are not met, a reward of -1 is received. The total reward value of the vehicle network at time slot t is as follows:
[0118]
[0119] Offline training algorithm:
[0120] Based on the DDPG algorithm, the optimization of neural network parameters is mainly divided into two processes: one is the sampling process and the other is the training process.
[0121] Sampling process:
[0122] In the process of collecting data, the Actor network outputs an action a(t) based on the current state s(t), and then the agent performs this action in the environment to obtain a new state s(t+1) and a reward r(t), forming a quaternion: state s(t), action a(t), reward value r(t) and next state s(t+1), which is placed in the experience replay pool. The agent interacts with the environment multiple times to generate experience data samples. Each time a piece of data is placed, it is determined whether the number of data in the experience replay pool reaches a preset threshold. If it reaches the threshold, the training process is executed, otherwise the sampling process continues.
[0123] Training process:
[0124] 1. Take a batch of data from the experience replay pool and send the data to the Critic network.
[0125] Critic network update process: update the four-tuple state s(t) = {EL1(t), EL2(t), ..., EL N(t), X1(t), X2(t), ...X N (t), L1(t), L2(t), ...L N (t)}, action a(t) = {a1(t), a2(t), ..., a N (t)}, reward value r(t) and next state s(t+1)={EL1(t+1), EL2(t+1), ..., EL N (t+1), X1(t+1), X2(t+1),... N The s(t) and a(t) in (t+1)} are input into the Critic network, and the Critic network obtains the evaluation value Q(s(t), a(t)) of the state-action pair (s(t), a(t)). The state s(t+1) is input into the Actor target network, and the Actor target network calculates the action a(t+1) under the state s(t+1), and returns a(t+1) to the Critic network. Subsequently, the Critic network inputs s(t+1) and a(t+1) together into the Critic target network, and the Critic target network calculates a Q value Q T (s(t+1), a(t+1)), is returned to the Critic network, and the Critic network calculates the target value Target(t)=r based on the returned Q value. i (t)+ξ(1-done)Q T (s(t+1), a(t+1)), where ξ is the discount factor, done∈{0,1}, done=1 indicates a terminal state, and the agent does not receive any reward after the current state, and done=0 indicates a non-terminal state, and the agent can still receive a reward after the current state. We hope that the evaluation value Q(s(t), a(t)) output by the Critic network should be as equal to the target value Target(t) as possible, and the gradient ascent / descent algorithm is used for the parameters of the Critic neural network to minimize the difference between the two.
[0126] Update of the Actor target network and the Critic target network: The parameters in the target network are updated slowly using a soft update method, and the output will be more stable. Every once in a while, the neural network parameters θ of the two target networks are updated. μ and θ Q Update the neural network parameters θ of the target network μ′ and θ Q′ . Using θ μ′ =τθ μ +(1-τ)θμ′ Update Actor target network θ μ′ , using θ Q′ =τθ Q +(1-τ)θ Q′ Update Actor target network 9 Q′ , τ is the update weight, which is used to adjust the proportion of new and old parameters.
[0127] Actor network update process: According to the evaluation value Q(s(t), a(t)) given by the Critic network, we use the gradient ascent / descent algorithm for the Actor neural network parameters to maximize the Q value.
[0128] The optimal neural network parameters of the DDPG network are obtained through the above training process, that is, the neural network parameters θ of the Actor actor network μ . Input the current state parameter, that is, s(t c )={EL1(t c ), EL2(t c ), ..., EL N (t c ), X1(t c ), X2(t c ), ...X N (t c ), L1(t c ), L2(t c ), ...L N (t c )}, get the optimal action a(t c ).
[0129] Figure 3 and Figure 4 This is a comparison chart of the training loss performance of local training and federated learning architecture. As can be seen from the figure, the federated learning architecture can achieve a lower training loss value in a faster time. Compared with the random unloading method, the method proposed in this embodiment can obtain a lower objective function.
[0130] This embodiment constructs a vehicle network model based on a federated learning architecture, establishes an objective function of minimizing computing delay and energy consumption according to the electric vehicle position, vehicle speed, vehicle remaining power and the size of the computing task that the vehicle needs to unload, solves the optimal computing task unloading method, obtains the optimal neural network parameters in the DDPG network, inputs the current electric vehicle position, vehicle speed, vehicle remaining power and the size of the computing task that the vehicle needs to unload, obtains the optimal unloading method to optimize the unloading of computing tasks, realizes load balancing of task computing in the vehicle network, and improves the utilization rate of computing resources.
[0131] Example 2
[0132] Figure 2 This is a schematic diagram of the computing task optimization offloading system in the Internet of Vehicles based on the federated learning architecture. Figure 2 As shown, this embodiment provides a system for optimizing and unloading computing tasks in an Internet of Vehicles based on a federated learning architecture, and the system includes:
[0133] A construction module 201 is used to construct a vehicle network model based on a federated learning architecture, and establish an objective function of minimizing computing delay and energy consumption according to the historical state data of the electric vehicle; the historical state data includes the position of the electric vehicle, the vehicle speed, the remaining power of the vehicle, and the size of the computing task that the vehicle needs to unload;
[0134] An optimization module 202 is used to solve the objective function and optimize the parameters by using a reinforcement learning algorithm to obtain an optimized unloading model;
[0135] The unloading module 203 is used to obtain the current state data of the current electric vehicle, input the current state data into the optimized unloading model, and output the optimal unloading solution of the computing task.
[0136] Preferably, the construction module 201 establishes an objective function for minimizing computing delay and energy consumption, including:
[0137] The objective function of vehicle unloading is established and the optimization problem is as follows:
[0138]
[0139] stC1:T i ≤T max
[0140] C2:E i ≤E max
[0141] C3:X i ≤X E , if a i (t) = {Edge}
[0142] C4:a i (t)≠{Cloud}, if EL i (t)≤EL thr
[0143] Among them, T i represents the total delay of the offloaded computing task, E i represents the energy consumed by offloading computing tasks; γ represents the weight of delay, T max is the maximum tolerable delay, E max is the maximum energy consumption value, X Erepresents the computing capacity of the edge computing unit, EL i (t) represents the remaining power of the vehicle, EL thr Indicates the threshold of the vehicle's remaining power, X i is the size of the computing task that the vehicle needs to unload at time t, a i (t)∈{Local,Edge,Cloud} represents action a i (t) is to offload the computing task to the local Local, edge computing unit Edge or cloud server Cloud.
[0144] Preferably, if the computing task is offloaded to local computing, then:
[0145]
[0146] The latency of local computation for the vehicle, is the energy consumption required for local computing in the vehicle, A is the computing intensity, which indicates the number of CPU cycles required for one bit, and f i is the vehicle CPU speed, κ i Energy consumption parameters when performing computing tasks for electric vehicles.
[0147] Preferably, if the computing task is offloaded to the edge computing unit, then:
[0148]
[0149] The transmission delay of offloading computing tasks to edge computing units, is the computational latency of the computing task in the edge computing unit, P i Represents the energy consumed per unit time, R i is the transmission rate from the vehicle to the edge computing unit, f E is the CPU frequency of the edge computing unit, The total latency of offloading computing tasks from the vehicle to the edge computing unit, The energy consumed by offloading computing tasks from the vehicle to the edge computing unit.
[0150] Preferably, if the computing task is offloaded to the cloud server, then:
[0151]
[0152] represents the propagation delay of transmitting the computing task to the cloud server, The energy consumed by offloading computing tasks from electric vehicles to cloud servers, L i represents the distance from the vehicle to the cloud server, C represents the propagation speed of electromagnetic waves in free space, represents the transmission power of the vehicle terminal, Transmission latency of offloading computing tasks from electric vehicles to cloud servers.
[0153] The specific implementation process of the functions realized by each module in this embodiment 2 is the same as the implementation process in embodiment 1, and will not be repeated here.
[0154] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A method for optimizing and offloading computing tasks in a vehicle network based on a federated learning architecture, characterized in that: The method comprises the following steps: S1: Build an Internet of Vehicles model based on a federated learning architecture, and establish an objective function that minimizes computing latency and energy consumption based on the historical status data of the electric vehicle; the historical status data includes the location of the electric vehicle, the vehicle speed, the remaining power of the vehicle, and the size of the computing task that the vehicle needs to unload; S2: using a reinforcement learning algorithm to solve the objective function and optimize parameters to obtain an optimized unloading model; S3: obtaining current state data of the current electric vehicle, inputting the current state data into the optimization unloading model, and outputting an optimal unloading solution for the calculation task; Wherein, the objective function of establishing the minimization of computing delay and energy consumption includes: The objective function of vehicle unloading is established and the optimization problem is as follows: s.t.C1:T i ≤T max C2:E i ≤E max C3:X i ≤X E , if a i (t) = {Edge} C4:a i (t) ≠ {Cloud}, if EL i (t) ≤ EL thr Where N represents N vehicle terminals, T i represents the total delay of the offloaded computing task, E i represents the energy consumed by offloading computing tasks; γ represents the weight of delay, T max is the maximum tolerable delay, E max is the maximum energy consumption value, X E represents the computing capacity of the edge computing unit, EL i (t) represents the remaining power of the vehicle, EL thr Indicates the threshold of the vehicle's remaining power, X i is the size of the computing task that the vehicle needs to unload at time t, a i (t)∈{Local,Edge,Cloud} represents action a i (t) offloading computing tasks to the local Local, edge computing unit Edge or cloud server Cloud; If the computing task is offloaded to local computing, then: The latency of local computation for the vehicle, is the energy consumption required for local computing in the vehicle, A is the computing intensity, which indicates the number of CPU cycles required for one bit, and f i is the vehicle CPU speed, κ i The energy consumption parameter when an electric vehicle performs computing tasks, X i (t) represents the size of the computing task that the vehicle needs to unload at time t; If the computing task is offloaded to the edge computing unit, then: The transmission delay of offloading computing tasks to edge computing units, is the computational latency of the computing task in the edge computing unit, P i Represents the energy consumed per unit time, R i is the transmission rate from the vehicle to the edge computing unit, f E is the CPU frequency of the edge computing unit, The total latency of offloading computing tasks from the vehicle to the edge computing unit, The energy consumed by offloading computing tasks from the vehicle to the edge computing unit; If the computing tasks are offloaded to the cloud server, then: represents the air propagation delay of transmitting computing tasks to the cloud server, The energy consumed by offloading computing tasks from electric vehicles to cloud servers, L i represents the distance from the vehicle to the cloud server, C represents the propagation speed of electromagnetic waves in free space, represents the transmission power of the vehicle terminal, Transmission delay of offloading computing tasks from electric vehicles to cloud servers, Represents the delay of offloading the computing task of vehicle terminal i to the cloud server.
2. A computing task optimization offloading system in the Internet of Vehicles based on a federated learning architecture, characterized in that: The system comprises: A construction module is used to construct a vehicle network model based on a federated learning architecture, and establish an objective function of minimizing computing delay and energy consumption based on the historical state data of the electric vehicle; the historical state data includes the location of the electric vehicle, the vehicle speed, the remaining power of the vehicle, and the size of the computing task that the vehicle needs to unload; An optimization module, used to solve the objective function and optimize parameters by using a reinforcement learning algorithm to obtain an optimized unloading model; An unloading module, used to obtain current state data of the current electric vehicle, input the current state data into the optimized unloading model, and output an optimal unloading solution for the computing task; The building block establishes the objective function of minimizing computing delay and energy consumption, including: The objective function of vehicle unloading is established and the optimization problem is as follows: s.t.C1:T i ≤T max C2:E i ≤E max C3:X i ≤X E , if a i (t) = {Edge} C4:a i (t) ≠ {Cloud}, if EL i (t) ≤ EL thr Among them, T i represents the total delay of the offloaded computing task, E i represents the energy consumed by offloading computing tasks; γ represents the weight of delay, T max is the maximum tolerable delay, E max is the maximum energy consumption value, X E represents the computing capacity of the edge computing unit, EL i (t) represents the remaining power of the vehicle, EL thr Indicates the threshold of the vehicle's remaining power, X i is the size of the computing task that the vehicle needs to unload at time t, a i (t)∈{Local,Edge,Cloud} represents action a i (t) offloading computing tasks to the local Local, edge computing unit Edge or cloud server Cloud; If the computing task is offloaded to local computing, then: The latency of local computation for the vehicle, is the energy consumption required for local computing in the vehicle, A is the computing intensity, which indicates the number of CPU cycles required for one bit, and f i is the vehicle CPU speed, κ i Energy consumption parameters when performing computing tasks for electric vehicles; If the computing task is offloaded to the edge computing unit, then: The transmission delay of offloading computing tasks to edge computing units, is the computational latency of the computing task in the edge computing unit, P i Represents the energy consumed per unit time, R i is the transmission rate from the vehicle to the edge computing unit, f E is the CPU frequency of the edge computing unit, The total latency of offloading computing tasks from the vehicle to the edge computing unit, The energy consumed by offloading computing tasks from the vehicle to the edge computing unit; If the computing tasks are offloaded to the cloud server, then: represents the air propagation delay of transmitting computing tasks to the cloud server, The energy consumed by offloading computing tasks from electric vehicles to cloud servers, L i represents the distance from the vehicle to the cloud server, C represents the propagation speed of electromagnetic waves in free space, represents the transmission power of the vehicle terminal, Transmission latency of offloading computing tasks from electric vehicles to cloud servers.
