Task offloading method, electronic device, and storage medium

By coordinating task vehicles, service vehicles, and roadside units, and employing a two-layer unloading method to optimize unloading location and unloading rate, the problem of low resource utilization in the transportation system is solved, and efficient and reliable storage and information synchronization of assisted driving data are achieved.

CN115202863BActive Publication Date: 2026-08-25STATE GRID HENAN INFORMATION & TELECOMM CO +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210531500.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2026-08-25
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

Existing technologies cannot optimize unloading location and unloading rate through two-layer unloading, resulting in low utilization of transportation system resources and affecting the reliable storage efficiency of assisted driving data.

Method used

By obtaining the task vehicle's block data to generate the task resource requirements and the service vehicle's spare computing resources, the first-layer unloading rate and the second-layer unloading rate are determined, realizing the two-layer unloading of the task, optimizing the unloading location and unloading rate, and improving the resource utilization rate of the transportation system.

Benefits of technology

It improves the processing efficiency of block generation tasks, enhances the reliable storage efficiency and information synchronization efficiency of assisted driving data, and strengthens the reliability of assisted driving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115202863B_ABST
    Figure CN115202863B_ABST
Patent Text Reader

Abstract

The application provides a task offloading method, an electronic device and a storage medium. The method comprises the following steps: determining a first layer offloading rate according to a task resource requirement, a free computing resource and a unit resource cost, and determining a plurality of target offloading vehicles and a second layer offloading rate corresponding to each target offloading vehicle; guiding a task vehicle to offload a block generation task to a road side unit and each target offloading vehicle for processing according to the first layer offloading rate and the second layer offloading rate; receiving a task processing result of the road side unit and each target offloading vehicle to form a target task result; generating a target block, verifying the target block, and adding the target block to a main side block chain to store auxiliary driving data if the target block passes the verification. The scheme provided by the application can improve the block generation efficiency and improve the trusted storage efficiency of the auxiliary driving data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a task offloading method, electronic device, and storage medium. Background Technology

[0002] With increasing urban road traffic flow, drivers inevitably encounter congested areas, significantly increasing travel time, fuel consumption, and additional emissions. To prevent congestion and improve driving quality, assisted driving systems are needed to calculate appropriate speeds and plan reasonable routes for drivers. To ensure the security of assisted driving data, blockchain technology is typically used to provide storage. However, since assisted driving data must be stored on all blockchain nodes, this increases communication overhead, leading to a waste of storage space and processing power. Furthermore, if all vehicles access the blockchain, data from different vehicle types could be leaked. Additionally, the consensus process generates numerous computationally intensive tasks, making it difficult for blockchain to meet the low latency and high throughput requirements of assisted driving.

[0003] In existing technologies, service-providing vehicles upload their service capability information to roadside edge computing nodes. The roadside edge nodes collect vehicle capability information and use blockchain technology to publish and share it on the chain. They then distribute the service capability information in the blocks to vehicles within their coverage area. User vehicles make calculation and unloading decisions based on the service capability information of edge nodes and surrounding service vehicles. Service-providing vehicles upload ongoing service information, and edge nodes update the service chain.

[0004] The aforementioned prior art has the following disadvantages:

[0005] This scheme cannot optimize the unloading location and unloading rate through two-layer unloading, and cannot further improve the utilization rate of traffic system resources to improve the efficiency of block generation, thus affecting the reliable storage efficiency of assisted driving data. Summary of the Invention

[0006] This application provides a task unloading method, electronic device, and storage medium to solve the problem in the prior art that it is impossible to optimize the unloading location and unloading rate through two-layer unloading, and it is impossible to further improve the utilization rate of traffic system resources to improve the efficiency of block generation, thereby improving the reliable storage efficiency of assisted driving data.

[0007] The first aspect of this application provides a task unloading method, including:

[0008] Obtain the task resource requirements of the block generation task of the task vehicle, and obtain the spare computing resources and unit resource cost of the service vehicle.

[0009] The first-level unloading rate is determined based on the task resource requirements, spare computing resources, and unit resource cost, and several target unloading vehicles and the corresponding second-level unloading rate for each target unloading vehicle are also determined.

[0010] Based on the first-level unloading rate, the task vehicle is guided to unload the first part of the block generation task to the roadside unit for processing. Based on the second-level unloading rate corresponding to each target unloading vehicle, the roadside unit is guided to unload the second part of the first part of the task to each target unloading vehicle for processing.

[0011] Receive the task processing results from the roadside unit and each target unloading vehicle, form the unloading task result, send the unloading task result to the task vehicle, and form the target task result corresponding to the block generation task.

[0012] The block generation task is determined based on the target task results. If it is completed, the target block is generated and verified. If the target block is verified, it is added to the main blockchain to store assisted driving data.

[0013] In one embodiment, the task information of the block generation task includes the task data volume, task computation intensity, data volume ratio, and maximum tolerable latency of the task, wherein the data volume ratio is the ratio of the output result data volume to the input data volume.

[0014] The first-level offloading rate is determined based on task resource requirements, available computing resources, and unit resource cost, including:

[0015] The data transmission rate between the roadside unit and the task vehicle and service vehicle is determined based on the channel bandwidth, channel gain, transmission power, path loss index, background noise power, and distance information between the roadside unit and the task vehicle and service vehicle.

[0016] Obtain the first CPU frequency of the task vehicle and the service vehicle, and obtain the second CPU frequency of the roadside unit;

[0017] The first completion time for the task vehicle to complete the block generation task is determined based on the task data volume, task computation intensity, and first CPU frequency.

[0018] The total delay function is determined based on the task data volume, task computation intensity, data volume ratio, data transmission rate, first CPU frequency, and second CPU frequency. The total delay function is used to determine the functional relationship between the first layer unloading rate, the second layer unloading rate, and the second completion time. The second completion time is the time for the block generation task to be unloaded to the roadside unit and for each target unloading vehicle to be processed.

[0019] The vehicle utility function for the task is determined based on the unit resource cost, the maximum tolerable delay of the task, and the first completion time. The hierarchical unloading utility function is determined based on the unit resource cost, the maximum tolerable delay of the task, and the total delay function.

[0020] An unloading optimization model is constructed based on the vehicle utility function and the hierarchical unloading utility function.

[0021] The first-level unloading rate is determined based on the unloading optimization model.

[0022] In one embodiment, the total latency function is determined based on the task data volume, task computation intensity, data volume ratio, data transmission rate, first CPU frequency, and second CPU frequency, including:

[0023] The first duration function is determined based on the task data volume, task computation intensity, and first CPU frequency. The first duration function is used to determine the functional relationship between the processing time of the first retained task and the first layer unloading rate. The first retained task is the task retained in the task vehicle for processing in the block generation task.

[0024] The second duration function is determined based on the task data volume, task computation intensity, and second CPU frequency. The second duration function is used to determine the functional relationship between the processing time of the second retention task, the first layer unloading rate, and the second layer unloading rate. The second retention task is the task retained in the block generation task and processed in the roadside unit.

