This application is based upon and claims priority to Chinese Patent Application No. 202311518680.1, filed on Nov. 15, 2023, the entire contents of which are incorporated herein by reference.
The present disclosure relates to the technical field of edge computing, and in particular, to a mobile edge computing (MEC) task unloading method with a cache mechanism.
With popularization of mobile devices and rapid development of applications, an increasing number of applications need to perform computing and storage. A traditional cloud computing model has problems of high computational delay, network bandwidth bottleneck, and high energy consumption. In order to resolve these problems, mobile edge computing (MEC) comes into being. The MEC can place computing and storage resources in an edge network closer to users, respond to requests from the users faster, reduce network bandwidth pressure, and reduce an energy consumption. However, the MEC also has problems of limited resources, diversified tasks, and a huge quantity of users.
Most literatures mainly consider a delay and an energy consumption for an MEC task unloading strategy. Some literatures consider a cache mechanism, mainly by combining the delay.
An objective of the present disclosure is to provide an MEC task unloading method with a cache mechanism to reduce a delay and an energy consumption of task unloading and processing, thereby further improving efficiency and accuracy of unloading an edge computing task.
In order to resolve the above technical problem, the present disclosure adopts following technical solutions:
The present disclosure provides an MEC task unloading method with a cache mechanism, where the MEC task unloading method with a cache mechanism includes:
Optionally, in the S1, the cache mechanism includes:
Optionally, the updating cache space based on the function value of the task includes:
Optionally, the task unloading total delay model is:
fn,klocal represents computing power of a central processing unit (CPU) of a mobile device when the nth user executes the kth task, in other words, a quantity of CPU cycles executed per second; ωk represents a quantity of computing resources required to complete the kth task, in other words, a total quantity of CPU cycles; Ik represents a data size of the kth task, fk represents a quantity of cycles required for each data bit in the kth task, and xk represents a joint decision variable for unloading and caching the kth task; Hitk represents a cache hit rate of the kth task, and the cache hit rate is
rk represents a request probability of the kth task; Ok represents a size of a processing result of the kth task; M represents a size of a cache capacity of a server; Tn,koff represents a persistence delay of unloading the kth task to the server by the nth user, and Tn,koff=Tn,ktrans+Tn,kexe+Tn,kresult;
represents an uplink transmission delay of unloading the kth task with an input size of Ik to the server by the nth user; Rn, mec represents an uplink data rate at which the nth user connects to the server through a wireless link, and
B represents a channel bandwidth; Pn represents transmission power of the mobile device of the nth user; Hn represents a gain of a channel between the nth user and the server; σ2 represents additive Gaussian white noise power; Tn,kexe represents a processing delay of the server when the nth user executes the kth task, and
fnmec represents computing power for the nth user to allocate a resource of the server to a task being executed; Tn,kresult represents a delay of feeding back the processing result of the kth task to the nth user, and
Rmec, n represents a downlink data rate at which the nth user connects to the server through the wireless link, and
Tn,kcoche represents a delay required for the nth user to request a cached kth task, and
Rread represents a reading rate of a cache of the server; En,k represents total energy for executing the kth task by the nth user; En,klocal represents a local computing energy consumption of executing the kth task by the nth user, and En,klocal=ξωk(fn,klocal)2; ξ represents an energy coefficient; En,koff represents an energy consumption in a process of sending the kth task to the server by the nth user, and En,koff=PnTn,ktrans; En,kcoche represents an energy consumption required by the nth user to cache the kth task, and En,kcoche=PmecTn,kresult; and Pmec represents transmission power of the server.
Optionally, in the S2, the joint optimization model configured for the task unloading and caching and having the constraint is:
Optionally, the constraint includes:
En,k≤θnTn,k≤max (tk,acom−tk,ares)
λnE+λnT=1λnE,λnT∈(0,1) xk∈{0,1,2}
Optionally, in the S3, the fitness function is:
The present disclosure has following beneficial effects:
FIGURE is a flowchart of an MEC task unloading method with a cache mechanism according to the present disclosure.
The principles and features of the present disclosure are described below with reference to the accompanying drawings. The listed embodiments are only used to explain the present disclosure, rather than to limit the scope of the present disclosure.
The present disclosure provides an MEC task unloading method with a cache mechanism. Referring to FIGURE, the MEC task unloading method with a cache mechanism includes following steps:
S1: A task unloading total delay model with a cache mechanism and a mobile device-side total energy consumption model are established based on a user task request.
To reduce a delay and an energy consumption during task unloading, and improve data access efficiency, a task can be cached on a server. Caching allows a user to directly obtain a processing result from cache space without a need for unloading and recomputing, thus saving time and resources. However, due to limited cache space, not all tasks can be cached. For this reason, the cache mechanism in the present disclosure includes:
Popularity, freshness, and a size factor of a task are determined based on the user task request.
A function value of the task is obtained based on the popularity, the freshness, and the size factor of the task, where the function value of the task is:
prik=α×popk+β×frek+γ×weightk,
where α, β, and γ represent different weight parameters, popk represent popularity of task dk, frek represents freshness of the task dk, weightk represents a size factor of the task dk, and dk represents a kth task.
The popularity is a degree to which some tasks are widely used or requested. Research on network traffic shows that a popular task is accessed by more users, while an unpopular task is accessed less frequently. The popularity in the present disclosure is affected by three main factors: a request probability, access time, and an average request time interval.
A request probability of a task is computed as a ratio of a quantity of requests for the task to a total quantity of requests for all tasks within a specific time period. This value represents importance of the task in a current user request, and a higher request probability means that the task is more popular. Therefore, request probability rk of the task dk is expressed as:
As described above, Numk represents a quantity of requests for the task dk.
Task access time is duration required by the server to process a task request, which can be computed by dividing total task access time by a quantity of task access requests. Total time of accessing a task once is computed based on a sum of a time difference between completion time and request time of each request for the task. Shorter task access time leads to faster task retrieval, thereby increasing a possibility of a future request. Therefore, access time tk of the task dk can be expressed as:
As described above, tk,acom represents completion time of an αth request for the task dk, in other words, time when a processing result is returned to the user, and tk,ares represents request time of the αth request for the task dk. When the popularity of the task is evaluated, it is important to consider the task access time as it directly affects user experience.
An average request time interval of a task represents an average time interval between consecutive requests of the user for the task. A short average request time interval means that a task is frequently requested, which also increases importance of the task in a cache. Average request time interval sk of the task dk can be expressed as:
Therefore, by considering factors such as the request probability, the access time, and the average request time interval of the task, the popularity popk of the task can be defined as:
The freshness is a latest level of a cached task. The freshness of the task is considered, which helps to ensure that a cached task result is relatively latest. In the present disclosure, both the popularity and the freshness of the task are considered to ensure that the cached task is popular and relatively fresh. tknow represents current time, and tkgen represents generation time of the task. Therefore, the freshness is represented by frek:
Time elapsed since the task is generated is computed as a difference between the current time and the generation time of the task. A smaller difference between the current time and the generation time of the task means that the task is fresher. An inverse function ensures that the freshness is always between 0 and 1.
The cached task is not only affected by the popularity and the freshness, but also affected by a size of data associated with the task. By introducing the size factor, a system can more effectively cache the task based on a storage resource requirement. For example, if a task has a high popularity value but requires a significant quantity of processing resources due to its data size, the task has a smaller size factor than a task with a similar popularity value but a smaller data size. The size factor weightk is expressed as follows:
A value between 0 and 1 is obtained. Ik represents an input data size of the task dk, and sizemax represents a maximum task data size in a request set.
rk represents the request probability of the task dk, tk represents the access time of the task dk, sk represents the average request time interval of the task dk, Numk represents the quantity of requests for the task dk, tk,acom represents the completion time of the αth request for the task dk, tk,ares represents the request time of the αth request for the task dk, tklast represents the time of the last request for the task dk, tkfirst represents the time of the first request for the task dk, K represents presence of K tasks, dk represents the kth task, α represents the αth request, tknow represents the current time, tkgen represents the generation time of the task dk, Ik represents the input data size of the task dk, sizemax represents the maximum task data size in the user task request set, and log 10 ( ) represents a computation function of the size factor.
The cache space is updated based on the function value of the task.
Optionally, that the cache space is updated based on the function value of the task includes:
The task unloading total delay model is:
The mobile device-side total energy consumption model is:
As described above, Tn,k represents a total delay of executing the kth task by an nth user; Tn,klocal represents a local computing delay of executing the kth task by the nth user, and
fn,klocal represents computing power of a CPU of a mobile device when the nth user executes the kth task, in other words, a quantity of CPU cycles executed per second; ωk represents a quantity of computing resources required to complete the kth task, in other words, a total quantity of CPU cycles; Ik represents the data size of the kth task, fk represents a quantity of cycles required for each data bit in the kth task, and xk represents a joint decision variable for unloading and caching the kth task; Hitk represents a cache hit rate of the kth task, and the cache hit rate is
represents the request probability of the kth task; Ok represents a size of a processing result of the kth task; M represents a size of a cache capacity of the server; Tn,koff represents a persistence delay of unloading the kth task to the server by the nth user, and Tn,koff=Tn,ktrans+Tn,kexe+Tn,kresult;
represents an uplink transmission delay of unloading the kth task with an input size of Ik to the server by the nth user; Rn, mec represents an uplink data rate at which the nth user connects to the server through a wireless link, and
B represents a channel bandwidth;
Pn represents transmission power of the mobile device of the nth user; Hn represents a gain of a channel between the nth user and the server; σ2 represents additive Gaussian white noise power; Tn,kexe represents a processing delay of the server when the nth user executes the kth task, and
fnmec represents computing power for the nth user to allocate a resource of the server to a task being executed; Tn,kresult represents a delay of feeding back the processing result of the kth task to the nth user, and
Rmec, n represents a downlink data rate at which the nth user connects to the server through the wireless link, and
Tn,kcoche represents a delay required for the nth user to request a cached kth task and
Rread represents a reading rate of the cache of the server; En,k represents total energy for executing the kth task by the nth user; En,klocal represents a local computing energy consumption of executing the kth task by the nth user, and En,klocal=ξωk(fn,klocal)2; ξ represents an energy coefficient; En,koff represents an energy consumption in a process of sending the kth task to the server by the nth user, and En,koff=PnTn,ktrans; En,kcoche represents an energy consumption required by the nth user to cache the kth task, and En,kcoche=PmecTn,kresult; and Pmec represents transmission power of the server.
Optionally, the joint optimization model configured for the task unloading and caching and having the constraint is:
As described above, λnT represents a weight factor of a delay in an execution process of the nth user, Tn,k represents a total unloading delay of executing the kth task by the nth user, λnE represents a weight factor of an energy consumption in the execution process of the user, En,k represents the mobile device-side total energy consumption, x represents a joint decision of the task unloading and caching, n represents the nth user, N represents a total quantity of users, and K represents the presence of the K tasks. If a particle violates a first energy consumption constraint, a penalty of 1000 times a violation quantity is added to the fitness function. If a second delay constraint is violated, a penalty of 1000 times a violation quantity is added to the fitness function.
Optionally, the constraint includes:
which ensures that a computing resource used for computing an unloading task is positive and that a total quantity of computing resources allocated to all users does not exceed maximum computing power of the server;
which indicates that the cached task result cannot exceed the cache capacity of the server;
As described above, En,k represents the total energy consumption of executing the kth task by the nth user, θn represents the energy consumption threshold, Tn,k represents the total delay of executing the kth task by the nth user, λnT represents the weight factor of the delay in the execution process of the nth user, λnE represents the weight factor of the energy consumption in the execution process of the nth user, tk,acom represents the completion time of the αth request for the task dk, tk,ares represents the request time of the αth request for the task dk, xk represents the joint decision variable for unloading and caching the task dk, xk=0 represents that the task dk is processed locally by the user, xk=1 represents that the task dk is unloaded to the server for processing, and xk=2 represents that the task dk has been cached. A higher cache hit rate leads to a higher frequency of task retrieval from the cache, thereby reducing communication and computation delays. On the contrary, a low cache hit rate will increase a frequency of unloading the task to the MEC server, resulting in a higher delay. fnmec represents a computing resource of the nth user for computing the unloading task, S represents the maximum computing power of the server, Ok represents the size of the processing result of the task dk, M represents the size of the cache capacity of the server, and dk represents the kth task.
Optionally, the fitness function is:
As described above, fitness represents a fitness value, λnT represents the weight factor of the delay in the execution process of the nth user, λnE represents the weight factor of the energy consumption in the execution process of the nth user, represents the total energy of executing the kth task by the nth user, θn represents the energy consumption threshold, Tn,k represents the total delay of executing the kth task by the nth user, tk,acom represents the completion time of the αth request for the task dk, tk,ares represents the request time of the αth request for the task dk, dk represents the kth task, N represents the total quantity of users, K represents the presence of the K tasks, and A represents a total quantity of requests.
Specifically, following steps are included:
As described above, lij represents a current position of the particle i in the iteration j, vij represents an updating velocity of the particle i in the iteration j, and lij-1 represents a position of the particle i in iteration j−1.
An equation of updating the velocity of each particle is:
vij=w·vij-1+c1·v1·(p_bestij-1−lij-1)+c2·r2·(g_bestj-1−lij-1)
As described above, w represents an inertia weight, with a value range of [0.4, 2], and c1 and c2 respectively represent an individual learning factor and a group learning factor, where when the two values are large, a search velocity is high, and as a result, the optimal solution may be missed. When the two values are small, the search velocity is low, and as a result, a local optimal value may be generated. Therefore, it is set that c1=2 and c2=2. r1 and r2 are random numbers in (0,1) to increase search randomness.
The present disclosure has following technical effects:
The above are merely preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, and the like made within the spirit and principle of the present disclosure shall be all included in the protection scope of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202311518680.1 | Nov 2023 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
11930080 | Jiang | Mar 2024 | B1 |
20220400062 | Cai | Dec 2022 | A1 |
20240192995 | Chen | Jun 2024 | A1 |
Number | Date | Country |
---|---|---|
111132191 | May 2020 | CN |
111818130 | Oct 2020 | CN |
113434212 | Sep 2021 | CN |
114863683 | Aug 2022 | CN |
116260871 | Jun 2023 | CN |
116361009 | Jun 2023 | CN |
116566838 | Aug 2023 | CN |
116963182 | Oct 2023 | CN |
3648436 | May 2020 | EP |
2021012584 | Jan 2021 | WO |
Entry |
---|
Zhao Chan Chan, et al., Joint Optimization Strategy of Task Offloading and Resource Allocation for Cache-assisted Mobile Edge Computing, Science Technology and Engineering, 2023, pp. 3812-3819, vol. 23 No. 9. |
Sang Yongxuan, et al., Hybrid Heuristic Task Offloading Algorithm with Edge Caching Mechanism, Computer Engineering, 2023, pp. 149-158, vol. 49 No. 4. |
Shuai Yu, et al., Computation Offloading with Data Caching Enhancement for Mobile Edge Computing, IEEE Transactions on Vehicular Technology, 2018, pp. 1-15. |
Wenqi Zhou, et al., Offloading strategy with PSO for mobile edge computing based on cache mechanism, Cluster Computing, 2022, pp. 2389-2401, vol. 25. |