Task offloading method, electronic device and storage medium
By building a task offloading optimization model and using deep reinforcement learning to solve it, the problem of high data transmission costs in smart factories is solved, and the efficiency of task offloading is improved and the cost is minimized.
Patent Information
- Application Number
- CN202311310881.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-10-11
AI Technical Summary
In smart factories, the amount of data processed by equipment under the 5G network is too large, resulting in high data transmission costs and affecting system efficiency.
By obtaining the task information of the target terminal device and the communication information with other terminal devices and edge computing devices, a task offloading optimization model is constructed to determine the service performance, and the optimal offloading solution is solved through the deep reinforcement learning formula to offload the task to Other terminal devices or edge computing devices.
It reduces the calculation amount and transmission cost of the target terminal device, improves the task processing speed of the production line, realizes the personalized needs of task offloading and minimizes the transmission cost.
Smart Images

Figure CN117580101B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a task offloading method, electronic device and storage medium. Background Art
[0002] At present, there have been some great progress in the optimization of wireless communication and computing resources for smart factories. However, in the current practical applications of smart factories based on 5G, for example, the raw data collected from various equipment terminals in the smart workshop is very important for the overall control and subsequent optimization of the workshop and the factory, and is the cornerstone of improving the efficiency of the entire system. However, the volume of these raw data is very large (each factory will generate pb-level data every day). If these data are uploaded to cloud nodes or edge computing nodes through 5G for calculation, processing and storage, it will generate unbearable communication costs. Therefore, in the current practical applications of smart factories based on 5G, there is still a problem of high data transmission costs due to the large amount of data processed by the equipment. Summary of the invention
[0003] In view of this, the purpose of the present application is to propose a task offloading method, an electronic device and a storage medium to solve the problem of excessively high data transmission costs caused by excessive amounts of data processed by devices in the prior art.
[0004] Based on the above purpose, the first aspect of the present application provides
[0005] A task offloading method, comprising:
[0006] Acquire task information of a task to be uninstalled of a target terminal device, first communication information between other terminal devices connected to the target terminal device and the target terminal device, and second communication information between an edge computing device and the target terminal device;
[0007] Determining a first service performance and a second service performance of the target terminal device according to the task information, the first communication information and the second communication information;
[0008] constructing a task offloading optimization model for the task to be offloaded according to the task information, the first communication information, the second communication information, the first service performance, and the second service performance;
[0009] Solving the task offloading optimization model to obtain an offloading solution for the task to be offloaded;
[0010] According to the offloading scheme, the task to be offloaded is offloaded to the other terminal device or the edge computing device.
[0011] Optionally, the task information includes a task calculation amount and a task transmission amount, the first communication information includes a first transmission rate between the target terminal device and the other terminal devices, the second communication information includes a second transmission rate between the target terminal device and the edge computing device, the first service performance includes a total processing energy consumption of the target terminal device, and the second service performance includes a total processing delay of the target terminal device;
[0012] The determining, according to the task information, the first communication information, and the second communication information, the first service performance and the second service performance of the target terminal device comprises:
[0013] Determining the total processing energy consumption of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate and the second transmission rate;
[0014] The total processing delay of the target terminal device is determined according to the task calculation amount, the task transmission amount, the first transmission rate and the second transmission rate.
[0015] Optionally, determining the total processing energy consumption of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate, and the second transmission rate includes:
[0016] Determining a first processing energy consumption of the target terminal device according to the task calculation amount;
[0017] Determining a second processing energy consumption of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount and the first transmission rate;
[0018] Determining a third processing energy consumption of the target terminal device relative to the edge computing device according to the task computing amount, the task transmission amount, and the second transmission rate;
[0019] The total processing energy consumption of the target terminal device is determined according to the first processing energy consumption, the second processing energy consumption and the third processing energy consumption.
[0020] Optionally, determining the total processing delay of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate, and the second transmission rate includes:
[0021] Determining a first local processing delay of the target terminal device according to the task calculation amount;
[0022] determining a second processing delay of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount and the first transmission rate;
[0023] Determining a third processing delay of the target terminal device relative to the edge computing device according to the task computing amount, the task transmission amount and the second transmission rate;
[0024] The total processing delay of the target terminal device is determined according to the first processing delay, the second processing delay and the third processing delay.
[0025] Optionally, determining the first processing energy consumption of the target terminal device according to the task calculation amount includes:
[0026] According to the task calculation amount, the actual task amount of the target terminal device is determined by the following formula:
[0027] ;
[0028] in, is the actual task volume of the i-th target terminal device, Whether to offload the tth task to be offloaded of the i-th target terminal device to the d-th other terminal device, is the task calculation amount of the tth task to be offloaded from the dth other terminal device, is the amount of tasks to be processed for the i-th target terminal device, Whether to offload the tth task to be offloaded of the dth terminal device to the ith target terminal device, where t is the tth task to be offloaded. is the serial number of the target terminal device, is the serial number of other terminal devices, d=1...N, i=1...N, i , Whether to process the tth task to be offloaded of the i-th target terminal device locally, The task calculation amount of the tth task to be offloaded processed locally by the i-th target terminal device;
[0029] The first processing energy consumption of the target terminal device is determined by the following formula:
[0030] ;
[0031] in, is the first processing energy consumption of the i-th target terminal device, is the actual task volume of the i-th target terminal device, is the serial number of the target terminal device, is a constant coefficient, is the preset computing capability of the target terminal device.
[0032] Optionally, determining, according to the task calculation amount, the task transmission amount and the first transmission rate, a second processing energy consumption of the target terminal device relative to the other terminal devices includes:
[0033] The second processing energy consumption of the target terminal device relative to the other terminal devices is determined by the following formula:
[0034] ;
[0035] in, is the total transmission energy consumption of the i-th target terminal device relative to all other terminal devices, Whether to offload the tth task to be offloaded of the i-th target terminal device to the d-th other terminal device, is the serial number of other terminal devices, d=1...N, i=1...N, i , t is the tth task to be offloaded, is the transmission power, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, is the first transmission rate between the i-th target terminal device and the d-th other terminal device.
[0036] Optionally, determining a third processing energy consumption of the target terminal device relative to the edge computing device according to the task computing amount, the task transmission amount, and the second transmission rate includes:
[0037] The third processing energy consumption of the target terminal device relative to the edge computing device is determined by the following formula:
[0038] ;
[0039] in, is the third processing energy consumption of the i-th target terminal device relative to the edge computing device, t is the t-th task to be offloaded, is the transmission power, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, Whether to offload the tth task to be offloaded of the i-th target terminal device to the edge computing device, is the second transmission rate between the i-th target terminal device and the edge computing device.
[0040] Optionally, determining the total processing energy consumption of the target terminal device according to the first processing energy consumption, the second processing energy consumption, and the third processing energy consumption includes:
[0041] The total processing energy consumption of the target terminal device is determined by the following formula:
[0042] ;
[0043] in, is the total processing energy consumption of the i-th target terminal device, is the first processing energy consumption of the i-th target terminal device, is the second processing energy consumption of the i-th target terminal device relative to all other terminal devices, is the third processing energy consumption of the i-th target terminal device relative to the edge computing device.
[0044] Optionally, determining a first local processing delay of the target terminal device according to the task calculation amount includes:
[0045] The first local processing delay of the target terminal device is determined by the following formula:
[0046] ;
[0047] in, is the first local processing delay of the tth task to be offloaded on the i-th target terminal device, is the computational delay of the tth task to be offloaded from the i-th target terminal device in the local processing task, c represents the computation, and is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, is the preset computing capability of the target terminal device.
[0048] Optionally, determining the second processing delay of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount and the first transmission rate includes:
[0049] The target terminal device determines the upload delay relative to the other terminal devices by the following formula:
[0050] ;
[0051] in, is the upload delay of the tth task to be offloaded from the i-th target terminal device to the d-th other terminal device, where up means uploading, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, is the first transmission rate between the i-th target terminal device and the d-th other terminal device, is the serial number of the target terminal device, is the serial number of other terminal devices, d=1...N;
[0052] The calculation delay of the target terminal device relative to the other terminal devices is determined by the following formula:
[0053] ;
[0054] in, is the calculation delay of offloading the tth task to be offloaded from the i-th target terminal device to the d-th other terminal device, c represents the calculation, and is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, The preset computing capacity of the other terminal devices;
[0055] The upload delay and the calculation delay are input into the following formula to obtain the second processing delay of the target terminal device relative to the other terminal devices:
[0056] ;
[0057] in, The second processing delay of offloading the t-th task to be offloaded from the i-th target terminal device to the d-th other terminal device;
[0058] Optionally, the task information also includes a task level;
[0059] The determining, according to the task computing amount, the task transmission amount, and the second transmission rate, a third processing delay of the target terminal device relative to the edge computing device includes:
[0060] The upload delay of the target terminal device relative to the edge computing device is determined by the following formula:
[0061] ;
[0062] in, is the upload delay of the tth task to be offloaded from the i-th target terminal device to the edge computing device, where up means uploading, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, is the second transmission rate between the i-th target terminal device and the edge computing device, is the serial number of the target terminal device;
[0063] Determine the computing delay of the target terminal device relative to the edge computing device by the following formula;
[0064] ;
[0065] in, is the local computing delay of offloading the tth task to be offloaded from the i-th target terminal device to the edge computing device, c represents the computing, is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, The preset computing capacity of the edge computing device;
[0066] In response to the task level being the highest level, determining a first queuing delay of the target terminal device relative to the edge computing device by the following formula;
[0067] ;
[0068] in, is the queuing delay of the highest level of the to-be-offloaded task of the i-th target terminal device to be offloaded to the edge computing device, To queue, is the highest level of tasks to be offloaded in the i-th target device, is the task calculation amount of the highest level of tasks to be offloaded of the i-th target terminal device, The proportion of the tasks to be offloaded to the other terminal devices;
[0069] In response to the task level not being the highest level, a second queuing delay of the target terminal device relative to the edge computing device is determined by the following formula:
[0070] ;
[0071] in, is the queuing delay of the non-highest-level to-be-offloaded task of the i-th target terminal device to be offloaded to the edge computing device, is the highest level of tasks to be uninstalled. is the i-th other terminal device There are tasks to be uninstalled that are not of the highest level. Whether to offload the highest level of the to-be-offloaded task of the i-th target terminal device to the edge computing device, is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, The preset computing capacity of the edge computing device;
[0072] According to the first queuing delay and the second queuing delay, the queuing delay of the target terminal device relative to the edge computing device is determined by the following formula:
[0073] );
[0074] in, is the queuing delay of the tth task to be offloaded of the i-th target terminal device;
[0075] The third processing delay of the target terminal device relative to the edge computing device is obtained by the following formula:
[0076] ;
[0077] in, is the third processing delay of the tth task to be offloaded of the ith target terminal device relative to the edge computing device.
[0078] Optionally, determining a total processing delay of the target terminal device according to the first processing delay, the second processing delay, and the third processing delay includes:
[0079] The total processing delay of the target terminal device is determined by the following formula:
[0080] ;
[0081] in, is the total processing delay of the tth task to be offloaded from the i-th target terminal device, Whether to process the tth task to be offloaded of the i-th target terminal device locally, Whether to offload the tth task to be offloaded of the i-th target terminal device to the d-th other terminal device, Whether to offload the tth task to be offloaded of the i-th target terminal device to the edge computing device, is the first local processing delay of the tth task to be offloaded on the i-th target terminal device, is the second processing delay of offloading the tth task to be offloaded from the i-th target terminal device to the d-th other terminal device, is the third processing delay of the tth task to be offloaded of the ith target terminal device relative to the edge computing device.
[0082] Optionally, the task information further includes security information, the first communication information includes a first transmission bandwidth between the target terminal device and the other terminal devices, the second communication information includes a second transmission bandwidth between the target terminal device and the edge computing device, and the task offloading optimization model includes an objective function and an objective constraint condition;
[0083] Constructing a task offloading optimization model for the task to be offloaded according to the task information, the first communication information, the second communication information, the first service performance, and the second service performance, including:
[0084] Constructing the objective function according to the task computing amount, the task transmission amount, the security information, the first transmission bandwidth, the second transmission bandwidth, the first service performance and the second service performance, wherein the objective function aims to minimize the transmission cost between the target terminal device and other terminal devices, minimize the transmission cost between the target terminal device and the edge computing device, minimize the total processing delay of the other terminal devices and minimize the total processing delay of the edge computing device;
[0085] The target constraint condition is constructed according to the task computing amount, the task transmission amount, the security information, the first service performance and the second service performance.
[0086] Optionally, the task information further includes a task level, and the safety information includes a task safety level and a task delay requirement;
[0087] The objective function is constructed according to the task computing amount, the task transmission amount, the security information, the first transmission bandwidth, the second transmission bandwidth, the first service performance, and the second service performance, including:
[0088] In response to the task level being the highest level, constructing a transmission cost function according to the task transmission amount, the first transmission bandwidth, and the second transmission bandwidth;
[0089] Constructing a first initial function according to the transmission cost function, the total processing delay of the other terminal devices, and the total processing delay of the edge computing device;
[0090] In response to the task level not being the highest level, determining the priority of the task to be offloaded according to the task transmission amount, the task calculation amount, the task safety level, and the task delay requirement;
[0091] Constructing a second initial function according to the priority of the task to be offloaded, the total processing delay of the other terminal devices, and the total processing delay of the edge computing device;
[0092] The objective function is constructed according to the first initial function and / or the second initial function.
[0093] Optionally, the safety information includes task safety level and task delay requirement, and the edge computing device transmission information includes edge computing device transmission bandwidth;
[0094] The target constraint condition is constructed according to the task computing amount, the task transmission amount, the security information, the first service performance and the second service performance, including:
[0095] The first constraint is constructed by the following formula:
[0096] ;
[0097] in, is the serial number of other terminal devices, d=1...N, Whether to offload the tth task to be offloaded from the dth other terminal device to the ith target terminal device, is the serial number of the target terminal device, , is the task calculation amount of the tth task to be offloaded from the dth other terminal device, The upper limit of the preset task calculation amount is is the amount of tasks to be processed for the i-th target terminal device, For tasks to be processed, Whether to process the tth task to be offloaded of the i-th target terminal device locally, The task calculation amount of the tth task to be offloaded processed locally by the i-th target terminal device;
[0098] The second constraint is constructed using the following formula:
[0099] ;
[0100] in, is the total processing delay of the tth task to be offloaded by the i-th target terminal device, is the preset total processing delay upper limit of the i-th target terminal device;
[0101] The third constraint is constructed by the following formula:
[0102] ;
[0103] in, Processing total energy consumption for the i-th target terminal device, is the preset total processing energy consumption limit of the i-th target terminal device;
[0104] The fourth constraint is constructed by the following formula:
[0105]
[0106] in, is whether to offload the tth to-be-offloaded task of the i-th target terminal device to the d-th other terminal device, where d is the sequence number of the other terminal device, and when d=1…N, Whether to offload the tth task to be offloaded of the i-th target terminal device to the edge computing device, i , is the serial number of the target terminal device;
[0107] The fifth constraint is constructed by the following formula:
[0108] ;
[0109] in, =0, it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the d-th other terminal device. =1, it means that the tth task to be offloaded of the i-th target terminal device is offloaded to the d-th other terminal device. , it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the edge device. , it means that the tth task to be offloaded of the i-th target terminal device is offloaded to the edge computing device. , it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the d-th other terminal device. , it means that the tth task to be offloaded of the i-th target terminal device is offloaded to the d-th other terminal device. is the serial number of the target terminal device, When , it means that the tth task to be offloaded of the i-th target terminal device will not be processed locally. When , it means that the tth task to be offloaded of the i-th target terminal device is processed locally. ;
[0110] The first constraint condition, the second constraint condition, the third constraint condition, the fourth constraint condition and the fifth constraint condition are combined as the target constraint condition.
[0111] Based on the same inventive concept, the second aspect of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method as described above when executing the computer program.
[0112] Based on the same inventive concept, the third aspect of the present disclosure further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method as described above.
[0113] From the above, it can be seen that the present application provides a task offloading method, electronic device and storage medium. The method constructs a task offloading optimization model for the task to be offloaded according to the task information, the first communication information, the second communication information, the first service performance and the second service performance; solves the task offloading optimization model to obtain the offloading plan for the task to be offloaded, and unloads the task to be offloaded to other terminal devices or edge computing devices according to the offloading plan; obtains the optimal solution by solving the task model to obtain the optimal offloading method for the task to be offloaded, and reduces the computing amount of the target terminal device by offloading the task to be offloaded of the target terminal device to other terminal devices or edge computing devices. At the same time, considering the task transmission amount, constructs the task offloading optimization model with the minimum task transmission cost, and solves the task offloading optimization model to obtain the offloading plan with the minimum transmission task amount, thereby realizing the offloading of the task to be offloaded with the minimum transmission cost, and at the same time realizing the personalized needs of task offloading while minimizing the transmission cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0114] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0115] Figure 1 A flowchart of a task offloading method according to an embodiment of the present application is shown;
[0116] Figure 2 A schematic diagram of a task offloading optimization model process for constructing a task to be offloaded according to an embodiment of the present application;
[0117] Figure 3 A schematic diagram of the structure framework of a task offloading device according to an embodiment of the present application;
[0118] Figure 4 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0119] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0120] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0121] In the relevant technologies, the original intention and vision of the design of the smart workshop is to connect various production factors such as production equipment, staff, materials, etc. through the Internet of Things technology, and to monitor, optimize and adjust the production process in real time through technologies such as big data analysis and artificial intelligence decision-making, so as to achieve efficient, flexible and coordinated production management. Among them, the raw data collected from various equipment terminals is very important for the overall regulation and subsequent optimization of the workshop and factory, and is the cornerstone for improving the efficiency of the entire system. However, the volume of these raw data is very large (each factory will generate pb-level data every day). If these data are uploaded to cloud nodes or edge computing nodes through 5G for calculation, processing and storage, it will generate unbearable communication costs. Therefore, the current treatment of most factories for most of the data "ignores" makes the intelligent process slow.
[0122] It can be seen that in the industrial Internet system, the optimization of wireless communication network resources has extremely high practical value and urgent need, and has a profound impact on the in-depth development and healthy operation of the subsequent Industry 4.0. In the actual smart factory scenario, the large amount of data required to be transmitted by production equipment leads to high transmission costs, so the transmission of valuable data has to be abandoned. In order to realize the smart manufacturing workshop, the actual reference value it can provide for production is comprehensively considered, and the main problems to be solved are focused on.
[0123] In order to solve the above problems, in this application, a task offloading optimization model for the task to be offloaded is constructed according to the task information, the first communication information, the second communication information, the first service performance and the second service performance; the task offloading optimization model is solved to obtain the offloading plan for the task to be offloaded, and according to the offloading plan, the task to be offloaded is 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 task to be offloaded, and the computing amount of the target terminal device is reduced by offloading the task to other terminal devices or edge computing devices, thereby reducing the task transmission cost, realizing the personalized needs of task offloading while minimizing the transmission cost.
[0124] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0125] Reference Figure 1 , the present application provides a task offloading method, applied to a controller, comprising the following steps:
[0126] Step 102: Obtain task information of the task to be uninstalled of the target terminal device, first communication information between other terminal devices connected to the target terminal device and the target terminal device, and second communication information between the edge computing device and the target terminal device.
[0127] In this step, the target terminal device receives the task information, and determines the task information of the task to be processed and the task to be uninstalled of the device according to the received task information, the task information includes a task type identifier, the task type to be processed includes a first task type, and the task type to be uninstalled includes a second task type and a third task type; the task type of each task is determined according to the task information, including: according to the task type identifier, searching for the first task type or the second task type or the third task type corresponding to the task type identifier in a preset table, and using the first task type or the second task type or the third task type found as the task type of the task corresponding to the task type identifier. Exemplarily, the first type of task is a Class A task (hereinafter referred to as A to be processed), wherein the Class A task is a task processed by the target terminal device itself, the second type of task is a Class B task, and exemplary, the Class B task is a task used to check the Class A task, and the level is the highest level, and the third type of task is a Class C task, wherein the Class C task is a set of other types of tasks, and exemplary, a set of tasks such as device status inspection and task security detection. The controller obtains the task information of the task to be offloaded of the target terminal device, the first communication information between the target terminal device and other terminal devices connected to the target terminal device, and the second communication information between the edge computing device and the target terminal device. The target terminal device and the other terminal devices communicate via D2D communication, and the first communication information includes the first transmission rate and the first transmission bandwidth between the target terminal device and the other terminal devices; the target terminal device and the edge computing device communicate via 5G communication, and the second communication information includes the second transmission rate and the second transmission bandwidth between the target terminal device and the edge computing device.
[0128] In this application, two communication methods are used: D2D communication is used between other terminal devices, and 5G communication is used between the target terminal device and the edge computing device, thereby saving data transmission costs. Based on the constraints of the actual environment, in the construction of the task model to be unloaded, the optimal unloading solution for the tasks generated by each device is obtained, so that the wireless transmission cost is minimized under this system. Furthermore, by obtaining the task information of the task to be unloaded, the first communication information between the target terminal device and other terminal devices, and the second communication information between the target terminal device and the edge computing device, the controller determines the service performance of each device according to the task information, the first communication information, and the second communication information, so that the controller can comprehensively consider the task information, each communication information, and each service performance, and unload the task to be unloaded to other terminal devices or edge computing devices in the optimal unloading method, so that the task to be unloaded can be unloaded to other terminal devices or edge computing devices with the minimum transmission cost, thereby reducing the task processing volume of the target terminal device and improving the task processing speed of the production line.
[0129] Step 104: Determine a first service performance and a second service performance of the target terminal device according to the task information, the first communication information, and the second communication information.
[0130] In this step, the task information includes the task calculation amount and the task transmission amount, the first communication information includes the first transmission rate between the target terminal device and the other terminal devices, the second communication information includes the second transmission rate between the target terminal device and the edge computing device, the first service performance includes the total processing energy consumption of the target terminal device, and the second service performance includes the total processing delay of the target terminal device;
[0131] The determining, according to the task information, the first communication information, and the second communication information, the first service performance and the second service performance of the target terminal device comprises:
[0132] Determining the total processing energy consumption of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate, and the second transmission rate;
[0133] The total processing delay of the target terminal device is determined according to the task calculation amount, the task transmission amount, the first transmission rate and the second transmission rate.
[0134] Specifically, the task information also includes security information. The controller can comprehensively consider the task calculation amount, task transmission amount, security information, the total processing energy consumption of the target terminal device, and the total processing delay of the target terminal device to select the optimal unloading solution, so that the task to be unloaded can be unloaded to other terminal devices or edge computing devices with the lowest transmission cost, thereby reducing the task processing amount of the target terminal device and improving the task processing speed of the production line.
[0135] Step 106: construct a task offloading optimization model for the task to be offloaded according to the task information, the first communication information, the second communication information, the first service performance, and the second service performance.
[0136] In this step, refer to Figure 2 , the task offloading optimization model includes an objective function and objective constraints, including:
[0137] Step 202: construct the objective function according to the task computing amount, the task transmission amount, the security information, the first transmission bandwidth, the second transmission bandwidth, the first service performance, and the second service performance, wherein the objective function aims to minimize the transmission cost between the target terminal device and other terminal devices, minimize the transmission cost between the target terminal device and the edge computing device, minimize the total processing delay of the other terminal devices, and minimize the total processing delay of the edge computing device;
[0138] Step 204: construct the target constraint condition according to the task computing amount, the task transmission amount, the security information, the first service performance and the second service performance.
[0139] Specifically, by constructing an objective function with the goals of minimizing the transmission cost between the target terminal device and other terminal devices, minimizing the transmission cost between the target terminal device and the edge computing device, minimizing the total processing delay of the other terminal devices, and minimizing the total processing delay of the edge computing device according to the task calculation amount, task transmission amount, security information, the first transmission bandwidth, the second transmission bandwidth, the first service performance and the second service performance, after solving the objective function, a solution with the lowest transmission cost to each device and the smallest total processing delay of each device can be obtained, that is, the most optimized unloading solution is obtained, so that the task to be unloaded can be unloaded to other terminal devices or edge computing devices with the minimum transmission cost, thereby reducing the task processing amount of the target terminal device and improving the task processing speed of the production line.
[0140] Step 108: solving the task offloading optimization model to obtain an offloading solution for the task to be offloaded;
[0141] In this step, the D3QN deep reinforcement learning formula is used to solve the task offloading optimization model. The D3QN deep reinforcement learning formula is as follows:
[0142]
[0143] in, is the target value, and To evaluate the parameters of the network and the target network, It’s an instant reward. is the next state, is the discount factor, () is to find the action in q() Maximum value, Is to evaluate the network status The action that optimizes the action value *; It is to find the state under the target network. Next action *The action value.
[0144] 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 plan for the task to be offloaded, so that the task to be offloaded can be offloaded to other terminal devices or edge computing devices with the minimum transmission cost, thereby reducing the task processing volume of the target terminal device and improving the task processing speed of the production line.
[0145] Step 110: According to the offloading scheme, the task to be offloaded is offloaded to the other terminal device or the edge computing device.
[0146] In this step, the tasks to be offloaded are offloaded to other terminal devices or edge computing devices according to the optimal offloading solution obtained, thereby reducing the processing task load of the target terminal device and improving the task processing speed of the production line.
[0147] Through the above steps 102-110, a task offloading optimization model for the task to be offloaded is constructed according to the task information, the first communication information, the second communication information, the first service performance and the second service performance; the task offloading optimization model is solved to obtain an offloading plan for the task to be offloaded, and according to the offloading plan, the task to be offloaded is 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 task to be offloaded, and the task calculation amount of the target terminal device is reduced by offloading the task to other terminal devices or edge computing devices, thereby reducing the task transmission cost, realizing the personalized needs of task offloading while minimizing the transmission cost.
[0148] In some embodiments, determining the total processing energy consumption of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate, and the second transmission rate includes:
[0149] Determining a first processing energy consumption of the target terminal device according to the task calculation amount;
[0150] Determining a second processing energy consumption of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount and the first transmission rate;
[0151] Determining a third processing energy consumption of the target terminal device relative to the edge computing device according to the task computing amount, the task transmission amount, and the second transmission rate;
[0152] The total processing energy consumption of the target terminal device is determined according to the first processing energy consumption, the second processing energy consumption and the third processing energy consumption.
[0153] In this embodiment, determining the first processing energy consumption of the target terminal device according to the task calculation amount includes:
[0154] According to the task calculation amount, the actual task amount of the target terminal device is determined by the following formula:
[0155] ;
[0156] in, is the actual task volume of the i-th target terminal device, Whether to offload the tth task to be offloaded of the i-th target terminal device to the d-th other terminal device, is the task calculation amount of the tth task to be offloaded from the dth other terminal device, is the amount of tasks to be processed for the i-th target terminal device, Whether to offload the tth task to be offloaded of the dth terminal device to the ith target terminal device, where t is the tth task to be offloaded. is the serial number of the target terminal device, is the serial number of other terminal devices, d=1...N, i=1...N, i , Whether to process the tth task to be offloaded of the i-th target terminal device locally, The task calculation amount of the tth task to be offloaded processed locally by the i-th target terminal device;
[0157] The first processing energy consumption of the target terminal device is determined by the following formula:
[0158] ;
[0159] in, is the first processing energy consumption of the i-th target terminal device, is the actual task volume of the i-th target terminal device, is the serial number of the target terminal device, is a constant coefficient, is the preset computing capability of the target terminal device.
[0160] In this embodiment, determining the second processing energy consumption of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount and the first transmission rate includes:
[0161] The second processing energy consumption of the target terminal device relative to the other terminal devices is determined by the following formula:
[0162] ;
[0163] in, is the total transmission energy consumption of the i-th target terminal device relative to all other terminal devices, Whether to offload the tth task to be offloaded of the i-th target terminal device to the d-th other terminal device, is the serial number of other terminal devices, d=1...N, i=1...N, i , t is the tth task to be offloaded, is the transmission power, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, is the first transmission rate between the i-th target terminal device and the d-th other terminal device.
[0164] In this embodiment, determining the third processing energy consumption of the target terminal device relative to the edge computing device according to the task computing amount, the task transmission amount, and the second transmission rate includes:
[0165] The third processing energy consumption of the target terminal device relative to the edge computing device is determined by the following formula:
[0166] ;
[0167] in, is the third processing energy consumption of the i-th target terminal device relative to the edge computing device, t is the t-th task to be offloaded, is the transmission power, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, Whether to offload the tth task to be offloaded of the i-th target terminal device to the edge computing device, is the second transmission rate between the i-th target terminal device and the edge computing device.
[0168] In this embodiment, determining the total processing energy consumption of the target terminal device according to the first processing energy consumption, the second processing energy consumption, and the third processing energy consumption includes:
[0169] The total processing energy consumption of the target terminal device is determined by the following formula:
[0170] ;
[0171] in, is the total processing energy consumption of the i-th target terminal device, is the first processing energy consumption of the i-th target terminal device, is the second processing energy consumption of the i-th target terminal device relative to all other terminal devices, is the third processing energy consumption of the i-th target terminal device relative to the edge computing device. Specifically, the task calculation amount includes the calculation amount of the task to be processed and the calculation amount of the task to be unloaded. The calculation amount of the task to be processed is processed locally by the target terminal device, and the task to be unloaded of the target terminal device is unloaded to other terminal devices or edge computing devices for processing. When calculating the task processing energy consumption of the target terminal device, the task to be processed processed locally by the target terminal and the sent task to be unloaded are comprehensively calculated to obtain the task processing energy consumption of the target terminal device. When calculating the total transmission energy consumption of the target terminal device, the unloading position of the task to be unloaded is considered, and the emission rate, transmission rate, task transmission amount and confirmation result of whether to unload are calculated between the target terminal device and the target unloading position to obtain the total transmission energy consumption of other terminal devices, and the task processing energy consumption and the total transmission energy consumption are added to obtain the total processing energy consumption of other terminal devices. In order to construct the constraint condition according to the minimum energy consumption, when the task to be unloaded is unloaded, the device with the minimum energy consumption is selected for unloading, so as to achieve the lowest processing energy consumption of the task to be unloaded and speed up the processing speed of the task to be unloaded.
[0172] In some embodiments, determining the total processing delay of the target terminal device according to the task calculation amount, the task transmission amount and the first transmission rate includes:
[0173] Determining a first local processing delay of the target terminal device according to the task calculation amount;
[0174] determining a second processing delay of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount and the first transmission rate;
[0175] Determining a third processing delay of the target terminal device relative to the edge computing device according to the task computing amount, the task transmission amount and the second transmission rate;
[0176] The total processing delay of the target terminal device is determined according to the first processing delay, the second processing delay and the third processing delay.
[0177] In this embodiment, determining the first local processing delay of the target terminal device according to the task calculation amount includes:
[0178] The first local processing delay of the target terminal device is determined by the following formula:
[0179] ;
[0180] in, is the first local processing delay of the tth task to be offloaded on the i-th target terminal device, is the computational delay of the tth task to be offloaded from the i-th target terminal device in the local processing task, c represents the computation, and is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, is the preset computing capability of the target terminal device.
[0181] Specifically, since there is only local calculation delay when the target terminal device performs processing, and there is no transmission and queuing delay, there is only calculation delay.
[0182] In this embodiment, determining the second processing delay of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount and the first transmission rate includes:
[0183] The target terminal device determines the upload delay relative to the other terminal devices by the following formula:
[0184] ;
[0185] in, is the upload delay of the tth task to be offloaded from the i-th target terminal device to the d-th other terminal device, where up means uploading, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, is the first transmission rate between the i-th target terminal device and the d-th other terminal device, is the serial number of the target terminal device, is the serial number of other terminal devices, d=1...N;
[0186] The calculation delay of the target terminal device relative to the other terminal devices is determined by the following formula:
[0187] ;
[0188] in, is the computational delay of the local processing task in the tth task to be offloaded of the i-th target terminal device, c represents the computation, and is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, The preset computing capacity of the other terminal devices;
[0189] The upload delay and the calculation delay are input into the following formula to obtain the second processing delay of the target terminal device relative to the other terminal devices:
[0190] ;
[0191] in, The second processing delay of offloading the tth to-be-offloaded task of the ith target terminal device to the dth other terminal device.
[0192] Furthermore, the target terminal device communicates with other terminal devices via D2D communication. Therefore, the transmission rate of D2D communication is determined by the following formula, that is, the first transmission rate is determined by the following formula: :
[0193]
[0194] in, is the first transmission rate between the i-th target terminal device and the d-th other terminal device, is the ambient noise power, is the transmission power, is the channel gain of D2D communication, is the transmission bandwidth of D2D communication;
[0195] The channel gain of D2D communication is determined by the following formula: ; In the formula, is the small-scale Rayleigh fading, is the path loss of D2D communication.
[0196] The path loss of D2D communication is determined by the following formula:
[0197]
[0198] In the formula, is the center frequency of D2D communication, is the spatial distance from the i-th target terminal device to the d-th other terminal device.
[0199] Specifically, based on the task calculation amount, the task transmission amount and the first transmission rate, the total processing delay of other terminal devices is determined so that the task to be unloaded selects the device with the smallest total processing delay for terminal devices to be unloaded, thereby achieving the lowest total processing delay for the task to be unloaded and accelerating the processing speed of the task to be unloaded.
[0200] In this embodiment, the task information also includes a task level;
[0201] The determining, according to the task computing amount, the task transmission amount, and the second transmission rate, a third processing delay of the target terminal device relative to the edge computing device includes:
[0202] The upload delay of the target terminal device relative to the edge computing device is determined by the following formula:
[0203] ;
[0204] in, is the upload delay of the tth task to be offloaded from the i-th target terminal device to the edge computing device, where up means uploading, is the task transmission amount of the tth task to be offloaded from the i-th target terminal device, is the second transmission rate between the i-th target terminal device and the edge computing device, is the serial number of the target terminal device;
[0205] The calculation delay of the target terminal device relative to the edge computing device is determined by the following formula, including:
[0206] ;
[0207] in, is the local computing delay of offloading the tth task to be offloaded from the i-th target terminal device to the edge computing device, c represents the computing, is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, The preset computing capacity of the edge computing device;
[0208] In response to the task level being the highest level, determining a first queuing delay of the target terminal device relative to the edge computing device by the following formula;
[0209] ;
[0210] in, is the queuing delay of the highest level of the to-be-offloaded task of the i-th target terminal device to be offloaded to the edge computing device, To queue, is the highest level of tasks to be offloaded in the i-th target device, is the task calculation amount of the highest level of tasks to be offloaded of the i-th target terminal device, The proportion of the tasks to be offloaded to the other terminal devices;
[0211] In response to the task level not being the highest level, a second queuing delay of the target terminal device relative to the edge computing device is determined by the following formula:
[0212] ;
[0213] in, is the queuing delay of the non-highest-level to-be-offloaded task of the i-th target terminal device to be offloaded to the edge computing device, is the highest level of tasks to be uninstalled. is the i-th other terminal device There are tasks to be uninstalled that are not of the highest level. Whether to offload the highest level of the to-be-offloaded task of the i-th target terminal device to the edge computing device, is the task calculation amount of the tth task to be offloaded from the i-th target terminal device, is the preset computing capacity of the edge computing device, is the task calculation amount of the highest level of tasks to be offloaded of the i-th target terminal device, The proportion of the tasks to be offloaded to the other terminal devices;
[0214] According to the first queuing delay and the second queuing delay, the queuing delay of the target terminal device relative to the edge computing device is determined by the following formula:
[0215] );
[0216] in, is the queuing delay of the tth task to be offloaded of the i-th target terminal device;
[0217] The third processing delay of the target terminal device relative to the edge computing device is obtained by the following formula:
[0218] ;
[0219] in, is the third processing delay of the tth task to be offloaded of the ith target terminal device relative to the edge computing device.
[0220] Optionally, determining a total processing delay of the target terminal device according to the first processing delay, the second processing delay, and the third processing delay includes:
[0221] The total processing delay of the target terminal device is determined by the following formula:
[0222] ;
[0223] in, is the total processing delay of the tth task to be offloaded from the i-th target terminal device, Whether to process the tth task to be offloaded of the i-th target terminal device locally, Whether to offload the tth task to be offloaded of the i-th target terminal device to the d-th other terminal device, Whether to offload the tth task to be offloaded of the i-th target terminal device to the edge computing device, is the first local processing delay of the tth task to be offloaded on the i-th target terminal device, is the second processing delay of offloading the tth task to be offloaded from the i-th target terminal device to the d-th other terminal device, is the third processing delay of the tth task to be offloaded of the ith target terminal device relative to the edge computing device.
[0224] Furthermore, the target terminal device communicates with the edge computing device via 5G communication, and the transmission rate of 5G communication is determined by the following formula, that is, the second transmission rate is determined by the following formula: :
[0225]
[0226] in, is the second transmission rate between the i-th target terminal device and the edge computing device, is the ambient noise power, is the transmission power, is the channel gain of 5G communication, The transmission bandwidth for 5G communication;
[0227] Among them, the channel gain of 5G communication is determined by the following formula: ; In the formula, is the small-scale Rayleigh fading, is the path loss of 5G communication.
[0228] The path loss of D2D communication is determined by the following formula:
[0229]
[0230] In the formula, is the center frequency of 5G communication, is the spatial distance from the i-th target terminal device to the edge computing device.
[0231] Specifically, when the edge computing device receives the task to be unloaded, it queues it according to the receiving time of the task to be unloaded, and processes the tasks to be unloaded in sequence according to the receiving time. Since the computing energy consumption of the edge computing device is not limited, a large number of tasks can be processed, and multiple tasks will be queued. According to the task calculation amount, task transmission amount and the first transmission rate, the total processing delay of the edge computing device is determined, so that the task to be unloaded determines whether to select the device for task unloading according to the total delay of the edge computing device, so that the task to be unloaded selects the device with the lowest total processing delay to unload the task, thereby improving the processing speed of the task to be unloaded.
[0232] In some embodiments, the task information further includes a task level, and the safety information includes a task safety level and a task delay requirement;
[0233] The objective function is constructed according to the task computing amount, the task transmission amount, the security information, the first transmission bandwidth, the second transmission bandwidth, the first service performance, and the second service performance, including:
[0234] In response to the task level being the highest level, constructing a transmission cost function according to the task transmission amount, the first transmission bandwidth, and the second transmission bandwidth;
[0235] Constructing a first initial function according to the transmission cost function, the total processing delay of the other terminal devices, and the total processing delay of the edge computing device;
[0236] In response to the task level not being the highest level, determining the priority of the task to be offloaded according to the task transmission amount, the task calculation amount, the task safety level, and the task delay requirement;
[0237] Constructing a second initial function according to the priority of the task to be offloaded, the total processing delay of the other terminal devices, and the total processing delay of the edge computing device;
[0238] The objective function is constructed according to the first initial function and / or the second initial function.
[0239] Specifically, the B-type task is the highest level task to be offloaded, and the C-type task is a non-highest level task to be offloaded, wherein the B-type task is a task to test the A-type task, and the C-type task is a collection of other tasks, exemplarily, a sensor test task, a test task to see whether the equipment can work normally, etc. The C-type task can be a collection of multiple tasks. When the task to be offloaded is a B-type task, according to the task transmission amount, the first transmission bandwidth and the second transmission bandwidth, the transmission cost function is constructed by the following formula:
[0240]
[0241] in, is the task transfer amount, , in the formula, is the transmission cost of D2D communication; is the transmission cost of 5G communication. When d=0, the transmission cost of 5G communication is offloaded to the edge computing device, that is, , when d=i, the transmission cost of offloading to d other edge computing devices using D2D communication is ,when When , the task is not offloaded, that is, no transmission cost is used.
[0242] According to the transmission cost function, the total delay of other terminal devices and the total delay of edge computing devices, the first initial function is obtained by the following formula:
[0243]
[0244] in, To adjust the coefficients of importance of different influencing factors, is the total processing delay of the tth task to be offloaded of the target terminal device. When the task to be offloaded is a Class C task, the Class C task is a collection of multiple tasks. The Analytic Hierarchy Process (AHP) is used to calculate the priority of the offloaded task according to the task transmission volume, task calculation volume, security level, and task delay requirements of multiple tasks. According to the priority of the task to be offloaded, the total processing delay of other terminal devices, and the total processing delay of the edge computing device, the second initial function is calculated by the following formula:
[0245]
[0246] in, To adjust the coefficients of importance of different influencing factors, is the priority of the u-th task in the C-type tasks of the i-th device.
[0247] According to the first initial function and / or the second initial function, the objective function is constructed by the following formula:
[0248]
[0249] Among them, 1{ } is the preset indicator function, if { } is true, the indicator function is 1, otherwise it is 0.
[0250] By constructing different initial functions according to different task levels and constructing objective functions according to different initial functions, it is possible to classify the tasks to be unloaded according to the task type, so that the tasks to be unloaded can choose a better solution to unload the tasks, saving the task unloading time, and enabling the tasks to be unloaded to choose the device with the lowest total processing delay to unload the tasks, thereby improving the processing speed of the tasks to be unloaded.
[0251] In some embodiments, the safety information includes the task safety level and the task delay requirement, and the edge computing device transmission information includes the edge computing device transmission bandwidth;
[0252] The target constraint condition is constructed according to the task calculation amount, the task transmission amount, the security information, the first service performance and the second service performance, including:
[0253] The first constraint is constructed by the following formula:
[0254]
[0255] in, is the serial number of other terminal devices, d=1...N, Whether to offload the tth task to be offloaded from the dth other terminal device to the ith target terminal device, is the serial number of the target terminal device, , is the task calculation amount of the tth task to be offloaded from the dth other terminal device, The upper limit of the preset task calculation amount is is the amount of tasks to be processed for the i-th target terminal device, For tasks to be processed;
[0256] The second constraint is constructed using the following formula:
[0257]
[0258] in, is the total processing delay of the tth task to be offloaded from the i-th target terminal device, is the preset total processing delay upper limit of the tth task to be offloaded from the i-th target terminal device;
[0259] The third constraint is constructed by the following formula:
[0260]
[0261] Among them, among them, Processing total energy consumption for the i-th target terminal device, A preset processing total energy consumption limit for a target terminal device;
[0262] The fourth constraint is constructed by the following formula:
[0263] ;
[0264] in, is whether to offload the tth to-be-offloaded task of the i-th target terminal device to the d-th other terminal device, where d is the sequence number of the other terminal device, and when d=1…N, Whether to offload the tth task to be offloaded of the i-th target terminal device to the edge computing device, i , is the serial number of the target terminal device;
[0265] The fifth constraint is constructed by the following formula:
[0266] ;
[0267] in, =0, it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the d-th other terminal device. =1, it means that the tth task to be offloaded of the i-th target terminal device is offloaded to the d-th other terminal device. , it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the edge device. , it means that the tth task to be offloaded of the i-th target terminal device is offloaded to the edge computing device. , it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the d-th other terminal device. , it means that the tth task to be offloaded of the i-th target terminal device is offloaded to the d-th other terminal device. is the serial number of the target terminal device, When , it means that the tth task to be offloaded of the i-th target terminal device will not be processed locally. When , it means that the tth task to be offloaded of the i-th target terminal device is processed locally. ;
[0268] The first constraint , the second constraint , the third constraint 、The fourth constraint And the fifth constraint combination as the target constraint condition.
[0269] The specific objective function and constraints are as follows:
[0270]
[0271]
[0272]
[0273]
[0274]
[0275]
[0276] Specifically, according to the task calculation amount, the total delay of task processing, the total energy consumption of task processing, the corresponding value of the unloading position of the task to be unloaded and the confirmation value of whether the task to be unloaded is to be unloaded, the target constraint condition is constructed, and restrictions can be imposed on the solution of the objective function to make the result of solving the objective function optimal, so as to obtain a better unloading solution, so as to achieve the lowest transmission cost when unloading the task to be unloaded and speed up the processing speed of the task to be unloaded.
[0277] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0278] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0279] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a task offloading device.
[0280] refer to Figure 3 , the task offloading device comprises:
[0281] An acquisition module 302 is configured to acquire task information of a task to be offloaded of a target terminal device, first communication information between other terminal devices connected to the target terminal device and the target terminal device, and second communication information between an edge computing device and the target terminal device;
[0282] A determination module 304 is configured to determine a first service performance of the other terminal device and a second service performance of the edge computing device according to the task information, the first communication information, and the second communication information;
[0283] A construction module 306 is configured to construct a task offloading optimization model for the task to be offloaded according to the task information, the first communication information, the second communication information, the first service performance, and the second service performance;
[0284] The processing module 308 is configured to solve the task offloading optimization model to obtain an offloading solution for the task to be offloaded;
[0285] The unloading module 310 is configured to unload the task to be unloaded to the other terminal device or the edge computing device according to the unloading scheme.
[0286] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0287] The device of the above embodiment is used to implement a corresponding task offloading method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0288] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a task offloading method described in any of the above embodiments is implemented.
[0289] Figure 4 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0290] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0291] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0292] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0293] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0294] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0295] 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, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0296] The electronic device of the above embodiment is used to implement a corresponding task offloading method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0297] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute a task unloading method as described in any of the above embodiments.
[0298] 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. Information can be computer-readable instructions, data structures, modules of programs, 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 technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0299] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute a task offloading method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0300] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, 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.
[0301] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0302] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0303] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0304] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0305] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power / ground connections to the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device may be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application are to be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0306] Although the present application has been described in conjunction with specific embodiments of the present application, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the discussed embodiments.
[0307] 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 principles of the embodiments of the present application should be included in the scope of protection 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 terminal device, first communication information between other terminal devices connected to the target terminal device and the target terminal device, and second communication information between an edge computing device and the target terminal device; Determining a first service performance and a second service performance of the target terminal device according to the task information, the first communication information and the second communication information; The task information includes a task calculation amount and a task transmission amount, the first communication information includes a first transmission rate between the target terminal device and the other terminal devices, the second communication information includes a second transmission rate between the target terminal device and the edge computing device, the first service performance includes a total processing energy consumption of the target terminal device, and the second service performance includes a total processing delay of the target terminal device; Determining the first service performance and the second service performance of the target terminal device according to the task information, the first communication information and the second communication information includes: determining the total processing energy consumption of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate and the second transmission rate; determining the total processing delay of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate and the second transmission rate; Determining the total processing energy consumption of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate, and the second transmission rate, including: determining the first processing energy consumption of the target terminal device according to the task calculation amount; determining the second processing energy consumption of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount, and the first transmission rate; determining the third processing energy consumption of the target terminal device relative to the edge computing device according to the task calculation amount, the task transmission amount, and the second transmission rate; determining the total processing energy consumption of the target terminal device according to the first processing energy consumption, the second processing energy consumption, and the third processing energy consumption; Determining the total processing delay of the target terminal device according to the task calculation amount, the task transmission amount, the first transmission rate, and the second transmission rate, including: determining the first processing delay of the target terminal device locally according to the task calculation amount; determining the second processing delay of the target terminal device relative to the other terminal devices according to the task calculation amount, the task transmission amount, and the first transmission rate; determining the third processing delay of the target terminal device relative to the edge computing device according to the task calculation amount, the task transmission amount, and the second transmission rate; determining the total processing delay of the target terminal device according to the first processing delay, the second processing delay, and the third processing delay; constructing a task offloading optimization model for the task to be offloaded according to the task information, the first communication information, the second communication information, the first service performance, and the second service performance; The task information also includes security information, the first communication information includes a first transmission bandwidth between the target terminal device and the other terminal devices, the second communication information includes a second transmission bandwidth between the target terminal device and the edge computing device, and the task offloading optimization model includes an objective function and objective constraints; Constructing a task offloading optimization model for the task to be offloaded according to the task information, the first communication information, the second communication information, the first service performance, and the second service performance, including: Constructing the objective function according to the task computing amount, the task transmission amount, the security information, the first transmission bandwidth, the second transmission bandwidth, the first service performance and the second service performance, wherein the objective function aims to minimize the transmission cost between the target terminal device and other terminal devices, minimize the transmission cost between the target terminal device and the edge computing device, minimize the total processing delay of the other terminal devices and minimize the total processing delay of the edge computing device; The task information also includes the task level, and the safety information includes the task safety level and task delay requirement; The objective function is constructed according to the task computing amount, the task transmission amount, the security information, the first transmission bandwidth, the second transmission bandwidth, the first service performance and the second service performance, including: in response to the task level being the highest level, a transmission cost function is constructed according to the task transmission amount, the first transmission bandwidth and the second transmission bandwidth; a first initial function is constructed according to the transmission cost function, the total processing delay of other terminal devices and the total processing delay of the edge computing device; in response to the task level not being the highest level, the priority of the task to be offloaded is determined according to the task transmission amount, the task computing amount, the task security level and the task delay requirement; a second initial function is constructed according to the priority of the task to be offloaded, the total processing delay of other terminal devices and the total processing delay of the edge computing device; the objective function is constructed according to the first initial function and / or the second initial function; Constructing the target constraint condition according to the task computing amount, the task transmission amount, the security information, the first service performance and the second service performance; The safety information includes the task safety level and task delay requirements, and the edge computing device transmission information includes the edge computing device transmission bandwidth; The first constraint is constructed by the following formula: ; in, is the serial number of other terminal devices, d=1...N, Whether to offload the tth task to be offloaded from the dth other terminal device to the ith target terminal device, is the serial number of the target terminal device, , is the task calculation amount of the tth task to be offloaded from the dth other terminal device, The upper limit of the preset task calculation amount is is the amount of tasks to be processed for the i-th target terminal device, For tasks to be processed, Whether to process the tth task to be offloaded of the i-th target terminal device locally, The task calculation amount of the tth task to be offloaded processed locally by the i-th target terminal device; The second constraint is constructed using the following formula: ; in, is the total processing delay of the tth task to be offloaded from the i-th target terminal device, is the preset total processing delay upper limit of the tth task to be offloaded from the i-th target terminal device; The third constraint is constructed by the following formula: ; in, Processing total energy consumption for the i-th target terminal device, A preset processing total energy consumption limit for a target terminal device; The fourth constraint is constructed by the following formula: ; in, is whether to offload the tth to-be-offloaded task of the i-th target terminal device to the d-th other terminal device, where d is the sequence number of the other terminal device, and when d=1…N, Whether to offload the tth task to be offloaded of the i-th target terminal device to the edge computing device, i , is the serial number of the target terminal device; The fifth constraint is constructed by the following formula: ; in, =0, it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the d-th other terminal device. , it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the edge device. , it means that the tth task to be offloaded from the target terminal device is offloaded to the edge computing device. , it means that the tth task to be offloaded of the i-th target terminal device will not be offloaded to the d-th other terminal device. , it means that the tth task to be offloaded of the i-th target terminal device is offloaded to the d-th other terminal device. is the serial number of the target terminal device, ; Combining the first constraint condition, the second constraint condition, the third constraint condition, the fourth constraint condition and the fifth constraint condition as the target constraint condition; Solving the task offloading optimization model to obtain an offloading solution for the task to be offloaded; Among them, the D3QN deep reinforcement learning formula is used to solve the task offloading optimization model. The D3QN deep reinforcement learning formula is as follows: in, is the target value, and To evaluate the parameters of the network and the target network, It’s an instant reward. is the next state, is the discount factor, () is to find the action in q() Maximum value, Is to evaluate the network status The action that optimizes the action value *; It is to find the state under the target network. Next action * action value; According to the offloading scheme, the task to be offloaded is offloaded to the other terminal device or the edge computing device.
2. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to claim 1 is implemented.
3. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method of claim 1.
