Method and system for offloading tasks between vehicles based on speed and computing resource prediction

By predicting the future speed and computing resources of vehicles in inter-vehicle task offloading, combining the MADQN model and the optimized greedy algorithm, the optimal task offloading decision and resource allocation strategy are designed, which solves the problem of unreasonable resource allocation in traditional methods and improves the computing resource utilization and task processing efficiency of the vehicle group.

CN119521164BActive Publication Date: 2025-09-19BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional inter-vehicle task offloading methods cannot adapt to the dynamic changes in vehicle speed and computing resources, resulting in unreasonable allocation of computing resources, low utilization, and inability to effectively solve the problem of unstable inter-vehicle communication.

Method used

By creating a target traffic network environment model, using non-standardized converters to predict the future vehicle speed and computing resources, and combining the multi-agent deep Q-network (MADQN) model with an optimized greedy algorithm, we design the optimal task offloading decision and computing resource allocation strategy, taking into account task priorities and communication constraints.

Benefits of technology

It improves the computing resource utilization of vehicle groups, adapts to dynamic traffic environments, reduces task processing delays and energy consumption, and improves the efficiency and resource utilization of task offloading between vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119521164B_ABST
    Figure CN119521164B_ABST
Patent Text Reader

Abstract

This application discloses a method and system for offloading tasks between vehicles based on speed and computing resource prediction, relating to the field of intelligent transportation. The method includes: creating an environmental model of a target traffic network; normalizing the speed and computing resource of each vehicle at time t; using a trained non-normalized converter to predict the speed and computing resource of each vehicle at time t+1 based on the normalized speed and computing resource of each vehicle at time t; determining the state sequence of each vehicle at time t based on the environmental model; within the MADQN model framework, each vehicle uses the state sequence at time t as input and uses its own trained DQN network to make a task offloading decision at time t and determine the total task computation amount of each vehicle at time t; and using an optimized greedy algorithm to allocate computing resources based on the total task computation amount of each vehicle at time t. This application can design the optimal task offloading decision and computing resource allocation strategy for each vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent transportation technology, and in particular to a method and system for offloading tasks between vehicles based on speed and computing resource prediction. Background Art

[0002] With the development of intelligent transportation systems, vehicle networking technology plays a vital role in communication, cooperation and resource sharing among vehicles.

[0003] To meet the real-time and high-efficiency demands of vehicles while driving, task offloading between vehicles has become an important means to address the challenges of insufficient computing resources and increasing task complexity. However, task offloading between vehicles also faces numerous challenges, such as dynamically changing traffic environments, limited computing resources, and unstable inter-vehicle communications.

[0004] Traditional task offloading methods often offload tasks sequentially based on their generation order. Because different tasks require varying computing resources, insufficient vehicle resources can lead to unsuccessful task offloading. Furthermore, because traditional task offloading methods cannot adapt to dynamic changes in vehicle speed and computing resources, their resource allocation is irrational, resulting in low actual resource utilization. Summary of the Invention

[0005] The purpose of this application is to provide a method and system for inter-vehicle task offloading based on speed and computing resource prediction, which can design the optimal task offloading decision and computing resource allocation strategy for each vehicle to improve the computing resource utilization of the vehicle group.

[0006] To achieve the above objectives, this application provides the following solutions:

[0007] In a first aspect, the present application provides a method for offloading tasks between vehicles based on speed and computing resource prediction, the method comprising:

[0008] Creating an environmental model of a target traffic network; the target traffic network is a traffic network comprising straight roads; the environmental model includes at least: a set time period, a plurality of different vehicles, the position coordinates of each vehicle at different times, the mission of each vehicle at different times, the speed of each vehicle at different times, and the computing resources of each vehicle at different times;

[0009] Normalize the speed and computing resources of each vehicle at time t;

[0010] Based on the normalized speed and computing resources of each vehicle at time t, the trained unnormalized converter is used to predict the speed and computing resources of each vehicle at time t+1.

