An edge computing task offloading method fusing trajectory prediction and computing latency evaluation

By introducing the Transformer trajectory prediction model and the dual-stream computing latency prediction network, combined with the DuelingDQN algorithm, the problems of insufficient user trajectory perception and latency discrimination of heterogeneous devices in the existing technology are solved, and high reliability, low latency and resource optimization of edge computing task offloading are achieved.

CN122640784APending Publication Date: 2026-08-25XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610995899.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing task offloading solutions lack effective coordination mechanisms in handling user trajectory perception, heterogeneous device latency discrimination, and multi-dimensional resource joint decision-making, making it difficult to achieve highly reliable, low-latency computing services in complex dynamic edge environments.

Method used

By employing a Transformer trajectory prediction model based on a multi-scale attention mechanism and a dual-stream computation latency prediction network, combined with the DuelingDQN algorithm, joint optimization of offloading destination, communication bandwidth, and computing power is achieved. Through forward-looking trajectory prediction and accurate latency perception, it provides technical support for high reliability and extremely low latency.

Benefits of technology

It significantly improves the reliability and success rate of task execution in dynamic environments, achieves low latency, low energy consumption, and balanced resource utilization, and solves the problems of connection interruption, heterogeneity barriers, and resource waste in traditional methods, providing technical support for high reliability and extremely low latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122640784A_ABST
    Figure CN122640784A_ABST
Patent Text Reader

Abstract

The application discloses an edge computing task offloading method combining trajectory prediction and computing delay evaluation, comprising the following steps: constructing a mobile user trajectory prediction model and outputting a predicted future trajectory sequence; constructing a double-flow computing delay prediction network and outputting a predicted execution delay; calculating a task completion delay and energy consumption based on the predicted execution delay, combining the task completion delay, the energy consumption, resource consumption and task failure penalty into a comprehensive cost; taking the minimization of the expected cumulative comprehensive cost of all tasks as a comprehensive optimization target; modeling the comprehensive optimization target into a Markov decision process based on the future trajectory sequence, the predicted execution delay and resource constraints, and outputting an offloading action through a DuelingDQN offloading decision network; and the application adopts the DuelingDQN algorithm to jointly optimize the offloading destination, communication bandwidth and computing power based on prospective trajectory prediction and accurate delay perception, thereby improving the reliability and robustness of task execution in a dynamic environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of edge computing technology, and in particular relates to an edge computing task offloading method that integrates trajectory prediction and computation latency assessment. Background Technology

[0002] With the rapid development of fifth-generation mobile communication technology (5G), new applications are emerging in an endless stream. The core characteristic of these applications is their heavy reliance on deep neural network models for complex computational processing. However, these computational tasks typically have the dual attributes of being computationally intensive and latency-sensitive, placing stringent demands on resources.

