A method and device for task offloading based on vehicle clusters

By building vehicle clusters, screening target task vehicles and idle computing power vehicles, and decomposing and layering unloading tasks, the problem of incomplete task unloading caused by high-speed vehicle movement is solved, and the task processing efficiency and reliability are improved.

CN119342534BActive Publication Date: 2025-09-09CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411468010.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-09-09
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

The high-speed movement of vehicles leads to the problem of incomplete task offloading. During high-speed movement, the vehicle may leave the communication range of the edge server and be unable to complete task offloading and provide application services.

Method used

By constructing a task offloading method based on vehicle clusters, target task vehicles whose task similarity and expected communication time meet the threshold are screened out to form a cluster head. A vehicle cluster is then built with idle computing power vehicles. The tasks are decomposed into subtasks, a directed acyclic graph is constructed, and logical hierarchical offloading is performed to ensure that the topological dependencies remain unchanged. Finally, the subtasks are offloaded to the vehicle cluster or cloud server.

Benefits of technology

It reduces the duration and data volume of task processing, solves the problem of incomplete task unloading caused by high-speed vehicle movement, and improves the efficiency and reliability of task processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342534B_ABST
    Figure CN119342534B_ABST
Patent Text Reader

Abstract

The present invention provides a task offloading method and device based on vehicle clusters, which screens out target task vehicles whose task similarity and expected communication duration meet a threshold to form a cluster head, and forms a vehicle cluster based on the cluster head and the screened target computing power vehicles. The tasks to be offloaded in the vehicle cluster are decomposed into multiple subtasks, and repeated subtasks are removed. Under the premise of ensuring that the topological dependencies between subtasks remain unchanged, the remaining subtasks are merged to obtain a directed acyclic graph, and the directed acyclic graph is logically layered, and the subtasks in each layer are offloaded layer by layer to an idle computing power vehicle or cloud server. In this solution, unlike traditional offloading solutions, a vehicle cluster is constructed in which the expected communication duration between vehicles meets a threshold, and repeated subtasks in the vehicle cluster are merged, which greatly reduces the amount of data that needs to be transmitted and the amount of computation required for task processing, thereby reducing the duration of task processing, thereby solving the problem of incomplete task offloading caused by high-speed movement of vehicles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle networking, and in particular to a task offloading method and device based on vehicle clustering. Background Art

[0002] In recent years, novel connected vehicle applications have emerged, such as augmented reality, virtual reality, and autonomous driving. These applications are often highly sensitive to latency and require significant computing resources. Currently, onboard computing resources are limited, hindering the ability of vehicles to provide real-time services. Therefore, using cellular connected vehicle technology, we are integrating edge computing with onboard computing to form a multi-layered vehicle edge computing (VEC). This allows vehicles to offload application-related tasks to edge servers and idle computing resources on the road.

[0003] In existing technologies, high-speed vehicle movement can lead to incomplete offloading. That is, before application-related tasks are offloaded and processed, the vehicle's high-speed movement causes it to leave the communication range of the edge server, resulting in the vehicle being unable to obtain the processing results of all application-related tasks and, consequently, unable to provide application services. Summary of the Invention

[0004] In view of this, an embodiment of the present invention provides a method and apparatus for task offloading based on vehicle clusters, so as to solve the problem of incomplete task offloading caused by high-speed movement of vehicles.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of an embodiment of the present invention discloses a vehicle cluster-based task offloading method, which is applied to a roadside unit (RU), wherein the RU is communicatively connected to a cloud server. The method includes:

[0007] Obtaining basic information sent by each mission vehicle within the communication range of the roadside unit;

[0008] Based on the basic information of each task vehicle, the task similarity of the tasks to be unloaded between each two task vehicles is calculated. If the task similarity is greater than or equal to a similarity threshold and the expected communication time between the two task vehicles is greater than or equal to a communication time threshold, the two task vehicles are determined to be target task vehicles; the task to be unloaded is composed of multiple subtasks, and there is a topological dependency relationship between the subtasks;

[0009] Building a cluster head based on each of the target mission vehicles and calculating the computing power required by the cluster head;

[0010] Based on the computing power required by the cluster head, a target computing power vehicle is selected from idle computing power vehicles within the communication range of the cluster head, and a vehicle cluster is constructed based on the target computing power vehicle and the cluster head;

[0011] For each target task vehicle in the vehicle cluster, decompose the corresponding to-be-unloaded task into a plurality of subtasks, and construct a first directed acyclic graph based on the topological dependency relationships between the subtasks; each node in the first directed acyclic graph represents a subtask, and an edge between each two nodes represents the topological dependency relationship between the corresponding two subtasks;

[0012] Under the condition that the topological dependency relationship between the subtasks remains unchanged, merging and deduplicating the first directed acyclic graphs to obtain a second directed acyclic graph;

[0013] Performing logical layering processing on the second directed acyclic graph to obtain a plurality of layers including the corresponding subtasks and the number of layers corresponding to the layers;

[0014] According to the number of levels corresponding to each level, the subtasks corresponding to each level are unloaded in turn, so that the subtasks are unloaded to the target computing vehicle or the cloud server in the vehicle cluster.

[0015] Preferably, the basic information includes: vehicle status information and information about tasks to be unloaded; based on the basic information of each task vehicle, the task similarity of the tasks to be unloaded between each two task vehicles is calculated; if the task similarity is greater than or equal to a similarity threshold and the expected communication time between the two task vehicles is greater than or equal to a communication time threshold, the two task vehicles are determined to be target task vehicles, including:

[0016] For each pair of the task vehicles, based on the distance formula, the communication duration threshold and the corresponding vehicle status information, a target distance between the two task vehicles is calculated; if the target distance is less than or equal to the communication distance threshold, then it is determined that the expected communication duration between the two task vehicles is greater than or equal to the communication duration threshold;

[0017] For the two task vehicles whose expected communication duration is greater than or equal to the communication duration threshold, the to-be-unloaded task information corresponding to the two task vehicles is compared to obtain task similarity. If the task similarity is greater than or equal to the similarity threshold, the two task vehicles are determined as target task vehicles.

[0018] Preferably, the step of constructing a cluster head based on each of the target mission vehicles and calculating the computing power required by the cluster head includes:

[0019] Selecting the first target mission vehicle that enters the communication range of the roadside unit as the first mission vehicle, and building a cluster head for the first mission vehicle;

[0020] For each target task vehicle within the communication range of the cluster head, if the number of hops between the target task vehicle and the first task vehicle is less than or equal to the hop number setting value, and the task similarity between the target task vehicle and the first task vehicle is greater than or equal to the similarity threshold, and the expected communication duration between the target task vehicle and the first task vehicle is greater than or equal to the communication duration threshold, then the target task vehicle is added to the cluster head;

[0021] The computing capacity required by the cluster head is obtained by calculation.

[0022] Preferably, the computing capacity required by the cluster head is used to select a target computing vehicle from idle computing vehicles within the communication range of the cluster head, and a vehicle cluster is constructed based on the target computing vehicle and the cluster head, including:

