The present disclosure relates to the technical field of task offloading, in particular to a method and system for offloading a computing task in a vehicle.
With the advent of the era of intelligent vehicles, the data volume and computation that vehicles need to process are growing exponentially. Intelligent sensors, high-definition maps, vehicle-to-everything (V2X) collaboration, augmented reality/virtual reality (AR/VR), and other applications make it more and more difficult for computing power of a single vehicle controller to cope with. If a vehicle-cloud architecture is uploaded to a cloud platform for processing computing tasks, the problems in consumption of network bandwidth and real-time performance of computing are hard to solve.
In view of the technical problems to be solved, the present disclosure provides a method and system for offloading a task in a vehicle, which can improve the real-time performance of the computing task under the condition of meeting computing power for the computing task.
To solve the above technical problems, a technical solution adopted by the present disclosure is as follows:
A method for offloading a computing task in a vehicle includes the following steps:
To solve the above technical problems, another technical solution adopted by the present disclosure is as follows:
A system for offloading a computing task in a vehicle includes a first controller and a second controller, where the first controller includes a first memory, a first processor, and a first computer program stored on the first memory and executable on the first processor; and the second controller includes a second memory, a second processor, and a second computer program stored on the second memory and executable on the second processor. The first processor, when executing the first computer program, implements the following steps:
The second processor, when executing the second computer program, implements the following steps:
The present disclosure has the following beneficial effects: when the data volume of the computing task in the first controller of the vehicle is greater than the preset maximum data volume, the data volume in the first controller is first sent to the second controller in the vehicle, the second controller calculates the offloading information of the computing task in the first controller and sends the offloading information to the first controller, and the first controller performs task offloading based on the offloading information. Therefore, through task offloading between different controllers in the vehicle, the problem of insufficient computing power of the controller can be solved, and the higher real-time performance is achieved compared with cloud computing.
The technical content, achieved objectives and effects of the present disclosure are described in detail below with reference to the embodiments and the accompanying drawings.
Referring to
It can be seen from the above description that the present disclosure has the following beneficial effects: when the data volume of the computing task in the first controller of the vehicle is greater than the preset maximum data volume, the data volume in the first controller is first sent to the second controller in the vehicle, the second controller calculates the offloading information of the computing task in the first controller and sends the offloading information to the first controller, and the first controller performs task offloading based on the offloading information. Therefore, through task offloading between different controllers in the vehicle, the problem of insufficient computing power of the controller can be solved, and the higher real-time performance is achieved compared with cloud computing.
Further, calculating, by the second controller, offloading information of the computing task based on the data volume for the computing task includes:
It can be seen from the above description that the task offloading objective function is formed in the second controller to minimize a delay, such that the offloading rate, the reserved bandwidth, and the resource allocated to the computing task can be calculated, thereby making full use of computing resources in an in-vehicle network, and minimizing the total task delay of the controllers in the vehicle.
Further, obtaining, by the second controller, formulas for local computing delay and energy consumption based on the data volume of the computing task includes:
where Zi represents energy consumed by the first controller i in a single CPU instruction cycle and is a known constant.
It can be seen from the above description that the formulas for the local computing delay and energy consumption are established, such that it is convenient to establish the task offloading objective function subsequently in combination with the formulas.
Further, obtaining, by the second controller, formulas for task offloading total delay and energy consumption based on the data volume of the computing task includes:
It can be seen from the above description that the formulas for the task offloading total delay and energy consumption are established, such that it is convenient to establish the task offloading objective function subsequently in combination with the formulas.
Further, forming, by the second controller, a task offloading objective function to minimize a delay, and solving the objective function to obtain offloading information includes:
It can be seen from the above description that the second controller evaluates a delay and an energy consumption cost of offloading the computing task in the first controller, and makes corresponding decisions on the offloading rate xi,j, the reserved bandwidth SidleB, and the computing resource fi,jM allocated by comparing costs of local computing and offloading computing, which can achieve the aim of minimizing a delay cost of in-vehicle computing.
Referring to
The second processor, when executing the second computer program, implements the following steps:
It can be seen from the above description that when the data volume of the computing task in the first controller of the vehicle is greater than the preset maximum data volume, the data volume in the first controller is first sent to the second controller in the vehicle, the second controller calculates the offloading information of the computing task in the first controller and sends the offloading information to the first controller, and the first controller performs task offloading based on the offloading information. Therefore, through task offloading between different controllers in the vehicle, the problem of insufficient computing power of the controller can be solved, and the higher real-time performance is achieved compared with cloud computing.
Further, calculating offloading information of the computing task based on the data volume of the computing task includes:
It can be seen from the above description that the task offloading objective function is formed in the second controller to minimize a delay, such that the offloading rate, the reserved bandwidth, and the resource allocated to the computing task can be calculated, thereby making full use of computing resources in an in-vehicle network, and minimizing the total task delay of the controllers in the vehicle.
Further, obtaining formulas for local computing delay and energy consumption based on the data volume of the computing task includes:
It can be seen from the above description that the formulas for the local computing delay and energy consumption are established, such that it is convenient to establish the task offloading objective function subsequently in combination with the formulas.
Further, obtaining formulas for task offloading total delay and energy consumption based on the data volume of the computing task includes:
where fi,jM represents computing power allocated by the second controller to the task j in the first controller i, tHPB represents a high-priority traffic blocking delay, tLPB represents a low-priority traffic blocking delay, tTSB represents a traffic shaping delay, ttrans represents a data frame transmission delay, and ε represents a ratio of a computing result to the data volume of the computing task; and
It can be seen from the above description that the formulas for the task offloading total delay and energy consumption are established, such that it is convenient to establish the task offloading objective function subsequently in combination with the formulas.
Further, forming a task offloading objective function to minimize a delay, and solving the objective function to obtain offloading information includes:
It can be seen from the above description that the second controller evaluates a delay and an energy consumption cost of offloading the computing task in the first controller, and makes corresponding decisions on the offloading rate xi,j, the reserved bandwidth SidleB, and the computing resource fi,jM allocated by comparing costs of local computing and offloading computing, which can achieve the aim of minimizing a delay cost of in-vehicle computing.
The method and system for offloading a task in a vehicle according to the present disclosure are applicable to task offloading on intelligent vehicles, can improve the real-time performance of the computing task under the condition of meeting computing power for the computing task, and are described below by specific embodiments.
Referring to
In S1, a first controller in a vehicle determines whether a data volume of a computing task is greater than a preset local maximum data volume, and sends, if the data volume of the computing task is greater than the preset local maximum data volume, the data volume of the computing task to a second controller in the vehicle.
In this embodiment, the first controller is a main controller, and the second controller is a central controller for audio and video entertainment.
Specifically, the first controller i presets a local computing maximum data volume Di, and when a data volume to be processed by a computing task j is greater than Di, the controller determines that the current controller in the vehicle has a large volume of computing data and a high computing delay, sends a total data volume Di,j of the current task to the central controller for audio and video entertainment, and requests for a computing resource for task offloading.
In S2, the second controller calculates offloading information of the computing task based on the data volume for the computing task, and sends the offloading information to the first controller.
Specifically, the central controller for audio and video entertainment stores software and hardware performance-related constants of the controllers in advance, and when a task offloading request from a new controller i is received, an objective function is established and optimal offloading rate xi,j, reserved bandwidth SidleB, and computing resource fi,jM allocated are calculated.
In S21, a delay model for a task offloading information frame is built.
Originally, audio and video data is transmitted on a vehicle-mounted Ethernet bus based on an audio video bridging (AVB) protocol. Conventionally, the data has three levels, where a level A is a high priority corresponding to a highly real-time data stream, which is generally an audio and video data stream, a vehicle control signal frame, or the like; a level B is a second priority, and in this embodiment, this level is specially used as a data stream of computing task offloading class, and the level-A data and the level-B data are both processed by a shaping algorithm of the AVB protocol to ensure the real-time performance; and a level BE indicates that other data is transmitted in shaping data whenever possible by using a conventional Ethernet Best Effort mechanism, and this level is a lowest priority and does not participate in shaping.
Specifically, a delay of task offloading includes several parts such as an input waiting delay, a storage and forwarding delay, an interference delay, and a transmission delay, where the interference delay caused by a traffic conflict is a main delay. The interference delay includes five types of delays: a high-priority traffic blocking delay tHPB, a same-priority traffic blocking delay tSPB, a low-priority traffic blocking delay tLPB, a traffic shaping delay tTSB, and a data frame transmission delay ttrans.
Without considering the same-priority traffic blocking delay, the class-A data only includes three types of delays due to the highest priority. The traffic shaping delay tTSB thereof is a time to wait for a credit value loCreditA of the class-A data to restore to 0 in the shaping algorithm:
When the shaping algorithm allows the class-A data to be sent, a low-level data frame may be being transmitted, and it is required to wait for a low-level data packet to be sent. A computing formula for the delay tLPB is as follows:
The transmission delay of the class-A data itself is as follows:
where MA is a length of a class-A data frame that is sent currently. Therefore, a delay WA=tTSBA+LLPBA+ttransA of the class-A data can be obtained.
For a class-B task offloading information frame, a traffic shaping delay TSB is as follows:
A computing formula for the low-priority traffic blocking delay is as follows:
A transmission delay thereof is as follows:
When the class-B data frame is shaped and can be sent, considering that there may be a length of part of the class-A data frame that has not yet been transmitted, high-priority traffic blocking is generated:
t
HPB
B
=W
A
−t
LPB
A;
Therefore, a delay of the computing task offloading information frame can be obtained:
W
B
=t
TSB
B
+t
HPB
B
+t
LPB
B
+t
trans
B.
In 522, the second controller obtains formulas for a local computing delay and energy consumption and a task offloading total delay and energy consumption based on the data volume of the computing task.
Specifically, a task offloading rate is set to xi,j, 0≤xi,j≤1, which represents a proportion of a jth computing task in the first controller i that is offloaded to the central controller for audio and video entertainment. The remaining computing tasks of (1−xi,j) are left in the first controller locally for computation. The local delay is as follows:
The local computing energy consumption Ei,j is as follows:
A computing delay of task offloading is as follows:
Therefore, a total transmission delay of task offloading is a sum of a time for data to be transmitted to the central controller for audio and video entertainment and a time for a data computing result to be transmitted back to the controller from the central controller:
T
i,j
EDGE
=T
i,j
COM
+T
i,j
TRAN;
In S23, the second controller forms a task offloading objective function to minimize a delay, and calculates offloading information based on the objective function, where the offloading information includes an offloading rate, a reserved bandwidth, and a resource allocated to the computing task.
Specifically, the central controller for audio and video entertainment evaluates a delay and an energy consumption cost of offloading the computing task in the first controller, and makes corresponding decisions on the offloading rate xi,j, the reserved bandwidth SidleB and the computing resource fi,jM allocated by comparing costs of local computing and offloading computing, thereby achieving the aim of minimizing a delay cost of in-vehicle computing. Moreover, if it is assumed that the designed maximum energy consumption of the controller i is EiMAX, the total energy consumption after offloading computing cannot exceed an upper limit of the designed maximum energy consumption of the controller itself.
So an optimized objective function is formed:
This is a single objective optimization problem involving multiple variables. There are many well-known methods for solving the optimization problem of an objective equation. In the present disclosure, a genetic algorithm can be used for optimization solving to obtain the decision on the offloading rate xi,j the reserved bandwidth SidleB, and the computing resource fi,jM allocated which meet optimization conditions of the objective function.
In S3, the first controller offloads the computing task into the second controller based on the offloading information.
Specifically, the central controller for audio and video entertainment informs the controller of the offloading rate xi,j and the reserved bandwidth SidleB, and the controller determines how much data to be processed by the computing task needs to be transmitted to the central controller for audio and video entertainment by the offloading rate xi,j, and sends it over Ethernet by the reserved bandwidth SidleB.
Referring to
The second processor 7, when executing the second computer program, implements the following steps:
In some embodiments, calculating offloading information of the computing task based on the data volume of the computing task includes:
In some embodiments, obtaining formulas for local computing delay and energy consumption based on the data volume of the computing task includes:
In some embodiments, obtaining formulas for task offloading total delay and energy consumption based on the data volume of the computing task includes:
In some embodiments, forming a task offloading objective function to minimize a delay, and solving the objective function to obtain offloading information includes:
In summary, in the method and system for offloading a computing task in a vehicle provided by the present disclosure, when the data volume of the computing task in the first controller of the vehicle is greater than the preset maximum data volume, the data volume in the first controller is first sent to the second controller in the vehicle, the second controller calculates the offloading information of the computing task in the first controller and sends the offloading information to the first controller, and the first controller performs task offloading based on the offloading information. Therefore, through task offloading between different controllers in the vehicle, the problem of insufficient computing power of the controller can be solved, and the higher real-time performance is achieved compared with cloud computing.
The above descriptions are only the embodiments of the present disclosure, rather than limiting the scope of patent of the present disclosure. Any equivalent transformations made using the content of the specification and the accompanying drawings of the present disclosure, directly or indirectly applied in related technical fields, are similarly included in the scope of patent protection of the present disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 202210646664.X | Jun 2022 | CN | national |
This application claims priority to International Patent Application PCT/CN2022/121608, filed Sep. 27, 2022, which claims priority to Chinese Patent Application 202210646664.X, filed on Jun. 8, 2022. International Patent Application PCT/CN2022/121608 and Chinese Patent Application 202210646664.X are incorporated herein by reference.
| Filing Document | Filing Date | Country | Kind |
|---|---|---|---|
| PCT/CN2022/121608 | 9/27/2022 | WO |