Task unloading method and device
By acquiring and analyzing task information and communication information, and building and solving task offload optimization model, the problem of inefficient resource allocation in the existing technology is solved, and the optimal task offload under different delay conditions is achieved, which improves system performance and efficiency.
Patent Information
- Application Number
- CN202510236408.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-13
AI Technical Summary
Existing task unloading methods cannot accurately describe the differences in task unloading under different delays, resulting in inefficient resource allocation.
By obtaining the task information of the task to be unloaded by the target active device and the communication information with the idle device and the edge computing device, the service indicators and service satisfaction index of the unloading task of the target active device are determined, and a task unloading optimization model is built to solve it to obtain the optimal unloading solution.
It realizes optimal task offloading under different delay conditions, improves resource allocation efficiency, reduces the computing volume of target active devices, and improves the performance and efficiency of the entire system.
Smart Images

Figure CN120151346A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a task offloading method and apparatus. Background Art
[0002] The Industrial Internet of Things (IIoT) has developed rapidly and become a key technology for the transformation and upgrading of modern manufacturing. In the IIoT scenario, a large number of heterogeneous devices, such as sensors, intelligent terminals, and controllers, are widely deployed. However, the computing power and battery life of IIoT devices are usually limited, making it difficult for them to meet the computing requirements of tasks. Therefore, it is necessary to offload tasks to other devices. However, existing task offloading methods cannot accurately describe the differences in task offloading under different latencies, which leads to inefficient resource allocation. Summary of the Invention
[0003] In view of this, the purpose of this application is to propose a task offloading method and apparatus to solve the problem that existing task offloading methods cannot determine the differences in task offloading under different latencies, resulting in inefficient resource allocation.
[0004] Based on the above purpose, this application provides a task offloading method, including: Obtaining task information of the task to be offloaded of the target active device, first communication information between the idle device connected to the target active device and the target active device, and second communication information between the edge computing device and the target active device; Determining a service metric for the offloading task of the target active device according to the task information, the first communication information, and the second communication information; Determining a service satisfaction index according to the service metric; Constructing a task offloading optimization model for the task to be offloaded according to the task information and the service satisfaction index; Solving the task offloading optimization model to obtain an offloading solution for the task to be offloaded; Offloading the task to be offloaded to the idle device or the edge computing device according to the offloading solution.
[0005] Optionally, the task information includes task computing volume, task transmission volume, and computing resources, the first communication information includes a first transmission rate between the target active device and the idle device, the second communication information includes a second transmission rate between the target active device and the edge computing device, and the service metric for the offloading task includes the total processing latency of the task to be offloaded by the target active device; The determining a service metric for the offloading task of the target active device according to the task information, the first communication information, and the second communication information includes: Determine the total processing delay of the tasks to be offloaded by the target active device according to the task computation amount, the task transmission amount, the computing resources, the first transmission rate, and the second transmission rate.
[0006] Optionally, the computing resources include first computing resources and second computing resources; The determining the total processing delay of the tasks to be offloaded by the target active device according to the task computation amount, the task transmission amount, the computing resources, the first transmission rate, and the second transmission rate includes: Determine a first processing delay of the target active device relative to the idle device according to the task computation amount, the task transmission amount, the first computing resources, and the first transmission rate; Determine a second processing delay of the target active device relative to the edge computing device according to the task computation amount, the task transmission amount, the second computing resources, and the second transmission rate; Determine the total processing delay of the tasks to be offloaded by the target active device according to the first processing delay and the second processing delay.
[0007] Optionally, the first processing delay includes a first transmission delay and a first computing delay; The determining a first processing delay of the target active device relative to the idle device according to the task computation amount, the task transmission amount, the first computing resources, and the first transmission rate includes: Determine the first transmission delay according to the task transmission amount and the first transmission rate; Determine the first computing delay according to the task computation amount and the first computing resources; Determine the first processing delay of the target active device relative to the idle device according to the first transmission delay and the first computing delay.
[0008] Optionally, the second processing delay includes a second transmission delay and a second computing delay; The determining a second processing delay of the target active device relative to the edge computing device according to the task computation amount, the task transmission amount, the second computing resources, and the second transmission rate includes: Determine the second transmission delay according to the task transmission amount and the second transmission rate; Determine the second computing delay according to the task computation amount and the second computing resources; Determine the second processing delay of the target active device relative to the edge computing device according to the second transmission delay and the second computing delay.
[0009] Optionally, the task information includes a task type; the service satisfaction index includes: a first service satisfaction index, a second service satisfaction index, and a third service satisfaction index; Determine the service satisfaction index according to the task information and the service metrics of the offloading task of the target active device, including: In response to the task type being the first task type, determine the first service satisfaction index according to the total processing delay of the target active device; In response to the task type being the second task type, determine the second service satisfaction index according to the total processing delay of the target active device; In response to the task type being the third task type, determine the third service satisfaction index according to the total processing delay of the target active device.
[0010] Optionally, the task offloading optimization model includes an objective function and objective constraints; Construct the task offloading optimization model of the task to be offloaded according to the task information and the service satisfaction index, including: Construct the objective function according to the task type, the first service satisfaction index, the second service satisfaction index, and the third service satisfaction index, where the objective function aims to minimize the total processing delay of the task to be offloaded of the target active device; Construct the objective constraints according to the task information.
[0011] Optionally, construct the objective function according to the task type, the first service satisfaction index, the second service satisfaction index, and the third service satisfaction index, including: Construct a first initial function according to the task type and the first service satisfaction index; Construct a second initial function according to the task type and the second service satisfaction index; Construct a third initial function according to the task type and the third service satisfaction index; Construct the objective function according to the first initial function, the second initial function, and / or the third initial function.
[0012] Optionally, construct the objective constraints according to the task information, including: Construct a first constraint condition through the following formula: ; where Whether to offload the to-be-offloaded task of the target active device n to the idle device i or whether to offload the to-be-offloaded task of the target active device n to the edge computing device; Construct the second constraint condition through the following formula: ; Among them, Whether to offload the to-be-offloaded task of the target active device n to the idle device i; Construct the third constraint condition through the following formula: ; Among them, Is the computing resource of the to-be-offloaded task in the edge computing device, Whether to offload the to-be-offloaded task of the target active device n to the edge computing device, Is the computing resource of the to-be-offloaded task n, Represents the total computing resource of the edge computing device; Construct the fourth constraint condition through the following formula: ; Among them, Is the computing resource allocated to the edge computing device for task n; Combine the first constraint condition, the second constraint condition, the third constraint condition and the fourth constraint as the target constraint condition.
[0013] Based on the same inventive concept, the present application also provides a task offloading device, including: An acquisition module, configured to acquire the task information of the to-be-offloaded task of the target active device, the first communication information between the idle device connected to the target active device and the target active device, and the second communication information between the edge computing device and the target active device; A first determination module, configured to determine the service metrics of the offloading task of the target active device according to the task information, the first communication information and the second communication information; A second determination module, configured to determine the service satisfaction index according to the service metrics of the offloading task of the target active device; A construction module, configured to construct a task offloading optimization model for the to-be-offloaded task according to the task information and the service satisfaction index; A solving module, configured to solve the task offloading optimization model to obtain an offloading solution for the to-be-offloaded task; An offloading module, configured to offload the to-be-offloaded task to the idle device or the edge computing device according to the offloading solution.
[0014] As can be seen from the above, a task offloading method and device provided by the present application determine service metrics for offloading tasks of a target active device according to task information, first communication information, and second communication information, and determine a service satisfaction index according to the service metrics. A task offloading optimization model for tasks to be offloaded is constructed based on the task information and the service satisfaction index; the task offloading optimization model is solved to obtain an offloading scheme for the tasks to be offloaded, and according to the offloading scheme, the tasks to be offloaded are offloaded to other terminal devices or edge computing devices; the optimal solution is obtained by solving the task model to obtain the optimal offloading method for the tasks to be offloaded. By offloading tasks to idle devices and / or edge computing devices, the computational load of the target active device is reduced; during the offloading process, according to the task information and the first communication information, the processing delay when the task to be offloaded is offloaded to an idle device can be obtained; according to the task information and the second communication information, the processing delay when the task to be offloaded is offloaded to an edge computing device can be obtained. In this way, the offloading scheme is optimal considering the different offloading destinations of the tasks and the differences in offloading at different time delays, and thus more efficient resource allocation can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following will briefly introduce the drawings required for use in the embodiments or related technology descriptions. Obviously, the drawings in the following description are only embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0016] Figure 1 Schematic flowchart of a task offloading method according to an embodiment of the present application; Figure 2 Schematic diagram of smart factory scenario modeling according to an embodiment of the present application; Figure 3 Schematic flowchart of the method for determining the total processing delay according to an embodiment of the present application; Figure 4 Schematic structural framework diagram of a task offloading device according to an embodiment of the present application; Figure 5 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] To make the objectives, technical solutions, and advantages of the present application clearer, the following further details the present application in conjunction with specific embodiments and with reference to the accompanying drawings.
[0018] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should have the ordinary meanings understood by those of ordinary skill in the art to which the present application belongs. The "first", "second" and similar terms used in the embodiments of the present application do not denote any order, quantity or importance, but are only used to distinguish different components. Words such as "including" or "comprising" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to represent relative position relationships, and when the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0019] Based on the background technology described above, the D2D-MEC architecture that combines direct communication between devices (Device-to-Device, D2D) and MEC has gradually become a research hotspot. Under this architecture, devices can not only offload tasks to edge computing nodes, but also utilize the computing resources of neighboring devices for task processing, forming a more efficient and flexible computing environment. In the D2D-MEC architecture, the offloading scheduling of tasks becomes more complex, and latency optimization is an important and challenging research issue. In the D2D-MEC architecture, most of the existing task offloading and resource allocation strategies fail to effectively consider the heterogeneity of devices and the differences in task latency sensitivity, which results in the inability to provide optimal service levels for different tasks. Moreover, traditional task scheduling methods usually adopt fixed latency constraints, which lack flexibility and cannot accurately meet the real-time and dynamically changing task requirements. In addition, existing resource allocation strategies often do not fully utilize the advantages of D2D communication and fail to maximize the efficiency of edge computing resources, thus affecting the performance and efficiency of the entire system.
[0020] To solve the above technical problems, the present application provides a task offloading method. To solve the above problems, in the present application, according to task information, first communication information, and second communication information, a service metric for offloading tasks of a target active device is determined, and according to the service metric, a service satisfaction index is determined. An offloading optimization model for tasks to be offloaded is constructed based on the task information and the service satisfaction index; the offloading optimization model is solved to obtain an offloading scheme for the tasks to be offloaded, and according to the offloading scheme, the tasks to be offloaded are offloaded to other terminal devices or edge computing devices; the optimal solution is obtained by solving the task model to obtain the optimal offloading method for the tasks to be offloaded. By offloading tasks to idle devices and / or edge computing devices, the computational load of the target active device is reduced; during the offloading process, according to the task information and the first communication information, the processing delay when the tasks to be offloaded are offloaded to idle devices can be obtained; according to the task information and the second communication information, the processing delay when the tasks to be offloaded are offloaded to edge computing devices can be obtained. In this way, the offloading scheme is optimal considering the different offloading destinations of the tasks and the differences in offloading at different time delays, and thus more efficient resource allocation can be ensured.
[0021] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0022] Refer to Figure 1 , the present application provides a task offloading method, including the following steps: Step 102: Obtain task information of tasks to be offloaded of a target active device, first communication information between the target active device and idle devices connected to the target active device, and second communication information between an edge computing device and the target active device.
[0023] In this step, a smart factory scenario is modeled. As Figure 2 shown, the smart factory scenario includes a base station and its equipped edge computing device (MEC server), and the coordinates are represented as . There are a large number of heterogeneous IIoT devices within the coverage of the base station. Given that IIoT devices do not continuously execute tasks, they are divided into two types: active devices and idle devices. Exemplarily, the D2D communication method (Device-to-Device, D2D) is adopted between active devices and idle devices, and the active devices are connected to the edge computing device by means of cellular network communication (or 5G communication).
[0024] The task information of the task to be offloaded includes the task computing volume, the task transmission volume, the task type, and the computing resources. Exemplarily, the task type can be classified according to the urgency level, including the emergency control task type (marked as UT in the following text to represent the emergency control task type), the sensor monitoring task type (marked as ST in the following text to represent the sensor monitoring task type), and the batch data processing task type (marked as DT in the following text to represent the batch data processing task type). The first communication information between the target active device and the idle device includes the first transmission rate, and the second communication information between the target active device and the edge computing device includes the second transmission rate. Among them, the first transmission rate represents the transmission rate when the target active device offloads the task to the idle device, and the second transmission rate represents the transmission rate when the target active device offloads the task to the edge computing device. Since there are many active devices in this scenario, but not all active devices perform task offloading, the target active device is considered as the device with the task to be offloaded. By obtaining the task information to be offloaded of the target active device and the communication information between the target active device and other devices, it is possible to determine the processing delay of the offloaded task relative to other devices based on the task information and the communication information, and it is also possible to determine the service satisfaction index according to the processing delay. Then, according to the service satisfaction index, the task is offloaded to other devices (idle device or edge computing device) in the optimal offloading manner, so that the task can be offloaded to other devices (idle device or edge computing device) with the minimum delay, thereby reducing the processing task volume of the target active terminal and improving the task processing speed of the entire industrial production line.
[0025] Step 104: Determine the service metrics of the task to be offloaded of the target active device according to the task information, the first communication information, and the second communication information.
[0026] In this step, the task information includes the task computation volume, the task transmission volume, and computing resources. The first communication information between the target active device and the idle device includes the first transmission rate, and the second communication information between the target active device and the edge computing device includes the second transmission rate. The service metric for the task to be offloaded by the target active device includes the total processing delay of the task to be offloaded by the target active device. Among them, the total processing delay of the task to be offloaded by the target active device may include the first processing delay between the target active device and the idle device and the second processing delay between the target active device and the edge computing device. Since the task computation volume, the task transmission volume, and the computing resources for each task to be offloaded by each target active device are fixed, and the transmission rate between the target active device and each device is fixed, therefore, the first processing delay between the target active device and the idle device can be determined based on the task computation volume, the task transmission volume, the computing resources, and the first transmission rate, and the second processing delay between the target active device and the edge computing device can be determined based on the task computation volume, the task transmission volume, the computing resources, and the second transmission rate. After obtaining the first processing delay and the second processing delay, the total processing delay of the task to be offloaded can be determined based on the first processing delay and the second processing delay, and then the service satisfaction index can be determined based on the total processing delay of the task to be offloaded. It can also be understood that the service satisfaction index for the target active device to offload the task to be offloaded to the idle device and the service satisfaction index for the target active device to offload the task to be offloaded to the edge computing device are determined based on each total processing delay. Furthermore, the task can be offloaded to the idle device and / or the edge computing device in an optimal offloading manner according to the satisfaction index, that is, the task can be offloaded to the idle device and / or the edge computing device with the minimum delay, improving the task processing speed of the production line.
[0027] Step 106: Determine the service satisfaction index according to the service metric.
[0028] In this step, the service satisfaction index decreases as the service metric gradually increases, that is, when the service metric value is higher, the service satisfaction index is lower. The service metric includes the total processing delay of the task to be offloaded by the target active device. When the value of the total processing delay of the task to be offloaded is higher, it indicates that the task to be offloaded will take too long to process, resulting in a decrease in the service satisfaction index. When the value of the total processing delay of the task to be offloaded is lower, it indicates that the task to be offloaded will take a short time to process, resulting in an increase in the service satisfaction index.
[0029] Step 108: Construct an optimization model for task offloading of the task to be offloaded according to the task information and the service satisfaction index.
[0030] In this step, the task offloading optimization model includes an objective function and objective constraint conditions. The task information includes the task type. Exemplarily, the task type may include an emergency control task type, a sensor monitoring task type, and a batch data processing task type. According to different task types and their corresponding satisfaction index functions, a task offloading optimization model for the to-be-offloaded tasks is constructed (for different task types, different satisfaction index functions are used to construct the optimization model, and specific details can be seen in the following description). Since the satisfaction index varies based on the total processing delay of the to-be-offloaded tasks, the objective function aims to minimize the total processing delay of the to-be-offloaded tasks of the target active devices. After solving the objective function, the to-be-offloaded tasks can be offloaded to idle devices and / or edge computing devices with the minimum processing delay, thereby reducing the task processing volume of the target active devices and improving the task processing speed of the production line.
[0031] Step 110: Solve the task offloading optimization model to obtain the offloading scheme for the to-be-offloaded tasks.
[0032] In this step, the proximal policy optimization (PPO) deep reinforcement learning formula is used to solve the task offloading and resource allocation optimization problem. The PPO deep reinforcement learning formula is as follows: ; where is the target value, is the network parameter, is the probability ratio between the old and new policies, is the estimate of the advantage function, is a constant, is the clipping function.
[0033] By solving the objective function of the task offloading optimization model through the above formula, the optimal solution can be obtained, that is, the optimal offloading scheme for the to-be-offloaded tasks is obtained, so that the to-be-offloaded tasks can be offloaded to idle devices and / or edge computing devices with the minimum processing delay, thereby reducing the task processing volume of the target active devices and improving the task processing speed.
[0034] Step 112: According to the offloading scheme, offload the to-be-offloaded tasks to the idle devices or the edge computing devices.
[0035] In this step, the to-be-offloaded tasks of the target active devices are offloaded to idle devices and / or edge computing devices according to the obtained optimal offloading scheme, reducing the processing task volume of the target terminal devices and improving the task processing speed of each device in each production line of the industrial Internet of Things.
[0036] Through steps 102-112, according to the task information, the first communication information, and the second communication information, determine the service metrics of the offloading task of the target active device, and according to the service metrics, determine the service satisfaction index. Construct an offloading optimization model for the task to be offloaded based on the task information and the service satisfaction index; solve the offloading optimization model to obtain the offloading scheme for the task to be offloaded, and according to the offloading scheme, offload the task to be offloaded to other terminal devices or edge computing devices; obtain the optimal offloading method for the task to be offloaded by solving the task model to obtain the optimal solution. By offloading the task to idle devices and / or edge computing devices, reduce the computational load of the target active device; during the offloading process, according to the task information and the first communication information, the processing delay when the task to be offloaded is offloaded to an idle device can be obtained; according to the task information and the second communication information, the processing delay when the task to be offloaded is offloaded to an edge computing device can be obtained. In this way, the offloading scheme is optimized considering different offloading destinations of the task and the differences in offloading at different delays, and thus more efficient resource allocation can be ensured.
[0037] In some embodiments, the task information includes the task computation amount, the task transmission amount, and computing resources, the first communication information includes the first transmission rate between the target active device and the idle device, the second communication information includes the second transmission rate between the target active device and the edge computing device, and the service metrics of the offloading task include the total processing delay of the task to be offloaded by the target active device; The determining of the service metrics of the offloading task of the target active device according to the task information, the first communication information, and the second communication information includes: Determine the total processing delay of the task to be offloaded by the target active device according to the task computation amount, the task transmission amount, the computing resources, the first transmission rate, and the second transmission rate.
[0038] Specifically, referring to Figure 3 , the computing resources include the first computing resources and the second computing resources; the total processing delay of the task to be offloaded by the target active device includes the first processing delay of the target active device relative to the idle device and the second processing delay of the target active device relative to the edge computing device; The determining of the total processing delay of the task to be offloaded by the target active device according to the task computation amount, the task transmission amount, the computing resources, the first transmission rate, and the second transmission rate includes the following steps: Step 202, determine the first processing delay of the target active device relative to the idle device according to the task computation amount, the task transmission amount, the first computing resources, and the first transmission rate.
[0039] In this step, the first processing delay includes a first transmission delay and a first computing delay; Determining the first processing delay of the target active device relative to the idle device according to the task computation amount, the task transmission amount, the first computing resource, and the first transmission rate includes the following steps: Step 2022: Determine the first transmission delay according to the task transmission amount and the first transmission rate.
[0040] In this step, the first transmission delay is determined by the following formula: ; where, is the first transmission delay, is the task transmission amount, is the first transmission rate; First transmission rate is obtained by the following formula: ; where, is the transmission bandwidth, is the target active device and the idle device transmission power for communication, is the interference of the D2D link of other active devices, , is whether the task to be offloaded in the target active device j is offloaded to the idle device k, where, , is the transmission power of the sending active device j relative to the receiving active device k, is the channel gain of the sending active device j relative to the receiving active device k (which can also be understood as the target active device j), is the set of idle devices, is the set of active devices, represents the number of active devices, is the uplink channel gain of the target active device n, , represents the target active device and the idle device Euclidean distance between, is the Rayleigh fading coefficient.
[0041] Step 2024: Determine the first computing delay according to the task computation amount and the first computing resource.
[0042] In this step, the first computing delay is determined by the following formula: ; Among them, is the first calculation time delay, is the task calculation amount, is the first calculation resource of the idle device.
[0043] Step 2026: Determine the first processing time delay of the target active device relative to the idle device according to the first transmission time delay and the first calculation time delay.
[0044] In this step, the first processing time delay of the target active device relative to the idle device is determined by the following formula: ; Among them, is the first transmission time delay of the target active device n relative to the idle device i, is the first calculation time delay of the target active device n relative to the idle device i.
[0045] When the target active device unloads the task to be unloaded to the idle device, it is necessary to consider the transmission time delay to the idle device and the calculation time delay of the idle device. In this way, the first processing time delay of the target active device relative to the idle device can be comprehensively considered. According to the first processing time delay, the satisfaction index can be calculated, the objective function can be constructed by integrating the satisfaction indexes in multiple aspects, and the objective function can be solved to make the task unloading obtain a better unloading scheme, thereby reducing the total processing time delay of the task to be unloaded to the idle device and improving the unloading speed.
[0046] Step 204: Determine the second processing time delay of the target active device relative to the edge computing device according to the task calculation amount, the task transmission amount, the second calculation resource, and the second transmission rate.
[0047] In this step, the second processing time delay includes a second transmission time delay and a second calculation time delay; Determining the second processing time delay of the target active device relative to the edge computing device according to the task calculation amount, the task transmission amount, the second calculation resource, and the second transmission rate includes the following steps: 2042: Determine the second transmission time delay according to the task transmission amount and the second transmission rate; In this step, the second transmission time delay is determined by the following formula: ; Among them, is the second transmission time delay, is the task transmission amount, is the second transmission rate; Second transmission rate It can be obtained through the formula: ; Wherein, is the transmission bandwidth of the target active device and is the transmission power of the target active device when offloading tasks, is the additive white Gaussian noise power, is the uplink gain, , represents the Euclidean distance between the active device and the base station. is the path loss coefficient, is the path loss exponent, is the Rayleigh fading coefficient.
[0048] 2044. Determine the second computing delay according to the task computing amount and the second computing resource.
[0049] In this step, the second computing delay is determined through the following formula: ; Wherein, is the second computing delay, is the task computing amount, is the second computing resource of the edge computing device.
[0050] 2046. Determine the second processing delay of the target active device relative to the edge computing device according to the second transmission delay and the second computing delay.
[0051] In this step, the second processing delay of the target active device relative to the edge computing device is determined through the following formula:
[0052] Wherein, is the second processing delay of the target active device n relative to the edge computing device, is the second transmission delay of the target active device n relative to the edge computing device, is the second computing delay of the target active device n relative to the edge computing device.
[0053] When the target active device offloads the task to be offloaded to the edge computing device, it is necessary to consider the transmission delay from the target active device to the edge computing device and the computing delay of the edge computing device. In this way, the second processing delay of the target active device relative to the edge computing device can be comprehensively considered. Based on the second processing delay, the satisfaction index can be calculated, and the objective function can be constructed by integrating the satisfaction indices in multiple aspects and solving the objective function, so that the task offloading can obtain a better offloading scheme, thereby reducing the total processing delay of the task to be offloaded to the edge computing device and improving the offloading speed.
[0054] Step 206: Determine the total processing delay of the task to be offloaded of the target active device according to the first processing delay and the second processing delay.
[0055] In this step, the total processing delay of the task to be offloaded of the target active device is determined by the following formula:
[0056] where, is the total processing delay of the target active device n, indicates whether the task to be offloaded in the target active device n is offloaded to the edge computing device, is the second processing delay of the target active device n relative to the edge computing device, indicates whether the task to be offloaded in the target active device n is offloaded to the idle device i, is the first transmission delay of the target active device n relative to the idle device i.
[0057] Since the target active device may have multiple tasks to be offloaded and can offload to the idle device and / or the edge computing device. When the target active device offloads tasks to the idle device and the edge computing device simultaneously, it is necessary to consider the first processing delay of the task to be offloaded from the target active device to the idle device and the second processing delay of the task to be offloaded from the target active device to the edge computing device. In this way, the total processing delay of the target active device to all devices to be offloaded is comprehensively considered. Based on the total processing delay, the service satisfaction index is determined, and the objective function is constructed according to the service satisfaction index and solved, so that the task offloading can obtain a better offloading scheme, thereby reducing the total processing delay of the task to be offloaded to the idle device and / or the edge computing device, improving the offloading speed, and further enhancing the task processing speed of the production line.
[0058] In some embodiments, the task information includes the task type; the service satisfaction index includes: the first service satisfaction index, the second service satisfaction index, and the third service satisfaction index; Determining the service satisfaction index according to the task information and the service metrics of the offloading task of the target active device includes: In response to the task type being the first task type, determine the first service satisfaction index according to the total processing delay of the target active device; In response to the task type being the second task type, determine the second service satisfaction index according to the total processing delay of the target active device; In response to the task type being the third task type, determine the third service satisfaction index according to the total processing delay of the target active device.
[0059] Specifically, the task type may include an emergency control task type, a sensor monitoring task type, and a batch data processing task type. Exemplarily, the first task type may be an emergency control task type. When the task type is the first task type, determine the first service satisfaction index according to the total processing delay of the target active device in combination with the first service satisfaction index function; Specifically, determine the first service satisfaction index through the following formula (the following formula can be understood as the first service satisfaction index function):
[0060] where, is the first service satisfaction index, is the upper limit of the function, is the step function, is the total processing delay, and by adjusting the delay threshold at which the task satisfaction drops to zero can be controlled. Among them, emergency control tasks are highly sensitive to delay and require the system to respond within an extremely short time. The SoI function (the first service satisfaction index function) of such tasks exhibits a step nature, and once the specific delay threshold is exceeded, the satisfaction will drop sharply. That is, it can be understood that the SoI function of the emergency control task is .
[0061] The second task type may be a sensor monitoring task type. When the task type is the second task type, determine the second service satisfaction index according to the total processing delay of the target active device in combination with the second service satisfaction index function; Specifically, determine the second service satisfaction index through the following formula (the following formula can be understood as the second service satisfaction index function): ; where, is the second service satisfaction index, is the upper limit of the second service satisfaction index function, is the lower limit of the function, and the parameter is the slope, indicating the degree to which the SoI (the second service satisfaction index function) decreases as the time delay increases, For the total processing delay, is the moment when the SoI drops fastest and can be set according to the actual requirements of the task. Among them, the sensor monitoring task has a moderate sensitivity to delay and allows a delay within a reasonable range. The SoI function (the second service satisfaction index function) of this type of task shows an obvious downward trend, but still maintains a high satisfaction within certain delay time ranges. That is, it can be understood that the SoI function of the sensor monitoring task is .
[0062] The third task type can be the batch data processing task type. When the task type is the third task type, the third service satisfaction index is determined according to the total processing delay of the target active device in combination with the third service satisfaction index function; Specifically, the third service satisfaction index is determined through the following formula (the following formula can be understood as the third service satisfaction index function): ; Among them, is the third service satisfaction index, is the upper limit of the third service satisfaction index function, is the lower limit of the third service satisfaction index function, and the parameter is the slope of the third service satisfaction index function, indicating the degree of decline of the SoI (the third service satisfaction index function) as the time delay increases, is the total processing delay, is the moment when the SoI drops fastest and can be set according to the actual requirements of the task. Among them, batch data processing tasks, such as production data analysis and inventory management, have a higher tolerance for delay. The time utility function of this type of task drops relatively slowly, indicating that the increase in delay has a relatively small impact on satisfaction. That is, it can be understood that the SoI function of the batch data processing task is .
[0063] By determining the service satisfaction index using different service satisfaction index functions for different types of tasks, the objective function can be constructed for multiple different types of tasks and the corresponding service satisfaction indices when constructing the objective function, so as to make the solved offloading scheme better, and then reduce the total processing delay of the tasks to be offloaded to idle devices and / or edge computing, improve the offloading speed, and then improve the task processing speed of the production line.
[0064] Based on the above embodiments, the task offloading optimization model includes an objective function and objective constraint conditions; According to the task information and the service satisfaction index, construct the task offloading optimization model of the task to be offloaded, including: Construct the objective function according to the task type, the first service satisfaction index, the second service satisfaction index, and the third service satisfaction index, where the objective of the objective function is to minimize the total processing delay of the tasks to be offloaded from the target active devices; Construct the objective constraint conditions according to the task information.
[0065] Further, constructing the objective function according to the task type, the first service satisfaction index, the second service satisfaction index, and the third service satisfaction index includes: Construct a first initial function according to the task type and the first service satisfaction index; Construct a second initial function according to the task type and the second service satisfaction index; Construct a third initial function according to the task type and the third service satisfaction index; Construct the objective function according to the first initial function, the second initial function, and / or the third initial function.
[0066] Specifically, when the task type is the first task type and the service satisfaction index is the first service satisfaction index, the first initial function is constructed using the following formula: ; where is the first initial function, is the total number of the first task type, is the first service satisfaction index; When the task type is the second task type and the service satisfaction index is the second service satisfaction index, the second initial function is constructed using the following formula: ; where is the second initial function, is the total number of the second task type, is the second service satisfaction index; When the task type is the third task type and the service satisfaction index is the third service satisfaction index, the third initial function is constructed using the following formula: ; where is the third initial function, is the total number of the third task type, is the third service satisfaction index; Construct the objective function through the following formula: ; In the formula, is the weight of the first task type, is the weight of the second task type, is the weight of the task type, .
[0067] Or construct the objective function through the following formula: ; In the formula, is the weight of the first task type, is the weight of the second task type, is the weight of the task type, , is the first initial function, is the second initial function, is the third initial function.
[0068] By constructing different initial functions according to different task types and constructing the objective function according to different initial functions, it is possible to classify the offloading tasks according to the task type, so that the offloading tasks can select a better solution for task offloading, save task offloading time, and realize that the offloading tasks select the device with the lowest total processing delay for task offloading, thereby improving the processing speed of the offloading tasks.
[0069] In some embodiments, according to the task information, the objective constraint conditions are constructed, including: Construct the first constraint condition through the following formula: ; Wherein, is whether to offload the offloading task of the target active device n to the idle device i or whether to offload the offloading task of the target active device n to the edge computing device; Construct the second constraint condition through the following formula: ; Wherein, is whether to offload the offloading task of the target active device n to the idle device i; Construct the third constraint condition through the following formula: ; Wherein, is the computing resource of the offloading task offloaded to the edge computing device, is whether to offload the offloading task of the target active device n to the edge computing device, is the computing resource of the offloading task n, represents the total computing resource of the edge computing device; Construct the fourth constraint condition through the following formula: ; Among them, is the computing resource allocated to the edge computing device for task n; Combine the first constraint condition, the second constraint condition, the third constraint condition, and the fourth constraint as the target constraint condition.
[0070] The specifically constructed objective function and constraint conditions are as follows:
[0071]
[0072]
[0073]
[0074]
[0075] Specifically, according to the task computing volume, the total task processing delay, the corresponding value of the offloading location of the task to be offloaded, and the confirmation value of whether to offload the task to be offloaded, construct the target constraint condition, which can limit the solution of the objective function, so that the result of the objective function solution is optimal, in order to obtain a better offloading scheme, so as to achieve the lowest processing delay when offloading the task to be offloaded and speed up the processing speed of the task to be offloaded.
[0076] It should be noted that the method of the embodiments of the present application can be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this case of a distributed scenario, one of these multiple devices can only execute one or more steps of the method of the embodiments of the present application, and these multiple devices will interact with each other to complete the described method.
[0077] It should be noted that some embodiments of the present application have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order from that in the above embodiments and still achieve the desired result. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired result. In certain embodiments, multi-task processing and parallel processing are also possible or may be advantageous.
[0078] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides a task offloading device.
[0079] Refer to Figure 4, the described task offloading device includes: An acquisition module 302, configured to acquire task information of a to-be-offloaded task of a target active device, first communication information between an idle device connected to the target active device and the target active device, and second communication information between an edge computing device and the target active device; A first determination module 304, configured to determine a service metric of the offloading task of the target active device according to the task information, the first communication information, and the second communication information; A second determination module 306, configured to determine a service satisfaction index according to the service metric of the offloading task of the target active device; A construction module 308, configured to construct a task offloading optimization model for the to-be-offloaded task according to the task information and the service satisfaction index; A solving module 310, configured to solve the task offloading optimization model to obtain an offloading solution for the to-be-offloaded task; An offloading module 312, configured to offload the to-be-offloaded task to the idle device or the edge computing device according to the offloading solution.
[0080] For the convenience of description, when describing the above device, it is divided into various modules according to functions and described separately. Of course, when implementing the present application, the functions of each module can be implemented in one or more software and / or hardware.
[0081] The device in the above embodiment is used to implement the corresponding task offloading method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated herein.
[0082] Based on the same inventive concept, corresponding to the method in any of the above embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the task offloading method described in any of the above embodiments.
[0083] Figure 5 FIG. shows a more specific schematic hardware structure diagram of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.
[0084] The processor 1010 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0085] The memory 1020 can be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0086] The input / output interface 1030 is used to connect to the input / output module to achieve information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Among them, the input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0087] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to achieve communication interaction between this device and other devices. Among them, the communication module can achieve communication through a wired method (such as USB, network cable, etc.) or can also achieve communication through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.).
[0088] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0089] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, this device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solutions of the embodiments of this specification and does not necessarily include all the components shown in the figure.
[0090] The electronic device of the above embodiment is used to implement the corresponding task offloading method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated herein.
[0091] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application further provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute a task offloading method as described in any of the foregoing embodiments.
[0092] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0093] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute a task offloading method as described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated herein.
[0094] It can be understood that before using the technical solutions of the various embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner and the user's authorization will be obtained.
[0095] For example, in response to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that executes the technical solution of the present disclosure according to the prompt message.
[0096] As an optional but non-limiting implementation manner, in response to receiving an active request from a user, the manner of sending a prompt message to the user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0097] It can be understood that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0098] Those of ordinary skill in the art should understand that: The discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above. For the sake of brevity, they are not provided in detail.
[0099] In addition, for the sake of simplicity of description and discussion, and in order not to make the embodiments of the present application difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. In addition, the devices may be shown in block diagram form in order not to make the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation manner of these block diagram devices are highly dependent on the platform on which the embodiments of the present application will be implemented (that is, these details should be completely within the understanding of those skilled in the art). In the case where specific details (such as circuits) are set forth to describe the exemplary embodiments of the present application, it will be apparent to those skilled in the art that the embodiments of the present application can be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0100] Although the present application has been described in connection with specific embodiments of the present application, many substitutions, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0101] The embodiments of the present application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the embodiments of the present application shall be included within the protection scope of the present application.
Claims
1. A task offloading method, characterized in that: include: Acquire task information of a task to be uninstalled of a target active device, first communication information between an idle device connected to the target active device and the target active device, and second communication information between an edge computing device and the target active device; Determining a service indicator of the offloading task of the target active device according to the task information, the first communication information, and the second communication information; Determine a service satisfaction index based on the service indicators; Constructing a task offloading optimization model for the task to be offloaded according to the task information and the service satisfaction index; Solving the task offloading optimization model to obtain an offloading solution for the task to be offloaded; According to the offloading scheme, the task to be offloaded is offloaded to the idle device or the edge computing device.
2. The method according to claim 1, characterized in that The task information includes task computing amount, task transmission amount and computing resources, the first communication information includes a first transmission rate between the target active device and the idle device, the second communication information includes a second transmission rate between the target active device and the edge computing device, and the service indicator of the offload task includes the total processing delay of the target active device to be offloaded task; The determining, according to the task information, the first communication information, and the second communication information, a service indicator of the offloading task of the target active device includes: The total processing delay of the task to be offloaded from the target active device is determined according to the task calculation amount, the task transmission amount, the computing resources, the first transmission rate, and the second transmission rate.
3. The method according to claim 2, characterized in that The computing resources include a first computing resource and a second computing resource; The determining, according to the task calculation amount, the task transmission amount, the computing resources, the first transmission rate, and the second transmission rate, a total processing delay of the task to be offloaded by the target active device includes: determining a first processing delay of the target active device relative to the idle device according to the task computing amount, the task transmission amount, the first computing resource and the first transmission rate; determining a second processing delay of the target active device relative to the edge computing device according to the task computing amount, the task transmission amount, the second computing resource, and the second transmission rate; The total processing delay of the task to be offloaded from the target active device is determined according to the first processing delay and the second processing delay.
4. The method according to claim 3, characterized in that The first processing delay includes a first transmission delay and a first calculation delay; The determining, according to the task computing amount, the task transmission amount, the first computing resource, and the first transmission rate, a first processing delay of the target active device relative to the idle device includes: Determining the first transmission delay according to the task transmission amount and the first transmission rate; Determining the first computing delay according to the task computing amount and the first computing resource; A first processing delay of the target active device relative to the idle device is determined according to the first transmission delay and the first calculation delay.
5. The method according to claim 3, characterized in that: The second processing delay includes a second transmission delay and a second calculation delay; The determining, according to the task computing amount, the task transmission amount, the second computing resource, and the second transmission rate, a second processing delay of the target active device relative to the edge computing device includes: determining the second transmission delay according to the task transmission amount and the second transmission rate; Determining the second computing delay according to the task computing amount and the second computing resource; According to the second transmission delay and the second computing delay, a second processing delay of the target active device relative to the edge computing device is determined.
6. The method according to claim 1, characterized in that The task information includes a task type; The service satisfaction index includes: a first service satisfaction index, a second service satisfaction index and a third service satisfaction index; Determining a service satisfaction index according to the task information and the service indicator of the offloading task of the target active device includes: In response to the task type being a first task type, determining the first service satisfaction index according to a total processing delay of the target active device; In response to the task type being a second task type, determining the second service satisfaction index according to the total processing delay of the target active device; In response to the task type being the third task type, determining the third service satisfaction index according to the total processing delay of the target active device.
7. The method according to claim 6, characterized in that The task offloading optimization model includes an objective function and objective constraints; According to the task information and the service satisfaction index, a task offloading optimization model of the task to be offloaded is constructed, including: Constructing the objective function according to the task type, the first service satisfaction index, the second service satisfaction index and the third service satisfaction index, wherein the objective function aims to minimize the total processing delay of the task to be offloaded from the target active device; The target constraint condition is constructed according to the task information.
8. The method according to claim 7, characterized in that Constructing the objective function according to the task type, the first service satisfaction index, the second service satisfaction index, and the third service satisfaction index includes: Constructing a first initial function according to the task type and the first service satisfaction index; constructing a second initial function according to the task type and the second service satisfaction index; constructing a third initial function according to the task type and the third service satisfaction index; The objective function is constructed according to the first initial function, the second initial function and / or the third initial function.
9. The method according to claim 7, characterized in that: According to the task information, the target constraint condition is constructed, including: The first constraint is constructed by the following formula: ; in, Whether to offload the to-be-offloaded tasks of the target active device n to the idle device i or whether to offload the to-be-offloaded tasks of the target active device n to the edge computing device; The second constraint is constructed using the following formula: ; in, Whether to offload the to-be-offloaded task of the target active device n to the idle device i; The third constraint is constructed by the following formula: ; in, The computing resources for the tasks to be offloaded to the edge computing device. Whether to offload the task to be offloaded of the target active device n to the edge computing device, is the computing resource of task n to be offloaded, Represents the total computing resources of edge computing devices; The fourth constraint is constructed by the following formula: ; in, Allocate computing resources in the edge computing device to task n; The first constraint condition, the second constraint condition, the third constraint condition and the fourth constraint condition are combined as the target constraint condition.
10. A task offloading device, characterized in that: include: an acquisition module, configured to acquire task information of a task to be uninstalled of a target active device, first communication information between an idle device connected to the target active device and the target active device, and second communication information between an edge computing device and the target active device; A first determination module is configured to determine a service indicator of the offloading task of the target active device according to the task information, the first communication information and the second communication information; A second determination module is configured to determine a service satisfaction index according to a service indicator of the offloading task of the target active device; A construction module, configured to construct a task offloading optimization model for the task to be offloaded according to the task information and the service satisfaction index; A solution module is configured to solve the task offloading optimization model to obtain an offloading solution for the task to be offloaded; The unloading module is configured to unload the task to be unloaded to the idle device or the edge computing device according to the unloading scheme.