[0023] Traversing each idle computing vehicle within the communication range of the cluster head, if the expected communication duration between the idle computing vehicle and any target task vehicle in the cluster head is greater than or equal to the communication duration threshold, then determining the idle computing vehicle as the target computing vehicle, until the sum of the computing capabilities of each target computing vehicle is greater than or equal to the computing capability required by the cluster head;

[0024] A vehicle cluster is constructed based on the target computing power vehicle and each target task vehicle in the cluster head.

[0025] Preferably, the step of merging and deduplicating the first directed acyclic graphs to obtain a second directed acyclic graph while ensuring that the topological dependencies between the subtasks remain unchanged comprises:

[0026] Each edge in each of the first directed acyclic graphs is traversed, and when any two identical edges exist, the two identical edges are merged to obtain a second directed acyclic graph.

[0027] Preferably, the second directed acyclic graph is subjected to logical layering processing to obtain a plurality of layers containing the corresponding subtasks and the number of layers corresponding to the layers, including:

[0028] Classify each of the nodes with an in-degree of 0 in the second directed acyclic graph into the same level, and mark the level number of the level;

[0029] Excluding the nodes that have been divided into the levels, returning to the step of dividing each of the nodes with an in-degree of 0 in the second directed acyclic graph into the same level and marking the level number of the level, until all nodes in the second directed acyclic graph are divided into the corresponding levels, and obtaining multiple levels containing the subtasks corresponding to the nodes.

[0030] Preferably, the unloading process is performed on the subtasks corresponding to each level in sequence according to the number of levels corresponding to each level, so that the subtasks are unloaded to the target computing vehicle or the cloud server in the vehicle cluster, including:

[0031] Solve the 0-1 knapsack problem for each level in turn according to the level number corresponding to each level, and obtain the first subtask of the level to be offloaded to the target computing vehicle in the vehicle cluster, and obtain the second subtask of the level to be offloaded to the cloud server;

[0032] For each of the levels, based on each of the first subtasks corresponding to the level and a greedy strategy, an offloading matrix is ​​obtained, and each of the first subtasks corresponding to the level is offloaded to the target computing vehicle in the vehicle cluster based on the offloading matrix;

[0033] For each of the levels, each of the second subtasks corresponding to the level is offloaded to the cloud server.

[0034] Preferably, for each of the layers, solving the 0-1 knapsack problem to obtain the first subtask of the target computing vehicle to be unloaded to the vehicle cluster in the layer, and obtaining the second subtask of the target computing vehicle to be unloaded to the cloud server in the layer, includes:

[0035] For each of the layers, the computing capacity of the vehicle cluster is used as the capacity of the backpack;

[0036] For each subtask in the hierarchy, consider the subtask as an object to be placed in the backpack, the computing power required to execute the subtask as the volume of the object, and the amount of data contained in the subtask as the value of the object, and solve the 0-1 backpack problem;

[0037] The subtask corresponding to the object placed in the backpack is determined as a first subtask, and the subtask corresponding to the object not placed in the backpack is determined as a second subtask.

[0038] Preferably, for each of the levels, obtaining an offloading matrix based on each of the first subtasks corresponding to the level and the greedy strategy includes:

[0039] For each of the levels, sorting the first subtasks corresponding to the level from large to small according to the amount of data, to obtain an uninstallation order of the first subtasks;

[0040] Based on the unloading order, for each of the first subtasks, within the communication range of the target task vehicle corresponding to the first subtask, determine as the target unloading vehicle the target computing power vehicle with the least number of hops to the target task vehicle and a remaining computing power greater than or equal to the computing power required to process the first subtask;

[0041] An unloading matrix is ​​constructed based on the target unloading vehicles corresponding to each of the subtasks.

[0042] A second aspect of an embodiment of the present invention discloses a task offloading device based on a vehicle cluster, which is applied to a roadside unit. The roadside unit is communicatively connected to a cloud server. The device includes:

[0043] An acquisition unit, configured to acquire basic information sent by each mission vehicle within the communication range of the roadside unit;

[0044] a screening unit, configured to calculate, based on the basic information of each task vehicle, a task similarity of the tasks to be unloaded between each two task vehicles, and determine the task vehicle as a target task vehicle if the task similarity is greater than or equal to a similarity threshold and the expected communication duration between the two task vehicles is greater than or equal to a communication duration threshold; the task to be unloaded is composed of a plurality of subtasks, and there is a topological dependency relationship between the subtasks;

[0045] A cluster head construction unit, configured to construct a cluster head based on each of the target mission vehicles and calculate the computing power required by the cluster head;

[0046] A cluster construction unit is configured to select target computing power vehicles from idle computing power vehicles within the communication range of the cluster head based on the computing power required by the cluster head, and to construct a vehicle cluster based on the target computing power vehicles and the cluster head;

[0047] a decomposition unit configured to decompose, for each target task vehicle in the vehicle cluster, the corresponding to-be-offloaded task into a plurality of subtasks, and construct a first directed acyclic graph based on the topological dependency relationships between the subtasks; wherein each node in the first directed acyclic graph represents a subtask, and an edge between each two nodes represents the topological dependency relationship between the corresponding two subtasks;

[0048] a merging and deduplication unit, configured to merge and deduplication each of the first directed acyclic graphs while ensuring that the topological dependency between the subtasks remains unchanged, to obtain a second directed acyclic graph;

[0049] a hierarchical unit, configured to perform logical hierarchical processing on the second directed acyclic graph to obtain a plurality of hierarchies containing the corresponding subtasks and the number of hierarchies corresponding to the hierarchies;

[0050] The unloading unit is used to unload the subtasks corresponding to each level in turn according to the number of levels corresponding to each level, so that the subtasks are unloaded to the target computing vehicle or the cloud server in the vehicle cluster.

[0051] Based on the above-mentioned embodiment of the present invention, a task offloading method and device based on vehicle clusters are provided. Target task vehicles whose task similarity and expected communication duration meet the threshold are screened out to form a cluster head. A vehicle cluster is formed based on the cluster head and the screened target computing power vehicles. The tasks to be offloaded in the vehicle cluster are decomposed into multiple subtasks, and repeated subtasks are removed. Under the premise of ensuring that the topological dependencies between subtasks remain unchanged, the remaining subtasks are merged to obtain a directed acyclic graph. The directed acyclic graph is logically layered, and the subtasks in each layer are offloaded layer by layer to an idle computing power vehicle or cloud server. In this solution, unlike traditional offloading solutions, a vehicle cluster is constructed in which the expected communication duration between vehicles meets the threshold, and repeated subtasks in the vehicle cluster are merged, which greatly reduces the amount of data that needs to be transmitted and the amount of computational effort for task processing, thereby reducing the duration of task processing, thereby solving the problem of incomplete task offloading caused by high-speed movement of vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0053] Figure 1 This is an architectural diagram of a multi-layer vehicle-mounted edge computing system model disclosed in an embodiment of the present invention;