[0011] Determine a state sequence of each vehicle at time t based on the environmental model; the state sequence is composed of the vehicle's own state information and state information of surrounding vehicles; the state information includes: current location coordinates, current task, current computing resources, predicted vehicle speed, and predicted computing resources;

[0012] In the MADQN model framework, each vehicle takes its state sequence at time t as input and uses its trained DQN to make a task offloading decision at time t, and determines the total task computational load for each vehicle at time t. The task offloading decision includes processing its own task locally or offloading the task to a neighboring vehicle.

[0013] The optimized greedy algorithm is used to allocate computing resources to the total task computing amount of each vehicle at time t; the optimized greedy algorithm adds the judgment of task priority.

[0014] In a second aspect, the present application also provides a computer system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for inter-vehicle task offloading based on speed and computing resource prediction as described in the first aspect.

[0015] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0016] This application first uses a non-standardized converter to effectively predict the speed of each vehicle at time t+1 and the computing resources at time t+1, and at the same time adds it as a factor to the state sequence of each vehicle at time t. Secondly, this application combines the Multi-Agent Deep Q-Networks (MADQN) model framework with the optimized greedy algorithm, with the goal of minimizing task processing delay and energy consumption, and uses each Deep Q Network (DQN) to calculate and process the state sequence of each vehicle at time t, and determines the optimal task offloading decision for each vehicle at time t. At the same time, the judgment of task priority is added to the optimized greedy algorithm, and the computing resources are reasonably allocated to the total task calculation amount of each vehicle at time t according to the task priority. In addition, the prediction of vehicle speed and computing resources in this application, as well as the combination of the MADQN model framework and the optimized greedy algorithm, can ensure that this application is more adaptable to dynamically changing traffic environments, so as to ensure that the optimal task offloading decision and computing resource allocation strategy can be designed for each vehicle under different traffic conditions, thereby improving the computing resource utilization of the vehicle group. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] Figure 1 A flowchart of a method for offloading tasks between vehicles based on speed and computing resource prediction provided in an embodiment of the present application;

[0019] Figure 2 This is a diagram of the internal structure of the computer system provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0021] The purpose of this application is to provide a method and system for inter-vehicle task offloading based on speed and computing resource prediction, which can design the optimal task offloading decision and computing resource allocation strategy for each vehicle to improve the computing resource utilization of the vehicle group.

[0022] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0023] Example 1

[0024] This embodiment provides a method for offloading tasks between vehicles based on speed and computing resource prediction, such as Figure 1 As shown, the method for offloading tasks between vehicles based on speed and computing resource prediction includes:

[0025] Step S1: Create an environmental model of the target traffic network; the target traffic network is a traffic network including straight roads; the environmental model includes: a set time period, multiple different vehicles, the position coordinates of each vehicle at different times, the tasks of each vehicle at different times, the speed of each vehicle at different times, the computing resources of each vehicle at different times, the communication channel bandwidth between vehicles, the communication channel gain between vehicles, and the communication model between vehicles.

[0026] In this embodiment, step S1 specifically includes:

[0027] Step S11: Research scope definition. Determine the research time period and use To represent, suppose there are N vehicles in the research road network segment, and the entire vehicle group set is represented as During the study period, each vehicle generates an offloadable task and updates its available computing resources at the same time.

[0028] Step S12: Vehicle position modeling. Set the coordinate system in the target traffic network and use two-dimensional coordinates (x, y) to represent the vehicle position. For example: vehicle The position at time t is recorded as (x n (t),y n (t)). The position of the vehicle on the road is dynamically tracked by the initial position, speed and direction of movement of the vehicle, and the speed v of each vehicle is defined n (t) and driving direction to predict the position at the future moment, where v n The sign of (t) indicates the direction of travel.

[0029] Step S13: Define the tasks in the form of triples. That is, the tasks of each vehicle at different times are represented as:

[0030]

[0031] Where, is the task of n vehicles at time t, d n (t) is the task size of n vehicles at time t, c n (t) is the mission complexity of n vehicles at time t, τ n(t) is the maximum allowed processing delay of n vehicles at time t.