[0025] The third duration function is determined based on the amount of task data, the task computation intensity, and the first CPU frequency. The third duration function is used to determine the functional relationship between the task processing time of each target unloading vehicle and the second-layer unloading rate.

[0026] The communication delay function is determined based on the data transmission rate, the amount of task data, and the proportion of data volume. The communication delay function is used to determine the functional relationship between the communication delay between each target unloading vehicle and the roadside unit and the second-layer unloading rate.

[0027] The third duration function corresponding to each target unloading vehicle is summed with the communication delay function corresponding to each target unloading vehicle to obtain several target vehicle processing delay functions;

[0028] Based on several target vehicle processing delay functions and the second duration function, determine the maximum processing delay of each target unloading vehicle's task and the second retention task, and determine the function corresponding to the maximum processing delay of each target unloading vehicle and the roadside unit as the unloading task processing delay function.

[0029] The unloading delay function is determined based on the amount of task data and the data transmission rate. The unloading delay function is used to determine the functional relationship between the unloading communication delay between the task vehicle and the roadside unit and the first-level unloading rate.

[0030] The receiving delay function is determined based on the task data volume, data volume ratio, and data transmission rate. The receiving delay function is used to determine the functional relationship between the receiving communication delay between the task vehicle and the roadside unit and the first-layer unloading rate.

[0031] The unloading task processing delay function, the unloading delay function, and the receiving delay function are summed to obtain the unloading task completion delay function.

[0032] The maximum processing delay between the uninstallation task and the first retention task is determined based on the uninstallation task completion delay function and the first duration function. The function corresponding to the maximum processing delay between the uninstallation task and the first retention task is then determined as the total delay function.

[0033] In one embodiment, determining the first-layer unloading rate based on an unloading optimization model includes:

[0034] The reward function of the A3C algorithm is determined as the unloading optimization model;

[0035] The maximum value of the unloading optimization model is determined using the A3C algorithm;

[0036] The unloading rate in the target action space is defined as the first-level unloading rate, and the target action space is the action space corresponding to the unloading optimization model reaching its maximum value.

[0037] In one embodiment, determining a plurality of target unloading vehicles and a second-layer unloading rate corresponding to each target unloading vehicle includes:

[0038] Determine the expected unit resource cost of the block generation task, and determine the unit resource weighted cost of the service vehicle;

[0039] Based on the expected cost per unit resource and the weighted cost per unit resource, several target unloading vehicles are determined. The block generation task is then matched with each target unloading vehicle, and the second-level unloading rate corresponding to each target unloading vehicle is determined.

[0040] In one embodiment, several target unloading vehicles are determined based on the expected cost per unit resource and the weighted cost per unit resource. The block generation task is then matched with each target unloading vehicle, and the second-layer unloading rate corresponding to each target unloading vehicle is determined, including:

[0041] If there are n block generation tasks and m service vehicles, then the expected unit resource costs corresponding to the n block generation tasks are sorted in descending order, and the weighted unit resource costs corresponding to the m service vehicles are sorted in ascending order.

[0042] If the expected cost of the yth unit resource is greater than or equal to the weighted cost of the yth unit resource, and the expected cost of the (y+1)th unit resource is less than or equal to the weighted cost of the (y+1)th unit resource, then the service vehicles corresponding to the remaining my unit resource weighted costs that are less than the weighted cost of the yth unit resource among the m unit resource weighted costs are sorted in ascending order of available computing resources to obtain the target unloading vehicle sequence.

[0043] The service vehicle with the largest available computing resources in the target unloading vehicle sequence is selected as the current target unloading vehicle, and the current target unloading vehicle is matched with the block generation task corresponding to the expected cost of the y-th unit of resources.

[0044] The amount of spare resources required for the second-layer unloading process is determined based on the task resource requirements and the first-layer unloading rate. The second-layer unloading process is the process by which the roadside unit unloads the block generation task to the target unloading vehicle.

[0045] If the demand for spare resources is less than the spare computing resources corresponding to the current target unloading vehicle, then the block generation task corresponding to the expected cost of the current y-th unit resource is removed from the task list consisting of n block generation tasks, and the spare computing resources corresponding to the current target unloading vehicle and the target unloading vehicle sequence are updated. The second-level unloading rate of the current target unloading vehicle is determined to be the ratio of the demand for spare resources to the demand for task resources.

[0046] If the demand for spare resources is greater than the spare computing resources corresponding to the current target unloading vehicle, then the current target unloading vehicle is removed from the target unloading vehicle sequence, the demand for spare resources is updated, and the second-level unloading rate of the current target unloading vehicle is determined as the ratio of the spare computing resources corresponding to the current target unloading vehicle to the task resource demand.

[0047] If the demand for spare resources is equal to the spare computing resources corresponding to the current target unloading vehicle, then remove the block generation task corresponding to the expected cost of the current y-th unit resource from the task list, remove the current target unloading vehicle from the target unloading vehicle sequence, and determine the second-level unloading rate of the current target unloading vehicle as the ratio of the demand for spare resources to the demand for task resources.

[0048] The process of matching block generation tasks with each target unloading vehicle will stop once the task list is empty.

[0049] or

[0050] The process continues until the target unloading vehicle sequence becomes empty. Then, the matching of block generation tasks with each target unloading vehicle is stopped, and it is determined whether the current free resource demand is greater than zero. If the current free resource demand is greater than zero, the task corresponding to the current free resource demand is taken as the second retention task.

[0051] In one embodiment, determining the expected cost per unit resource for a block generation task and determining the weighted cost per unit resource for a service vehicle includes:

[0052] A first matching utility optimization function and a second matching utility optimization function are constructed. The first matching utility optimization function is used to determine the functional relationship between the task benefit parameter, the probability of successful matching of the first task, and the expected cost per unit resource. The expected cost per unit resource is used to maximize the benefit of the block generation task. The second matching utility optimization function is used to determine the functional relationship between the unit resource cost, the probability of successful matching of the second task, and the weighted cost per unit resource. The weighted cost per unit resource is used to maximize the service benefit of the service vehicle.

[0053] The expected cost per unit resource and the weighted cost per unit resource are determined based on the first matching utility optimization function and the second matching utility optimization function.

[0054] In one embodiment, verifying the target block includes:

[0055] If more than two-thirds of the nodes in the main blockchain confirm that the target block has passed verification, then the target block has passed verification.

[0056] If the verification processing time of the target block exceeds the verification limit, the target block cannot pass verification. The verification processing time is the sum of the target block propagation delay and the verification delay. The target block propagation delay is determined based on the number of transactions in the target block, the amount of data per unit transaction, the block transmission rate, the node spacing, and the speed of light. The verification delay is determined based on the preset average verification speed parameter and the number of transactions.

[0057] A second aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the task offloading method as described above.

[0058] A third aspect of this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the task offloading method as described above.