[0054] Figure 2 A flowchart of a vehicle cluster-based task offloading method disclosed in an embodiment of the present invention;

[0055] Figure 3 A schematic diagram of a merging and deduplication process disclosed in an embodiment of the present invention;

[0056] Figure 4This is a structural diagram of a task offloading device for a vehicle cluster disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0058] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0059] First, the technical terms used in this application are explained as follows:

[0060] 1. Edge computing: A distributed computing architecture in which data processing, storage, and analysis occur on edge devices or nodes close to the data source, rather than relying on remote centralized data centers or the cloud. This computing model aims to reduce latency, conserve bandwidth, and improve real-time data processing capabilities.

[0061] 2. Task dependency: This refers to the sequential relationship whereby the completion of a task requires the completion of other related tasks. In other words, the execution of one task may depend on the completion of another. For example, if Task A requires the result data of Tasks B and C as input, then Task A is dependent on Tasks B and C.

[0062] 3. Delay Sensitivity: In the Internet of Vehicles (IoV), certain tasks are extremely sensitive to delays and must be completed in an extremely short time, otherwise system performance and even safety will be affected. This sensitivity stems from the real-time and high reliability requirements of IoV tasks.

[0063] 4. Vehicle clustering: Multiple vehicles on the road are logically grouped together. Groups assist each other in sharing resources, such as computing power and cached content. However, rapid movement of vehicles on the road can change their relative positions, easily causing the cluster to disintegrate.

[0064] 5. Task offloading: In a computing system, tasks originally performed by one device or node are transferred to another. Task offloading is often used to optimize performance, save energy, improve computing efficiency, or reduce load.

[0065] 6. Roadside Unit (ROU): This refers to communication equipment deployed along roads in the connected vehicle network, such as base stations, used to exchange data and communicate with vehicles. RSUs are a crucial component of connected vehicle infrastructure. They are typically installed along roads, intersections, traffic lights, or highways to support communication between vehicles and infrastructure.

[0066] 7. Cloud Server: A cloud computing-based virtual server that provides computing resources, storage, and network services over the internet. Unlike traditional physical servers, cloud servers do not rely on specific physical hardware. Instead, they are created and managed by cloud service providers using virtualization technology in their data centers.

[0067] 8. Mission vehicle: This refers to a vehicle that generates a mission while driving on the road. When the vehicle itself cannot provide sufficient computing power to process the mission, it requests assistance from the outside world.

[0068] 9. Idle computing power vehicles: Vehicles with idle computing power, such as buses and taxis, or private cars, can provide computing power for mission vehicles.

[0069] 10. Computing power: This generally refers to computing power, which measures the speed and efficiency of a computer system in processing data and executing tasks. Floating-point operations per second (FLOPS) measures how many floating-point operations a computer can perform per second and is often used to assess computing power. Computing power is primarily determined by the following computing resources:

[0070] CPU and GPU performance: The computing power of the central processing unit (CPU) and graphics processing unit (GPU) directly affects the processing speed of the task.

[0071] Memory and storage: Ample memory and fast storage devices (such as SSDs) can increase the speed at which data is read and written, thereby improving overall performance.

[0072] Parallel processing capability: The ability to process multiple tasks or data streams simultaneously.

[0073] like Figure 1 Figure 2 shows the architecture of a multi-layered in-vehicle edge computing system model disclosed in an embodiment of the present invention. This model uses cellular Internet of Vehicles (IoV) technology to integrate edge computing and in-vehicle computing to form a multi-layered in-vehicle edge computing system. This model addresses the issue of optimizing task offloading in an IoV environment, encompassing the vehicle layer, edge layer, and cloud layer.

[0074] The vehicle layer includes: mission vehicles and idle computing vehicles.

[0075] Among them, the task vehicle generates a task while driving on the road. When the local area cannot provide sufficient computing power to process the task, it reports information to the base station and other roadside units to request assistance; the idle computing power vehicle has idle computing power in the current time slot, such as buses and taxis, or private cars, which provide computing power for the task vehicle.

[0076] The edge layer includes roadside units, of which base stations are the most common. If a task vehicle cannot obtain sufficient computing power support from nearby idle computing vehicles, part of the task will be offloaded to the roadside unit.

[0077] The cloud layer includes cloud servers with powerful computing power. Roadside units communicate with cloud servers via optical fiber links.

[0078] According to the IEEE 1609.4 standard, each vehicle is required to broadcast basic information at regular intervals. After receiving this information, the roadside unit (ROU) will build a vehicle cluster and formulate a task offloading strategy, enabling idle computing vehicles within the cluster to provide computing power to the task vehicle.

[0079] Based on the multi-layer vehicle-mounted edge computing system model disclosed in the above embodiment of the present invention, Figure 2 FIG. 1 is a flowchart of a vehicle cluster-based task offloading method disclosed in an embodiment of the present invention, which is applied to a roadside unit in a multi-layer vehicle-mounted edge computing system model, including the following steps:

[0080] S201: Obtain basic information sent by each mission vehicle within the communication range of the roadside unit.

[0081] It should be noted that in actual roads, according to the IEEE 1609.4 standard, each vehicle needs to broadcast basic information within a certain time interval. In a time cycle, each vehicle broadcasts this basic information at the beginning of the time slot.

[0082] Basic information includes vehicle status information, such as location, speed, direction, acceleration, etc.

[0083] The IEEE 1609.4 standard payload is 39 bytes, and the basic information can be further expanded to include information related to available computing resources (such as CPU frequency) and information about tasks to be offloaded.

[0084] It is understandable that if the basic information contains information about tasks to be unloaded, the vehicle can be determined to be a task vehicle.

[0085] S202: Based on the basic information of each task vehicle, the task similarity of the tasks to be unloaded between each two task vehicles is calculated. If the task similarity is greater than or equal to the similarity threshold and the expected communication time between the two task vehicles is greater than or equal to the communication time threshold, then the two task vehicles are determined to be the target task vehicle.

[0086] The task to be offloaded consists of multiple subtasks, and there are topological dependencies between the subtasks.

[0087] In S202 , the task similarity threshold may be adjusted according to the road conditions.

[0088] Among them, task similarity is an indicator that measures how many identical subtasks there are in the unloading tasks generated by two task vehicles in a time period.

[0089] It should be noted that since the subsequent merging and deduplication process requires merging the tasks of two vehicles whose task similarity meets the task similarity threshold to reduce system workload, it is necessary to screen out task vehicles whose task similarity meets the similarity threshold. For example, if map resources and road information are requested at the same time and location, there is no need to waste resources to repeatedly execute these subtasks. Aggregating vehicles with repeated subtasks and sharing the results of repeated subtasks will significantly reduce task processing latency and system energy consumption. Conversely, the topological dependencies in the total merged task will be very complex, which is not conducive to subsequent offloading.

[0090] In S202 , it is also necessary to ensure that the task result can be returned before the link is disconnected, so it is necessary to predict the expected communication duration between task vehicles, that is, the expected duration for which the task vehicles can maintain communication.