[0032] Step S14: Model the local computing resources of each vehicle. Set the computing resources of vehicle n at time t to f n (t).

[0033] Step S15: Set the communication channel bandwidth and communication channel gain between vehicles. Define the communication channel bandwidth between vehicle n and vehicle n' at time t as B nn′ (t), the communication channel gain between vehicle n and vehicle n' at time t is

[0034] Step S16: Establish a communication model between vehicles. Determine the feasibility of inter-vehicle communication based on the vehicle's position, speed, and distance, and calculate the communication rate. The feasibility of inter-vehicle communication is determined by the inter-vehicle communication distance. When the distance between the two vehicles is less than the maximum communication distance, inter-vehicle communication is feasible; when the distance between the two vehicles is greater than or equal to the maximum communication distance, inter-vehicle communication is not feasible. When inter-vehicle communication is feasible, calculate the communication rate R between vehicle n and vehicle n′ at time t. nn′ (t), Among them, P n is the communication transmission power of n vehicles, σ 2 is the noise power.

[0035] Step S2: Normalize the vehicle speed and computing resources of each vehicle at time t.

[0036] In this embodiment, step S2 specifically includes:

[0037] Step S21: Obtain the speed of all vehicles at time t and the computing resources at time t, and obtain the vehicle speed set {v n (t)|n=1,2,...,N} and the vehicle computing resource set {f n (t)|n=1,2,...,N}.

[0038] Step S22: Dynamically calculate the maximum vehicle speed v based on the vehicle speed set max and minimum vehicle speed v min ,Right now

[0039] As a preferred implementation manner, the maximum vehicle speed and the minimum vehicle speed may also be pre-set according to the traffic environment and vehicle performance.

[0040] Step S23: Dynamically calculate the maximum computing resource f based on the vehicle computing resource set max and minimum computing resources f min ,Right now

[0041] As a preferred implementation manner, the maximum vehicle speed and the minimum vehicle speed may also be pre-set according to the traffic environment and vehicle performance.

[0042] Step S24: Normalize the speed of each vehicle at time t using the maximum speed and minimum speed, i.e. Normalized vehicle speed at time t The value range is [0,1].

[0043] Step S25: Using the maximum computing resources and the minimum computing resources, normalize the speed of each vehicle at time t, that is, Normalized computing resources at time t The value range is [0,1].

[0044] Step S3: Based on the normalized speed of each vehicle at time t and the normalized computing resources at time t, the trained non-normalized converter is used to predict the speed of each vehicle at time t+1 and the computing resources at time t+1.

[0045] In this embodiment, step S3 specifically includes:

[0046] Step S31: Determine the characteristic vector of each vehicle at time t, i.e.

[0047] Step S32: Based on the feature vector of each vehicle at time t, obtain the feature vector of the first k time steps of each vehicle at time t, that is, {X n (t-k+1),X n (t-k+2),...,X n (t)}.

[0048] Step S33: Construct a non-stationary transformer (NST); the non-stationary transformer consists of an encoder, a multi-head self-attention model, and a decoder. The non-stationary transformer uses a multi-head self-attention mechanism to flexibly focus on different time points in the time series and adapt to non-stationary changes in vehicle speed and computing resources. The encoder extracts the correlation between the features of each time step in the input sequence, and the decoder generates a prediction result for the next moment based on the encoder output and its own input.

[0049] Step S34: Take the feature vectors of the first k time steps of each vehicle at time t as input, and use the trained non-standardized converter to output the speed of each vehicle at time t+1 and the computing resources at time t+1, that is,

[0050] Step S35: Denormalize the speed of each vehicle at time t+1 and the computing resources at time t+1 output by the trained non-normalized converter to obtain the predicted speed of each vehicle at time t+1 and the predicted computing resources of each vehicle at time t+1, that is:

[0051]

[0052] Using predicted and computing resources As a reference for subsequent task offloading and resource allocation decisions, the optimal task offloading strategy and resource allocation plan are designed for each vehicle.