[0059] The task unloading method, electronic device, and storage medium provided in this application obtain the task resource requirements of the block generation task from the task vehicle, and obtain the spare computing resources and unit resource cost of the service vehicle. Based on the task resource requirements, spare computing resources, and unit resource cost, a first-level unloading rate is determined, and several target unloading vehicles and their corresponding second-level unloading rates are identified. The task vehicle is guided to unload the first part of the block generation task to the roadside unit for processing according to the first-level unloading rate. The roadside unit is guided to unload the second part of the first part of the task to the respective target unloading vehicles according to the second-level unloading rate of each target unloading vehicle. This two-level unloading method optimizes the unloading location and... The purpose of the unloading rate is to improve the utilization rate of transportation system resources and thus enhance the processing efficiency of block generation tasks. It receives task processing results from roadside units and various target unloading vehicles, forms unloading task results, sends these results to the task vehicles, and forms the target task results corresponding to the block generation task. Based on the target task results, it determines whether the block generation task is complete. If complete, a target block is generated and verified. If the target block verification passes, it is added to the main blockchain to store assisted driving data. This allows for efficient generation of target blocks to store assisted driving data, thereby improving the information synchronization efficiency between blocks in the main blockchain, enhancing the reliable storage efficiency of assisted driving data, and improving the reliability of assisted driving. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is one of the flowcharts illustrating the task unloading method provided in the embodiments of this application;

[0062] Figure 2 This is a second flowchart illustrating the task unloading method provided in the embodiments of this application;

[0063] Figure 3 This is the third flowchart illustrating the task unloading method provided in this application embodiment;

[0064] Figure 4 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0066] Figure 1 This is one of the flowcharts illustrating the task unloading method provided in this application. Please refer to... Figure 1 The task unloading method provided in this application embodiment may include:

[0067] Step 101: Obtain the task resource requirements of the task vehicle's block generation task, and obtain the spare computing resources and unit resource cost of the service vehicle.

[0068] A blockchain is a decentralized database that establishes trust relationships among all nodes through consensus. This application does not employ a typical blockchain framework due to its low scalability and consensus efficiency. Instead, it uses a master-side blockchain, or a 1+n master-side blockchain, consisting of a master chain and multiple side chains. Typically, index information is stored on the master chain, while complete data is stored on the side chains. By applying this master-side blockchain, driver assistance data for different vehicle models is stored on different side chains, thereby reducing the ledger size stored on the blockchain nodes and the number of consensus nodes on each side chain. This improves consensus speed, reduces communication overhead, and expands storage space. The master chain allows access from all nodes, while the side chains only allow access from certain types of vehicles and trusted institutions, preventing data leakage between different side chains, i.e., different types of vehicles.

[0069] In this embodiment, the system built on the 1+n main-side blockchain includes, but is not limited to, roadside units, trusted institutions (i.e., institutions providing assisted driving services), and vehicles such as ambulances, government vehicles, police cars, and private cars. The system contains information about the entities accessing the data, vehicle types, driving information, and protocols for accessing this data. Taking a police car as an example, when a police car needs assisted driving services, its OBU (On-Board Unit) acquires the vehicle's driving data in real time and transmits the data to a trusted institution for processing. When the assisted driving analysis is complete, a block needs to be generated on the corresponding sidechain to store the assisted driving data, including correct speed, driving route, and other vehicle information. Simultaneously, the roadside unit closest to the police car packages the index information of the assisted driving data to generate a main chain block.

[0070] Therefore, to more efficiently and reliably store assisted driving data, it is necessary to generate blocks more efficiently to meet the low latency and high throughput requirements of assisted driving. To complete the block generation task for the task vehicle, it is necessary to obtain the task resource requirements, the available computing resources of the service vehicle, and the unit resource cost for analysis. The task resource requirements are the computing resources needed to complete the block generation task; the available computing resources are the idle computing resources in the service vehicle's processor; and the unit resource cost is the cost incurred by the task vehicle when requesting assistance from the service vehicle to complete the block generation task, occupying a unit of idle computing resources.

[0071] Step 102: Determine the first-level unloading rate based on task resource requirements, spare computing resources, and unit resource cost, and determine several target unloading vehicles and the corresponding second-level unloading rate for each target unloading vehicle.

[0072] In this embodiment, the task vehicle, service vehicle, and roadside unit form a collaborative task processing network. The MEC server is deployed on the roadside unit. MEC stands for Mobile Edge Computing, which places computing, communication, and storage resources closer to the vehicle, effectively improving the service quality of the blockchain system.

[0073] In urban environments, traffic lights or toll booths can cause vehicle congestion. These slowly moving service vehicles will form a collaborative task processing network in a short period of time. These service vehicles may have abundant spare computing resources. Therefore, the block generation tasks of the task vehicles can be offloaded to these service vehicles by roadside units near the vehicle congestion points. This allows the task vehicles and surrounding service vehicles to work together to complete the block generation tasks, thereby reducing the completion time of the block generation tasks and improving the block generation efficiency. Therefore, in order to better utilize these service vehicles to complete the block generation tasks, a two-layer offloading method is adopted in this application embodiment. That is, the task vehicles first offload a part of the tasks to the roadside units through the first layer of offloading. The roadside units then offload a part of the tasks to the service vehicles through the second layer of offloading, thereby optimizing the offloading position and offloading rate and improving the utilization rate of the spare computing resources of the service vehicles.

[0074] Step 103: Based on the first-level unloading rate, guide the task vehicle to unload the first part of the block generation task to the roadside unit for processing. Based on the second-level unloading rate corresponding to each target unloading vehicle, guide the roadside unit to unload the second part of the first part of the task to each target unloading vehicle for processing.

[0075] It is understandable that, in addition to service vehicles, roadside units can also perform some tasks, making full use of the computing resources of task vehicles, service vehicles, and roadside units to better balance the cost of resource occupation and task completion latency.

[0076] Step 104: Receive the task processing results from the roadside unit and each target unloading vehicle, form the unloading task results, and send the unloading task results to the task vehicle to form the target task results corresponding to the block generation task.

[0077] In this embodiment, the task processing results of each target unloading vehicle are merged with the task processing results of the roadside unit in the roadside unit to obtain the processing results of the tasks unloaded to the roadside unit and each target unloading vehicle, i.e., the unloading task results. When the download instruction of the task vehicle is received, the unloading task results are sent to the task vehicle and merged with the processing results of the tasks executed in the task vehicle to obtain the target task results corresponding to the complete block generation task.

[0078] Step 105: Determine whether the block generation task is completed based on the target task result. If completed, generate the target block and verify it. If the target block is verified, add it to the main blockchain to store assisted driving data.