[0091] Mission vehicles entering the coverage area of ​​a base station or other roadside unit are assumed to be stable over a short period of time, so their positions can be predicted within the next few seconds. The successful return of mission results is determined by determining whether the mission vehicles are still within the communication distance threshold at the communication time threshold.

[0092] The communication duration threshold is the minimum duration required to ensure that the task result can be returned.

[0093] In the specific implementation process of S202, for every two task vehicles, the target distance between the two task vehicles is calculated based on the distance formula, the communication time threshold and the corresponding vehicle status information. If the target distance is less than or equal to the communication distance threshold, it is determined that the expected communication time between the two task vehicles is greater than or equal to the communication time threshold.

[0094] More specifically, we obtain the basic information of the i-th task vehicle, where i∈[1,M], and M is the total number of task vehicles on the road. We denote the task vehicle as V={x,y,v,a}, where x and y represent the horizontal and vertical coordinates of V, and v and a represent the velocity and acceleration, respectively, both of which are vectors.

[0095] The position of the task vehicle at time t can be expressed as:

[0096]

[0097] The target distance between two mission vehicles is expressed by the distance formula:

[0098]

[0099] Among them, X(t)1 and Y(t)1 represent the horizontal coordinate and vertical coordinate of the first task vehicle, and X(t)2 and Y(t)2 represent the horizontal coordinate and vertical coordinate of the second task vehicle.

[0100] Let the communication duration threshold be t min , the communication distance threshold of the mission vehicle is d max Therefore, the conditions that need to be met for the communication duration to be greater than or equal to the communication duration threshold are:

[0101] d(t min )≤d max

[0102] It should be noted that for the current time period, after the roadside unit obtains the basic information of each vehicle, it will select two vehicles within the communication range of each other, and judge whether their expected communication time meets the communication time threshold through vehicle status information such as position, speed, and acceleration, thereby ensuring the stability of the communication link during task unloading, processing, and result transmission.

[0103] For two mission vehicles whose expected communication time is greater than or equal to the communication time threshold, the to-be-unloaded task information corresponding to the two mission vehicles is compared to obtain the task similarity. If the task similarity is greater than or equal to the similarity threshold, the two mission vehicles are determined as target mission vehicles.

[0104] More specifically, the task to be offloaded is decomposed into smaller subtasks, and the task similarity is calculated by whether the subtasks are the same. K is the unloading task for the Kth vehicle, which can be decomposed into n subtasks, where n∈[1,N], N is M K The total number of decomposable subtasks.

[0105] The task similarity, denoted as η, is equal to the number of similar subtasks in the two unloaded tasks (e.g., M1 and M2) for the two vehicles divided by the total number of subtasks. η provides an indication of the benefits of merging two applications. The higher the similarity, the greater the benefit of merging.

[0106] Let the task similarity threshold be η min , if η is greater than or equal to η min , then the corresponding two mission vehicles are determined as target mission vehicles.

[0107] S203: Construct a cluster head based on each target mission vehicle and calculate the computing power required by the cluster head.

[0108] In S203, the generated cluster head is recorded as CH = {ch_1, ch_2, ..., ch_i}, where ch_i represents a target task vehicle in the cluster head. The target task vehicles in the cluster head have the same subtasks and can be de-duplicated and merged.

[0109] In the specific implementation process of S203, first, the first target mission vehicle that enters the communication range of the roadside unit is selected as the first mission vehicle, and a cluster head is constructed for the first mission vehicle.

[0110] Then, for each target mission vehicle within the communication range of the cluster head, if the number of hops between it and the first mission vehicle is less than or equal to the hop number setting value, and the mission similarity between it and the first mission vehicle is greater than or equal to the similarity threshold, and the expected communication time between it and the first mission vehicle is greater than or equal to the communication time threshold, then the target mission vehicle is added to the cluster head.

[0111] Finally, the computing power required by the cluster head is calculated.

[0112] For example, vehicle A->vehicle B->vehicle C, the number of hops between vehicle A and vehicle C is 2.

[0113] It should be noted that, based on the basic information of the vehicles in the cluster head, the roadside unit can clearly know the computing power required by each target mission vehicle, and thus calculate the computing power required by the cluster head.

[0114] In this embodiment of the present invention, cluster head size is controlled by limiting the number of hops between the first task vehicle joining a cluster head and subsequent target task vehicles. Because intra-cluster head communication delay is related to the communication distance and the number of vehicles within the cluster head, the hop count can be set higher if the communication distance between target task vehicles is short on congested roads. Conversely, the hop count should be set lower.

[0115] The target task vehicle within the CH communication range is selected through cyclic traversal. If the number of hops between the current target task vehicle and the first task vehicle is less than the set value of the hop number, and the expected communication duration and task similarity both reach the corresponding threshold, it can be added to the cluster head and the subsequent nodes can be expanded.

[0116] Preferably, it is first determined whether the current target mission vehicle is added to an existing cluster head. If so, the current target mission vehicle is no longer added to the cluster head currently being constructed.

[0117] S204: Based on the computing power required by the cluster head, target computing power vehicles are screened out from the idle computing power vehicles within the communication range of the cluster head, and a vehicle cluster is constructed based on the target computing power vehicles and the cluster head.

[0118] In S204, the idle computing vehicles within the cluster head's communication range are traversed to determine whether the idle computing vehicle meets the expected communication duration requirement. If so, the idle computing vehicle is marked as the target computing vehicle. The cluster head's communication range is the combined communication range of all vehicles within the cluster head.

[0119] In the specific implementation process of S204, each idle computing power vehicle within the communication range of the cluster head is traversed. If the expected communication duration between the idle computing power vehicle and any target task vehicle in the cluster head is greater than or equal to the communication duration threshold, the idle computing power vehicle is determined to be the target computing power vehicle, until the sum of the computing capabilities of each target computing power vehicle is greater than or equal to the computing capability required by the cluster head; a vehicle cluster is constructed based on the target computing power vehicle and each target task vehicle in the cluster head.

[0120] It's important to note that a single idle computing vehicle might be within the communication range of multiple cluster heads, leading to competition among cluster heads. Therefore, to ensure the smooth formation of vehicle clusters, a greedy strategy is employed, sequentially searching for idle computing vehicles for cluster heads along the road's direction of travel. The next cluster is considered only after the previous one has been successfully formed, thus preventing multiple clusters from competing for the same idle computing vehicle.

[0121] S205: For each target task vehicle in the vehicle cluster, decompose the corresponding task to be unloaded into multiple subtasks, and construct a first directed acyclic graph based on the topological dependency relationship between the subtasks.

[0122] Each node in the first directed acyclic graph represents a subtask, and the edge between each two nodes represents the topological dependency relationship between the corresponding two subtasks.

[0123] In S205, at the beginning of each time slot t, each task vehicle can only generate one task to be unloaded, and the number of tasks to be unloaded M KGenerated by the kth task vehicle, it consists of N interdependent subtasks, each of which is determined by t n ={C n ,D n} represents. Among them, C n Indicates the number of CPU cycles required to complete the subtask, that is, the computing power required to complete the subtask, D n Represents the data size of the subtask, and both obey uniform distribution.