[0053] Step S4: Determine the state sequence of each vehicle at time t based on the environmental model; the state sequence consists of the vehicle's own state information and the state information of surrounding vehicles; the state information includes: current position coordinates, current task, current computing resources, predicted vehicle speed and predicted computing resources.

[0054] In this embodiment, the state sequence of each vehicle at time t is represented as:

[0055]

[0056] Where s n (t) is the state sequence of vehicle n at time t, x n (t) is the horizontal coordinate of vehicle n at time t, y n (t) is the vertical coordinate of vehicle n at time t, is the task of n vehicles at time t, f n (t) is the computing resources of n vehicles at time t, is the predicted speed of vehicle n at time t+1, is the predicted computing resources of n vehicles at time t+1, s n′ (t) is the state sequence of vehicle n′ at time t, x n′ (t) is the horizontal coordinate of vehicle n′ at time t, y n′ (t) is the vertical coordinate of vehicle n′ at time t, is the task of vehicle n′ at time t, f n′ (t) is the computing resource of vehicle n′ at time t, is the predicted speed of vehicle n′ at time t+1, is the predicted computing resource of vehicle n′ at time t+1, A collection of vehicle groups.

[0057] Step S5: Within the MADQN model framework, each vehicle uses its state sequence at time t as input and utilizes its trained DQN to make a task offloading decision at time t and determine the total task computational load for each vehicle at time t. Task offloading decisions include processing its own task locally or offloading the task to a neighboring vehicle.

[0058] In this embodiment, step S5 specifically includes:

[0059] Step S51: Multi-agent environment modeling. In the multi-agent reinforcement learning environment, each vehicle is considered as an independent agent. The goal of each agent is to select the optimal task offloading strategy to minimize the comprehensive cost of task processing (delay and energy consumption). Its state input is the defined s n (t), its output action is to process its own task locally, or to offload the task to a neighboring vehicle for processing.

[0060] Step S52: Determine the total task calculation amount of each vehicle at different times. n (t) is the sum of all tasks assigned to n vehicles, including its own tasks and tasks unloaded to it by other vehicles. If the vehicle is unloaded onto another vehicle for processing, it is not included in L n In (t), the mathematical expression of the total task computation amount of n vehicles at time t is:

[0061]

[0062] Among them, δ n→n (t), δ n→n' (t) is an indicator variable. If vehicle n chooses to process its own task locally at time t, then δ n→n (t) = 1, δ n→n' (t) = 0; if vehicle n chooses to offload the task to vehicle n′ at time t, then δ n→n' (t) = 1, δ n→n (t)=0.

[0063] Step S53: Establish communication distance constraints and computing resource constraints. When vehicle n makes a task offloading decision, it must ensure that the distance to the offloading target vehicle n′ is within the communication range. The communication distance constraint is:

[0064] d nn′ (t)=(x n (t)-x n′ (t)) 2 +(y n (t)-y n′ (t)) 2 ≤dmax ;

[0065] The computing resource constraints are:

[0066] f n' (t)≥L n (t);

[0067] Where, d nn′ (t) is the distance between vehicle n and vehicle n′ at time t, x n (t) is the horizontal coordinate of vehicle n at time t, y n (t) is the vertical coordinate of vehicle n at time t, x n′ (t) is the horizontal coordinate of vehicle n′ at time t, y n′ (t) is the vertical coordinate of vehicle n′ at time t, d max is the maximum communication distance of the vehicle, f n' (t) is the computing resource of vehicle n′ at time t.

[0068] Step S54: MADQN decision process. Each agent (vehicle) uses its own DQN to s n (t) is the input, and the output is the Q value of each possible action, that is, Q n (s n (t),a n )=DQN(s n (t)), where a n is the unloading action of n vehicles, a n The set of possible actions is This includes the option to process tasks locally or offload them to neighboring vehicles. It can be described as:

[0069]

[0070] Where, is the set of neighbors of n vehicles, local processing means that n vehicles choose to perform tasks locally, and offloading to neighboring vehicles means that n vehicles choose to offload tasks to neighboring n′ vehicles.