[0003] In traditional Mobile Edge Computing (MEC) architectures, user terminals typically attempt to offload tasks to edge servers. However, in real-world dynamic scenarios, this offloading model, reliant on fixed infrastructure, reveals significant limitations: firstly, fixed base stations have limited coverage, leading to frequent cross-region handovers by high-speed mobile user terminals; secondly, base station computing resources are prone to congestion during peak hours. Therefore, utilizing nearby user terminals with idle computing power as mobile computing devices to build collaborative edge computing networks has become a key technological path for improving system throughput and reducing response latency. Despite the significant theoretical advantages of collaborative task offloading, existing technologies still face the following challenges in practical deployment: 1. Task interruption problem caused by highly dynamic topology: In mobile environments, the relative positions between user terminals and service devices change rapidly. Traditional offloading strategies (Wenhao Fan, Yi Su, Jie Liu, Shenmeng Li, Wei Huang, Fan Wu, and Yuan'an Liu. Joint task offloading and resource allocation for vehicular edge computing based on v2i and v2v modes. IEEE Transactions on Intelligent Transportation Systems, 24(4):4277–4292, 2023.) construct an optimization model for V2I / V2V collaborative task offloading and resource allocation in the vehicle network edge computing scenario, and use an analytical model under the static network assumption to estimate task transmission latency and execution latency. However, this scheme ignores the nonlinear characteristics of the mobile trajectory, resulting in blind offloading decisions. Once the service device is out of communication range, the task being executed will be interrupted, and the resulting retransmission overhead and switching latency seriously deteriorate the user experience.

[0004] 2. Latency prediction failure in heterogeneous computing environments: Devices in edge computing networks are highly heterogeneous. Meanwhile, the real-time load of each device (such as CPU utilization and available memory) is random. Existing performance evaluation models (Salman Raza, Shangguang Wang, Manzoor Ahmed, Muhammad Rizwan Anwar, MuhammadAyzed Mirza, and Wali Ullah Khan. Task offloading and resource allocation foriov using 5g nr-v2x communication. IEEE Internet of Things Journal, 9(13):10397–10410, 2022.) estimate task transmission latency and computation execution latency by constructing a simplified analytical latency model under static network assumptions. However, this approach struggles to capture the deep mapping relationship between the complexity of deep neural network tasks and the underlying hardware state of the devices. This prevents the system from accurately predicting the execution time of tasks on specific devices, thus hindering the ability to make globally optimal resource allocations.

[0005] 3. The High-Dimensional Decision-Making Challenge of Joint Resource Optimization: In environments with a massive user terminal scale and real-time fluctuations in resource status, traditional optimization algorithms (Quyuan Luo, Jiyun Zhang, Shihong Hu, Tom H Luan, and Pingzhi Fan. Joint task migration and resource allocation in vehicular edgecomputing: A deep reinforcement learning-based approach. IEEE Transactions on Vehicular Technology, 2025) construct a joint optimization model for task migration and resource allocation and employ deep reinforcement learning methods to learn offloading decision strategies in vehicular edge computing scenarios. However, this approach often fails to simultaneously consider the joint optimization of task placement, bandwidth allocation, and computing resource allocation when making offloading decisions, resulting in low overall system resource utilization and difficulty in meeting the real-time requirements of deep neural network tasks.

[0006] In summary, existing task offloading solutions still lack effective collaborative mechanisms in handling user trajectory perception, heterogeneous device latency discrimination, and multi-dimensional resource joint decision-making, making it difficult to achieve truly high-reliability, low-latency computing services in complex dynamic edge environments. Summary of the Invention

[0007] To overcome the shortcomings of existing technologies, this invention aims to provide an edge computing task offloading method that integrates trajectory prediction and computational latency assessment. By introducing a Transformer trajectory prediction model based on a multi-scale attention mechanism, it solves the problem of insufficient terminal mobility perception in traditional methods. By constructing a dual-stream computational latency prediction network, it can not only automatically learn the nonlinear relationship between tasks with different computational loads and different hardware specifications (such as CPU / GPU frequency and memory status), eliminating heterogeneity barriers, but also provide a quantitative standard for resource scheduling based on the predicted latency value. Furthermore, it serves as a high-quality reward signal for reinforcement learning, achieving accurate latency prediction in heterogeneous computing environments. The DuelingDQN algorithm enables joint optimization of offloading destination, communication bandwidth, and computing power. Through forward-looking trajectory prediction and accurate latency perception, this invention provides highly reliable and extremely low-latency technical support for next-generation intelligent edge computing applications.

[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for offloading edge computing tasks by fusing trajectory prediction and computation latency assessment includes the following steps: Step 1: Construct an unloading device set and a task set; the unloading device set includes mobile users, edge servers, and cloud servers, and the mobile users include task mobile users and collaborative mobile users; Step 2: Construct a mobile user trajectory prediction model, taking the historical trajectory sequence of mobile users as input and outputting the predicted future trajectory sequence; calculate the link stability of the coordinated mobile users based on the future trajectory sequence; Step 3: Construct a dual-stream computing latency prediction network, obtain historical execution samples to train the dual-stream computing latency prediction network until the mean squared error loss function converges, and obtain a trained dual-stream computing latency prediction network. Input task features and device features into the trained dual-stream computing latency prediction network for latency evaluation to obtain the predicted execution latency; the historical execution samples include task features, device features and actual execution latency; Step 4: Calculate the task completion latency and energy consumption based on the predicted execution latency, and then calculate the task completion latency. Energy consumption Resource expenditure Penalties for mission failure Combination as comprehensive cost The overall optimization objective is to minimize the expected cumulative cost of all tasks. , To unload decision-making strategies, As a discount factor, The length of the decision-making cycle. For a moment The task set; Step 5: Set resource constraints, including bandwidth constraints, computational resource constraints, or link stability constraints; Step 6: Based on the future trajectory sequence, predicted execution latency, and resource constraints, model the comprehensive optimization objective as a Markov decision process, including the state space. Action space and instant reward function ; Step 7: Set the status Input into the DuelingDQN unloading decision network, based on the immediate reward function Select the appropriate action and output the unloading action. Determine the unloading decision vector, bandwidth resource allocation vector, and computing resource allocation vector.

[0009] The characteristics of any device in the set of unloading devices include the device's CPU frequency, GPU availability, available memory, current load, number of queued tasks, and proportion of allocable computing resources; the characteristics of any task in the set of tasks include the amount of input data for the task, the amount of computation required to complete the task, the memory resources required to execute the task, and the deadline for the task to be completed.

[0010] The historical trajectory sequence ,in, For mobile users at any time The state vector includes position coordinates, velocity, and direction of motion. Historical observation window length; future trajectory sequence ,in, For mobile users at any time The predicted state vector, Indicates the length of the future prediction window.

[0011] The mobile user trajectory prediction model includes an input embedding layer, a multi-scale attention encoder, a trajectory feature fusion layer, a trajectory decoder, and a fully connected layer. The input embedding layer maps the historical trajectory sequence of the mobile user into a high-dimensional trajectory representation. The multi-scale attention encoder includes a local attention branch and a global attention branch. The local attention branch is used to capture the velocity changes and turning trends of the high-dimensional trajectory in the historical trajectory sequence within a short period of time, while the global attention branch is used to capture the path dependence of the high-dimensional trajectory in the historical trajectory sequence over a longer period of time. The trajectory feature fusion layer fuses the outputs of the two branches into a trajectory latent vector that can represent complex nonlinear motion laws. The trajectory decoder outputs the predicted future trajectory sequence based on the trajectory latent vector. The fully connected layer is used to map the future trajectory sequence output by the trajectory decoder to the target prediction space, outputting the future position coordinates, future velocity, and future direction of motion.

[0012] The link stability of collaborative mobile users is calculated based on future trajectory sequences, as follows: For users who move tasks and collaborative mobile users In the future The predicted distance is denoted as ,in, Indicates task movement user In the future The predicted state vector below, Indicates collaborative mobile users In the future The predicted state vector; when the prediction distance is less than the communication radius. When the link is considered available at that moment, the link stability index is obtained. , For indicator functions, Predict the length of the future prediction window.

[0013] The dual-stream computation latency prediction network includes a task encoder, a device encoder, a fusion module, and a prediction head. The task encoder encodes task features to obtain task latent vectors. The device encoder encodes device features to obtain device latent vectors. The fusion module concatenates, differs, and performs element-wise multiplication on the task latent vectors and device latent vectors to obtain fused features. The prediction head outputs the predicted execution latency of the task on the candidate device based on the fused features.

[0014] The task completion delay consists of transmission delay and predicted execution delay, denoted as: ,in, For unloading device sets, To predict execution latency, For transmission delay model, For the task To the equipment transmission rate For channel bandwidth, For channel gain, For wireless transmission power, For noise power, For bandwidth allocation ratio, Enter the amount of data for the task.

[0015] The bandwidth constraint refers to the requirements that communication bandwidth allocation must meet. , A binary variable representing the task. Select equipment implement, Bandwidth allocation ratio; computational resource constraints are the requirements that computational resource allocation must meet. , To calculate resource allocation ratios; link stability constraints require that the link stability of cooperative mobile users must meet certain conditions. , This is the threshold for link stability.

[0016] Based on future trajectory sequences, predicted execution delays, and resource constraints, the comprehensive optimization objective is modeled as a Markov decision process, specifically: The Markov decision process is a triplet ( , , ) model, where, For state space, state , The task feature matrix, A set of future trajectory sequences for mobile users. For channel state and link stability, channel state includes channel bandwidth and channel gain; For the device feature matrix, To predict the execution delay matrix, This is a vector representing the device load rate. For the action space, unload the action. , This is the destination for unloading the task. Allocate bandwidth tiers, Allocate tiers for computing resources; For a preset set of bandwidth ratios, This is a preset set of computing resource proportions; For instant reward function, The degree to which bandwidth constraints, computational resource constraints, or link stability constraints are violated. This is the penalty coefficient.

[0017] The DuelingDQN unloading decision network comprises an online network and a target network. Each network includes a shared feature extraction layer, a state value branch, and an action advantage branch. The shared feature extraction layer is used to analyze the state... Normalization and feature extraction are performed; the state value branch outputs the long-term value of the current state itself. The action advantage branch output selects an action in the current state. Advantages compared to other actions ; Calculate the action value function based on state value and action advantage. ,in, To share the parameters of the feature extraction layer, For state value branch parameters, For the action advantage branch parameters, For the action space, For action space Any candidate action in the list.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Step 2 of this invention introduces a Transformer trajectory prediction model based on a multi-scale attention mechanism. This model can detect link interruption risks in advance, capture the long-term dependencies and short-term trends of terminal motion, and predict the position changes of candidate computing devices during the task processing cycle. Subsequently, the decision agent prioritizes devices that can maintain stable connections for offloading based on the predicted future trajectory sequence, effectively reducing task failures and retransmission overhead caused by connection interruptions. This model overcomes the shortcomings of traditional methods in terms of insufficient terminal motion perception, significantly improving the reliability and success rate of task execution in dynamic environments.

[0019] 2. To address the "performance black box" challenge of varying hardware capabilities and dynamic load fluctuations in edge devices, step 3 of this invention achieves more accurate latency prediction in heterogeneous computing environments through a dual-stream computing latency prediction network. By jointly modeling with the task encoder and device encoder, the model can automatically learn the nonlinear relationship between tasks with different computational loads and different hardware specifications (such as CPU / GPU frequency and memory status), eliminating the heterogeneity barrier. The predicted execution latency value not only provides a quantitative standard for resource scheduling but also serves as a high-quality reward signal for reinforcement learning, providing a high-fidelity decision-making basis and solving the problem of excessive errors in traditional analytical models in dynamic environments.

[0020] 3. Step 4 of this invention constructs a comprehensive cost function that includes task completion latency, energy consumption, resource overhead, and task failure penalties. This integrates multiple optimization objectives, such as low latency, low energy consumption, balanced resource utilization, and task success rate, into the offloading decision process. By weighted modeling of different optimization objectives, the system can dynamically balance various performance indicators based on task requirements and network status, avoiding resource waste, node congestion, or task timeouts caused by a single optimization objective. This improves the overall performance and adaptability of the edge computing task offloading scheme.

[0021] 4. Step 7 of this invention employs the DuelingDQN algorithm to jointly optimize the offloading destination, communication bandwidth, and computing power. By separating state value from action advantage through the Dueling architecture, the agent can more efficiently find the global optimal solution in the discrete high-dimensional action space, significantly reducing algorithm oscillations. The system successfully finds the optimal balance between minimizing task latency, reducing terminal power consumption, and maintaining system load balance, achieving long-term minimization of cumulative system costs.

[0022] In summary, this invention, through forward-looking trajectory prediction and precise latency perception, completely changes the traditional "blind unloading" and "passive response" modes, providing highly reliable and extremely low-latency technical support for next-generation intelligent edge computing applications. Attached Figure Description

[0023] Figure 1 This is a framework diagram of the edge computing task offloading system of the present invention.

[0024] Figure 2 This is a flowchart of the edge computing task unloading method of the present invention.

[0025] Figure 3 This is a reward comparison diagram between the edge computing task offloading method and the baseline method of the present invention. Detailed Implementation

[0026] The technical solution of the present invention will be further described below with reference to the accompanying drawings. The following embodiments are used to explain the implementation of the present invention and do not limit the scope of protection of the present invention. In this embodiment, the mobile user can be a handheld terminal user, a wearable terminal user, a robot terminal user, or other mobile computing task initiator or collaborative computing terminal.

[0027] like Figure 1 and Figure 2As shown, an edge computing task offloading method integrating trajectory prediction and computation latency assessment is applied to a mobile edge computing system comprising multiple mobile users, edge servers, and cloud servers. Mobile users include task-oriented mobile users and collaborative mobile users. Task-oriented mobile users generate deep neural network computation tasks, while collaborative mobile users participate in task execution as nearby computing devices when idle computing power is available. Edge servers are deployed at base stations, wireless access points, or campus edge devices, and cloud servers communicate with edge servers via backhaul links. Task-oriented mobile users can choose to execute locally, offload to collaborative mobile users, offload to edge servers, or offload to cloud servers.

[0028] Step 1: Build the set of unloaded devices and the set of tasks.

[0029] Obtain the current set of task-mobile users, collaborative-mobile users, edge servers, and cloud servers in the system, and collectively denote the computing devices available for task offloading as the candidate computing device set. .in, This indicates that the task is moving to the user's local terminal. This refers to cooperative mobile users who meet the requirements for communication distance and available computing power. Indicates edge server, This refers to cloud servers. By unifying different types of computing resources into the same candidate set, subsequent offloading decisions can be compared within the same action space.

[0030] Obtain the set of Deep Neural Networks (DNN) tasks that arrive at the current decision time. , will any task Represented as ,in, The amount of input data for the task refers to the size of the input files or image data required by the task, which directly determines the communication overhead during the unloading process. The computational load required to complete the task is expressed in floating-point operations (FLOPs), representing the total computing power required to complete the task. The memory resources required to execute the task represent the instantaneous memory resources needed to run the task, which are used to ensure that the target device has sufficient hardware capacity and prevent computational anomalies caused by memory overflow. The deadline for task completion is defined by , and the maximum tolerable latency for task execution is represented by . This task model allows the system to simultaneously consider transmission overhead, computational overhead, memory constraints, and latency constraints.

[0031] Step 2: Construct a mobile user trajectory prediction model. For any mobile user, at time... Collect its historical trajectory sequence ;in, Indicates the mobile user at any time The state vector includes position coordinates, velocity, and direction of motion. This indicates the length of the historical observation window. The output of the trajectory prediction model is the sequence of positions within the future prediction window, i.e., the predicted future trajectory sequence. ,in, Indicates the mobile user at any time The predicted state vector, Indicates the length of the future prediction window.

[0032] The mobile user trajectory prediction model is a Transformer trajectory prediction model based on a multi-scale attention mechanism, including an input embedding layer, a multi-scale attention encoder, a trajectory feature fusion layer and a trajectory decoder, and a fully connected layer. The input embedding layer incorporates historical trajectory sequences such as position coordinates, velocity, and direction of motion. The mapping is to a high-dimensional trajectory representation; the multi-scale attention encoder includes a local attention branch and a global attention branch. The local attention branch is used to capture the velocity changes and turning trends of the high-dimensional trajectory in the historical trajectory sequence over a short period of time, while the global attention branch is used to capture the path dependence of the high-dimensional trajectory in the historical trajectory sequence over a longer period of time; the trajectory feature fusion layer fuses the outputs of the two branches into a trajectory latent vector that can represent complex nonlinear motion laws. The trajectory decoder uses the trajectory latent vector. Output the predicted future trajectory sequence The fully connected layer is used to process the future trajectory sequence output by the trajectory decoder. Mapped to the target prediction space, it outputs the future position coordinates, future velocity, and future direction of motion; Calculate cooperative mobile users based on predicted future trajectory sequences Link stability. For users on task mobility. and collaborative mobile users In the future The predicted distance is denoted as ,in, Indicates task movement user In the future The predicted state vector below, Indicates collaborative mobile users In the future The predicted state vector. When the prediction distance is less than the communication radius. When the link is considered available at a given moment, the link stability index is obtained. ,in, This is an indicator function; the larger the indicator, the more likely the co-mobile user is to maintain a stable connection during task execution.

[0033] Step 3: Construct a two-stream computation latency prediction network. (For the task...) and candidate devices Obtain task characteristics and equipment characteristics Among them, task characteristics Including the amount of task input data Calculation required to complete the task Memory resources required to execute the task Maximum tolerable latency for task execution Equipment characteristics This includes device CPU frequency, GPU availability, available memory, current load, number of queued tasks, and proportion of allocable computing resources. A dual-stream computation latency prediction network is used to learn the non-linear relationship between task complexity and the heterogeneous computing capabilities of the devices.

[0034] Step 3.1: The dual-stream computation latency prediction network includes a task encoder, a device encoder, a fusion module, and a prediction head; the task encoder processes task features... Encode to obtain the task latent vector ,in, This represents the trainable network parameters of the task encoder; the device encoder's representation of device features. Encode to obtain the device latent vector ,in, This represents the trainable network parameters of the device encoder. Subsequently, the fusion module concatenates, differs, and performs element-wise multiplication on the two latent vectors to obtain the fused features. The prediction head outputs the task based on the fused features. In candidate devices On the prediction execution latency ,in, This represents the trainable network parameters of the prediction head.

[0035] Step 3.2: Train the dual-stream computation latency prediction network using the collected historical execution sample set. Each historical execution sample includes task features, device features, and actual execution latency. During training, the mean squared error between the predicted execution latency and the actual execution latency is used as the loss function, expressed as: .in, Represents the training sample set, Indicates the number of samples. Indicates the predicted execution latency. This represents the actual execution latency. Through this training process, the system can predict the execution time of tasks on different heterogeneous devices before making real-time decisions.

[0036] Step 4: Calculate the task completion latency and energy consumption based on the predicted execution latency, and then calculate the task completion latency. Energy consumption Resource expenditure Penalties for mission failure Combination as comprehensive cost ,in, , , and This is a weighting coefficient. The smaller the overall cost, the better the unloading action. It should be superior in terms of latency, energy consumption, resource utilization, and mission success rate.

[0037] For a continuous decision-making process, the objective is to minimize the expected cumulative comprehensive cost of all tasks, i.e., the comprehensive optimization objective is expressed as: ,in, This indicates the unloading decision strategy. Indicates the discount factor. Indicates the length of the decision-making cycle. Indicates time The set of tasks. This objective enables the system to focus not only on the latency of the current task, but also on the impact of resource consumption at consecutive time points on subsequent tasks.

[0038] Step 4.1: Construct the task completion delay. For the task... Uninstallation action By unloading decision vector Bandwidth resource allocation vector and compute resource allocation vector Composition, the task Select equipment Execution is denoted as a binary variable. ,in Indicates the selection of devices implement, Indicates no device selection Since each task can only choose one execution location, it must meet the following requirements. The task completion delay consists of transmission delay and predicted execution delay, denoted as... This formula indicates that only the selected device will participate in the task completion delay calculation.

[0039] The transmission delay model is constructed as follows: For the task and candidate devices Get task mobile users To candidate devices channel bandwidth Channel gain Wireless transmission power Noise power and bandwidth allocation ratio ;in, This indicates that the system assigns tasks. To the equipment The proportion of bandwidth used for data transmission. According to Shannon's capacity formula, the task... To the equipment The transmission rate is This formula is used to convert wireless link quality and bandwidth allocation results into quantifiable transmission capabilities. A transmission delay model is constructed based on the amount of task input data, expressed as follows: When a task is executed on a local terminal, it does not need to upload task input data via a wireless link, therefore, it is set... This transmission latency model can distinguish the differences in communication overhead between local execution, nearby collaborative mobile user execution, edge execution, and cloud execution.

[0040] Step 4.2: Construct an energy consumption and resource overhead model. The energy consumption of the task-mobile user includes local computing energy consumption and wireless transmission energy consumption, represented as follows: ,in, Indicates the locally calculated power. Indicates wireless transmission power. Indicates task Predicted execution latency for local execution. Indicates task To the equipment Transmission latency. To avoid excessive system bandwidth and computing power consumption, resource overhead is introduced. ,in, This indicates the proportion of resources allocated. Indicates the equipment load rate. , , Both represent physical weights.

[0041] Step 4.3: Establish a task failure penalty. If the task completion delay exceeds the deadline, set a task failure penalty. ,in, For indicator functions, Indicates the task deadline.

[0042] Step 5: Set resource constraints, including bandwidth constraints, computational resource constraints, or link stability constraints; the bandwidth constraint refers to the communication bandwidth allocation requirements. This indicates that the total bandwidth allocated on the same channel does not exceed the available bandwidth; the computational resource constraint is that the allocation of computational resources must meet the following requirements. This indicates that the total proportion of computing resources allocated to multiple tasks by the same computing device does not exceed the total resources of the device; for cooperative mobile user equipment, constraints are also set according to the link stability index in step 2, and the link stability must meet the following requirements. , If the threshold for link stability is indicated, then the cooperating mobile user will be prioritized for offloading.

[0043] Step 6: Based on the future trajectory sequence, predicted execution latency, and resource constraints, the comprehensive optimization objective is modeled as a Markov decision process; The Markov decision process is a triplet ( , , Model; State Space Used to describe the current system environment state; state This includes task characteristics, predicted trajectory, channel state, device characteristics, predicted execution latency, link stability, and device load rate, expressed as... ,in, Represents the task feature matrix. Represents the set of future trajectory sequences of mobile users. This indicates channel state and link stability. Channel state includes channel bandwidth. and channel gain ; Represents the device feature matrix. This represents the prediction execution delay matrix. This represents the device load rate vector.

[0044] Constructing Action Space Uninstallation action Indicates at time The joint unloading and resource allocation decisions made for the task are represented as ,in, Indicates the destination for unloading the task. Indicates the bandwidth allocation level. Indicates the level of computing resource allocation; For a preset set of bandwidth ratios, This is a preset set of computing resource ratios. The system bases this on... , and Generate the corresponding , and .

[0045] Construct an instant reward function To align the learning direction of reinforcement learning with the optimization objective, the immediate reward function is set as the negative of the combined cost and constraint violation penalty, denoted as: ,in, This indicates the degree of violation of bandwidth constraints, computational resource constraints, or link stability constraints. denoted by the penalty coefficient. By maximizing the cumulative reward, the agent equivalently learns an offloading strategy that minimizes task completion latency, energy consumption, resource overhead, and task failure penalties.

[0046] Step 7: Construct the DuelingDQN offloading decision network, which consists of two independent neural network models with the same topology: an online network and a target network. Both networks include a shared feature extraction layer, a state value branch, and an action advantage branch. The shared feature extraction layer is used to analyze the state... The task, trajectory, channel, resource, and latency features are normalized and feature extracted; the state value branch output is performed. This represents the long-term value of the current state itself; action advantage branch output. This indicates that an action should be selected in the current state. Advantages relative to other actions; combining state value and action advantage yields the action value function, expressed as: ,in, This indicates shared feature extraction layer parameters. Indicates the state value branch parameter, Indicates the parameters of the dominant branch of the action. Represents the action space. Representing the action space This structure allows for the separate estimation of the quality of a state and the relative merit of an action, thereby improving learning stability in a large action space.

[0047] Step 7.1: Action Selection. During the training phase, the following actions are used: -The greedy strategy selects actions based on probability. Randomly select actions to explore, based on probability. Select the current action value function Utilize the largest possible actions until the immediate reward function stabilizes; during the online execution phase, select... This serves as the basis for current task unloading and resource allocation decisions.

[0048] Step 7.2: Update the target network parameters. Use the samples obtained through interaction... Store in the experience replay buffer Sample a small batch of samples from the buffer. Training is performed. For any sample, the target temporal difference is calculated using the target network. ,in, , and This represents the target network parameters.

[0049] Step 7.3: Construct the time difference error loss function and update the online network parameters. , This represents a mini-batch of samples randomly sampled from the experience replay buffer. The parameters are updated using gradient descent, denoted as... ,in, This represents the learning rate. It is calculated every preset period. Synchronize online network parameters to the target network, i.e. .

[0050] Step 7.4: Perform the task uninstallation online. Edge server At each decision-making moment, mobile user trajectories, task information, channel states, and device characteristics are collected; the predicted trajectories of cooperative mobile users are obtained using a trajectory prediction model, and link stability is calculated; the execution latency of the network prediction task on each device is calculated using dual-stream latency prediction; and the state is then... Input the data into the trained DuelingDQN unloading decision network, and then apply the immediate reward function. Select the appropriate action and output the unloading action. This process determines the unloading decision vector, bandwidth resource allocation vector, and computing resource allocation vector; finally, it executes task transmission, computing scheduling, and result return.

[0051] Through the above steps, this embodiment, in an environment of dynamic mobile user movement, fluctuating link quality, and heterogeneous computing devices, uses trajectory prediction results, computational latency prediction results, and real-time resource status together for offloading decisions. This allows for the early exclusion of cooperative mobile users with unstable links, accurate estimation of execution latency for different candidate devices, and joint optimization among task latency, terminal power consumption, resource utilization, and task success rate. Figure 3 As shown, compared with existing random algorithms, greedy algorithms, and load balancing, the edge computing task offloading method proposed in this invention exhibits the best joint optimization performance. The random algorithm strategy randomly selects a device from the candidate devices to execute the task upon arrival, without considering link quality, device load, or task latency requirements. The greedy algorithm strategy estimates the completion latency or overall cost of the task on each candidate device at each task offloading, and selects the device with the lowest current latency or cost to execute the task, without considering subsequent tasks or long-term system status. The load balancing strategy prioritizes assigning tasks to devices with lower loads based on the current load of each candidate device to avoid overloading some devices.

Claims

1. A method for offloading edge computing tasks by fusing trajectory prediction and computation latency assessment, characterized in that, The steps include the following: Step 1: Construct an unloading device set and a task set; the unloading device set includes mobile users, edge servers, and cloud servers, and the mobile users include task mobile users and collaborative mobile users; Step 2: Construct a mobile user trajectory prediction model, taking the historical trajectory sequence of mobile users as input and outputting the predicted future trajectory sequence; calculate the link stability of the coordinated mobile users based on the future trajectory sequence; Step 3: Construct a dual-stream computing latency prediction network, obtain historical execution samples to train the dual-stream computing latency prediction network until the mean squared error loss function converges, and obtain a trained dual-stream computing latency prediction network. Input task features and device features into the trained dual-stream computing latency prediction network for latency evaluation to obtain the predicted execution latency; the historical execution samples include task features, device features and actual execution latency; Step 4: Calculate the task completion latency and energy consumption based on the predicted execution latency, and then calculate the task completion latency. Energy consumption Resource expenditure Penalties for mission failure Combination as comprehensive cost The overall optimization objective is to minimize the expected cumulative cost of all tasks. , To unload decision-making strategies, As a discount factor, The length of the decision-making cycle. For a moment The task set; Step 5: Set resource constraints, including bandwidth constraints, computational resource constraints, or link stability constraints; Step 6: Based on the future trajectory sequence, predicted execution latency, and resource constraints, model the comprehensive optimization objective as a Markov decision process, including the state space. Action space and instant reward function ; Step 7: Set the status Input into the DuelingDQN unloading decision network, based on the immediate reward function Select the appropriate action and output the unloading action. Determine the unloading decision vector, bandwidth resource allocation vector, and computing resource allocation vector.

2. The edge computing task offloading method according to claim 1, characterized in that, The characteristics of any device in the set of unloading devices include the device's CPU frequency, GPU availability, available memory, current load, number of queued tasks, and proportion of allocable computing resources; the characteristics of any task in the set of tasks include the amount of input data for the task, the amount of computation required to complete the task, the memory resources required to execute the task, and the deadline for the task to be completed.

3. The edge computing task offloading method according to claim 1, characterized in that, The historical trajectory sequence ,in, For mobile users at any time The state vector includes position coordinates, velocity, and direction of motion. Historical observation window length; future trajectory sequence ,in, For mobile users at any time The predicted state vector, Indicates the length of the future prediction window.

4. The edge computing task offloading method according to claim 1, characterized in that, The mobile user trajectory prediction model includes an input embedding layer, a multi-scale attention encoder, a trajectory feature fusion layer and a trajectory decoder, and a fully connected layer. The input embedding layer maps the historical trajectory sequence of the mobile user into a high-dimensional trajectory representation. The multi-scale attention encoder includes a local attention branch and a global attention branch. The local attention branch is used to capture the speed changes and turning trends of the high-dimensional trajectory in the historical trajectory sequence within a short period of time, while the global attention branch is used to capture the movement path dependence of the high-dimensional trajectory in the historical trajectory sequence over a longer period of time. The trajectory feature fusion layer merges the outputs of the two branches into a trajectory latent vector that can characterize complex nonlinear motion laws; the trajectory decoder outputs the predicted future trajectory sequence based on the trajectory latent vector; the fully connected layer is used to map the future trajectory sequence output by the trajectory decoder to the target prediction space, and output the future position coordinates, future velocity and future direction of motion.

5. The edge computing task offloading method according to claim 1, characterized in that, The link stability of collaborative mobile users is calculated based on future trajectory sequences, as follows: For users who move tasks and collaborative mobile users In the future The predicted distance is denoted as ,in, Indicates task movement user In the future The predicted state vector below, Indicates collaborative mobile users In the future The predicted state vector; when the prediction distance is less than the communication radius. When the link is considered available at that moment, the link stability index is obtained. , For indicator functions, Predict the length of the future prediction window.

6. The edge computing task offloading method according to claim 1, characterized in that, The dual-stream computation latency prediction network includes a task encoder, a device encoder, a fusion module, and a prediction head. The task encoder encodes task features to obtain task latent vectors. The device encoder encodes device features to obtain device latent vectors. The fusion module concatenates, differs, and performs element-wise multiplication on the task latent vectors and device latent vectors to obtain fused features. The prediction head outputs the prediction execution latency of the task on the candidate device based on the fused features.

7. The edge computing task offloading method according to claim 1, characterized in that, The task completion delay It consists of transmission delay and prediction execution delay, denoted as ,in, For unloading device sets, To predict execution latency, For transmission delay model, For the task To the equipment transmission rate, For channel bandwidth, For channel gain, For wireless transmission power, For noise power, For bandwidth allocation ratio, Enter the amount of data for the task.

8. The edge computing task offloading method according to claim 1, characterized in that, The bandwidth constraint refers to the requirements that communication bandwidth allocation must meet. , A binary variable representing the task. Select equipment implement, Assign bandwidth allocation ratio; Computational resource constraints are the requirements that the allocation of computational resources must meet. , To calculate the resource allocation ratio; Link stability constraints require that the link stability of cooperative mobile users must meet certain conditions. , This is the threshold for link stability.

9. The edge computing task offloading method according to claim 1, characterized in that, Based on future trajectory sequences, predicted execution delays, and resource constraints, the comprehensive optimization objective is modeled as a Markov decision process, specifically: The Markov decision process is a triplet ( , , ) model, where, For state space, state , The task feature matrix, A set of future trajectory sequences for mobile users. For channel state and link stability, channel state includes channel bandwidth and channel gain; For the device feature matrix, To predict the execution delay matrix, This is a vector representing the device load rate. For the action space, unload the action. , The destination for unloading the task. Allocate bandwidth tiers, Allocate tiers for computing resources; For a preset set of bandwidth ratios, This is a preset set of computing resource proportions; For instant reward function, The degree to which bandwidth constraints, computational resource constraints, or link stability constraints are violated. This is the penalty coefficient.

10. The edge computing task offloading method according to claim 1, characterized in that, The DuelingDQN offloading decision network comprises an online network and a target network, with each network including a shared feature extraction layer, a state value branch, and an action advantage branch. Shared feature extraction layers are used for state Normalization and feature extraction are performed; the state value branch outputs the long-term value of the current state itself. ; The action advantage branch output selects an action in the current state. Advantages compared to other actions ; Calculate the action value function based on state value and action advantage. ,in, To share the parameters of the feature extraction layer, For state value branch parameters, For the action advantage branch parameters, For the action space, For action space Any candidate action in the list.