[0124] In the specific implementation process of S205, the to-be-unloaded tasks of each target task vehicle in the vehicle cluster are decomposed based on the topological dependency relationship, and the decomposed subtasks are represented using a directed acyclic graph to obtain a first directed acyclic graph corresponding to each target task vehicle in the vehicle cluster.

[0125] It should be noted that each subtask can only be started after the previous subtask is completed. The topological dependency between two subtasks is represented by express.

[0126] Model the subtasks and topological dependencies as a directed acyclic graph, represented as

[0127] in, is the set of nodes in a directed acyclic graph, t n ∈M K Indicates the task to be uninstalled M K The nth subtask in . The is an edge of the directed acyclic graph, representing subtask t b Requires the previous subtask t a The output of t b Must be in t a It can be started only after completion.

[0128] S206: Under the condition that the topological dependency relationship between the subtasks remains unchanged, the first directed acyclic graphs are merged and deduplicated to obtain a second directed acyclic graph.

[0129] In S206, the total task is obtained by merging and deduplicating the tasks to be unloaded of the target task vehicles in the vehicle cluster, wherein the tasks to be unloaded of each target task vehicle are represented by each first directed acyclic graph, and the total task is represented by a second directed acyclic graph.

[0130] It is understandable that the target task vehicle is a task vehicle that has been screened by the above task similarity, and there will be some repeated subtasks in its unloading tasks. In order to reduce the system workload, each first directed acyclic graph needs to be merged and deduplicated.

[0131] It's important to note that due to task dependencies, each subtask must adhere to strict execution time constraints. The input of each subtask must be the output of its predecessor, and the overall task is complete only when all dependent tasks are completed. Therefore, after deduplication, the overall task must maintain the topological dependencies between its subtasks. This ensures that subtasks execute in the order of their dependencies during offloading.

[0132] In the specific implementation process of S206, each edge in each first directed acyclic graph is traversed, and when any two identical edges exist, the two identical edges are merged to obtain a second directed acyclic graph.

[0133] It should be noted that when there are two identical edges (Ta, Tb), it means that subtask Ta and subtask Tb exist in both target task vehicles, and the topological dependency between Ta and Tb is the same. This indicates that subtask Tb in the two vehicles receives data from the same preceding subtask Ta, and the calculations performed by subtask Tb in the two vehicles are the same, so these two edges can be merged into one edge. The second directed acyclic graph represents the total task after the merge and deduplication process. The process of merging and deduplication is expressed as:

[0134] like Figure 3 , which is a schematic diagram of a merging and deduplication process disclosed in an embodiment of the present invention.

[0135] For example, Figure 3 The first directed acyclic graphs corresponding to the two tasks to be offloaded are merged and deduplicated, wherein: Figure 3 The tasks to be uninstalled on the left include subtasks: T1 to T7. Figure 3 The tasks to be uninstalled on the right include subtasks T1 to T6, and T8 to T10.

[0136] Figure 3 In the first directed acyclic graph corresponding to the two tasks to be offloaded shown, the edges between T1 and T5 are the same, and they are merged to obtain the second directed acyclic graph corresponding to the total task. The subtasks contained in the second directed acyclic graph include: T1 to T10, among which there are two T6.

[0137] S207: Performing logical layering processing on the second directed acyclic graph to obtain a plurality of layers including corresponding subtasks and the number of layers corresponding to the layers.

[0138] The specific implementation process of S207 includes:

[0139] S2071: Divide each node with in-degree 0 in the second directed acyclic graph into the same level, and mark the level number of the level.

[0140] In a directed acyclic graph, in-degree refers to the number of incoming edges to a node. In other words, in-degree indicates how many edges point to the node.

[0141] S2072: excluding nodes that have been divided into levels, and returning to S2071 for execution, until all nodes in the second directed acyclic graph are divided into corresponding levels, thereby obtaining multiple levels containing subtasks corresponding to the nodes.

[0142] It's important to note that by treating each data input as an in-degree of a node, we can determine the in-degree of each node. Obviously, there will be nodes with an in-degree of 0, which constitute the first layer of the second directed acyclic graph. Removing the nodes in the first layer will create new nodes with an in-degree of 0, which are considered the second layer. Repeat this process, removing the previous layer each time and treating the new in-degree 0 nodes as a new layer. This creates a logically hierarchical structure for the second directed acyclic graph, resulting in multiple layers containing subtasks corresponding to the nodes.

[0143] S208: According to the number of levels corresponding to each level, the subtasks corresponding to each level are unloaded in turn, so that the subtasks are unloaded to the target computing vehicle or cloud server in the vehicle cluster.

[0144] In S208, a 0-1 knapsack problem is solved at each level to determine the subtasks that remain in the vehicle cluster and are processed by the target computing vehicle, as well as the subtasks that are offloaded to the cloud server. For the subtasks that remain in the vehicle cluster, an offloading matrix is ​​derived based on a greedy strategy, and the subtasks are offloaded to the target computing vehicle based on the offloading matrix.

[0145] It's important to note that layer-by-layer processing significantly reduces the algorithm's time complexity. Assume that after merging and deduplication, the number of subtasks is n. As the task to be offloaded grows larger, the number of decomposable subtasks increases, and the topological dependencies between them become correspondingly complex, requiring decomposition into more layers. Assuming the number of subtasks in a layer is m, the time complexity of solving the 0-1 knapsack problem is O(mP), where P is the number of target vehicles within the cluster. P is less than or equal to m, so the time complexity for this part is approximately O(m^2). Then, using a greedy approach, the subtasks remaining within the cluster are traversed twice, resulting in a time complexity of approximately O(2m). Let L represent the number of layers in the second directed acyclic graph corresponding to the task to be offloaded, resulting in a time complexity of O(L*m^2). L*m is approximately equal to n. When the number of subtasks is small, the time complexity is approximately O(N^2). When the number of subtasks is large, O(L*m^2) is significantly less than O(N^2).

[0146] The specific implementation process of S208 includes:

[0147] S2081: According to the level number corresponding to each level, solve the 0-1 knapsack problem for each level in turn to obtain the first subtask of the target computing vehicle to be unloaded to the vehicle cluster in the level, and obtain the second subtask of the target computing vehicle to be unloaded to the cloud server in the level.

[0148] In the specific implementation process of S2081, for each level, the computing power of the vehicle cluster is used as the capacity of the backpack; for each subtask in the level, the subtask is used as the object to be placed in the backpack, the computing power required to execute the subtask is used as the volume of the object, and the amount of data contained in the subtask is used as the value of the object to solve the 0-1 backpack problem; the subtask corresponding to the object placed in the backpack is determined as the first subtask, and the subtask corresponding to the object not placed in the backpack is determined as the second subtask.