[0071] Step S55: Design a reward function. The reward function mainly considers the comprehensive cost of task processing, including task processing delay and task processing energy consumption, and controls their relative importance through weight coefficients α and β. The specific reward function is defined as:

[0072] r n (t) = -(αT n (t)+βE n (t));

[0073]

[0074]

[0075] Where r n (t) is the reward function of vehicle n at time t, T n (t) is the task processing delay of vehicle n at time t, E n (t) is the task processing energy consumption of n vehicles at time t, f n′ (t) is the computing resource of vehicle n′ at time t, and κ is the energy coefficient.

[0076] Step S56: Constraint processing. When the agent selects the offloading decision, it needs to check its communication distance constraint and computing resource constraint. n If these constraints are not met, an extremely low Q value will be assigned to it to prevent the agent from choosing this action, i.e., Q n (s n (t),a n )=-∞。

[0077] Furthermore, as a preferred embodiment, the training process of each agent (vehicle) DQN in MADQN includes:

[0078] The first step is network initialization. For each agent (vehicle), initialize its DQN and target Q network. DQN is used to output the Q value of each possible action. The target Q network is used to stabilize the training process. Initialize the experience replay pool of each agent (vehicle) to store the four-tuple (s) of current state, current action, current reward and next state. n (t),a n (t),r n (t),s n (t+1)).

[0079] The second step is the training process. In each time step, the following steps are performed simultaneously for all agents (vehicles):

[0080] (1) Action selection. Each agent (vehicle) selects an action using a ∈-greedy strategy based on its current state and its DQN: As training progresses, the value of ∈ is gradually reduced to make the agent (vehicle) move from exploration to exploiting the optimal policy.

[0081] (2) Execute actions and state transitions. Execute the selected action a n (t), update the vehicle state and get the next state s n (t+1), calculate the immediate reward r based on the current unloading decision and the resource allocation of the greedy algorithm n (t).

[0082] (3) Computing resource allocation. According to the optimized greedy algorithm designed in this application, computing resources are allocated to each vehicle using the maximum delay priority of the task. For each vehicle, computing resources R are allocated according to the priority. n (t).

[0083] (4) Store experience. n (t),a n (t),r n (t),s n (t+1)) is stored in the experience replay pool of n agents (vehicles).

[0084] (5) Experience replay and network update. Randomly sample a small batch of experience quadruple (s) from the experience replay pool. n (t),a n (t),r n (t),s n (t+1)) for training, and then use the target Q network to calculate the target Q value: Among them, y n is the target Q value, γ is the discount factor, which is used to measure the importance of future rewards. is the target Q network.

[0085] By minimizing the loss function To update the parameters of the deep Q network

[0086] (6) Update the target network. At regular time steps, the parameters of the deep Q network are copied to the target Q network to maintain the stability of the training:

[0087] The third step is to terminate the training process. Continue training until the rewards of the agent (vehicle) converge, that is, the average cumulative reward of the agent (vehicle) remains stable over multiple consecutive training cycles. By calculating the rolling average reward over a period of time, when the change of the rolling average is within the threshold When it is within the range, it is considered to be convergent, that is,

[0088] Step S6: Using the optimized greedy algorithm, the computing resources are allocated to the total task computing amount of each vehicle at time t.

[0089] In this embodiment, step S6 specifically includes:

[0090] Step S61: For all pending tasks of each vehicle at time t, the maximum allowable processing delay of each pending task is calculated respectively.

[0091] Step S62: sorting the priorities of all tasks to be processed according to the maximum allowable processing delay of each task to be processed to obtain a task priority list.

[0092] The shorter the maximum allowable processing delay of a task, the higher its priority. , task n1 has a higher priority than task n2.

[0093] Step S63: Allocate computing resources for the total task computation amount of each vehicle at time t according to the task priority list.