[0079] The main and side blockchains employ a proof-of-work consensus algorithm. During the consensus process, computationally intensive tasks are generated on block-generating nodes on both the main and side chains. Roadside units and task vehicles act as consensus nodes on the main and side chains, respectively. In the proof-of-work consensus algorithm, the success rate of generating the target block depends on the hash rate of the block generation task's executor, which is the ratio between the number of queries per second and the total hash rate of the entire network. Therefore, once the block generation task is determined, the generated target block is immediately propagated to the blockchain network for verification. If more than two-thirds of the nodes in the main blockchain pass the verification, the target block passes verification and is added to the main blockchain to store assisted driving data. If the verification processing time of the target block exceeds the verification limit, it indicates that the propagation delay and verification delay are too long. The target block will become an isolated block and be abandoned by the blockchain. In this case, the target block cannot pass verification. The verification processing time is the sum of the target block propagation delay and the verification delay. The target block propagation delay is determined based on the number of transactions in the target block, the amount of data per unit transaction, the block transmission rate, the node spacing, and the speed of light. The verification delay is determined based on the preset average verification speed parameter and the number of transactions.

[0080] Specifically, the propagation delay of the target block can be determined by the following formula (1):

[0081] Formula (1):

[0082] in, For the target block propagation delay, t blockH is the number of transactions in the target block. data R is the unit transaction data volume, R is the block transfer rate, and d is the block transfer rate. n is the node spacing, and c is the speed of light.

[0083] Specifically, since the transaction verification and proof-of-work consensus algorithm calculation process consumes a fixed amount of computing power, the verification time can be set to have a linear relationship with the number of transactions in the target block. Therefore, the verification latency can be determined as l·t. block Where l is the preset average verification speed parameter, which is a parameter determined by the network size and the average verification speed of blockchain nodes.

[0084] In summary, the verification processing time can be determined using the following formula (2):

[0085] Formula (2):

[0086] It is understood that the above verification methods for target blocks are merely illustrative. In practical applications, there are various verification methods for target blocks, and the appropriate verification method should be determined based on the actual application situation. No single method is specified here.

[0087] The following beneficial effects can be seen from the above embodiments:

[0088] By acquiring the task resource requirements of the block generation task from the task vehicle, and obtaining the spare computing resources and unit resource cost of the service vehicle, a first-level unloading rate is determined based on the task resource requirements, spare computing resources, and unit resource cost. Several target unloading vehicles and their corresponding second-level unloading rates are also determined. Based on the first-level unloading rate, the task vehicle is guided to unload the first part of the block generation task to the roadside unit for processing. Based on the second-level unloading rate corresponding to each target unloading vehicle, the roadside unit is guided to unload the second part of the first part of the task to the respective target unloading vehicles for processing. This two-level unloading system optimizes the unloading location and unloading rate, thereby improving traffic efficiency. The system improves the utilization rate of resources to enhance the processing efficiency of block generation tasks. It receives task processing results from roadside units and various target unloading vehicles, forms unloading task results, sends these results to the task vehicles, and generates target task results corresponding to the block generation task. Based on the target task results, it determines whether the block generation task is complete. If complete, it generates a target block and verifies it. If the target block passes verification, it is added to the main blockchain to store assisted driving data. This allows for the efficient generation of target blocks to store assisted driving data, thereby improving the information synchronization efficiency between blocks in the main blockchain, enhancing the reliable storage efficiency of assisted driving data, and improving the reliability of assisted driving.

[0089] In practical applications, an unloading optimization model is constructed to determine the first-layer unloading rate, thereby optimizing the unloading rate between the task vehicle and the roadside unit.

[0090] Please refer to Figure 2 The task unloading method provided in this application embodiment may include:

[0091] Step 201: Determine the data transmission rate between the roadside unit and the task vehicle and the service vehicle based on the channel bandwidth, channel gain, transmission power, path loss index, background noise power and distance information between the roadside unit and the task vehicle and the service vehicle.

[0092] When the task vehicle and service vehicle enter the coverage area of ​​the roadside unit, the offloaded block generation task can be transmitted to the MEC server through vehicular-to-infrastructure communication, or other wireless communication technologies can be used. When the vehicle is moving slowly due to traffic lights or toll booths, the data transmission rate between the vehicle and the roadside unit can be obtained through Shannon's formula, which can be expressed as the following formula (3):

[0093] Formula (3):

[0094] When the vehicle is traveling at normal speed, the data transmission rate between the vehicle and the roadside unit can be expressed as the following formula (4):

[0095] Formula (4):

[0096] Among them, R i,j (t) represents the data transmission rate between vehicle i and roadside unit j, ω i,j g is the channel bandwidth between vehicle i and roadside unit j. i,j (t) represents the channel gain between vehicle i and roadside unit j, p i,j (t) represents the transmission power between vehicle i and roadside unit j, χ represents the path loss exponent, and σ represents the path loss index. 2 The background noise power is represented by d. i (t) represents the distance between vehicle i and roadside unit j, h j Let l be the height of roadside unit j. i Let d be the initial position of vehicle i. j Let v be the range length of roadside unit j. i This represents the average speed of vehicle i.

[0097] It is understandable that in practical applications, there are various ways to determine the data transmission rate between vehicles and roadside units. The appropriate determination method needs to be determined according to the actual application situation, and no single limitation is made here.

[0098] Step 202: Determine the first completion time corresponding to the task vehicle completing the block generation task based on the task data volume, task computation intensity, and first CPU frequency; determine the total delay function based on the task data volume, task computation intensity, data volume ratio, data transmission rate, first CPU frequency, and second CPU frequency.

[0099] The task information for the block generation task of the task vehicle includes, but is not limited to, task data volume, task computation intensity, data volume ratio, and maximum tolerable latency. The data volume ratio is the ratio of the output data volume to the input data volume, which can be obtained when the block generation task is formed.

[0100] The first CPU frequency of the task vehicle and the service vehicle is obtained. In this embodiment, the CPU frequency of the task vehicle and the service vehicle is set to be the same. The second CPU frequency of the roadside unit is obtained. In this embodiment, the CPU frequency of the roadside unit is set to be greater than the CPU frequency of the task vehicle and the service vehicle.

[0101] When the block generation task is processed solely within the task vehicle, the first completion time for the task vehicle to complete the block generation task can be determined based on the task data volume, task computational intensity, and the first CPU frequency. In this case, the completion latency of the block generation task depends only on the computational power of the task vehicle. Specifically, through S... a S represents the total CPU cycles for processing block generation tasks. a It can be expressed by formula (5), and the first completion time can be expressed by formula (6):

[0102] Formula (5): S a =D a X a

[0103] Formula (6):

[0104] Among them, D a For the amount of task data, X a For calculating the intensity of the task, T loc (t) represents the first completion time, f v This is the first CPU frequency.

[0105] When the block generation task is handled collaboratively by the task vehicle and nearby roadside units, the block generation task can be divided into two parts, namely (1-α)D. a The task is handled by the mission vehicle, αD aThe block generation task is processed by the roadside unit, where α is the first-level unloading rate. If there are service vehicles within the roadside unit's range, the block generation task can be further unloaded to the respective service vehicles that meet the unloading requirements, i.e., the target unloading vehicles, using the second-level unloading rate β. It can be understood that the unloading rate corresponding to each target unloading vehicle can be inconsistent; therefore, β = {β1, β2, β3…, β} k}, and β k ∈[0,α). Through This represents the proportion of tasks handled by all target unloading vehicles, and this proportion is mainly affected by available computing resources.