[0149] It's important to note that in this 0-1 knapsack problem, the computing power of the vehicle cluster is considered the capacity of the knapsack, each subtask is considered an object to be placed in the knapsack, and the required computing power is considered the object's volume. Communication distance is the primary cause of communication latency. Communication latency within a vehicle cluster is significantly less than the latency between a vehicle and a base station. Furthermore, communication latency is primarily related to task size. Therefore, processing larger subtasks within the cluster reduces communication latency. Therefore, the size of the subtask is considered the value of the object.

[0150] S2082: For each level, based on the first subtasks corresponding to the level and the greedy strategy, an offloading matrix is ​​obtained, and based on the offloading matrix, the first subtasks corresponding to the level are offloaded to the target computing vehicle in the vehicle cluster.

[0151] In the specific implementation process of S2082, based on the unloading order, for each first subtask in turn, within the communication range of the target task vehicle corresponding to the first subtask, the target computing power vehicle with the least number of hops to the target task vehicle and the remaining computing power greater than or equal to the computing power required to process the first subtask is determined as the target unloading vehicle; based on the target unloading vehicles corresponding to each subtask, an unloading matrix is ​​constructed.

[0152] For example, the first subtask remaining in the cluster is denoted as t cluster .

[0153] The first step is sorting: Since the amount of data in a subtask is the main factor affecting the transmission delay, it is hoped that the larger the task, the shorter the transmission distance. cluster The unloading order is obtained by sorting the tasks in reverse order according to their size (in MB), so that the first subtask with the largest data volume is placed at the front and is processed first. Then, the tasks are unloaded one by one according to the unloading order.

[0154] The second step is to offload the nearest hop: if the current first subtask t i In vehicle d j On, and there is a target computing power vehicle p k In d j If the task is within the communication range, then it will be unloaded. α[i][k]=1, indicating that task t i Uninstall to p k .

[0155] The third step is multi-hop uninstallation: the remaining first subtasks that have not been uninstalled are uninstalled in a multi-hop manner according to the uninstallation order.

[0156] Through the above steps, we can obtain the offloading matrix. Each time, we only consider how to offload the current first subtask without considering its impact on the overall task, which is a greedy strategy.

[0157] S2083: For each level, offload each second subtask corresponding to the level to the cloud server.

[0158] In an embodiment of the present invention, the subtasks placed in the backpack remain in the vehicle cluster and are processed by idle computing power vehicles. The rest will be unloaded to the roadside unit and then transmitted to the cloud server via optical fiber. Then, an unloading decision is made for the subtasks in the vehicle cluster. This application takes into account multi-hop communication, which makes the scale and scope of the cluster larger and can better cope with various road conditions compared to traditional single-hop communication. However, when a large amount of data is transmitted over multiple hops, it will result in higher communication delays. Therefore, subtasks with large amounts of data should be unloaded nearby. First, sort the tasks in reverse order by data size. Then, according to the sorting results, larger tasks are unloaded first, and vehicles with idle resources within the one-hop communication range are selected for unloading to reduce transmission delays. Finally, since the target computing power vehicle within the one-hop communication range and idle no longer exists, the remaining subtasks are greedily unloaded to the nearest target computing power vehicle through multi-hop transmission.

[0159] Based on the above-mentioned embodiment of the present invention, a task offloading method based on vehicle clusters is disclosed. Target task vehicles whose task similarity and expected communication duration meet the threshold are screened out to form a cluster head. A vehicle cluster is formed based on the cluster head and the screened target computing power vehicles. The tasks to be offloaded in the vehicle cluster are decomposed into multiple subtasks, and repeated subtasks are removed. Under the premise of ensuring that the topological dependencies between subtasks remain unchanged, the remaining subtasks are merged to obtain a directed acyclic graph. The directed acyclic graph is logically layered, and the subtasks in each layer are offloaded layer by layer to an idle computing power vehicle or cloud server. In this solution, unlike traditional offloading solutions, a vehicle cluster is constructed in which the expected communication duration between vehicles meets the threshold, and repeated subtasks in the vehicle cluster are merged, which greatly reduces the amount of data that needs to be transmitted and the amount of computational effort for task processing, thereby reducing the duration of task processing, thereby solving the problem of incomplete task offloading caused by high-speed movement of vehicles.

[0160] Corresponding to the vehicle cluster-based task offloading method disclosed in the above embodiment of the present invention, Figure 4 FIG. 1 is a structural diagram of a task offloading device for a vehicle cluster disclosed in an embodiment of the present invention. The device is applied to a roadside unit (RU), which is communicatively connected to a cloud server. The device includes:

[0161] The acquisition unit 401 is used to acquire basic information sent by each task vehicle within the communication range of the roadside unit.

[0162] The screening unit 402 is used to calculate the task similarity of the unloading tasks between each two task vehicles based on the basic information of each task vehicle. If the task similarity is greater than or equal to the similarity threshold and the expected communication time between the two task vehicles is greater than or equal to the communication time threshold, then the vehicle is determined to be the target task vehicle; the unloading task is composed of multiple subtasks, and there is a topological dependency relationship between the subtasks.

[0163] In one embodiment, the basic information includes: vehicle status information and information about unloading tasks, and the corresponding screening unit 402 is specifically used to:

[0164] For each pair of task vehicles, the target distance between the two task vehicles is calculated based on the distance formula, the communication duration threshold, and the corresponding vehicle status information. If the target distance is less than or equal to the communication distance threshold, the expected communication duration between the two task vehicles is determined to be greater than or equal to the communication duration threshold.

[0165] For two mission vehicles whose expected communication time is greater than or equal to the communication time threshold, the to-be-unloaded task information corresponding to the two mission vehicles is compared to obtain the task similarity. If the task similarity is greater than or equal to the similarity threshold, the two mission vehicles are determined as target mission vehicles.

[0166] The cluster head construction unit 403 is used to construct a cluster head based on each target mission vehicle and calculate the computing power required by the cluster head.

[0167] In one embodiment, the cluster head construction unit 403 is specifically configured to:

[0168] The first target mission vehicle that enters the communication range of the roadside unit is selected as the first mission vehicle, and a cluster head is constructed for the first mission vehicle;

[0169] For each target mission vehicle within the communication range of the cluster head, if the number of hops between it and the first mission vehicle is less than or equal to the hop number setting value, and the mission similarity between it and the first mission vehicle is greater than or equal to the similarity threshold, and the expected communication time between it and the first mission vehicle is greater than or equal to the communication time threshold, then the target mission vehicle is added to the cluster head;

[0170] Calculate the computing power required by the cluster head.

[0171] The cluster construction unit 404 is used to screen out target computing power vehicles from idle computing power vehicles within the communication range of the cluster head based on the computing power required by the cluster head, and construct a vehicle cluster based on the target computing power vehicles and the cluster head.

[0172] In one embodiment, the cluster building unit 404 is specifically configured to:

[0173] Traverse each idle computing vehicle within the communication range of the cluster head. If the expected communication duration between the idle computing vehicle and any target task vehicle in the cluster head is greater than or equal to the communication duration threshold, then determine the idle computing vehicle as the target computing vehicle, until the sum of the computing capabilities of all target computing vehicles is greater than or equal to the computing capability required by the cluster head;

