Calculation unloading method, device and equipment for multi-source task of Internet of Vehicles and medium
By obtaining task information and resource point trajectory information, dynamically adjusting task priority and unloading decisions, and using genetic algorithms to optimize resource allocation, it solves the problem of resource competition and priority changes in multi-source tasks in vehicle edge computing, and improves task processing efficiency and security.
Patent Information
- Application Number
- CN202510946242.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-09-05
AI Technical Summary
The prior art has failed to effectively solve the problem of resource competition and dynamic change in multi-source tasks in vehicle edge computing, resulting in insufficient computing resources and task delays exceeding limits, affecting driving safety.
By obtaining task information and resource points trajectory information, calculate the distance between the task publishing node and the resource point, dynamically adjust task priority and unloading decisions, and use genetic algorithms to optimize resource allocation to ensure timely processing of security-related tasks.
It achieves accurate resource allocation for multi-source tasks in the Internet of Vehicles, reduces task failure rate, and improves vehicle driving safety and service quality.
Smart Images

Figure CN120602906A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle networking technology, and in particular to a method, device, computer equipment and medium for offloading computation of multi-source tasks in a vehicle networking. Background Art
[0002] During actual vehicle operation, the requests issued by vehicles are random and diverse. Depending on the specific request, its urgency and required resources also vary. In vehicle edge computing (VEC), the processing speed of tasks is crucial to improving the quality of service (QoS) of in-vehicle applications and ensuring driving safety. However, due to the limited computing power of VEC servers deployed at the edge of the network, the surge in the number of task requests has caused fierce competition for computing resources. The limited computing resources are insufficient to support the processing of all tasks in the system, causing some tasks with low delay tolerance to exceed their maximum allowable delay threshold, which in turn causes safety issues during driving.
[0003] During the development of the present invention, the inventors recognized at least the following technical issues with the prior art: Existing approaches typically focus solely on assigning tasks to computing nodes, while ignoring the crucial factor of when tasks are offloaded. This approach is particularly inadequate when computing resources are limited. In real-world scenarios, multiple vehicles may initiate tasks simultaneously, or even a single vehicle may initiate multiple tasks simultaneously, each with varying priorities. In such a highly concurrent multi-task environment, resource competition inevitably arises between tasks due to the limited computing resources of nodes, so computing resources are not always immediately available upon initiation. Furthermore, due to varying task priorities, the traditional first-come, first-served strategy is no longer able to meet the latency requirements of safety-critical tasks. Task priority changes over time are rarely considered, with fixed priorities assigned based solely on their characteristics. This often leads to higher failure rates for low-priority tasks. However, in ultra-intensive task scenarios, there is often a gap between task initiation and resource availability for processing. During this gap, tasks and system resources often dynamically change, leading to changes in task urgency and the optimal offloading location. Therefore, an offloading strategy that dynamically adjusts task priorities is urgently needed to address these issues. Summary of the Invention
[0004] Embodiments of the present invention provide a method, apparatus, computer equipment, and storage medium for offloading computation of multi-source tasks in an Internet of Vehicles (IoV) to improve the accuracy of resource allocation for multi-source tasks in an IoV.
[0005] To solve the above technical problems, embodiments of the present application provide a method for offloading computation of multi-source tasks in an Internet of Vehicles (IoV) network, which is applied to an IoV interaction scenario. The IoV interaction scenario includes a base station and basic vehicles within the base station coverage area. The method for offloading computation of multi-source tasks in an IoV network includes:
[0006] When a task is received, task information and node information of a task publishing node corresponding to the task information are obtained, and the task information is placed in a task set, wherein the task information includes a task type, and the task type includes a security-related task and a non-security-related task;
[0007] Acquire the trajectory information of the resource point, and calculate the distance from the task issuing node to any resource point based on the node information of the task issuing node and the trajectory information of the resource point as the first distance;
[0008] determining a task processing mode according to the task type and the first distance, wherein the task processing mode includes local processing and offload processing;
[0009] If a new task is detected, the system adjusts the priorities of tasks in the current task set, updates the offloading decisions, and updates the task offloading locations and resource acquisition order. The current task set includes newly initiated tasks and unprocessed legacy tasks.
[0010] Optionally, the acquiring of the trajectory information of the resource point and calculating the distance from the task issuing node to any resource point as the first distance based on the node information of the task issuing node and the trajectory information of the resource point includes:
[0011] The trajectory information of vehicle motion is defined as in Indicates vehicle v n The trajectory information at time t, Representative mission vehicle v n The driving speed at time t is Representative mission vehicle v n Position coordinates at time t;
[0012] use Indicates the position coordinates of BS and its speed Set to 0;
[0013] By using the L2 norm, we can get the vehicle v at time t. n The distance between it and any resource point m is
[0014]
[0015] Where m is the resource point, V is the basic vehicle, and it is expressed as V={v1,v2,…,v n ,…,v N},n∈[1,N].
[0016] Optionally, determining the task processing method according to the task type and the first distance includes:
[0017] Define the task set at time t∈T as Binary variables for uninstall decision
[0018]
[0019] The vehicle provides computing resources for one task at a time, while the BS takes an even distribution of resources to provide computing resources for multiple tasks at a time, computing delay The calculation formula is as follows:
[0020]
[0021] Among them F m is the computing resource size of resource point m, F0 is the computing power of BS, and Q represents the number of tasks that BS can calculate simultaneously;
[0022] For the set at time t Tasks in The computation completion time on m can be expressed as:
[0023]
[0024] in, For the task The moment when the calculation can officially begin, the task Satisfy that it has been successfully transferred to m and m is idle and can be used for the task Calculation starts when computing resources are provided. The calculation formula is as follows:
[0025]
[0026] in, Is m able to do the task The moment computing resources are provided, For the task The moment of successful transmission to m;
[0027] for If the task The m that provides computing resources is the vehicle v n The task itself No need to transmit, i.e.
[0028] If the task m, which provides computing resources, is other vehicles or BS. The calculation formula is as follows:
[0029]
[0030] in, Indicates a task The start time of transmission, For transmission tasks The required delay,
[0031] If a new task is initiated during the waiting time, the offloading decision will be updated, resulting in a change in the m of computing resources provided to some tasks. Using m as task Provide computing resources at the time and vehicle v n Able to do tasks The moment of providing communication resources is obtained The calculation formula is as follows:
[0032]
[0033] Assuming that the transmission rate remains constant in a short period of time, Communication rate at the moment To calculate At the same time, since the unloading decision will be updated at time t, the task of
[0034] Must be greater than or equal to t;
[0035] for use Indicates that resource point m is a task The order number of computing resources provided is calculated as follows:
[0036]
[0037] in express The dynamic priority of Before, that is, m is Providing computing resources;
[0038] Task After waiting for all tasks that are ahead of it and decided to execute on m to complete, m is task Provide computing resources, m is the task The moment computing resources are provided The calculation formula is as follows:
[0039]
[0040] in represents the earliest idle available time of computing resource m at time t, express It is at the top of all tasks computed on m at time t. express For the task The predecessor task on m, Indicates a task Precursor tasks The time at which the calculation on m begins.
[0041] Optionally, if a new task is detected, dynamically adjusting the priority of the current task set to obtain task resource allocation information includes:
[0042] When a new task is detected, the total processing delay of the task set at the current moment is calculated;
[0043] Based on the genetic algorithm, the total processing delay of the new task and the current task set is combined to adjust the priority of the tasks in the current task set and update the offloading decision, task offloading location and the order of obtaining resources.
[0044] Optionally, the genetic algorithm is used to combine the total processing delay of the new task and the current task set to perform an offloading strategy and a task-triggered dynamic priority adjustment strategy to obtain the task resource allocation information, including:
[0045] Based on the task initiation time, the required computing resource size, and the maximum tolerable delay of the task, the tolerance is determined. The task tolerance is the gap between the maximum deadline of the task and the expected total completion time. The tolerance of the same task decreases as the waiting time increases. The tolerance at time t is expressed as:
[0046]
[0047] If m∈V, then F * =F m , whereas F * =F0 / Q, where Q is the number of resource blocks of the RSU.
[0048] For each task, sort them in ascending order of tolerance. For tasks with the same tolerance, sort them in ascending order of priority.
[0049] If the estimated completion time of a safety-related task exceeds its deadline, some non-safety-related tasks ahead of it will be discarded to advance the completion time of high-safety-related tasks and ensure that the safety-related tasks can be completed on time.
[0050] In order to solve the above technical problems, the embodiment of the present application further provides a computing offloading device for multi-source tasks in an Internet of Vehicles, comprising:
[0051] An acquisition module is used to, upon receiving a task, acquire task information and node information of a task publishing node corresponding to the task information, and place the task information into a task set, wherein the task information includes a task type, and the task type includes a security-related task and a non-security-related task;
[0052] a calculation module, configured to obtain trajectory information of a resource point, and calculate a distance from the task issuing node to any resource point based on the node information of the task issuing node and the trajectory information of the resource point, as a first distance;
[0053] a determination module, configured to determine a task processing mode according to the task type and the first distance, wherein the task processing mode includes local processing and offload processing;
[0054] The allocation module is used to dynamically adjust the priority of the current task set if a new task is detected to obtain task resource allocation information. The current task set includes the new task initiated at the current moment and the legacy tasks that have not been processed.
[0055] Optionally, the determining module includes:
[0056] The first trajectory determination unit is used to define the trajectory information of the vehicle movement as in Represents vehicle v n The trajectory information at time t, Representative mission vehicle v n The driving speed at time t is Representative mission vehicle v n Position coordinates at time t;
[0057] The second trajectory determination unit is used to adopt Indicates the position coordinates of BS and its speed Set to 0;
[0058] The distance calculation unit uses the L2 norm to obtain the vehicle v at time t n The distance between any resource point m is taken as the first distance. Expressed as:
[0059]
[0060] Where m is the resource point, V is the basic vehicle, and it is expressed as V={v1,v2,…,v n ,…,v N},n∈[1,N].
[0061] Optionally, the allocation module includes:
[0062] A delay calculation unit, used to calculate the total processing delay of the task set at the current moment when a new task is detected;
[0063] The resource allocation unit is used to combine the total processing delay of the new task and the current task set based on the genetic algorithm, perform an offloading strategy and a task-triggered dynamic priority adjustment strategy, and obtain task resource allocation information.
[0064] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for computing offloading of multi-source tasks in the Internet of Vehicles are implemented.
[0065] In order to solve the above technical problems, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the above-mentioned method for computing offloading of multi-source tasks in the Internet of Vehicles.
[0066] The embodiments of the present invention provide a method, apparatus, computer equipment, and storage medium for offloading computational tasks of a multi-source Internet of Vehicles (IoV) system. Upon receiving a task, the method obtains task information and node information of the task issuing node corresponding to the task information, and places the task information into a task set. The task information includes the task type, which includes safety-related tasks and non-safety-related tasks. The method also obtains trajectory information of resource points, and based on the node information of the task issuing node and the trajectory information of the resource points, calculates the distance from the task issuing node to any resource point as a first distance. The method determines the task processing mode based on the task type and the first distance, wherein the task processing mode includes local processing and offloading processing. If a new task is detected, the task set at the current moment is dynamically prioritized to obtain task resource allocation information. The task set at the current moment includes new tasks initiated at the current moment and legacy tasks that have not yet been processed. This method implements priority screening and sorting of dynamic tasks from multiple sources, ensuring the rationality and accuracy of resource allocation for multi-source tasks in the IoV system. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0068] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0069] Figure 2 This is a flowchart of an embodiment of the method for offloading computation of multi-source tasks in an Internet of Vehicles (IoV) according to the present application;
[0070] Figure 3 This is a structural diagram of an embodiment of a device for offloading computation of multi-source tasks in an Internet of Vehicles according to the present application;
[0071] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0073] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0074] The following are some professional terms involved in this embodiment:
[0075] Computation offloading: The vehicle terminal generates tasks, offloads the tasks to other devices for processing, and then returns the calculation results.
[0076] Genetic Algorithm (GA): A genetic algorithm is an optimization algorithm inspired by natural evolutionary theory. It simulates biological evolution to gradually evolve individuals that are better adapted to their environment from a random population. This process primarily involves initializing the population, evaluating fitness, selecting, crossover, and mutation. Through continuous iterative optimization, the genetic algorithm can find near-optimal or better solutions within the search space.
[0077] Local Optima: A local optimum is a solution found in an optimization problem that, while optimal within the current search space, is not necessarily the global optimum. In some cases, an algorithm may stop searching because it believes it has found the optimal solution, but a better solution may actually exist. For example, a genetic algorithm may become stuck in a local optimum if it has not explored enough space when it stops searching.
[0078] Global Optimum: The global optimal solution refers to the best solution found in an optimization problem, that is, the one with the minimum or maximum objective function value in the entire search space.
[0079] First Come First Served (FCFS): In the first come first served algorithm, tasks are given system resources in the order of their arrival time and run until completion after obtaining the resources.
[0080] 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 them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0081] See also Figure 1 ,like Figure 1 This is a schematic diagram of an optional system architecture for the application of the method of this application, which includes a vehicle network interaction scenario. The vehicle network interaction scenario includes a base station and basic vehicles under the coverage of the base station. The basic vehicles include user vehicles and service vehicles. The service vehicles and base stations serve as resource points, and the user vehicles serve as task release nodes.
[0082] See also Figure 2 , Figure 2 The present invention provides a method for offloading the calculation of multi-source tasks in the Internet of Vehicles. Figure 1 The following is an example of a scenario in the middle section:
[0083] S201: When a task is received, task information and node information of the task publishing node corresponding to the task information are obtained, and the task information is placed in a task set. The task information includes a task type, and the task type includes a safety-related task and a non-safety-related task.
[0084] In this embodiment, a base station (BS) and the vehicles within the coverage area of the BS are considered as a system for research. The communication radius and computing resources of the BS are represented as R0 and F0 respectively, and the number of moving vehicles on the road covered by the BS is represented as V = {v1, v2, ..., v n ,…,v N},n∈[1,N], whose communication radius is R n Since BS can provide computing resources for multiple tasks at the same time, for the convenience of the following representation, the computing resource set of BS is represented as G = {g1, g2, ... g q ,…g Q},q∈[1,Q], where Q is the number of tasks that the BS can handle simultaneously. To simulate the initiation of tasks over a period of time, the time is discretized into equally spaced time slots, and the time slot set is represented as T={0,1,…,t,…,|T|}, where T is the entire observation period. Within T, the initiation of tasks follows a Poisson distribution. Vehicles may initiate tasks multiple times according to their own needs, and each vehicle may generate multiple tasks at a certain moment. To represent the vehicle v n The number of tasks initiated at time t.
[0085] S202: Obtain trajectory information of the resource point, and calculate the distance from the task issuing node to any resource point based on the node information of the task issuing node and the trajectory information of the resource point as a first distance.
[0086] In a specific optional implementation, in step S202, the trajectory information of the resource point is obtained, and based on the node information of the task issuing node and the trajectory information of the resource point, the distance from the task issuing node to any resource point is calculated as the first distance including:
[0087] The trajectory information of vehicle motion is defined as in Indicates vehicle v n The trajectory information at time t, Representative mission vehicle v n The driving speed at time t is Representative mission vehicle v n Position coordinates at time t;
[0088] use Indicates the position coordinates of BS and its speed Set to 0;
[0089] By using the L2 norm, we can get the vehicle v at time t. n The distance between any resource point m is taken as the first distance. Expressed as:
[0090]
[0091] Where m is the resource point, V is the basic vehicle, and it is expressed as V={v1,v2,…,v n ,…,v N},n∈[1,N].
[0092] Within T, if a task is initiated at time t∈T, the tasks waiting for decision in the system include the tasks initiated at time t and the tasks initiated at time t'∈[0,t] but not yet processed. Therefore, the set of tasks waiting for decision in the system at time t can be expressed as Indicates vehicle v n The kth task is initiated at time t' and has not been processed at time t, where Indicates a task The data size, Indicates a task Required CPU cycles, Indicates a task The maximum tolerable delay, Indicates a task The initial priority of Indicates a task The initiation moment. 0 indicates a task 1 represents a security-related task, whereas 1 represents a non-security-related task.
[0093] Vehicle-initiated missions By using binary offloading, you can choose to perform calculations locally on the vehicle, or offload the task to other vehicles or BS for calculation, so that the task can be The set of resource points that provide computing resources is expressed as M = {m|m∈V∪G}, where m = v n Indicates a task Local computing, by vehicle v n For the task Provide computing resources. Set TASK at time t t The dynamic priority of the task in can be expressed as At time t, the idleness of computing resources at each resource point in the system is expressed as in Indicates the earliest idle available time of computing resources at resource point m at time t.
[0094] Although the initial position of the vehicle is random, the vehicle is generally equipped with positioning equipment such as the Beidou satellite navigation system, which can obtain the vehicle's trajectory information in real time. The trajectory information of the vehicle movement is defined as in Indicates vehicle v n The trajectory information at time t, Representative mission vehicle v n The driving speed at time t is Representative mission vehicle v n The position coordinates at time t. Since BS always remains stationary, Indicates the position coordinates of BS and its speed Set to 0. Therefore, by using the L2 norm, we can get the vehicle v at time t. n The distance between it and any resource point m is
[0095]
[0096] If the mission requires the mission vehicle v n The task is offloaded to resource point m for processing. Only after the task is completely transferred to m can m start computing. In essence, computing tasks that require collaborative processing follow a serial offloading model, but can be processed concurrently on different nodes. The vehicles in the system use orthogonal frequency division multiple access (OFDMA) technology for data transmission, ignoring the problem of inter-channel interference. Therefore, at time t, the task vehicle v can be calculated according to the Shannon formula n The average uplink transmission rate to resource point m is:
[0097]
[0098] Among them, B n It is a mission vehicle v n The bandwidth of the available spectrum. SNR n.m (t) is the signal-to-noise ratio at time t, specifically:
[0099]
[0100] Among them, P n For vehicle v n Uplink transmission power. Indicates vehicle v n The data transmission distance between the resource point m can be obtained by the L2 norm formula. Indicates that the vehicle v nThe channel gain between the node and the resource point m, λ is the path loss exponent, and N0 is the noise power.
[0101] S203: Determine a task processing method according to the task type and the first distance, wherein the task processing methods include local processing and offload processing.
[0102] In a specific optional implementation, in step S203, determining the task processing method according to the task type and the first distance includes:
[0103] In order to make full use of the available computing resources around the vehicle, the tasks generated by the vehicle are processed in two ways: local computing and offloading computing. In order to study the performance of the offloading system, a binary offloading decision variable is defined To indicate whether the resource point m is a task Provide computing resources.
[0104]
[0105] The vehicle can only provide computing resources for one task at a time, while the BS can provide computing resources for multiple tasks at a time by evenly distributing resources, which reduces the computing delay. The calculation formula is as follows:
[0106]
[0107] Among them F m is the computing resource size of resource point m, F0 is the computing power of BS, and Q represents the number of tasks that BS can compute simultaneously. Tasks in The computation completion time on m can be expressed as:
[0108]
[0109] in, For the task The moment when calculation can officially begin. It needs to be successfully transferred to m and m is free to perform the task The calculation can only be officially started when computing resources are provided. The calculation formula is as follows:
[0110]
[0111] in, Is m able to do the task The moment computing resources are provided, For the task The moment of successful transmission to m.
[0112] 1) For If the task The m that provides computing resources is the vehicle v n The task itself No need to transmit, i.e. But if the task m that provides computing resources is other vehicles or BS, The calculation formula is as follows:
[0113]
[0114] in, Indicates a task The start time of transmission, For transmission tasks The required delay.
[0115] Considering the shortage of computing resources, tasks often need to wait for a while before they can be processed. If a new task is initiated during the waiting time, the offloading decision will be updated, resulting in a change in the m of computing resources provided for some tasks. Therefore, the task Not when the mission is initiated Or the current decision time t is immediately transmitted to m to wait, but m can be used to Provide computing resources at the time and vehicle v n Able to do tasks The moment of providing communication resources is obtained The calculation formula is as follows:
[0116]
[0117] Since the system communication resources are sufficient, assuming that the transmission rate remains unchanged in a short time, Communication rate at the moment To calculate At the same time, since the uninstallation decision will be updated at time t, the task of Must be greater than or equal to t.
[0118] 2) For use Indicates that resource point m is a task The order number of computing resources provided is calculated as follows:
[0119]
[0120] in express The dynamic priority of Before, that is, m is Provide computing resources. Task It needs to wait until all tasks that are ahead of it in the dynamic priority and decided to be executed on m are completed before m can be task Provide computing resources. Therefore, m can be used for tasks
[0121] The moment computing resources are provided The calculation formula is as follows:
[0122]
[0123] in Indicates the earliest idle available time of computing resource m at time t. express It is at the top of all tasks computed on m at time t. express For the task The predecessor task on m, Indicates a task Precursor tasks The time at which the calculation on m begins.
[0124] The latency caused by task offloading is usually divided into four parts: transmission latency, computation latency, waiting latency, and result feedback latency. Since the amount of computational results is small, the result feedback latency is usually negligible.
[0125] S204: If a new task is detected, dynamically adjust the priority of the current task set to obtain task resource allocation information. The current task set includes the new task initiated at the current moment and the remaining tasks that have not been processed.
[0126] In a specific optional implementation, in step S204, if a new task is detected, the priority of the current task set is dynamically adjusted to obtain the task resource allocation information including:
[0127] When a new task is detected, the total processing delay of the task set at the current moment is calculated;
[0128] Based on genetic algorithm, the total processing delay of new tasks and the current task set is combined to implement offloading strategy and task-triggered dynamic priority adjustment strategy to obtain task resource allocation information.
[0129] In a specific optional implementation, based on a genetic algorithm, the total processing delay of the new task and the current task set are combined to implement an offloading strategy and a task-triggered dynamic priority adjustment strategy, and the task resource allocation information obtained includes:
[0130] Computing tasks Dynamic priority
[0131] The tolerance of a task is the difference between the maximum deadline and the estimated total completion time. The tolerance of a task decreases as the waiting time increases. Therefore, the following formula is used to calculate the tolerance of the task: Tolerance at time t is used to measure the urgency of task completion:
[0132]
[0133] If m∈V, then F * =F m , whereas F * =F0 / Q, where Q is the number of resource blocks of the RSU.
[0134] Update the dynamic priority based on tolerance and task type to obtain the task Prioritization of goals;
[0135] The main idea is as follows: First, for each task, its current tolerance is calculated and the tasks are sorted in ascending order based on tolerance. Tasks with the same tolerance are re-sorted in ascending order based on their initial priority. Then, if the estimated completion time of some safety-related tasks exceeds their deadline, the non-safety-related tasks ahead of them are discarded to advance the completion time of the safety-related tasks, ensuring that the safety-related tasks can be completed on time. The final position of the task in the queue represents its target priority.
[0136] Furthermore, in this embodiment, the optimization goal is to minimize the set TASK at time t t The failure rate of tasks.
[0137] Assemble TASK at time t t The number of failed tasks in is expressed as:
[0138]
[0139] in is an indicator function, if True is equal to 1, otherwise it is 0, Indicates a task The delay from initiation to completion of calculation, It's a task The maximum tolerable delay.
[0140] Therefore, the final optimization goal is to minimize the set TASK at time t t The failure rate of the task can be expressed as:
[0141]
[0142] st
[0143]
[0144] in, Represents the set TASK at time t t The offloading strategy for all tasks in Represents the set TASK at time t t The dynamic priority of all tasks in the task. C1 means that a task can only select one resource point to calculate; C2 means that all security-related tasks can be successfully executed; C3 means that the set TASK t There is no overlap in the time that any two tasks unloaded to the same resource point m occupy m computing resources; C4 represents the set TASK t As long as the initiating vehicles and resource points m of any two tasks are consistent, the transmission time of the two tasks will not overlap; C5 represents the set TASK t There is no overlap in the transmission time of any two tasks initiated by the same vehicle and offloaded to the BS; C6 means that the vehicle will not exceed the communication range of the BS during the execution of the task; C7 means that the vehicle v n The selected resource point m is always within its communication range during task processing.
[0145] This example uses a genetic algorithm (GA)-based task offloading strategy (Algorithm 1) and a task-triggered dynamic priority adjustment strategy (Algorithm 2). Whenever a task is initiated within the T observation period, Algorithm 1 and Algorithm 2 are iterated alternately to update the task's dynamic priority and offloading decision, ultimately solving the optimization objective.
[0146] GA is an optimization algorithm based on the biological evolution process. It continuously searches and optimizes the solution space by simulating natural selection, gene crossover and mutation mechanisms.
[0147] The model in this embodiment aims to find an offloading strategy that minimizes the system failure rate without affecting the completion rate of safety-related tasks. Therefore, in this embodiment, the gene in the genetic algorithm is the offloading method ultimately selected for each task, that is, one chromosome corresponds to one solution. Similarly, the population size S, the maximum number of iterations I, the crossover probability CP, and the mutation probability MP are determined through initialization. In the GA, the individuals in the population can be encoded as a K-dimensional vector, where K represents the number of tasks in the system at the current moment. Each gene on an individual represents a task in the total tasks of the system at the current moment, and the value of the gene indicates the execution position of the task. To more conveniently represent the offloading decision of the task, this article adopts integer encoding, and the value of the gene can range from 1 to M, where M = N + Q.
[0148] Since this embodiment is a dynamic offloading decision scenario, each decision needs to select the inverse of the weighted failure rate of the tasks waiting to be processed at the current moment as the fitness function to evaluate the individual. Therefore, the fitness function of the system at time t is calculated as follows:
[0149]
[0150] Here, α + β = 1, and α > β. The value of the fitness function is inversely proportional to the value of the objective function. A higher value for the fitness function lowers the total system cost of calculating the offloading solution, meaning the offloading solution is more optimal. Based on the fitness function calculation results, chromosomes with high fitness are retained, while chromosomes with low fitness are eliminated. With continuous iteration, the total system cost of the offloading solution decreases.
[0151] The system uses a roulette wheel method to select the probability of selecting individuals for reorganization and their fitness value Fitness i In this method, the greater the fitness value of an individual, the greater the probability of being selected. The probability of the i-th (i∈S) individual inheriting is:
[0152]
[0153] Among them, P i Represents the probability of chromosome i being selected, Fitness i is the fitness of chromosome i. This selection strategy makes individuals with high fitness more likely to participate in population recombination.
[0154] Crossover and mutation are two key operations in GAs, used to generate new individuals to explore the solution space and gradually optimize the solution. Crossover involves exchanging some gene segments between the chromosomes of parent individuals in the selection phase to generate new offspring individuals. This paper uses single-point crossover for task offloading genes. A random integer between 0 and M-1 is generated as the crossover point, and the two parent individuals are crossed at this crossover point.
[0155] Mutation involves performing genetic mutations on individual chromosomes to introduce new genetic information. However, if the optimal individuals are too concentrated during the solution process, the algorithm can become trapped in a local optimum. Considering that chaotic mapping can produce highly complex and unpredictable sequences, using chaotic mapping to generate random numbers during the mutation process helps escape the local optimum, resulting in a globally optimal solution.
[0156] Furthermore, since task generation is a random and continuous process, adopting a first-come, first-served (FCFS) strategy for tasks in different time slots will seriously affect the execution of subsequently generated safety-related tasks. Therefore, this embodiment adopts a task-triggered dynamic priority adjustment strategy. In this embodiment, when a task is received, task information and the node information of the task release node corresponding to the task information are obtained, and the task information is placed in a task set. The task information includes the task type, which includes safety-related tasks and non-safety-related tasks. The trajectory information of the resource point is obtained, and based on the node information of the task release node and the trajectory information of the resource point, the distance from the task release node to any resource point is calculated as the first distance. Based on the task type and the first distance, the task processing method is determined, where the task processing method includes local processing and offload processing. If a new task is detected, the current task set is dynamically prioritized to obtain task resource allocation information. The current task set includes new tasks initiated at the current moment and legacy tasks that have not yet been processed. This achieves priority screening and sorting of dynamic tasks from multiple sources, ensuring the rational and accurate resource allocation of multi-source tasks in the Internet of Vehicles.
[0157] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0158] Figure 3 The principle block diagram of the vehicle networking multi-source task calculation offloading device is shown in one-to-one correspondence with the vehicle networking multi-source task calculation offloading method of the above embodiment. Figure 3 As shown, the computing offloading device for multi-source tasks in the Internet of Vehicles includes a data separation module 31, a missing simulation module 32, a local repair module 33, a secondary repair module 34 and a result aggregation module 35. The functional modules are described in detail as follows:
[0159] An acquisition module 31 is configured to acquire task information and node information of a task issuing node corresponding to the task information upon receiving a task, and place the task information into a task set. The task information includes a task type, which includes a safety-related task and a non-safety-related task.
[0160] A calculation module 32 is configured to obtain trajectory information of the resource point and calculate the distance from the task issuing node to any resource point as a first distance based on the node information of the task issuing node and the trajectory information of the resource point;
[0161] a determination module 33, configured to determine a task processing mode according to the task type and the first distance, wherein the task processing mode includes local processing and offload processing;
[0162] The allocation module 34 is configured to dynamically adjust the priority of the current task set if a new task is detected, and obtain task resource allocation information. The current task set includes new tasks initiated at the current moment and legacy tasks that have not been processed.
[0163] Optionally, the determining module 33 includes:
[0164] The first trajectory determination unit is used to define the trajectory information of the vehicle movement as in Indicates vehicle v n The trajectory information at time t, Representative mission vehicle v n The driving speed at time t is Representative mission vehicle v n Position coordinates at time t;
[0165] The second trajectory determination unit is used to adopt Indicates the position coordinates of BS and its speed Set to 0;
[0166] The distance calculation unit obtains the vehicle v at time t by using the L2 norm n The distance between any resource point m is taken as the first distance. Expressed as:
[0167]
[0168] Where m is the resource point, V is the basic vehicle, and it is expressed as V={v1,v2,…,v n ,…,v N},n∈[1,N]
[0169] Optionally, the allocation module 34 includes:
[0170] A delay calculation unit, used to calculate the total processing delay of the task set at the current moment when a new task is detected;
[0171] The resource allocation unit is used to combine the total processing delay of the new task and the current task set based on the genetic algorithm, perform an offloading strategy and a task-triggered dynamic priority adjustment strategy, and obtain task resource allocation information.
[0172] Optionally, the resource allocation unit includes:
[0173] The first computing subunit is used for computing tasks Dynamic priority
[0174] The second calculation subunit is used to calculate the task using the following formula Tolerance at time t is used to measure the urgency of task completion:
[0175]
[0176] The priority update subunit is used to update the dynamic priority based on the tolerance and task type to obtain the task Prioritization of goals;
[0177] The sorting subunit is used to sort the tasks according to each target priority to obtain a task queue;
[0178] The resource allocation subunit is used to allocate task resources based on the task queue and determine task resource allocation information.
[0179] For the specific definition of the computing offloading device for multi-source tasks in the Internet of Vehicles, please refer to the definition of the computing offloading method for multi-source tasks in the Internet of Vehicles above, which will not be repeated here. The various modules in the above-mentioned computing offloading device for multi-source tasks in the Internet of Vehicles can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0180] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0181] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components connected to the memory 41, the processor 42, and the network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0182] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.
[0183] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or D interface display memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as the program code of the method for offloading computation of multi-source tasks in the Internet of Vehicles. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0184] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute program code stored in the memory 41 or process data, such as executing program code for a method for offloading computational resources for a multi-source task in an Internet of Vehicles.
[0185] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0186] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores an interface display program, and the interface display program can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned method for computing offloading of multi-source tasks in the Internet of Vehicles.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0188] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.
Claims
1. A method for offloading computation of multi-source tasks in an Internet of Vehicles, characterized in that: Applied to a vehicle networking interaction scenario, the vehicle networking interaction scenario includes a base station and basic vehicles within the base station coverage, the basic vehicles include user vehicles and service vehicles, the service vehicles and the base station serve as resource points, and the user vehicles serve as task release nodes. The vehicle networking multi-source task computation offloading method includes: When a task is received, task information and node information of a task publishing node corresponding to the task information are obtained, and the task information is placed in a task set, wherein the task information includes a task type, and the task type includes a security-related task and a non-security-related task; Obtaining trajectory information of a resource point, and calculating the distance from the task issuing node to any resource point as a first distance based on the node information of the task issuing node and the trajectory information of the resource point, wherein the node information of the task issuing node includes the task information and the trajectory information of the task node; determining a task processing mode according to the task type and the first distance, wherein the task processing mode includes local processing and offload processing; If a new task is detected, a dynamic priority adjustment is performed on the current task set to obtain task resource allocation information. The current task set includes the new task initiated at the current moment and the legacy tasks that have not been processed.
2. The method for offloading computing of multi-source tasks in the Internet of Vehicles according to claim 1, characterized in that: The obtaining of the trajectory information of the resource point and calculating the distance from the task issuing node to any resource point as the first distance based on the node information of the task issuing node and the trajectory information of the resource point includes: The trajectory information of vehicle motion is defined as in Indicates vehicle v n The trajectory information at time t, Representative mission vehicle v n The driving speed at time t is Representative mission vehicle v n Position coordinates at time t; use Indicates the position coordinates of BS and its speed Set to 0; By using the L2 norm, we can get the vehicle v at time t. n The distance between any resource point m is taken as the first distance. Expressed as: Where m is the resource point, V is the basic vehicle, and it is expressed as V={v1,v2,…,v n ,…,v N },n∈[1,N].
3. The method for offloading computing of multi-source tasks in an Internet of Vehicles according to claim 2, characterized in that: The determining of the task processing method according to the task type and the first distance includes: Define the task set at time t∈T as v n ∈V,t'∈[0,t], Binary variables for uninstall decision v n ∈V,t'∈[0,t], m∈M.. The vehicle provides computing resources for one task at a time, while the BS takes an even distribution of resources to provide computing resources for multiple tasks at a time, computing delay The calculation formula is as follows: Among them F m is the computing resource size of resource point m, F0 is the computing power of BS, and Q represents the number of tasks that BS can calculate simultaneously; For the set at time t Tasks in The computation completion time on m can be expressed as: in, For the task The moment when the calculation can officially begin, the task Satisfy that it has been successfully transferred to m and m is idle and can be used for the task Calculation starts when computing resources are provided. The calculation formula is as follows: in, Is m able to do the task The moment computing resources are provided, For the task The moment of successful transmission to m; for If the task The m that provides computing resources is the vehicle v n The task itself No need to transmit, i.e. If the task m, which provides computing resources, is other vehicles or BS. The calculation formula is as follows: in, Indicates a task The start time of transmission, For transmission tasks The required delay, If a new task is initiated during the waiting time, the offloading decision will be updated, resulting in a change in the m of computing resources provided to some tasks. Using m as task Provide computing resources at the time and vehicle v n For the task The moment of providing communication resources is obtained The calculation formula is as follows: Assuming that the transmission rate remains constant in a short period of time, Communication rate at the moment To calculate At the same time, since the unloading decision will be updated at time t, the task of Must be greater than or equal to t; for use Indicates that resource point m is a task The order number of computing resources provided is calculated as follows: in express The dynamic priority of Before, that is, m is Providing computing resources; Task After waiting for all tasks that are ahead of it and decided to execute on m to complete, m is task Provide computing resources, m is the task The moment computing resources are provided The calculation formula is as follows: in represents the earliest idle available time of computing resource m at time t, express It is at the top of all tasks computed on m at time t. express For the task The predecessor task on m, Indicates a task Precursor tasks The time at which the calculation on m begins.
4. The method for offloading computing of multi-source tasks in an Internet of Vehicles according to claim 2, wherein: If a new task is detected, the priority of the current task set is dynamically adjusted to obtain the task resource allocation information including: When a new task is detected, the total processing delay of the task set at the current moment is calculated; Based on the genetic algorithm, the total processing delay of the new task and the current task set is combined, and the unloading strategy and task priority dynamic adjustment strategy are updated for the tasks that have not been processed at time t∈T to obtain the task unloading location information.
5. The method for offloading computing of multi-source tasks in the Internet of Vehicles according to claim 4, characterized in that: The genetic algorithm is based on combining the total processing delay of the new task and the current task set to perform the unloading strategy and task priority dynamic adjustment strategy update. The priority adjustment steps are as follows Based on the task initiation time, the required computing resource size, and the maximum tolerable delay of the task, the tolerance is determined. The task tolerance is the gap between the maximum deadline of the task and the expected total completion time. The tolerance of the same task decreases as the waiting time increases. The tolerance at time t is expressed as: If m∈V, then F * =F m , whereas F * =F0 / Q, where Q is the number of resource blocks of the RSU; For each task, sort them in ascending order according to their tolerance. For tasks with the same tolerance, sort them in ascending order according to their task type. If the estimated completion time of a safety-related task exceeds its deadline, some non-safety-related tasks ahead of it will be discarded to advance the completion time of high-safety-related tasks and ensure that the safety-related tasks can be completed on time.
6. A computing offloading device for multi-source tasks in an Internet of Vehicles, characterized in that: include: An acquisition module is used to, upon receiving a task, acquire task information and node information of a task publishing node corresponding to the task information, and place the task information into a task set, wherein the task information includes a task type, and the task type includes a security-related task and a non-security-related task; a calculation module, configured to obtain trajectory information of a resource point, and calculate a distance from the task issuing node to any resource point based on the node information of the task issuing node and the trajectory information of the resource point, as a first distance; a determination module, configured to determine a task processing mode according to the task type and the first distance, wherein the task processing mode includes local processing and offload processing; The allocation module is used to dynamically adjust the priority of the current task set if a new task is detected to obtain task resource allocation information. The current task set includes the new task initiated at the current moment and the legacy tasks that have not been processed.
7. The device for offloading computing of multi-source tasks in the Internet of Vehicles according to claim 6, characterized in that: The determination module includes: The first trajectory determination unit is used to define the trajectory information of the vehicle movement as in Represents the mission vehicle v n The trajectory information at time t, Representative mission vehicle v n The driving speed at time t is Representative mission vehicle v n Position coordinates at time t; The second trajectory determination unit is used to define the resource point movement trajectory information as in Indicates resource point sv m The trajectory information at time t, Indicates resource point sv m The driving speed at time t is Indicates resource point sv m Position coordinates at time t; The distance calculation unit obtains the vehicle v at time t by using the L2 norm n The distance between it and any resource point m is Where m is the resource point, V is the basic vehicle, and it is expressed as V={v1,v2,…,v n ,…,v N },n∈[1,N].
8. The device for offloading computing of multi-source tasks in the Internet of Vehicles according to claim 6, characterized in that: The allocation module includes: A delay calculation unit, used to calculate the total processing delay of the task set at the current moment when a new task is detected; The resource allocation unit is used to update the task offloading strategy and dynamic priority based on the genetic algorithm and the total processing delay of the task set at the current moment, and obtain the task offloading location and the order of obtaining resources.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for offloading computation of multi-source tasks in the Internet of Vehicles as described in any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for offloading computation of multi-source tasks in an Internet of Vehicles as described in any one of claims 1 to 5 is implemented.