[0106] The total delay function is determined based on the task data volume, task computation intensity, data volume ratio, data transmission rate, first CPU frequency, and second CPU frequency. This total delay function is used to determine the functional relationship between the first-layer unloading rate, the second-layer unloading rate, and the second completion time. The second completion time is the time required for the block generation task to be unloaded to the roadside unit and processed by each target unloading vehicle. Specifically:

[0107] The first duration function is determined based on the task data volume, task computation intensity, and first CPU frequency. The first duration function is used to determine the functional relationship between the processing time of the first retained task and the first layer unloading rate. The first retained task is the task retained in the task vehicle for processing in the block generation task. The first duration function can be expressed by the following formula (7):

[0108] Formula (7):

[0109] The second duration function is determined based on the task data volume, task computation intensity, and second CPU frequency. The second duration function is used to determine the functional relationship between the processing time of the second retention task, the first layer unloading rate, and the second layer unloading rate. The second retention task is the task retained in the block generation task and processed in the roadside unit. The second duration function can be expressed by the following formula (8):

[0110] Formula (8):

[0111] Among them, f R This is the second CPU frequency.

[0112] The third duration function is determined based on the task data volume, task computation intensity, and first CPU frequency. The third duration function is used to determine the functional relationship between the task processing time of each target unloading vehicle and the second-level unloading rate. The third duration function can be expressed by the following formula (9):

[0113] Formula (9):

[0114] The communication delay function is determined based on the data transmission rate, task data volume, and data volume ratio. This function is used to determine the functional relationship between the communication delay between each target unloading vehicle and the roadside unit and the second-layer unloading rate, denoted by λ. a The proportion of data volume can be represented by formula (10), the data transmission rate between each target unloading vehicle and the roadside unit can be represented by formula (11), and the communication delay function can be represented by formula (11).

[0115] Formula (10):

[0116] Formula (11):

[0117] By summing the third duration function corresponding to each target unloading vehicle with the communication delay function corresponding to each target unloading vehicle, several target vehicle processing delay functions are obtained, which can be expressed by formula (12):

[0118] Formula (12):

[0119] Based on the processing delay functions of several target vehicles and the second duration function, the maximum processing delay of each target unloading vehicle's task and the second retention task is determined. The function corresponding to the maximum processing delay of each target unloading vehicle and the roadside unit is determined as the unloading task processing delay function. It can be understood that since the target unloading vehicles and the roadside units process the unloading tasks simultaneously, if the processing delay of a certain target unloading vehicle is the longest, then the final overall unloading task processing delay is defined as the processing delay of that target unloading vehicle. This is because even if other target unloading vehicles or roadside units have completed their respective tasks, they need to wait for all unloading tasks to be completed before they can be sent back to the roadside unit for merging. Therefore, the unloading task processing delay function can be expressed by formula (13):

[0120] Formula (13): T exe (t)=max{T exe,j (t),T1(t),T2(t),T……,T k (t)}

[0121] The unloading delay function is determined based on the task data volume and data transmission rate. The unloading delay function is used to determine the functional relationship between the unloading communication delay between the task vehicle and the roadside unit and the first-layer unloading rate. It can be understood that during the task unloading process, a delay will be generated in the communication process between the task vehicle and the roadside unit. Therefore, the unloading delay function can be expressed by formula (14):

[0122] Formula (14):

[0123] The receiving delay function is determined based on the task data volume, data volume ratio, and data transmission rate. The receiving delay function is used to determine the functional relationship between the receiving communication delay between the task vehicle and the roadside unit and the first-layer unloading rate. It can be understood that during the task feedback process, a delay will occur during the communication between the task vehicle and the roadside unit. Therefore, the receiving delay function can be expressed by formula (15):

[0124] Formula (15):

[0125] The unloading task processing delay function, the unloading delay function, and the receiving delay function are summed to obtain the unloading task completion delay function.

[0126] The maximum processing delay between the unloading task and the first retention task is determined based on the unloading task completion delay function and the first duration function. The function corresponding to the maximum processing delay between the unloading task and the first retention task is determined as the total delay function. It can be understood that the tasks in the task vehicle and the unloading task are processed simultaneously. Therefore, assuming that the task vehicle has the longest processing delay, the final overall block generation task processing delay is defined as the task vehicle's processing delay. This is because even if the unloading task has been completed, it still needs to wait for the task vehicle's task to be completed before it can be merged to form the target task result. Therefore, the total delay function can be expressed by formula (16):

[0127] Formula (16):

[0128] Step 203: Determine the vehicle utility function based on unit resource cost, maximum tolerable delay of the task, and first completion time, and determine the hierarchical unloading utility function based on unit resource cost, maximum tolerable delay of the task, and total delay function.

[0129] In this embodiment, both the task vehicle utility function and the hierarchical offloading utility function are logical utility functions used to quantify the level of resource efficiency satisfaction. These are primarily measured by task processing latency and resource costs. The utility function should monotonically decrease with increasing task processing latency. Since shorter task processing latency results in higher vehicle utility satisfaction, the vehicle's satisfaction with task processing latency should be non-negative. Offloading computational tasks to roadside units or other vehicles incurs costs, which can take the form of fees, resource exchanges, etc., and are not limited to a single form.

[0130] Specifically, the utility function of the mission vehicle can be expressed by the following formula (17):

[0131] Formula (17):

[0132] The hierarchical unloading utility function can be expressed by the following formula (18):

[0133] Formula (18):

[0134] Where θ is the weighting coefficient, I(x) is an indicator function that equals 1 when x is true and 0 otherwise, T loc The total latency for processing block generation tasks separately for the task vehicle, T tot The total latency for block generation tasks to be collaboratively processed by the task vehicle and nearby roadside units. For standardization The parameter, B i Let be the unit resource cost of vehicle i. τ is the average unit resource cost in a collaborative task processing network. a The maximum tolerable latency for the task.

[0135] Step 204: Construct an unloading optimization model based on the task vehicle utility function and the hierarchical unloading utility function.

[0136] To improve the resource utilization of the main-side blockchain system, an optimization model for calculating the unloading rate and resource allocation was designed, namely the unloading optimization model. Specifically, the unloading optimization model can be expressed as formula (19):

[0137] Formula (19):

[0138] in, This is the offloading decision, where x∈{loc,mec} represents the offloading location. This includes tasks processed individually by a single vehicle and tasks processed collaboratively by the vehicle and nearby roadside units in a hierarchical manner. Constraints C1 and C2 ensure the validity of the task offloading location. Constraint C3 ensures that the amount of data unloaded cannot exceed the link capacity. Constraint C4 indicates that the total processing latency of the task cannot exceed the task's maximum tolerable latency. Constraint C5 ensures the task offloading rate is effective. Constraint C6 is the total computational resource constraint for the collaborative task processing network.