[0174] A vehicle cluster is constructed based on the target computing power vehicle and each target task vehicle in the cluster head.

[0175] The decomposition unit 405 is used to decompose the corresponding to-be-unloaded task into multiple subtasks for each target task vehicle in the vehicle cluster, and construct a first directed acyclic graph based on the topological dependency relationship between each subtask; each node in the first directed acyclic graph represents a subtask, and the edge between each two nodes represents the topological dependency relationship between the corresponding two subtasks.

[0176] The merging and deduplication unit 406 is used to merge and deduplication each of the first directed acyclic graphs to obtain a second directed acyclic graph while ensuring that the topological dependency between the subtasks remains unchanged.

[0177] In one embodiment, the combined deduplication unit 406 is specifically configured to:

[0178] Each edge in each first directed acyclic graph is traversed, and when any two identical edges exist, the two identical edges are merged to obtain a second directed acyclic graph.

[0179] The layering unit 407 is configured to perform logical layering processing on the second directed acyclic graph to obtain a plurality of layers containing corresponding subtasks and the number of layers corresponding to the layers.

[0180] In one embodiment, the stratification unit 407 is specifically configured to:

[0181] Divide each node with in-degree 0 in the second directed acyclic graph into the same level and mark the level number of the level;

[0182] Excluding nodes that have been divided into levels, returning to the step of dividing each node with in-degree 0 in the second directed acyclic graph into the same level and marking the level number of the level, until all nodes in the second directed acyclic graph are divided into corresponding levels, obtaining multiple levels containing subtasks corresponding to the nodes.

[0183] The unloading unit 408 is used to unload the subtasks corresponding to each level in sequence according to the level number corresponding to each level, so that the subtasks are unloaded to the target computing vehicle or cloud server in the vehicle cluster.

[0184] In one embodiment, the unloading unit 408 includes:

[0185] The solving sub-unit is used to solve the 0-1 knapsack problem for each level in turn according to the level number corresponding to each level, and obtain the first subtask of the target computing vehicle to be unloaded to the vehicle cluster in the level, and obtain the second subtask to be unloaded to the cloud server in the level.

[0186] The first unloading subunit is used to obtain an unloading matrix for each level based on the first subtasks corresponding to the level and the greedy strategy, and unload the first subtasks corresponding to the level to the target computing vehicle in the vehicle cluster based on the unloading matrix.

[0187] In one embodiment, the first unloading subunit is specifically configured to:

[0188] For each level, the computing power of the vehicle cluster is used as the capacity of the backpack;

[0189] For each subtask in the hierarchy, consider the subtask as an object to be placed in the backpack, the computing power required to perform the subtask as the volume of the object, and the amount of data contained in the subtask as the value of the object, and solve the 0-1 knapsack problem;

[0190] The subtask corresponding to the object placed in the backpack is determined as the first subtask, and the subtask corresponding to the object not placed in the backpack is determined as the second subtask.

[0191] The second offloading sub-unit is used to offload each second subtask corresponding to each level to the cloud server.

[0192] In one embodiment, the second unloading subunit is specifically configured to:

[0193] For each level, sort the first subtasks corresponding to the level from large to small according to the data volume to obtain the unloading order of the first subtasks;

[0194] Based on the unloading order, for each first subtask, within the communication range of the target task vehicle corresponding to the first subtask, determine the target computing power vehicle with the least number of hops to the target task vehicle and whose remaining computing power is greater than or equal to the computing power required to process the first subtask as the target unloading vehicle;

[0195] Based on the target unloading vehicles corresponding to each subtask, an unloading matrix is ​​constructed.

[0196] Based on the above-mentioned embodiment of the present invention, a task unloading device based on vehicle clusters is disclosed. Target task vehicles whose task similarity and expected communication duration meet the threshold are screened out to form a cluster head. A vehicle cluster is formed based on the cluster head and the screened target computing power vehicles. The tasks to be unloaded in the vehicle cluster are decomposed into multiple subtasks, and repeated subtasks are removed. Under the premise of ensuring that the topological dependencies between subtasks remain unchanged, the remaining subtasks are merged to obtain a directed acyclic graph. The directed acyclic graph is logically layered, and the subtasks in each layer are unloaded layer by layer to an idle computing power vehicle or cloud server. In this solution, unlike traditional unloading solutions, a vehicle cluster is constructed in which the expected communication duration between vehicles meets the threshold, and repeated subtasks in the vehicle cluster are merged, which greatly reduces the amount of data that needs to be transmitted and the amount of computational effort for task processing, thereby reducing the duration of task processing, thereby solving the problem of incomplete task unloading caused by high-speed movement of vehicles.

[0197] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.

[0198] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0199] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A task offloading method based on vehicle clusters, characterized in that: Applied to a roadside unit, the roadside unit is communicatively connected to a cloud server, and the method includes: Obtaining basic information sent by each mission vehicle within the communication range of the roadside unit; Based on the basic information of each task vehicle, the task similarity of the tasks to be unloaded between each two task vehicles is calculated. If the task similarity is greater than or equal to a similarity threshold and the expected communication time between the two task vehicles is greater than or equal to a communication time threshold, the two task vehicles are determined to be target task vehicles; the task to be unloaded is composed of multiple subtasks, and there is a topological dependency relationship between the subtasks; Building a cluster head based on each of the target mission vehicles and calculating the computing power required by the cluster head; Based on the computing power required by the cluster head, a target computing power vehicle is selected from idle computing power vehicles within the communication range of the cluster head, and a vehicle cluster is constructed based on the target computing power vehicle and the cluster head; For each target task vehicle in the vehicle cluster, decompose the corresponding to-be-unloaded task into a plurality of subtasks, and construct a first directed acyclic graph based on the topological dependency relationships between the subtasks; each node in the first directed acyclic graph represents a subtask, and an edge between each two nodes represents the topological dependency relationship between the corresponding two subtasks; Under the condition that the topological dependency relationship between the subtasks remains unchanged, merging and deduplicating the first directed acyclic graphs to obtain a second directed acyclic graph; Performing logical layering processing on the second directed acyclic graph to obtain a plurality of layers including the corresponding subtasks and the number of layers corresponding to the layers; According to the number of levels corresponding to each level, the subtasks corresponding to each level are unloaded in turn, so that the subtasks are unloaded to the target computing vehicle or the cloud server in the vehicle cluster.

2. The method according to claim 1, characterized in that The basic information includes: vehicle status information and information about tasks to be unloaded; based on the basic information of each task vehicle, calculating the task similarity of the tasks to be unloaded between each two task vehicles, and determining the target task vehicle if the task similarity is greater than or equal to a similarity threshold and the expected communication duration between the two task vehicles is greater than or equal to a communication duration threshold, including: For each pair of the task vehicles, based on the distance formula, the communication duration threshold and the corresponding vehicle status information, a target distance between the two task vehicles is calculated; if the target distance is less than or equal to the communication distance threshold, then it is determined that the expected communication duration between the two task vehicles is greater than or equal to the communication duration threshold; For the two task vehicles whose expected communication duration is greater than or equal to the communication duration threshold, the to-be-unloaded task information corresponding to the two task vehicles is compared to obtain task similarity. If the task similarity is greater than or equal to the similarity threshold, the two task vehicles are determined as target task vehicles.