[0094] According to the sorted task priority list, computing resources are allocated to each task in order from high to low. For the current high-priority task, check whether the available vehicle computing resources are sufficient to handle the task computation: if the available computing resources are sufficient, then allocate resources to meet the computing requirements of the task, and the vehicle computing resources R n (t)=min(f n (t),L n (t)), that is, the allocation computing resources R of n vehicles n (t) cannot exceed its available computing resources f n (t), and also needs to meet the total task computation amount L that needs to be processed n (t); If the available computing resources are insufficient, the maximum resources that the vehicle can provide are allocated, and the remaining tasks may need to be processed in the next time step.

[0095] Update the computing resource status. After allocating computing resources for the current task, update the vehicle's available computing resources to continue allocating resources for subsequent tasks. Repeat the above steps until all tasks have been allocated resources or the vehicle's computing resources are exhausted.

[0096] In summary, this application designs the optimal offloading decision and resource allocation strategy for each vehicle, with the goal of minimizing task processing delay and energy consumption, improving the computing resource utilization of the vehicle group, and is more suitable for intelligent vehicle networking systems in dynamic traffic environments, with the characteristics of high real-time performance and excellent resource utilization.

[0097] Example 2

[0098] This embodiment provides a computer system, which can be a server or a terminal. Its internal structure diagram can be as follows: Figure 2As shown. The computer system includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer system is used to provide computing and control capabilities. The memory of the computer system includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer system is used to exchange information between the processor and an external device. The communication interface of the computer system is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for unloading tasks between vehicles based on speed and computing resource prediction is implemented.

[0099] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer system to which the solution of the present application is applied. The specific computer system may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0100] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0101] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0102] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.

[0103] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0104] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for offloading tasks between vehicles based on speed and computing resource prediction, characterized in that: The method for offloading tasks between vehicles based on speed and computing resource prediction includes: Creating an environmental model of a target traffic network; the target traffic network is a traffic network comprising straight roads; the environmental model includes at least: a set time period, a plurality of different vehicles, the position coordinates of each vehicle at different times, the mission of each vehicle at different times, the speed of each vehicle at different times, and the computing resources of each vehicle at different times; Normalize the speed and computing resources of each vehicle at time t; Based on the normalized speed and computing resources of each vehicle at time t, the trained unnormalized converter is used to predict the speed and computing resources of each vehicle at time t+1. Determine a state sequence of each vehicle at time t based on the environmental model; the state sequence is composed of the vehicle's own state information and state information of surrounding vehicles; the state information includes: current location coordinates, current task, current computing resources, predicted vehicle speed, and predicted computing resources; In the MADQN model framework, each vehicle takes its state sequence at time t as input and uses its trained DQN to make a task offloading decision at time t, and determines the total task computational load for each vehicle at time t. The task offloading decision includes processing its own task locally or offloading the task to a neighboring vehicle. The optimized greedy algorithm is used to allocate computing resources to the total task computing amount of each vehicle at time t; the optimized greedy algorithm adds the judgment of task priority.

2. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: The environmental model further includes: a communication channel bandwidth between vehicles, a communication channel gain between vehicles, and a communication model between vehicles; the communication model is used to determine the feasibility of communication between vehicles and calculate a communication rate.

3. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: The mission of each vehicle at different times is represented as: T n (t)={d n (t),c n (t),τ n (t)}; Where, T n (t) is the task of n vehicles at time t, d n (t) is the task size of n vehicles at time t, c n (t) is the mission complexity of n vehicles at time t, τ n (t) is the maximum allowed processing delay of n vehicles at time t.

4. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: Normalize the speed and computing resources of each vehicle at time t, including: Obtain the speed of all vehicles at time t and the computing resources at time t, and obtain the vehicle speed set and vehicle computing resource set respectively; Dynamically calculating a maximum vehicle speed and a minimum vehicle speed based on the vehicle speed set; Dynamically calculating a maximum computing resource and a minimum computing resource based on the vehicle computing resource set; Normalizing the speed of each vehicle at time t using the maximum speed and the minimum speed; The maximum computing resource and the minimum computing resource are used to normalize the speed of each vehicle at time t.

5. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: Based on the normalized speed and computing resources of each vehicle at time t, the trained non-normalized converter is used to predict the speed and computing resources of each vehicle at time t+1, specifically including: Determine the feature vector of each vehicle at time t; the feature vector at time t includes: the normalized vehicle speed at time t and the normalized computing resources at time t; Based on the feature vector of each vehicle at time t, obtain the feature vector of the first k time steps of each vehicle at time t; Constructing a non-normalized converter; the non-normalized converter consists of an encoder, a multi-head self-attention model, and a decoder; The feature vectors of the first k time steps of each vehicle at time t are used as input, and the trained non-normalized converter is used to output the speed of each vehicle at time t+1 and the computing resources at time t+1; The speed of each vehicle at time t+1 and the computing resources at time t+1 output by the trained non-normalized converter are respectively denormalized to obtain the predicted speed of each vehicle at time t+1 and the predicted computing resources of each vehicle at time t+1.

6. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: The state sequence of each vehicle at time t is represented as: Where s n (t) is the state sequence of vehicle n at time t, x n (t) is the horizontal coordinate of vehicle n at time t, y n (t) is the vertical coordinate of vehicle n at time t, is the task of n vehicles at time t, f n (t) is the computing resources of n vehicles at time t, is the predicted speed of vehicle n at time t+1, is the predicted computing resources of n vehicles at time t+1, s n′ (t) is the state sequence of vehicle n′ at time t, x n′ (t) is the horizontal coordinate of vehicle n′ at time t, y n′ (t) is the vertical coordinate of vehicle n′ at time t, is the task of vehicle n′ at time t, f n′ (t) is the computing resource of vehicle n′ at time t, is the predicted speed of vehicle n′ at time t+1, is the predicted computing resource of vehicle n′ at time t+1, A collection of vehicle groups.

7. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: The reward function in the MADQN model framework is: r n (t)=-(αT n (t)+βE n (t)); Where r n (t) is the reward function of vehicle n at time t, ɑ and β are weight coefficients, T n (t) is the task processing delay of vehicle n at time t, E n (t) is the task processing energy consumption of n vehicles at time t, d n (t) is the task size of n vehicles at time t, c n (t) is the task complexity of n vehicles at time t, f n (t) is the computing resources of n vehicles at time t, f n′ (t) is the computing resource of vehicle n′ at time t, R nn′ (t) is the communication rate between vehicle n and vehicle n′ at time t, κ is the energy coefficient, P n is the communication transmission power of n vehicles, δ n→n (t), δ n→n' (t) is the indicator variable, δ n→n (t) = 1 means that vehicle n processes its own task locally at time t, δ n→n' (t)=1 means that vehicle n offloads the task to vehicle n′ for processing at time t.

8. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: The constraints in the MADQN model framework include communication distance constraints and computing resource constraints; the communication distance constraints are: d nn′ (t)=(x n (t)-x n′ (t)) 2 +(y n (t)-y n′ (t)) 2 ≤d max ; The computing resource constraints are: f n' (t)≥L n (t); Where, d nn′ (t) is the distance between vehicle n and vehicle n′ at time t, x n (t) is the horizontal coordinate of vehicle n at time t, y n (t) is the vertical coordinate of vehicle n at time t, x n′ (t) is the horizontal coordinate of vehicle n′ at time t, y n′ (t) is the vertical coordinate of vehicle n′ at time t, d max is the maximum communication distance of the vehicle, f n' (t) is the computing resource of vehicle n′ at time t, L n (t) is the total task computation amount of n vehicles at time t.

9. The method for offloading tasks between vehicles based on speed and computing resource prediction according to claim 1, characterized in that: Using the optimized greedy algorithm, computing resources are allocated to the total task computation of each vehicle at time t, specifically including: For all pending tasks of each vehicle at time t, calculate the maximum allowable processing delay of each pending task; According to the maximum allowable processing delay of each task to be processed, all tasks to be processed are prioritized to obtain a task priority list; According to the task priority list, computing resources are allocated to the total task computing amount of each vehicle at time t.

10. A computer system comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for inter-vehicle task offloading based on speed and computing resource prediction according to any one of claims 1 to 9.