[0139] Step 205: Determine the first-layer unloading rate based on the unloading optimization model.

[0140] The reward function of the A3C algorithm is defined as the unloading optimization model. The maximum value of the unloading optimization model is determined using the A3C algorithm. The unloading rate in the target action space is defined as the first-layer unloading rate. The target action space is the action space corresponding to when the unloading optimization model reaches its maximum value. Specifically, in the A3C algorithm, the state value function V(s)t ;θ v The corresponding strategy π(a(t)|s(t); θ) can be calculated based on the input state. Then, the A3C algorithm updates the parameter θ by using the gradient of the reward function, thereby obtaining the maximum value of the reward function. Thus, the A3C algorithm is used to solve the problem of calculating the unloading decision and the first-layer unloading rate.

[0141] The current state space can be represented as the available computing resources of the service vehicle. This can be expressed using formula (20) or formula (21).

[0142] Formula (20): C s (t)={C1(t),C2(t),...,C k (t)}

[0143] Formula (21): S(t)@{C s (t)}

[0144] Action space includes unloading decisions And the first layer unloading rate α, through A s (t) Define the action set, express the action set using formula (22), and express the unloading decision using formula (23):

[0145] Formula (22):

[0146] Formula (23):

[0147] Therefore, the probability of leaving the current state s(t) to the next state s(t+1) after performing an action can be defined by formula (24):

[0148] Formula (24):

[0149] Furthermore, the reward function of the A3C algorithm can be determined as an unloading optimization model, and the reward function of the A3C algorithm can be expressed by formula (25):

[0150] Formula (25):

[0151] Understandably, the A3C algorithm has an initial state, a set of actions, and a reward function. The algorithm selects actions based on certain strategies, and as actions are performed, it obtains reward values ​​and new states until it reaches a terminating state or the maximum number of iterations is reached, at which point the algorithm terminates. The reward function of the A3C algorithm can be viewed as the optimization objective of unloading decisions and the unloading rate. The entire algorithm process aims to find the action that maximizes the reward function. Therefore, the target action space can be obtained through the reward function of the A3C algorithm, and the first-layer unloading rate can be obtained within the target action space.

[0152] By determining the data transmission rate between the roadside unit and the task vehicle and service vehicle, the first completion time corresponding to the task vehicle completing the block generation task is determined, and the total delay function is determined. Based on the unit resource cost, the maximum tolerable delay of the task, and the first completion time, the utility function of the task vehicle is determined. Furthermore, based on the unit resource cost, the maximum tolerable delay of the task, and the total delay function, the hierarchical offloading utility function is determined. Based on the task vehicle utility function and the hierarchical offloading utility function, an offloading optimization model is constructed. Based on the offloading optimization model, the first-level offloading rate is determined to improve resource utilization and better balance resource cost and the processing delay of the block generation task.

[0153] In practical applications, a second-layer unloading rate will be further determined, enabling roadside units to unload tasks to target unloading vehicles for processing based on the second-layer unloading rate, thereby further improving the utilization rate of airspace resources.

[0154] Please refer to Figure 3 The task unloading method provided in this application embodiment may include:

[0155] Step 301: Construct the first matching utility optimization function and the second matching utility optimization function.

[0156] The initial utility formula can be expressed by formula (26):

[0157] Formula (26): E(u)=(v i -bp i )P(bp i )

[0158] Among them, v i The parameter representing task effectiveness is bp. i P(bp) represents the expected cost per unit of resource. i The value represents the matching success rate of the i-th block generation task in the task list, i.e., the probability of the first task matching successfully. It can be understood that in the main blockchain system, there are multiple task vehicles currently executing block generation tasks and multiple roadside units, with multiple service vehicles covering these roadside units. The block generation tasks being processed can form a task list.

[0159] In this embodiment, both the roadside unit and the service vehicle use a linear strategy to provide the expected cost and weighted cost, and the maximum resource cost is set to P. max The minimum resource cost is P. min Therefore, bp i with ap k It follows a uniform distribution, which can be expressed by formulas (27) and (28):

[0160] Formula (27):

[0161] Formula (28):

[0162] in, μ b , μ s These are fixed parameters.

[0163] Therefore, the optimization problem of the second-layer unloading rate can be formulated as a first matching utility optimization function P1 and a second matching utility optimization function P2, where P1 can be expressed by formula (29) and P2 can be expressed by formula (30):

[0164] Formula (29): P1:

[0165] Formula (30): P2:

