Task unloading method and device and storage medium
By obtaining task information and location information in the terminal device and determining the target network device based on this information, the problem of task unloading failure caused by terminal device movement characteristics is solved, and the success rate and delay performance of task unloading are improved.
Patent Information
- Application Number
- CN202510228950.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-13
AI Technical Summary
In actual industrial scenarios, the movement characteristics of the terminal device cause frequent task unloading to fail and the delay requirements cannot be met.
By acquiring task information and location information of the pending tasks of the terminal device, the target network device is determined based on the location information and mobility of the terminal device. The target network device is configured with an edge server, and the pending tasks are assigned to the terminal device and the edge server for processing.
It improves the success rate of task unloading of terminal devices, ensures timely completion of tasks, and meets the delay requirements.
Smart Images

Figure CN120144208A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular, to a task offloading method, apparatus, and storage medium. Background Art
[0002] With the continuous progress of information technology, the amount of data that terminal devices need to process has increased sharply. However, the computing power of most terminal devices is limited. Relying solely on the local computing resources of terminal devices to execute all tasks will result in significant execution delays and cannot meet the delay requirements.
[0003] Currently, through mobile edge computing (MEC) technology, tasks with large amounts of computation on terminals are assigned to edge servers for processing, effectively alleviating the defect of scarce computing resources of terminal devices and reducing the task execution delay. However, in actual industrial scenarios, some terminals have mobility characteristics, which will affect the access and handover processes between terminal devices and base stations, thereby introducing additional delays or causing connection failures between terminal devices and base stations, and further resulting in frequent failures of task offloading of terminal devices. Summary of the Invention
[0004] The present application provides a task offloading method, apparatus, and storage medium, which can improve the success rate of task offloading of terminal devices.
[0005] To achieve the above object, the present application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a task offloading method, which includes: obtaining task information of a to-be-processed task of a terminal device and location information of the terminal device; determining a target network device according to the location information and mobility of the terminal device, where the target network device is configured with an edge server; and allocating the to-be-processed task to the terminal device and the edge server for processing.
[0007] In a possible implementation, the task information includes a task deadline; wherein, the processing duration of the terminal device is determined according to the computing speed and computing frequency of the terminal device; and the processing duration of the edge server is determined according to the computing speed of the edge server, the computing resources allocated by the edge server to the to-be-processed task, and the data transmission rate between the terminal device and the target network device.
[0008] In a possible implementation, the data transmission rate between the terminal device and the target network device is determined according to the channel bandwidth of the edge server, the transmission power of the terminal device, the channel gain between the terminal device and the target network device, and the distance between the terminal device and the target network device.
[0009] In a possible implementation, the data transmission rate between the terminal device and the target network device satisfies the following formula:
[0010]
[0011] where W represents the channel bandwidth of the edge server, P i,trans represents the transmission power of the terminal device, h i represents the channel gain between the terminal device and the target network device, dis ij represents the distance between the terminal device and the target network device, β represents the path loss coefficient, N 0 represents the Gaussian white noise power, and I represents the interference power.
[0012] In a possible implementation, the number of terminal devices is multiple, and the method further includes: for each terminal device, determining the task processing duration corresponding to each terminal device, where the task processing duration is the maximum duration for the edge server to process the pending task of the terminal device; based on the task processing duration corresponding to the terminal device, determining the minimum computing resources required for the edge server to process the pending task of the terminal device.
[0013] In a possible implementation, the method further includes: if the sum of the minimum computing resources required for the edge server to process the pending tasks of each terminal device is less than or equal to the total computing resources of the edge server, determining that the edge server can process the pending tasks of the multiple allocated terminal devices; if the sum of the minimum computing resources required to process the pending tasks of each terminal device is greater than the total computing resources of the edge server, determining to process the pending tasks of the multiple allocated terminal devices according to the priorities of the terminal devices.
[0014] In a possible implementation, allocating the pending task to the terminal device and the edge server for processing includes: determining an allocation coefficient according to the task information of the pending task and the allocation coefficient decision algorithm; based on the allocation coefficient, allocating the pending task to the terminal device and the edge server for processing.
[0015] In a second aspect, the present application provides a task offloading device, and the device includes: a communication unit and a processing unit; the communication unit is configured to obtain the task information of the pending task of the terminal device and the location information of the terminal device; the processing unit is configured to determine a target network device according to the location information and mobility of the terminal device, where the target network device is configured with an edge server; the processing unit is further configured to allocate the pending task to the terminal device and the edge server for processing.
[0016] In a possible implementation, the task information includes a task deadline; wherein, the processing duration of the terminal device is determined according to the computing speed and computing frequency of the terminal device; the processing duration of the edge server is determined according to the computing speed of the edge server, the computing resources allocated by the edge server to the task to be processed, and the data transmission rate between the terminal device and the target network device.
[0017] In a possible implementation, the data transmission rate between the terminal device and the target network device is determined according to the channel bandwidth of the edge server, the transmission power of the terminal device, the channel gain between the terminal device and the target network device, and the distance between the terminal device and the target network device.
[0018] In a possible implementation, the data transmission rate between the terminal device and the target network device satisfies the following formula:
[0019]
[0020] wherein, W represents the channel bandwidth of the edge server, P i,trans represents the transmission power of the terminal device, h i represents the channel gain between the terminal device and the target network device, dis ij represents the distance between the terminal device and the target network device, β represents the path loss coefficient, N 0 represents the Gaussian white noise power, and I represents the interference power.
[0021] In a possible implementation, the number of terminal devices is multiple. For each terminal device, the processing unit is further configured to determine the task processing duration corresponding to each terminal device, where the task processing duration is the maximum duration for the edge server to process the task to be processed by the terminal device; the processing unit is further configured to determine the minimum computing resources required for the edge server to process the task to be processed by the terminal device based on the task processing duration corresponding to the terminal device.
[0022] In a possible implementation, if the sum of the minimum computing resources required for the edge server to process the tasks to be processed by each terminal device is less than or equal to the total computing resources of the edge server, the processing unit is further configured to determine that the edge server can process the tasks to be processed by the multiple allocated terminal devices; if the sum of the minimum computing resources required for processing the tasks to be processed by each terminal device is greater than the total computing resources of the edge server, the processing unit is further configured to determine to process the tasks to be processed by the multiple allocated terminal devices according to the priorities of the terminal devices.
[0023] In a possible implementation, the processing unit is further configured to determine an allocation coefficient according to the task information of the task to be processed and the allocation coefficient decision algorithm; the processing unit is further configured to allocate the task to be processed to a terminal device and an edge server for processing based on the allocation coefficient.
[0024] In a third aspect, the present application provides a task offloading device, which includes: a processor and a communication interface; the communication interface is coupled to the processor, and the processor is configured to run a computer program or instruction to implement the task offloading method described in the first aspect and any possible implementation manner of the first aspect.
[0025] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are run on a terminal, the terminal is caused to execute the task offloading method described in the first aspect and any possible implementation manner of the first aspect.
[0026] In a fifth aspect, the present application provides a computer program product containing instructions. When the computer program product is run on a task offloading device, the task offloading device is caused to execute the task offloading method described in the first aspect and any possible implementation manner of the first aspect.
[0027] In a sixth aspect, the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a computer program or instruction to implement the task offloading method described in the first aspect and any possible implementation manner of the first aspect.
[0028] Specifically, the chip provided in the present application further includes a memory for storing a computer program or instruction.
[0029] The above technical solutions at least bring the following beneficial effects: obtaining the task information of the task to be processed of the terminal device and the location information of the terminal device, determining the target network device according to the location information and mobility of the terminal device, and allocating the task to be processed to the terminal device and the edge server configured by the target network device for processing. Since the target network device is determined according to the location information and mobility of the terminal device, the connection success rate between the terminal device and the target network device is relatively high, and the success rate of task offloading is relatively high. That is to say, the task offloading method provided by the embodiments of the present application takes into account the mobile characteristics of the terminal device, and thus can improve the success rate of task offloading of the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the composition of a task offloading device provided by an embodiment of the present application;
[0031] Figure 2Flowchart of a task offloading method provided by an embodiment of the present application;
[0032] Figure 3 Flowchart of another task offloading method provided by an embodiment of the present application;
[0033] Figure 4 Flowchart of another task offloading method provided by an embodiment of the present application;
[0034] Figure 5 Schematic diagram of modules of a task offloading device provided by an embodiment of the present application;
[0035] Figure 6 Schematic diagram of a communication network structure provided by an embodiment of the present application;
[0036] Figure 7 Schematic diagram of a reward value curve provided by an embodiment of the present application;
[0037] Figure 8 Schematic diagram of a task execution success rate provided by an embodiment of the present application;
[0038] Figure 9 Schematic diagram of another reward value curve provided by an embodiment of the present application;
[0039] Figure 10 Schematic diagram of another task execution success rate provided by an embodiment of the present application;
[0040] Figure 11 Schematic diagram of the structure of a task offloading device provided by an embodiment of the present application. Detailed implementation manners
[0041] The task offloading method, device, and storage medium provided by an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0042] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone.
[0043] The terms "first" and "second" in the specification and drawings of the present application are used to distinguish different objects or different processes for the same object, rather than to describe the specific order of the objects.
[0044] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally further include other steps or units not listed, or may optionally further include other steps or units inherent to these processes, methods, products, or devices.
[0045] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0046] In the description of the present application, unless otherwise specified, the meaning of "a plurality of" refers to two or more.
[0047] With the continuous progress of information technology, the amount of data that terminal devices need to process has increased sharply. In industrial application scenarios, the number of compute-intensive and time-sensitive tasks has also increased significantly. However, due to the limited computing power of most terminal devices, if all tasks are executed only relying on the local computing resources of the terminal devices, it will result in significant execution delays and cannot meet the delay requirements.
[0048] Currently, by deploying computing resources at the network edge through MEC technology, the defect of terminal devices in lacking computing resources has been effectively alleviated. MEC technology has become a common means to alleviate the problem of insufficient computing resources of terminal devices in current industrial scenarios.
[0049] However, the existing task offloading schemes do not consider the mobility characteristics of terminal devices. However, in the application of actual industrial scenarios, the physical locations of terminal devices are not fixed. Some terminal devices have mobility characteristics. For example, intelligent inspection robots, material transportation trolleys, unmanned delivery trolleys, etc. The physical locations of these terminal devices will change continuously over time. This mobility characteristic will affect the access and handover processes between terminal devices and base stations, thereby introducing additional delays or causing connection failures between terminal devices and base stations, and further resulting in frequent task offloading failures of terminal devices.
[0050] In view of this, an embodiment of the present application provides a task offloading method, which includes: obtaining task information of a to-be-processed task of a terminal device and location information of the terminal device, determining a target network device according to the location information and mobility of the terminal device, and allocating the to-be-processed task to an edge server configured by the terminal device and the target network device for processing. Since the target network device is determined according to the location information and mobility of the terminal device, the connection success rate between the terminal device and the target network device is relatively high, and the success rate of task offloading is relatively high. That is to say, the task offloading method provided by the embodiment of the present application takes into account the mobile characteristics of the terminal device, and thus can improve the success rate of task offloading of the terminal device.
[0051] Exemplarily, Figure 1 is a schematic diagram of the composition of a task offloading device 10 provided by an embodiment of the present application. As Figure 1 shown, the task offloading device 10 may include a processor 101 and a bus 102.
[0052] Further, the task offloading device 10 may further include a communication interface 103 and a memory 104. Among them, the processor 101, the memory 104, and the communication interface 103 may be connected through the bus 102.
[0053] Among them, the processor 101 is a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 101 may also be other devices with processing functions, such as circuits, devices, or software modules, without limitation.
[0054] The bus 102 is used to transmit information between the components included in the task offloading device 10.
[0055] The communication interface 103 is used to communicate with other devices or other communication networks. The other communication network may be an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 103 may be a module, a circuit, a communication interface, or any device capable of implementing communication.
[0056] The memory 104 is used to store instructions. Among them, the instructions may be computer programs.
[0057] Among them, the memory 104 can be a read-only memory (ROM) or other types of static storage devices that can store static information and / or instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and / or instructions. It can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, without limitation.
[0058] It should be noted that the memory 104 can exist independently of the processor 101 or be integrated with the processor 101. The memory 104 can be used to store instructions, program codes, or some data, etc. The memory 104 can be located inside the task offloading device 10 or outside the task offloading device 10, without limitation. The processor 101 is used to execute the instructions stored in the memory 104 to implement the task offloading method provided in the following embodiments of the present application.
[0059] In one example, the processor 101 can include one or more CPUs. For example, CPU0 and CPU1 (not shown in the figure).
[0060] As an optional implementation, the task offloading device 10 includes multiple processors.
[0061] As an optional implementation, the task offloading device 10 further includes an output device and an input device. Exemplarily, the input device is a device such as a keyboard, a mouse, a microphone, or a joystick, and the output device is a device such as a display screen or a speaker.
[0062] It should be noted that the task offloading device 10 can be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system, or a device with a Figure 1 similar structure. In addition, Figure 1 the shown component structure does not constitute a limitation on each device in the Figure 1 . Except for the Figure 1 shown components, Figure 1 each device in the
[0063] In the embodiments of the present application, the chip system may be composed of chips, or may include chips and other discrete devices.
[0064] In addition, actions, terms, etc. involved among the embodiments of the present application can be referred to each other without limitation. The message names or parameter names in the messages exchanged between devices in the embodiments of the present application are only examples, and other names can also be used in specific implementations without limitation.
[0065] The task offloading method provided by the embodiments of the present application will be described below with reference to the accompanying drawings. Among them, actions, terms, etc. involved among the embodiments of the present application can be referred to each other without limitation. The message names or parameter names in the messages exchanged between devices in the embodiments of the present application are only examples, and other names can also be used in specific implementations without limitation. The actions involved in the embodiments of the present application are only examples, and other names can also be used in specific implementations. For example, "included in" in the embodiments of the present application can also be replaced by "carried on" or "carried in", etc.
[0066] As Figure 2 shown, the embodiments of the present application propose a task offloading method, which includes:
[0067] S201. Obtain the task information of the task to be processed by the terminal device and the location information of the terminal device.
[0068] Among them, the terminal device includes a fixed terminal device and a mobile terminal device. The fixed terminal device does not have mobility, and the mobile terminal device has mobility.
[0069] In a possible implementation manner, taking a preset time slot as a unit time period, obtain the task information of the task to be processed by the terminal device in each time slot and the location information of the terminal device.
[0070] Exemplarily, the task information of the task to be processed by the above terminal device may include the task volume and the task deadline. For example, the task information of the task to be processed can be expressed as D = {d, ddl}. Where d represents the task volume, and the unit is bits. Ddl represents the task deadline. In the t-th time slot, the task information of the task to be processed by the terminal device can be expressed as d t and ddl t .
[0071] It should be noted that in each time slot, the terminal device will generate a task to be processed with a preset probability. The generation of the task to be processed follows a Poisson distribution, and a random task deadline less than 100 milliseconds is assigned to the task to be processed.
[0072] S202. Determine the target network device according to the location information and mobility of the terminal device.
[0073] Among them, the target network device is configured with an edge server.
[0074] In a possible implementation, when the terminal device is a fixed terminal device (i.e., it does not have mobility), according to the location information of the terminal device, determine which network device's coverage area the location where the terminal device is located belongs to, and determine the network device as the target network device. When the terminal device is a mobile terminal device (i.e., it has mobility), according to the location information of the terminal device, determine the network device closest to the terminal device, and determine the closest network device as the target network device.
[0075] Exemplarily, taking the mobile terminal device as an example, assume that the mobile terminal device only makes horizontal movement when moving. The location information of the mobile terminal device i at the initial moment can be expressed as (x i , y i ). At the t-th time slot, the location of the mobile terminal device i is updated to Among them, represents the abscissa of the mobile terminal device i at the end of the previous time slot, v represents the speed of the mobile terminal device i at the t-th time slot, and Δt represents the duration of the time slot. The location information of the network device can be expressed as (X Bj , Y Bj ), j = 0, 1, 2..., j represents the number of the network device. Calculate the distance between the mobile terminal and each network device and determine the network device closest to the mobile terminal device i Then the network device j is the target network device corresponding to the mobile terminal device i in the current time slot, and the mobile terminal device i is within the coverage area of the target network device j.
[0076] Optionally, the above network device can be a base station, and the base station is configured with an edge server.
[0077] S203. Allocate the task to be processed to the terminal device and the edge server for processing.
[0078] In a possible implementation, the task information of the task to be processed is expressed as D = {d, ddl}, and the task to be processed is allocated to the terminal device for local processing at a ratio of α, and allocated to the edge server for processing at a ratio of 1 - α. Among them, α can be called the allocation coefficient. Specifically, the processing flow of the task to be processed includes the following three parts.
[0079] 1-1. The terminal device processes part of the task to be processed locally
[0080] Specifically, at the t-th time slot, the amount of task processed locally by the terminal device i can be expressed as It can be obtained according to the following formula 1.
[0081]
[0082] Among them, α represents the proportion of the task to be processed assigned to the terminal device for processing. represents the amount of the task to be processed.
[0083] The processing duration of the terminal device i for local processing can be expressed as It can be determined according to the computing speed and computing frequency of the terminal device i. It can satisfy the following formula 2.
[0084]
[0085] Among them, represents the amount of the task processed locally by the terminal device i. c i represents the number of CPU cycles required for the terminal device i to calculate 1 bit of the task amount (i.e., the computing speed). f i local represents the computing frequency of the terminal device i, with the unit of CPU cycles per second.
[0086] The energy consumption of the terminal device i for local processing can be expressed as It can be obtained according to the following formula 3.
[0087]
[0088] Among them, κ represents the effective energy coefficient. f i local represents the computing frequency of the terminal device i. represents the local energy consumption calculation factor. represents the amount of the task processed locally by the terminal device i. c i represents the number of CPU cycles required for the terminal device i to calculate 1 bit of the task amount.
[0089] 1-2. The terminal device uploads part of the tasks to be processed to the edge server
[0090] Specifically, in the t-th time slot, the amount of the task uploaded by the terminal device i to the edge server for processing can be expressed as It can be obtained according to the following formula 4.
[0091]
[0092] Among them, 1-α represents the proportion of the task to be processed assigned to the edge server for processing. represents the amount of the task to be processed.
[0093] It should be noted that the implementation process of the terminal device i uploading some tasks to be processed to the edge server can be as follows: The terminal device i sends an offloading request to the corresponding target network device, and the offloading request includes the task offloading amount and the task deadline. After receiving the offloading request, the target network device sends the offloading request to the configured edge server.
[0094] The transmission duration for the terminal device i to upload the tasks assigned to the edge server for processing to the edge server can be expressed as It can be obtained based on the amount of tasks assigned to the edge server for processing (i.e., the second task amount) and the data transmission rate between the terminal device and the corresponding target network device. It can satisfy the following formula 5.
[0095]
[0096] Among them, represents the amount of tasks processed by the edge server. r ij represents the data transmission rate between the terminal device i and the corresponding target network device.
[0097] Furthermore, the data transmission rate r between the above-mentioned terminal device i and the corresponding target network device ij can be obtained based on the channel bandwidth of the edge server, the transmission power of the terminal device i, the channel gain between the terminal device i and the target network device, and the distance between the terminal device i and the target network device. r ij It can satisfy the following formula 6.
[0098]
[0099] Among them, W represents the channel bandwidth of the edge server. represents the transmission power of the terminal device i in the t-th time slot. h i represents the channel gain between the terminal device i and the target network device. dis ij represents the distance between the terminal device i and the target network device. β represents the path loss coefficient. N 0 represents the Gaussian white noise power. I represents the interference power.
[0100] Optionally, the above interference power I can be obtained according to the following formula 7.
[0101]
[0102] Among them, x can take values of 0 or 1, which is used to determine whether the terminal device is in an area with interference. P represents the transmission power of the terminal device. H represents the channel state from the terminal device to the target network device.
[0103] The transmission energy consumption of the terminal device i for uploading some tasks to be processed to the edge server can be expressed as It can be obtained according to the following formula 8.
[0104]
[0105] Wherein, represents the transmission power of the terminal device i in the t-th time slot. represents the transmission duration for the terminal device i to upload the tasks assigned to the edge server for processing to the edge server.
[0106] 1-3. The edge server processes the received partial tasks to be processed
[0107] Specifically, the edge server calculates the received partial tasks to be processed and returns the calculation results to the terminal device.
[0108] It should be noted that the processing duration of the edge server includes the transmission duration for the terminal device to upload the partial tasks to be processed to the edge server and the duration for the edge server to process the received partial tasks to be processed.
[0109] In the task offloading method provided in this application, the task information of the tasks to be processed of the terminal device and the location information of the terminal device are obtained, the target network device is determined according to the location information and mobility of the terminal device, and the tasks to be processed are assigned to the edge server configured by the terminal device and the target network device for processing. Since the target network device is determined according to the location information and mobility of the terminal device, the connection success rate between the terminal device and the target network device is relatively high, and the success rate of task offloading is relatively high. That is to say, the task offloading method provided in the embodiments of this application considers the mobile characteristics of the terminal device, and thus can improve the success rate of task offloading of the terminal device.
[0110] Optionally, if the number of terminal devices is multiple, after S203, the edge server can allocate computing resources for the tasks to be processed uploaded by each terminal device. In view of this, as Figure 3 shown, the task offloading method described in the embodiments of this application may further include the following steps.
[0111] S301. For each terminal device, determine the task processing duration corresponding to each terminal device.
[0112] Wherein, the task processing duration is the maximum duration for the edge server to process the tasks to be processed of the terminal device.
[0113] Specifically, the maximum duration for the edge server to process the tasks to be processed of the terminal device i can be expressed as It can be obtained according to the following formula 9.
[0114]
[0115] Among them, represents the task deadline delay of the task to be processed by the terminal device i. represents the transmission duration for the terminal device i to upload the task assigned to the edge server for processing to the edge server.
[0116] S302. Determine the minimum computing resources required for the edge server to process the task to be processed by the terminal device based on the task processing duration corresponding to the terminal device.
[0117] Specifically, the minimum computing resources required for the edge server to process the task to be processed by the terminal device i can be expressed as and can be obtained according to the following formula 10.
[0118]
[0119] Among them, represents the amount of task uploaded by the terminal device i to the edge server for processing. C represents the number of CPU cycles required for the edge server to calculate 1 bit of task.
[0120] Furthermore, within each time slot, the edge server allocates computing resources for the tasks of each terminal device according to the minimum computing resources required to process the tasks of each terminal device.
[0121] If the sum of the minimum computing resources required for the edge server to process the tasks to be processed by each terminal device is less than or equal to the total computing resources of the edge server, it is expressed by the formula where f n,j represents the total computing resources of the edge server configured by the target network device numbered j, then it is determined that the edge server can process the tasks to be processed by the allocated multiple terminal devices (i.e., task offloading is successful). The computing resources allocated by the edge server for the task to be processed by the terminal device i can be expressed as f i off , f i off and can be obtained according to the following formula 11.
[0122]
[0123] Among them, represents the minimum computing resources required for the edge server to process the task to be processed by the terminal device i. represents the sum of the minimum computing resources required for the edge server to process the tasks to be processed by each terminal device. f n,j represents the total computing resources of the edge server.
[0124] If the sum of the minimum computing resources required for the edge server to process the pending tasks of each terminal device is less than or equal to the total computing resources of the edge server, it is expressed by the formula Then the task offloading fails, and the edge server determines to process the pending tasks of the allocated multiple terminal devices according to the priorities of the terminal devices.
[0125] Optionally, in In this case, the edge server can determine the priority of allocating computing resources for the tasks of each terminal device according to the task deadline delay of each terminal device. Among them, the task with the earliest deadline delay has the highest priority. According to the order from the highest priority to the lowest priority, the offloading tasks of all terminal devices are determined as task queue M. The edge server allocates computing resources for the tasks of each terminal device in turn according to the order of task queue M, and processes the tasks according to the computing resources allocated to the corresponding tasks.
[0126] Furthermore, in In this case, the total computing resources of the edge server in the current time slot cannot allocate computing resources for the tasks of all terminal devices. In this case, the edge server can still allocate computing resources for the tasks of each terminal device in turn according to the task deadline delay of each terminal device. Record the tasks of the terminal devices that do not receive computing resources, and allocate computing resources for the tasks of the terminal devices that do not receive computing resources when the computing resources of the edge server are released.
[0127] In one embodiment, as Figure 4 shown, the above S203 can be specifically determined by the following S401 to S402.
[0128] S401. Determine the allocation coefficient according to the task information of the pending task and the allocation coefficient decision algorithm.
[0129] Among them, the allocation coefficient refers to the proportion of the pending task processed locally by the terminal device, and the allocation coefficient can be expressed as α.
[0130] In a possible implementation, obtain the status information of the current time slot, input the status information into the allocation coefficient decision algorithm, and obtain the allocation coefficient α of terminal device i.
[0131] Optionally, the above allocation coefficient decision algorithm can be determined based on the twin delayed deep deterministic policy gradient algorithm (TD3). The TD3 algorithm includes a total of 6 network structures, namely 1 Actor network, 2 Critic networks, 1 target Actor network and 2 target Critic networks.
[0132] Among them, the Actor network includes a multi-layer neural network, which is used to extract features from the input state and output actions. The Critic network is used to evaluate the value of the actions output by the Actor network. In the TD3 algorithm, there are two Critic networks (i.e., Critic1 network and Critic2 network), and the Critic1 network and the Critic2 network have the same network structure but different parameters. The Critic1 network and the Critic2 network calculate the evaluation values respectively, and take the smaller value of the two as the final evaluation value to suppress the problem of network overestimation. The target Actor network and the target Critic network are the "target versions" of the Actor network and the Critic network, which are used to calculate the target values. During the training process, the target network will update its parameters regularly or according to a preset strategy to maintain consistency with the original network, but the update speed is slower to achieve a stable learning process.
[0133] It should be noted that the distribution coefficients of each terminal device within the coverage range of each network device are obtained by adopting the method of centralized training and distributed decision-making. Specifically, each network device is regarded as an independent agent, and these agents do not interfere with each other during operation and can make independent decisions based on the actual situation of the terminal devices within their own coverage ranges. Among them, the centralized training stage is responsible for optimizing the decision-making model of the agents. The distributed decision-making stage enables each agent to decide on appropriate distribution coefficients for the tasks to be processed by the terminal devices according to the actual state.
[0134] Furthermore, since the TD3 algorithm optimizes in the direction of increasing the reward value, taking the negative value of the energy consumption as the reward value can enable the agent to optimize in the direction of reducing the energy consumption. Among them, the total energy consumption includes the energy consumption of the tasks to be processed by the terminal devices during local computing, the energy consumption of transmitting the tasks to be processed to the edge server, and the energy consumption of the tasks to be processed during computing on the edge server.
[0135] Optionally, since the energy consumption of the tasks to be processed during computing on the edge server is almost negligible compared to the energy consumption of the tasks to be processed by the terminal devices during local computing and the energy consumption of transmitting the tasks to be processed to the edge server, the total energy consumption only considers the sum of the energy consumption of the tasks to be processed by the terminal devices during local computing and the energy consumption of transmitting the tasks to be processed to the edge server. The total energy consumption can be expressed as It can be obtained according to the following formula 12.
[0136]
[0137] Among them, represents the energy consumption of terminal device i during local processing. Indicates the transmission energy consumption of the terminal device i uploading part of the tasks to be processed to the edge server.
[0138] S402. Based on the allocation coefficient, allocate the tasks to be processed to the terminal device and the edge server for processing.
[0139] In a possible implementation, according to the allocation coefficient α, allocate the tasks to be processed to the terminal device i for processing at a ratio of α, and allocate the tasks to be processed to the edge server at a ratio of (1 - α).
[0140] For the tasks to be processed of each terminal device, if the tasks to be processed are completed within the task deadline, a reward value is given If the tasks to be processed are not completed within the task deadline, a reward value r is given i =-20.
[0141] Exemplarily, the process of dataset storage through the allocation coefficient decision algorithm may include the following steps.
[0142] Step 1. Obtain the state information of each agent.
[0143] Specifically, take each base station as an agent, and the state information of the agent can be represented as S t , S t ={s 0,t , s 1,t , ……, s i,t}. Among them, s i,t represents the state of the i-th terminal device within the coverage of the base station at time slot t, Among them, f n,j,t represents the total computing resources of the edge server configured by the base station in the current time slot, represents the task volume of the tasks to be processed of the i-th terminal device in the current time slot, represents the task deadline of the tasks to be processed of the i-th terminal device in the current time slot, h i,t represents the channel gain between the i-th terminal device and the base station, dis ij represents the distance between the i-th terminal device and the base station.
[0144] Step 2. Input the state information S t into the Actor network of the allocation coefficient decision algorithm to obtain the action information A t .
[0145] Among them, the action information A t represents the set of allocation coefficients of each terminal device within the coverage of the base station.
[0146] Step 3. The terminal device makes a decision based on the obtained action information At perform task offloading according to the distribution coefficient (i.e., the partition coefficient), and give the base station to perform action A according to the actual execution energy consumption t and obtain the reward value R t 。
[0147] Among them, the reward value R t is the sum of the reward values obtained after each terminal device performs an action, that is, R t = ∑r i 。
[0148] Step 4: The Critic network scores A t and gives the Q value
[0149] It can be understood that the Critic network evaluates the quality of the partition coefficient to help evaluate the action effect of each terminal device within the coverage of each base station
[0150] Step 5: Update the state information of the agent to obtain the state information S of the agent in the next time slot t+1 and obtain a set of quadruple data (S t , A t , R t , S t+1 ), and store the quadruple data in the experience cache pool corresponding to the agent
[0151] It can be understood that storing the data in the experience cache pool can facilitate the subsequent training of the partition coefficient decision algorithm using the data in the experience cache pool
[0152] Step 6: Repeat the above steps 1 to 5 to obtain multiple sets of quadruple data
[0153] Exemplarily, the training process of the partition coefficient decision algorithm may include the following steps
[0154] Step 7: Agent j randomly extracts a set of quadruple data (S t , A t , R t , S t+1 ) from the corresponding experience cache pool
[0155] Step 8: Input the state information S t+1 into the Actor network to predict the action information A t+1 in the next time slot
[0156] Among them, A t+1 = π(θ, S t , S t+1) + ζ, where ζ ~ clip(N(0, σ), -e, e), ζ represents noise used to increase exploration, θ represents the parameters of the Actor network, and π represents the policy function of the Actor network.
[0157] Step Nine: Two Critic networks will score the action A t to obtain the Q value:
[0158] Q 1 = Q(S t , A t ; ω 1 ) and Q 2 = Q(S t , A t ; ω 2 ).
[0159] Among them, ω 1 represents the parameters of the Critic1 network, and ω 2 represents the parameters of the Critic2 network. Q(S t , A t ; ω) represents the action value function of the Critic network.
[0160] Step Ten: Two target Critic networks score the predicted action A t+1 to obtain the value:
[0161] and
[0162] Among them, represents the parameters of the target Critic1 network, represents the parameters of the target Critic2 network. represents the action value function of the target Critic network.
[0163] Step Eleven: Calculate the target value y t :
[0164] Among them, γ represents the discount factor.
[0165] Step Twelve: Update the Critic network.
[0166] Specifically, update the Critic network by minimizing the mean squared error loss function:
[0167]
[0168] Use the gradient descent method to update the parameters of the target Critic network:
[0169]
[0170] Among them, τ represents the learning rate. The old target network parameters and the new corresponding network parameters are weighted and averaged, and then assigned to the target network.
[0171] Step Thirteen: Update the Actor network.
[0172] Specifically, after the Critic network is updated d steps, the Actor network is updated, and the Actor network parameters are updated using gradient ascent:
[0173]
[0174] Step Fourteen: Repeat the above Steps Six to Thirteen to obtain an optimized allocation coefficient decision algorithm.
[0175] Specifically, when the fluctuation range of the reward value gradually decreases and remains within a small range for a certain period of time, it indicates that the allocation coefficient decision algorithm has converged or is approaching convergence, and a relatively optimal allocation coefficient decision algorithm is obtained.
[0176] Exemplarily, Figure 5 is a schematic diagram of modules of a task offloading device provided by an embodiment of the present application. As Figure 5 shown, the task offloading device includes an information collection module and an allocation coefficient decision module.
[0177] The information collection module includes a terminal device information collection module, a network device information collection module, and an edge server information collection module. Among them, the terminal device information collection module is used to collect the initial position information, task information of tasks to be processed, transmission power, and local computing resources of each fixed terminal device and active terminal device. The terminal device information collection module includes a position information update module and a to-be-processed task generation module. The position information update module is used to update the position information of the active terminal device in each time slot and determine the target network device corresponding to the active terminal device in each time slot. The to-be-processed task generation module is used to generate the to-be-processed tasks of the fixed terminal device and the active terminal device in each time slot. The network device information collection module is used to collect the position information, bandwidth resource information, and channel information of each network device. The edge server information collection module is used to collect the computing resource information of each edge server.
[0178] The allocation coefficient decision module includes an agent decision allocation coefficient module, a to-be-processed task local computing module, a to-be-processed task edge computing module, a reward value calculation module, a data storage module, and an algorithm training module.
[0179] Exemplarily, Figure 6 is a schematic diagram of a communication network structure provided by an embodiment of the present application. As Figure 6As shown in the figure, the communication network includes multiple base stations, and each base station is equipped with one edge server. The coverage area of each base station includes at least one fixed terminal device and at least one mobile terminal device. Among them, the mobile terminal device will move horizontally within the coverage areas of all base stations, and its location information will change. The location information of the fixed terminal device will not change.
[0180] It should be noted that, in Figure 6 the case of the communication network structure shown in the figure, the task offloading method provided by the embodiments of the present application can, for the tasks to be processed by the terminal device, intelligently determine a suitable task allocation coefficient on the premise of meeting the delay requirements and energy-saving constraints, so that the tasks of the terminal device are executed collaboratively between the local and the edge, and at the same time, the edge server can allocate reasonable computing resources to the tasks uploaded by the terminal device.
[0181] Furthermore, according to the above task offloading method, specific simulation experiments are carried out.
[0182] Exemplarily, Figure 7 is a schematic diagram of a reward value curve provided by the embodiments of the present application. As Figure 7 shown, it is set that the number M of mobile terminal devices is 1, and the numbers of fixed terminal devices are set to N = 5, N = 10, and N = 15 respectively. Figure 7 The horizontal axis of is the episode, and the vertical axis is the reward.
[0183] According to Figure 7 , it can be obtained that all the reward value curves can finally reach a convergent state. In addition, on the premise of keeping the number of mobile terminal devices constant, as the number of fixed terminal devices increases, the convergence speed of the reward value curve shows a slowing trend. However, all the curves can still finally reach a convergent state.
[0184] Furthermore, Figure 8 is a schematic diagram of the task execution success rate provided by the embodiments of the present application, and this Figure 8 is Figure 7 the schematic diagram of the corresponding task execution success rate. As Figure 8 shown, when the number M of mobile terminal devices is 1, the average success rates when the numbers of fixed terminal devices are N = 5, N = 10, and N = 15 are all 0.9996. It can be seen from this that the task offloading method provided by the embodiments of the present application has a very good effect in this application scenario.
[0185] Exemplarily, Figure 9 is another schematic diagram of a reward value curve provided by the embodiments of the present application. As Figure 9As shown, the number of fixed terminal devices is set to N=5, and the number of active terminal devices is set to M=1, M=2 and M=3 respectively. Figure 9 The horizontal axis is episode, and the vertical axis is reward.
[0186] according to Figure 9 , it can be obtained that all reward value curves can eventually reach a convergence state. In addition, under the premise of keeping the number of fixed terminal devices constant, as the number of active terminal devices increases, the convergence difficulty of the reward value curve increases and the convergence speed of the curve also tends to slow down. However, all curves can still reach convergence after a certain training process.
[0187] Furthermore, Figure 10 A schematic diagram of another task execution success rate provided in an embodiment of the present application, the Figure 10 for Figure 9 Schematic diagram of the corresponding task execution success rate. Figure 9 As shown, when the number of fixed terminal devices N=5, the average success rates when the number of active terminal devices is M=1, M=2 and M=3 are 0.9997, 0.9994 and 0.9994 respectively. It can be seen that under the premise that the number of fixed terminal devices is constant, as the number of active terminal devices increases, the ratio of the task execution success rate decreases slightly but still reaches 0.9994, indicating that the task offloading method provided in the embodiment of the present application is very effective in this application scenario.
[0188] It is understandable that the above-mentioned task offloading method can be implemented by a task offloading device. In order to realize the above-mentioned functions, the task offloading device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments disclosed in the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments disclosed in this application.
[0189] The embodiment disclosed in the present application can divide the functional modules according to the task unloading device generated by the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment disclosed in the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0190] Figure 11 This is a schematic structural diagram of a task offloading device provided by an embodiment of the present application. As Figure 11 shown, the task offloading device 110 can be used to execute Figures 2 - 4 the task offloading method shown. The task offloading device 110 includes: a communication unit 1101 and a processing unit 1102.
[0191] The communication unit 1101 is configured to obtain task information of a to-be-processed task of a terminal device and location information of the terminal device; the processing unit 1102 is configured to determine a target network device according to the location information and mobility of the terminal device, and the target network device is configured with an edge server; the processing unit 1102 is further configured to allocate the to-be-processed task to the terminal device and the edge server for processing.
[0192] In a possible implementation manner, the task information includes a task deadline; wherein, the processing duration of the terminal device is determined according to the computing speed and computing frequency of the terminal device; the processing duration of the edge server is determined according to the computing speed of the edge server, the computing resources allocated by the edge server to the to-be-processed task, and the data transmission rate between the terminal device and the target network device.
[0193] In a possible implementation manner, the data transmission rate between the terminal device and the target network device is determined according to the channel bandwidth of the edge server, the transmission power of the terminal device, the channel gain between the terminal device and the target network device, and the distance between the terminal device and the target network device.
[0194] In a possible implementation manner, the data transmission rate between the terminal device and the target network device satisfies the following formula:
[0195]
[0196] wherein, W represents the channel bandwidth of the edge server, P i,trans represents the transmission power of the terminal device, h i represents the channel gain between the terminal device and the target network device, dis ij represents the distance between the terminal device and the target network device, β represents the path loss coefficient, N 0 represents the Gaussian white noise power, and I represents the interference power.
[0197] In a possible implementation, the number of terminal devices is multiple. For each terminal device, the processing unit 1102 is further configured to determine the task processing duration corresponding to each terminal device, where the task processing duration is the maximum duration for the edge server to process the pending tasks of the terminal device; the processing unit 1102 is further configured to determine the minimum computing resources required for the edge server to process the pending tasks of the terminal device based on the task processing duration corresponding to the terminal device.
[0198] In a possible implementation, if the sum of the minimum computing resources required for the edge server to process the pending tasks of each terminal device is less than or equal to the total computing resources of the edge server, the processing unit 1102 is further configured to determine that the edge server can process the pending tasks of the multiple allocated terminal devices; if the sum of the minimum computing resources required to process the pending tasks of each terminal device is greater than the total computing resources of the edge server, the processing unit 1102 is further configured to determine to process the pending tasks of the multiple allocated terminal devices according to the priorities of the terminal devices.
[0199] In a possible implementation, the processing unit 1102 is further configured to determine an allocation coefficient according to the task information of the pending task and the allocation coefficient decision algorithm; the processing unit 1102 is further configured to allocate the pending task to the terminal device and the edge server for processing based on the allocation coefficient.
[0200] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the system, device, and unit described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0201] The present disclosure also provides a computer-readable storage medium, on which instructions are stored. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the task offloading method provided in the embodiments of the present disclosure.
[0202] The embodiments of the present disclosure also provide a computer program product containing instructions. When it runs on an electronic device, the electronic device is enabled to execute the task offloading method provided in the embodiments of the present disclosure.
[0203] Among them, a computer-readable storage medium may be, for example, but not limited to, a system, device, or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium well-known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an application specific integrated circuit (ASIC). In the embodiments of the present application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in conjunction with an instruction execution system, device, or component.
[0204] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any change or replacement within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A task offloading method, characterized in that: The method comprises: Acquire task information of tasks to be processed by the terminal device and location information of the terminal device; Determine a target network device according to the location information and mobility of the terminal device, wherein the target network device is configured with an edge server; The tasks to be processed are allocated to the terminal device and the edge server for processing.
2. The method according to claim 1, characterized in that The task information includes task deadline delay; The processing time of the terminal device is determined according to the computing speed and calculation frequency of the terminal device; The processing time of the edge server is determined according to the computing speed of the edge server, the computing resources allocated by the edge server to the task to be processed, and the data transmission rate between the terminal device and the target network device.
3. The method according to claim 2, characterized in that The data transmission rate between the terminal device and the target network device is determined according to the channel bandwidth of the edge server, the transmission power of the terminal device, the channel gain between the terminal device and the target network device, and the distance between the terminal device and the target network device.
4. The method according to claim 3, characterized in that The data transmission rate between the terminal device and the target network device satisfies the following formula: Wherein, W represents the channel bandwidth of the edge server, P i,trans represents the transmission power of the terminal device, h i represents the channel gain between the terminal device and the target network device, dis ij represents the distance between the terminal device and the target network device, β represents the path loss coefficient, N0 represents the Gaussian white noise power, and I represents the interference power.
5. The method according to claim 1, characterized in that The number of the terminal devices is multiple, and the method further includes: For each terminal device, determine the task processing duration corresponding to each terminal device, where the task processing duration is the maximum duration for the edge server to process the pending task of the terminal device; Based on the task processing duration corresponding to the terminal device, the minimum computing resources required by the edge server to process the task to be processed by the terminal device are determined.
6. The method according to claim 5, characterized in that The method further comprises: If the sum of the minimum computing resources required by the edge server to process the pending tasks of each terminal device is less than or equal to the total computing resources of the edge server, it is determined that the edge server is capable of processing the pending tasks of the multiple terminal devices assigned; If the sum of the minimum computing resources required for processing the pending tasks of each terminal device is greater than the total computing resources of the edge server, it is determined to process the pending tasks of the multiple terminal devices allocated according to the priorities of the terminal devices.
7. The method according to any one of claims 1 to 6, characterized in that The allocating the to-be-processed tasks to the terminal device and the edge server for processing includes: Determine the allocation coefficient according to the task information of the task to be processed and the allocation coefficient decision algorithm; Based on the allocation coefficient, the to-be-processed task is allocated to the terminal device and the edge server for processing.
8. A task offloading device, characterized in that: The device comprises: a communication unit and a processing unit; The communication unit is used to obtain task information of a task to be processed by a terminal device and location information of the terminal device; The processing unit is used to determine a target network device according to the location information and mobility of the terminal device, wherein the target network device is configured with an edge server; The processing unit is further used to distribute the tasks to be processed to the terminal device and the edge server for processing.
9. A task offloading device, characterized in that: include: Memory and processor; The memory is coupled to the processor; The memory is used to store instructions executable by the processor; When the processor executes the instruction, the task offloading method according to any one of claims 1 to 7 is performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the task offloading method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product comprises computer program instructions, and when the computer program instructions are executed by a processor, the task offloading method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Task offloading method and apparatus, and storage medium
WO2026179953A1