3. The method according to claim 1, characterized in that The step of constructing a cluster head based on each of the target mission vehicles and calculating the computing power required by the cluster head includes: Selecting the first target mission vehicle that enters the communication range of the roadside unit as the first mission vehicle, and building a cluster head for the first mission vehicle; For each target task vehicle within the communication range of the cluster head, if the number of hops between the target task vehicle and the first task vehicle is less than or equal to the hop number setting value, and the task similarity between the target task vehicle and the first task vehicle is greater than or equal to the similarity threshold, and the expected communication duration between the target task vehicle and the first task vehicle is greater than or equal to the communication duration threshold, then the target task vehicle is added to the cluster head; The computing capacity required by the cluster head is obtained by calculation.

4. The method according to claim 1, wherein The method includes screening target computing power vehicles from idle computing power vehicles within the communication range of the cluster head based on the computing power required by the cluster head, and constructing a vehicle cluster based on the target computing power vehicles and the cluster head, including: Traversing each idle computing vehicle within the communication range of the cluster head, if the expected communication duration between the idle computing vehicle and any target task vehicle in the cluster head is greater than or equal to the communication duration threshold, then determining the idle computing vehicle as the target computing vehicle, until the sum of the computing capabilities of each target computing vehicle is greater than or equal to the computing capability required by the cluster head; A vehicle cluster is constructed based on the target computing power vehicle and each target task vehicle in the cluster head.

5. The method according to claim 1, wherein Under the condition that the topological dependency between the subtasks remains unchanged, merging and deduplicating the first directed acyclic graphs to obtain a second directed acyclic graph includes: Each edge in each of the first directed acyclic graphs is traversed, and when any two identical edges exist, the two identical edges are merged to obtain a second directed acyclic graph.

6. The method according to claim 1, characterized in that The second directed acyclic graph is logically layered to obtain a plurality of layers containing the corresponding subtasks and the number of layers corresponding to the layers, including: Classify each of the nodes with an in-degree of 0 in the second directed acyclic graph into the same level, and mark the level number of the level; Excluding the nodes that have been divided into the levels, returning to the step of dividing each of the nodes with an in-degree of 0 in the second directed acyclic graph into the same level and marking the level number of the level, until all nodes in the second directed acyclic graph are divided into the corresponding levels, and obtaining multiple levels containing the subtasks corresponding to the nodes.

7. The method according to claim 1, characterized in that The step of offloading the subtasks corresponding to each level in sequence according to the number of levels corresponding to each level, so that the subtasks are offloaded to the target computing vehicle or the cloud server in the vehicle cluster, includes: Solve the 0-1 knapsack problem for each level in turn according to the level number corresponding to each level, and obtain the first subtask of the level to be offloaded to the target computing vehicle in the vehicle cluster, and obtain the second subtask of the level to be offloaded to the cloud server; For each of the levels, based on each of the first subtasks corresponding to the level and a greedy strategy, an offloading matrix is ​​obtained, and each of the first subtasks corresponding to the level is offloaded to the target computing vehicle in the vehicle cluster based on the offloading matrix; For each of the levels, each of the second subtasks corresponding to the level is offloaded to the cloud server.

8. The method according to claim 7, characterized in that For each of the layers, solving the 0-1 knapsack problem to obtain a first subtask of the layer to be unloaded to the target computing vehicle in the vehicle cluster, and obtaining a second subtask of the layer to be unloaded to the cloud server, includes: For each of the layers, the computing capacity of the vehicle cluster is used as the capacity of the backpack; For each subtask in the hierarchy, consider the subtask as an object to be placed in the backpack, the computing power required to execute the subtask as the volume of the object, and the amount of data contained in the subtask as the value of the object, and solve the 0-1 backpack problem; The subtask corresponding to the object placed in the backpack is determined as a first subtask, and the subtask corresponding to the object not placed in the backpack is determined as a second subtask.

9. The method according to claim 7, characterized in that For each of the levels, based on the first subtasks corresponding to the level and the greedy strategy, an offloading matrix is ​​obtained, including: For each of the levels, sorting the first subtasks corresponding to the level from large to small according to the amount of data, to obtain an uninstallation order of the first subtasks; Based on the unloading order, for each of the first subtasks, within the communication range of the target task vehicle corresponding to the first subtask, determine as the target unloading vehicle the target computing power vehicle with the least number of hops to the target task vehicle and a remaining computing power greater than or equal to the computing power required to process the first subtask; An unloading matrix is ​​constructed based on the target unloading vehicles corresponding to each of the subtasks.

10. A task offloading device based on vehicle clusters, characterized in that: Applied to a roadside unit, the roadside unit is communicatively connected to a cloud server, and the device includes: An acquisition unit, configured to acquire basic information sent by each mission vehicle within the communication range of the roadside unit; a screening unit, configured to calculate, based on the basic information of each task vehicle, a task similarity of the tasks to be unloaded between each two task vehicles, and determine the task vehicle as a target task vehicle if the task similarity is greater than or equal to a similarity threshold and the expected communication duration between the two task vehicles is greater than or equal to a communication duration threshold; the task to be unloaded is composed of a plurality of subtasks, and there is a topological dependency relationship between the subtasks; A cluster head construction unit, configured to construct a cluster head based on each of the target mission vehicles and calculate the computing power required by the cluster head; A cluster construction unit is configured to select target computing power vehicles from idle computing power vehicles within the communication range of the cluster head based on the computing power required by the cluster head, and to construct a vehicle cluster based on the target computing power vehicles and the cluster head; a decomposition unit configured to decompose, for each target task vehicle in the vehicle cluster, the corresponding to-be-offloaded task into a plurality of subtasks, and construct a first directed acyclic graph based on the topological dependency relationships between the subtasks; wherein each node in the first directed acyclic graph represents a subtask, and an edge between each two nodes represents the topological dependency relationship between the corresponding two subtasks; a merging and deduplication unit, configured to merge and deduplication each of the first directed acyclic graphs while ensuring that the topological dependency between the subtasks remains unchanged, to obtain a second directed acyclic graph; a hierarchical unit, configured to perform logical hierarchical processing on the second directed acyclic graph to obtain a plurality of hierarchies containing the corresponding subtasks and the number of hierarchies corresponding to the hierarchies; The unloading unit is used to unload the subtasks corresponding to each level in turn according to the number of levels corresponding to each level, so that the subtasks are unloaded to the target computing vehicle or the cloud server in the vehicle cluster.

Citation Information

Patent Citations

  • Task dependency-based clustering method applied to Internet of Vehicles

    CN111626354A

  • Internet of vehicles edge computing task unloading method based on vehicle clustering

    CN114995917A