[0166] Among them, B k For unit resource cost, AP k P(ap) is the weighted cost per unit resource. k Let u be the success rate of matching the task with the k-th target unloading vehicle, i.e., the success probability of matching the second task. bp (v i ,bp i () represents the first matching utility in the first matching utility optimization function. u represents the expected cost per unit resource that maximizes the utility of the first matching. ap (B k ,ap k () represents the second matching utility in the second matching utility optimization function. This represents the unit resource weighted cost for finding the solution that maximizes the utility of the second matching.

[0167] The first matching utility optimization function is used to determine the functional relationship between the task benefit parameters, the probability of successful matching of the first task, and the expected cost per unit resource. The expected cost per unit resource is used to maximize the benefit of the block generation task. The second matching utility optimization function is used to determine the functional relationship between the unit resource cost, the probability of successful matching of the second task, and the weighted cost per unit resource. The weighted cost per unit resource is used to maximize the service benefit of the service vehicle.

[0168] Step 302: Determine the expected cost per unit resource and the weighted cost per unit resource based on the first matching utility optimization function and the second matching utility optimization function.

[0169] Furthermore, v i -bp i With P(bp) i The calculations yield formulas (31) and (32) respectively:

[0170] Formula (31):

[0171] Formula (32):

[0172] ap k -B k With P(ap) k The calculations yield formulas (33) and (34) respectively:

[0173] Formula (33):

[0174] Formula (34):

[0175] Furthermore, by substituting formulas (31) to (34) into formulas (29) and (30), and setting the first derivative to zero, we can obtain formulas (35), (36), and (37):

[0176] Formula (35):

[0177] Formula (36):

[0178] Formula (37):

[0179] Step 303: Determine several target unloading vehicles based on the expected cost per unit resource and the weighted cost per unit resource. Match the block generation task with each target unloading vehicle and determine the second-layer unloading rate corresponding to each target unloading vehicle.

[0180] If there are n block generation tasks and m service vehicles, then the expected unit resource costs corresponding to the n block generation tasks are sorted in descending order, and the weighted unit resource costs corresponding to the m service vehicles are sorted in ascending order.

[0181] If the expected cost of the y-th unit resource is greater than or equal to the weighted cost of the y-th unit resource, and the expected cost of the (y+1)-th unit resource is less than or equal to the weighted cost of the (y+1)-th unit resource, i.e., bp y ≥ap y And bp y+1 ≤ap y+1 Then, the service vehicles whose weighted cost per unit resource is less than that of the yth unit resource weighted cost among the m unit resource weighted costs are sorted in ascending order by available computing resources to obtain the target unloading vehicle sequence.

[0182] The service vehicle with the largest available computing resources in the target unloading vehicle sequence is selected as the current target unloading vehicle. The current target unloading vehicle is then matched with the block generation task corresponding to the expected cost of the y-th unit of resources.

[0183] The amount of spare resources required for the second-layer unloading process is determined based on the task resource requirements and the first-layer unloading rate. The second-layer unloading process is the process by which the roadside unit unloads the block generation task to the target unloading vehicle. The amount of spare resources required is the product of the first-layer unloading rate and the task resource requirements.

[0184] If the available resource demand is less than the available computing resources corresponding to the current target unloading vehicle, then the block generation task corresponding to the expected cost of the y-th unit resource is removed from the task list consisting of n block generation tasks. This is because the task has already been matched and is ready for subsequent processing, and will not participate in matching again. Furthermore, the available computing resources corresponding to the current target unloading vehicle and the target unloading vehicle sequence are updated. It can be understood that because the target unloading vehicle matched this task, the task occupied the target unloading vehicle's available computing resources. Therefore, after matching this task, the available computing resources of the target unloading vehicle should decrease, resulting in updated available computing resources. Since the available computing resources of the target unloading vehicle decrease, its ranking position in the target unloading vehicle sequence changes accordingly, thus requiring an update to the target unloading vehicle sequence. The second-level unloading rate of the current target unloading vehicle is determined as the ratio of available resource demand to task resource demand. For example, assuming the available resource demand is 5 and the task resource demand is 10, then the second-level unloading rate of the current target unloading vehicle is 0.5.

[0185] If the available resource demand exceeds the available computing resources corresponding to the current target unloading vehicle, then the current target unloading vehicle is removed from the target unloading vehicle sequence because its available computing resources are fully utilized and it cannot continue to match tasks. The available resource demand is then updated, and the second-level unloading rate of the current target unloading vehicle is determined as the ratio of its available computing resources to the task's resource demand. For example, assuming the current available resource demand is 5, the task's resource demand is 10, and the available computing resources corresponding to the current target unloading vehicle are 2, then after matching with the current target unloading vehicle, the available resource demand is updated to 3, and the second-level unloading rate of the current target unloading vehicle is 0.2. The task then needs to find another target unloading vehicle to match, allowing the remaining available resource demand to be processed.

[0186] If the demand for spare resources is equal to the spare computing resources corresponding to the current target unloading vehicle, then remove the block generation task corresponding to the expected cost of the current y-th unit resource from the task list, remove the current target unloading vehicle from the target unloading vehicle sequence, and determine the second-level unloading rate of the current target unloading vehicle as the ratio of the demand for spare resources to the demand for task resources.

[0187] The process continues until the task list is empty, indicating that there are no block generation tasks that need to be processed. At this point, the matching of block generation tasks with each target unloading vehicle is stopped. Alternatively, the matching of block generation tasks with each target unloading vehicle is stopped until the target unloading vehicle sequence is empty. At this point, it is determined whether the current available resource demand is greater than zero. If the current available resource demand is greater than zero, the task corresponding to the current available resource demand is designated as the second retention task.

[0188] By constructing a first matching utility optimization function and a second matching utility optimization function, the expected cost per unit resource and the weighted cost per unit resource are determined based on the first and second matching utility optimization functions. Several target unloading vehicles are then determined based on the expected cost per unit resource and the weighted cost per unit resource. The block generation task is matched with each target unloading vehicle, and the second-level unloading rate corresponding to each target unloading vehicle is determined. This optimizes the unloading location and unloading rate, makes full use of the resources of task vehicles, service vehicles, and roadside units, improves resource utilization, better balances resource costs and the processing latency of block generation tasks, and improves the processing efficiency of block generation tasks.

[0189] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440. The processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions stored in the memory 430 to execute a task offloading method.

[0190] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0191] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the task unloading methods provided by the above methods.

[0192] In another aspect, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the task offloading methods provided by the above methods.

[0193] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0194] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0195] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A task unloading method, characterized in that, include: Obtain the task resource requirements of the block generation task of the task vehicle, and obtain the spare computing resources and unit resource cost of the service vehicle. The first-level unloading rate is determined based on the task resource requirements, the available computing resources, and the unit resource cost, and several target unloading vehicles and the second-level unloading rate corresponding to each target unloading vehicle are determined. Based on the first layer unloading rate, the task vehicle is guided to unload the first part of the block generation task to the roadside unit for processing. Based on the second layer unloading rate corresponding to each target unloading vehicle, the roadside unit is guided to unload the second part of the first part of the task to each target unloading vehicle for processing. Receive the task processing results from the roadside unit and each target unloading vehicle, form an unloading task result, and send the unloading task result to the task vehicle to form the target task result corresponding to the block generation task; Based on the result of the target task, determine whether the block generation task is completed. If completed, generate the target block and verify it. If the target block passes verification, add the target block to the main blockchain to store assisted driving data.

2. The task unloading method according to claim 1, characterized in that, The task information of the block generation task includes the task data volume, task computation intensity, data volume ratio, and maximum tolerable latency of the task. The data volume ratio is the ratio of the output result data volume to the input data volume. The step of determining the first-level unloading rate based on the task resource requirements, the available computing resources, and the unit resource cost includes: The data transmission rate between the roadside unit and the task vehicle and the service vehicle is determined based on the channel bandwidth, channel gain, transmission power, path loss index, background noise power, and distance information between the roadside unit and the task vehicle and the service vehicle. Obtain the first CPU frequency of the task vehicle and the service vehicle, and obtain the second CPU frequency of the roadside unit; The first completion time for the task vehicle to complete the block generation task is determined based on the task data volume, the task computation intensity, and the first CPU frequency. The total delay function is determined based on the task data volume, the task computation intensity, the data volume ratio, the data transmission rate, the first CPU frequency, and the second CPU frequency. The total delay function is used to determine the functional relationship between the first layer unloading rate, the second layer unloading rate, and the second completion time. The second completion time is the time for the block generation task to be unloaded to the roadside unit and processed by each target unloading vehicle. The task vehicle utility function is determined based on the unit resource cost, the maximum tolerable delay of the task, and the first completion time; and the hierarchical unloading utility function is determined based on the unit resource cost, the maximum tolerable delay of the task, and the total delay function. An unloading optimization model is constructed based on the task vehicle utility function and the hierarchical unloading utility function; The unloading rate of the first layer is determined based on the unloading optimization model.

3. The task unloading method according to claim 2, characterized in that, The step of determining the total latency function based on the task data volume, the task computation intensity, the data volume ratio, the data transmission rate, the first CPU frequency, and the second CPU frequency includes: A first duration function is determined based on the task data volume, the task computation intensity, and the first CPU frequency. The first duration function is used to determine the functional relationship between the processing time of the first retained task and the first layer unloading rate. The first retained task is the task in the block generation task that is retained in the task vehicle for processing. The second duration function is determined based on the task data volume, the task computation intensity, and the second CPU frequency. The second duration function is used to determine the functional relationship between the processing time of the second retention task, the first layer unloading rate, and the second layer unloading rate. The second retention task is the task in the block generation task that is retained in the roadside unit for processing. A third duration function is determined based on the task data volume, the task computation intensity, and the first CPU frequency. The third duration function is used to determine the functional relationship between the task processing time of each target unloading vehicle and the second-layer unloading rate. The communication delay function is determined based on the data transmission rate, the task data volume, and the data volume ratio. The communication delay function is used to determine the functional relationship between the communication delay between each target unloading vehicle and the roadside unit and the second-layer unloading rate. The third duration function corresponding to each target unloading vehicle is summed with the communication delay function corresponding to each target unloading vehicle to obtain several target vehicle processing delay functions; Based on several target vehicle processing delay functions and a second duration function, determine the task of each target unloading vehicle and the maximum processing delay in the second retention task. Then, determine the function corresponding to the maximum processing delay of each target unloading vehicle and the roadside unit as the unloading task processing delay function. The unloading delay function is determined based on the task data volume and the data transmission rate. The unloading delay function is used to determine the functional relationship between the unloading communication delay between the task vehicle and the roadside unit and the first layer unloading rate. The receiving delay function is determined based on the task data volume, the data volume ratio, and the data transmission rate. The receiving delay function is used to determine the functional relationship between the receiving communication delay between the task vehicle and the roadside unit and the first layer unloading rate. The uninstallation task processing delay function, the uninstallation delay function, and the receiving delay function are summed to obtain the uninstallation task completion delay function. The maximum processing delay between the uninstallation task and the first retention task is determined based on the uninstallation task completion delay function and the first duration function, and the function corresponding to the maximum processing delay between the uninstallation task and the first retention task is determined as the total delay function.

4. The task unloading method according to claim 2, characterized in that, Determining the first-layer unloading rate based on the unloading optimization model includes: The reward function of the A3C algorithm is determined as the unloading optimization model; The maximum value of the unloading optimization model is determined using the A3C algorithm. The unloading rate in the target action space is determined as the first layer unloading rate, and the target action space is the action space corresponding to when the unloading optimization model reaches the maximum value.

5. The task unloading method according to claim 3, characterized in that, The determination of several target unloading vehicles and the corresponding second-layer unloading rate for each target unloading vehicle includes: Determine the expected unit resource cost of the block generation task, and determine the unit resource weighted cost of the service vehicle; Based on the expected cost per unit resource and the weighted cost per unit resource, several target unloading vehicles are determined. The block generation task is then matched with each target unloading vehicle, and the second-layer unloading rate corresponding to each target unloading vehicle is determined.

6. The task unloading method according to claim 5, characterized in that, The step of determining a number of target unloading vehicles based on the expected cost per unit resource and the weighted cost per unit resource, matching the block generation task with each target unloading vehicle, and determining the second-level unloading rate corresponding to each target unloading vehicle includes: If there are n block generation tasks and m service vehicles, then the expected unit resource costs corresponding to the n block generation tasks are sorted in descending order, and the weighted unit resource costs corresponding to the m service vehicles are sorted in ascending order. If the expected cost of the yth unit resource is greater than or equal to the weighted cost of the yth unit resource, and the expected cost of the (y+1)th unit resource is less than or equal to the weighted cost of the (y+1)th unit resource, then the service vehicles corresponding to the weighted costs of the m units of resources that are less than the weighted cost of the yth unit resource are sorted in ascending order of available computing resources to obtain the target unloading vehicle sequence. The service vehicle with the largest available computing resources in the target unloading vehicle sequence is selected as the current target unloading vehicle, and the current target unloading vehicle is matched with the block generation task corresponding to the expected cost of the y-th unit resource. Based on the task resource requirements and the first layer unloading rate, the amount of spare resources required for the second layer unloading process is determined. The second layer unloading process is the process by which the roadside unit unloads the block generation task to the target unloading vehicle. If the required amount of spare resources is less than the spare computing resources corresponding to the current target unloading vehicle, then the block generation task corresponding to the expected cost of the current y-th unit resource is removed from the task list consisting of n block generation tasks, and the spare computing resources corresponding to the current target unloading vehicle and the target unloading vehicle sequence are updated, and the second-level unloading rate of the current target unloading vehicle is determined to be the ratio of the required amount of spare resources to the required amount of task resources. If the required amount of spare resources is greater than the spare computing resources corresponding to the current target unloading vehicle, then the current target unloading vehicle is removed from the target unloading vehicle sequence, the required amount of spare resources is updated, and the second-level unloading rate of the current target unloading vehicle is determined to be the ratio of the spare computing resources corresponding to the current target unloading vehicle to the task resource requirement. If the required amount of spare resources is equal to the spare computing resources corresponding to the current target unloading vehicle, then the block generation task corresponding to the expected cost of the current y-th unit resource is removed from the task list, and the current target unloading vehicle is removed from the target unloading vehicle sequence. The second-level unloading rate of the current target unloading vehicle is determined to be the ratio of the required amount of spare resources to the required amount of task resources. The process of matching the block generation task with each target unloading vehicle will stop once the task list is empty. or Until the target unloading vehicle sequence is an empty sequence, stop matching the block generation task with each target unloading vehicle, and determine whether the current free resource demand is greater than zero. If the current free resource demand is greater than zero, then the task corresponding to the current free resource demand is used as the second retention task.

7. The task unloading method according to claim 5, characterized in that, Determining the expected unit resource cost of the block generation task and the weighted unit resource cost of the service vehicle includes: A first matching utility optimization function and a second matching utility optimization function are constructed. The first matching utility optimization function is used to determine the functional relationship between the task benefit parameter, the probability of successful matching of the first task, and the expected cost per unit resource, wherein the expected cost per unit resource is used to maximize the benefit of the block generation task. The second matching utility optimization function is used to determine the functional relationship between the unit resource cost, the probability of successful matching of the second task, and the weighted cost per unit resource, wherein the weighted cost per unit resource is used to maximize the service benefit of the service vehicle. The expected cost per unit resource and the weighted cost per unit resource are determined based on the first matching utility optimization function and the second matching utility optimization function.

8. The task unloading method according to claim 1, characterized in that, The verification of the target block includes: If more than two-thirds of the nodes in the main blockchain pass the verification, then the target block passes the verification. If the verification processing time of the target block exceeds the verification limit, the target block cannot pass verification. The verification processing time is the sum of the target block propagation delay and the verification delay. The target block propagation delay is determined based on the number of transactions in the target block, the amount of data per unit transaction, the block transmission rate, the node spacing, and the speed of light. The verification delay is determined based on a preset average verification speed parameter and the number of transactions.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the task unloading method as described in any one of claims 1 to 8.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the task unloading method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Edge motorcade cloud computing unloading method and system, medium equipment and application

    CN112702414A

  • On-chain and off-chain collaborative resource transaction method based on state channel

    CN113411338A