Tconns: a novel time‑varying context‑aware offloading strategy for mobile edge computing

Mobility is a fundamental feature of mobile edge computing.

Many related researches have explored optimal offloading decisions [5][6][7] and mobileaware offloading [8,9], aiming to minimize energy consumption while satisfying the delay constraint.However, these studies also have some limitations as follows: (1) The variation of contexts with environmental parameters is neglected, which will have a great impact on the offloading decision adaptation; (2) All tasks will be offloaded by default.However, some tasks may be less power-wasting to process on the local device; (3) In mobile-aware scheme, offloading decisions are usually made purely based on mobility.In fact, mobility is just one of the important factors influencing the offloading decisions.
Mobility is the basic feature of MEC [10], and the core characteristic is the change of location or movement pattern.Wang et al. [10] showed that the user movement process will upload tasks and receive results through different small cell base stations (SBS).The number of users accessed by each SBSs is different, and the load involving communication and computing in the mobile edge network will change, that is, the movement of users results in a time-varying workload.Due to the mobility, The terminal devices in MEC are in different areas at different moments.The network condition and the available resources of the edge server (such as cloudlets) are dynamically updated with time [10,11].The values of contextual attributes that affect the offloading decision fluctuate, have time-varying characteristics [12,13].The fixed context offloading strategy do not consider the mobility characteristics, which may lead to the invalidation for task offloading in MEC [12].
In this paper, we make the time-varying context-aware optimal edge offloading decision based on neutrosophic set (NS).Our main contributions are summarized as follows: (1) We establish a contextual offloading decision framework in a three-layer cloudedge hybrid MEC environment.Furthermore, we establish a single-value NS model with the ability to express fuzzy information for four key time-varying contextual attributes.(2) We propose a time-varying context-aware cloudlet decision-making scheme based on neutrosophic sets, and use a series of NS unique operations including neutrosophic entropy, aggregation operator and NS score function to calculate the optimal cloudlet (3) Experiments show that compared with other methods, the proposed scheme performs better in terms of the number of task failures, response time and energy consumption.
The remainder of this paper is organized as follows.Section 2 reviews related work.Section 3 provides an overview of the framework and a description of the problem.Section 4 proposes the transformation from time-varying context sequence data to the contextual NS representation.Section 5 introduces the proposed cloudlet decision algorithm.Section 6 presents the experimental details and results.Section 7 concludes the paper and highlights future directions of study.

Related works
In order to make offloading decisions that maximize benefits, it is essential to consider contextual information.Studies have been conducted to make service selection or offloading decision by considering different contextual factors, such as user location [11], wireless medium [14], application type [15], and network bandwidth [16], etc.These schemes adopted such as supervised learning [11] or a multi-criteria decision-making [14] to improve cloud computing service performance or optimize the energy consumption of mobile devices.Given a specific context, these schemes' decisions may be inaccurate and inefficient.In response to this problem, Junior et al. [17] considered six factors including network throughput, application data size, CPU utilization of mobile phone, etc., and used machine learning classification algorithms JRIP and J48 to achieve highprecision context-aware offloading.Chen et al. [18] conducted an evaluation under the T-Mobile LTE network.It was shown that when watching streaming video in a mobile vehicle with weak wireless signal, maintaining a high bitrate is not helpful for improving the user experience.Meanwhile, reducing the resolution at this time can greatly save energy of the device.As you can see, mobility does affect the offloading context.
To this end, some studies (such as [2] and [8]) model the distribution of mobile users in the Cloudlet as a Poisson point process, which then could be solved using a Markov Decision Process (MDP).The difference is that Wang et al. [2] considered the sojourn time of the mobile device in the current service area, while Zhang et al. [8] focused on the impact of user movement on the connectivity between the user and the cloudlet.
Solutions using MDP assume that the user's movement patterns are known in advance which is difficult to obtain in fact.Zhang et al. [4] proposed a deep Q-network (DQN)based task migration technique for MEC systems, which learns optimal task offloading and migration strategies from previous experience, without having to obtain the user's moving pattern information in advance.Mukherjee et al. [19] proposed a mobile-aware task delegation model and a code offloading model based on virtual machine migration.Yu et al. [9] proposed a dynamic mobility-aware partial offloading scheme based on short-term movement prediction, which optimize the offloading ratio and offloading path during the movement of users.
It can be seen that the existing mobile-aware edge offloading research focused on the analysis and processing of mobile patterns.In fact, the user's movement is accompanied by dynamic hidden features that change over time.These hidden features lead to uncertainty about the network enabled by MEC [20].To ensure the effectiveness of offloading in MEC, it is necessary to consider the time-varying characteristics in addition to the mobility characteristics [12].
The current research on the time-varying characteristics in MEC mainly consider two types, namely, time-varying network and time-varying load variation.Both [12] and [21] study the time-varying characteristics of the channel in-vehicle edge computing.A timevarying channel will result in time-varying spectral efficiency (SE).If the time-varying delay is not considered, the offloading strategy cannot guarantee the task delay requirement.In [12], the time-varying SE is calculated using the average SE across the region during the task transit time.[21] also adopted the mean value scheme for time-varying features.The MobiEdge system [13] considered the time-varying characteristics of the service request workload in a frame for edge service placement and transforms the maximization problem under constraints into a linear programming problem.
It can be seen that the existing work has limited consideration of the changes context of mobile edge environment over time and does not simultaneously integrate mobility and other contexts to make comprehensive offloading decisions.The above reasons prompt us to propose a time-varying context-aware edge offloading strategy.

System framework
In this paper, we consider a three-tier cloud-edge hybrid computation offloading environment, consisting of a central cloud, some cloudlets and some mobile devices.Computational tasks can be executed at these three locations.Among them, the central cloud can provide stable and powerful computing ability and massive storage, but the communication latency is high.Within the user's mobile range, there are also p cloudlets, which deploy servers with computing and network resources.The cloudlets have computing ability superior to mobile devices, and can provide low-latency services compared to the central cloud.At this time, within the delay threshold T timer , the optimal cloudlet may be selected from the nearby p cloudlets to perform the task according to the context attributes.
The time-varying context-aware edge offloading framework proposed in this paper is shown in Fig. 1.The framework has three levels: (1) Obtaining historical contextual time-varying data.These data, including CPU utilization, load, and network latency are obtained through related APIs.The mobile attribute is characterized by the expected residence time within the cloudlet.(2) A novel presentation model of time-varying context.The time-varying data of contextual attributes are dynamic and imprecise.We use a neutrosophic set (NS) model to describe such uncertain fuzzy Fig. 1 The framework of time-varying context-aware offloading based on neutrosophic set.We consider a three-tier cloud-edge hybrid computation offloading environment (which is depicted in the right part), consisting of a central cloud, some cloudlets and some mobile devices.Computational tasks can be executed at these three locations.The framework, from bottom to top, has three levels: (1) Obtaining historical contextual time-varying data.These contextual data includes four types, include CPU utilization, load, network latency and the expected residence time within the cloudlet.(2) A novel presentation model of time-varying context.The time-varying data of contextual attributes are dynamic and imprecise.We use a neutrosophic set (NS) model to describe such uncertain fuzzy information and generate a single-valued NS for each contextual attribute of cloudlets.(3) The best cloudlet selection through a series operations of NS.That is, first, we calculate the weight of each context attribute.we calculate the weight of each context attribute.Then, we use the single valued NS weighted average aggregation operator to aggregate the SVNS of cloudlets into the single-valued neutrosophic number of cloudlets.Finally, we select the best cloudlet using the NS score function information, and generate a single-valued NS for each contextual attribute of cloudlets.(3) The best cloudlet selection through a series operations of NS.That is, first, we calculate the weight of each context attribute.Then, we use the single-valued NS weighted average aggregation operator to aggregate the SVNS of cloudlets into the single-valued neutrosophic number of cloudlets.Finally, we select the best cloudlet using a combination of the NS score function and the cloudlet usage probability predicted by the mobile periodicity.
In the three-layer cloud-edge environment, there are n tasks to be executed.The execution cost consists of two parts: the task response time and the energy consumption.The execution costs of computing tasks in the local mobile device, the cloudlet and the central cloud are denoted as C mob , C clt , C cld , respectively.
Accordingly, if C mob ≤ C clt , it is less costly to process the task locally on the mobile device itself, and otherwise it is more appropriate to offload the task to the nearest cloudlet.When no suitable cloudlet can be obtained within T timer , the task will be trans- ferred to the central cloud and be served.The tasks in the system are offloaded to three locations, and the total cost of completing this set of tasks is formulated as follows: where x, y and z denote the number of tasks executed in local mobile devices, cloudlets and the central cloud, respectively.Here, we have x + y + z = n.

Three layers cloud-edge hybrid offloading cost
The execution cost consists task response time T and energy consumption E as follows: where site ∈ {mob, clt, cld} , α and β are the weighting factors for response time and energy consumption, determined according to user preferences.The calculations of T and E for task execution at the three locations are detailed below, respectively.
(1) Local execution If the task is executed on a mobile device, the response time and energy consumption of the task are calculated as follows: where I refers to the task size which is described by the number of instructions, S mob is the number of instructions executed per unit time of the mobile device, and P mob is the power consumption per unit time while executing the task.
(2) Task offloading to the cloudlet If a task request is responded by the nearest cloudlet, the response time includes propagation time, communication time, queuing time and processing time.The corresponding calculation is shown as follows: (1) where D clt is the distance between the device and the cloudlet, S p is the propagation speed.D u , D d , B u , B d are the amount of uplink data, the amount of downlink data, uplink data transmission rate, downlink data transmission rate, respectively, Q clt denotes the queue waiting time, S clt denotes the number of instructions executed by cloudlet per unit time.
The total energy consumption of the task execution on the cloudlet includes the energy consumption of the mobile device when sending and receiving data and waiting for the results.It is calculated as follows: where P moi is the power consumed per unit time when the mobile device is waiting for a result, P s is the power consumed by mobile device for sending data per unit time, P r is the power consumed by mobile device for receiving data per unit time.
(3) Task offloading to the central cloud The central cloud has powerful computing ability and storage capabilities, and thus tasks can be executed without queuing.The response time and energy consumption are calculated below.
where D cld represents the distance between the nearest cloudlet and the central cloud, S cld represents the number of instructions executed by the central cloud per unit time.

Time-varying context of offloading
In this paper, contexts are defined as the relevant attributes that affect the task offloading process and results.Four time-varying contextual factors are considered for offloading decision, namely, cloudlet load, CPU utilization, network conditions and mobile residence time.
The former three factors are common contextual factors which are easy to measure, collect and test [22].(1) The load refers to the average number of tasks that are using CPU or waiting CPU over a period of time.The higher the load, the higher the queuing delay and service loss probability.(2) CPU utilization is the percentage of CPU occupied by the program in real time during its operation.The lower the current CPU utilization, the more computationally intensive tasks can be executed.(3) Network conditions determine the quality of communication between the mobile device and the server throughout the offloading process. (5) The mobile residence time.User's movement may result in disconnection from the old cloudlet and reconnection to the new cloudlet, bringing additional task migration overhead.Different from the former three contexts, mobility is an abstract concept.In this paper, the mobile residence time of the device is used to represent the user's expected residence time within the cloudlet service range.The mobile residence time is one of the most important factors affecting edge server selection and ensuring service continuity.
The above four contexts are dynamically updated over time, all have time-varying characteristics.Thus, making the offload decision cannot only consider the state of the context at the current moment but should analyze it from a recent period of time.

Mobile residence time
The longer a user stays within the service scope of a cloudlet, the more likely the task will be completed at the current cloudlet without additional overhead resulted from task migration [23].The variation of mobile residence time is shown in Fig. 2. Suppose the user moving along the direction α 0 at the moment t 0 , changes the direction of movement to α 1 at the moment t 1 , and the user moves along α 2 again by t 2 .Taking cloudlet2 as an example, we estimate the mobile residence time of users within cloudlet2's service range.The cloudlet position is (a, b), R denotes the service scope of the cloudlet.The user current position is (x, y).The user's direction of movement α and the user moving speed V can be obtained via GPS.D is the straight line distance between the Fig. 2 Illustrate the measure of mobile residence time.Suppose the user moving along the direction α 0 at the moment t 0 , changes the direction of movement to α 1 at the moment t 1 , and the user moves along α 2 again by t 2 .Taking cloudlet2 as an example, we estimate the mobile residence time of users within cloudlet2's service range.The cloudlet position is (a, b), R denotes the service scope of the cloudlet.The user current position is (x, y).The user's direction of movement α and the user moving speed V can be obtained via GPS.D is the straight line distance between the user's current position and the cloudlet user's current position and the cloudlet.Then the residence time of the user in cloudlet2 at moment t 0 can be calculated by Eq. ( 9).
where S is the distance of the user needs to travel to leave the coverage of the cloudlet along the moving direction.θ = arccos α•β |α|×|β| , β is the direction vector from the user's current position to the cloudlet.We have β = (a − x, b − y) .Instead of calculate the res- idence time of cloudlet through a single straight-line distance and velocity, we describe the time-varying characteristics of the estimated residence time, record the estimated residence time within q moments.There are already some software that obtains the relevant interfaces to achieve accurate step counting, speed acquisition, etc. Examples include Google's Speedometer, a GPS Speed Tracker.By calculating the expected residence time of mobile users at q moments within p cloudlets respectively, we can obtain the time-varying data sequences, denoted as M j i , i ∈ {1, 2, ..., p}, j ∈ {1, 2, ..., q}.

Time-varying context data sequence of a cloudlet
Suppose there are p candidate cloudlets.The time-varying sequences of cloudlet load L, CPU utilization C and network conditions D in q consecutive moments are denoted as .., q} .The load and CPU utilization can be viewed by top and vmstat commands respectively in Linux environment.The network conditions are measured by network latency.The time-varying mobility property is characterized by the expected user residence time within the cloudlet.By calculating the expected residence time of mobile users at q moments within p cloudlets respectively, we can obtain the time-varying data sequences, denoted as M j i , i ∈ {1, 2, ..., p}, j ∈ {1, 2, ..., q} .The time-varying contextual data of cloudlet i are collectively denoted as a quaternion vector After normalizing the contextual original data, the four time-varying contextual data sequences of p candidate cloudlets at q moments can be expressed as matrix CON (cloudlet j i ) p×4 , i ∈ {1, 2, ..., p} , j ∈ {1, 2, ..., q} , which is formulated as follows: The i-th row of the matrix CON (cloudlet j i ) , CON(i) corresponds to the context data sequence of the cloudlet i , expressed as follows:

The SVNS representation of the time-varying context
Most of the existing work on analyzing the time-varying features of mobile edges adopt the average value based scheme, which is difficult to accurately characterize the inconsistent and uncertain fuzzy information.In this paper, we consider the characterization tool of fuzzy information, single-valued neutrosophic set (SVNS).SVNS [24] is a branch of neutrosophic set (NS) theory [25], which expands the traditional fuzzy set, adopts three measures of truth-membership, indeterminacy-membership and falsity-membership to characterize fuzzy decision-making information.It has the ability to delicately and accurately describe the fuzzy nature of objective things.At the same time, the neutrosophic set has independent unique operations, which have been widely used in multi-attribute decision making [26], artificial intelligence [27] and service evaluation [28].
The value of the membership function of the SVNS is a real number.Given a domain X, a SVNS A on X includes truth-membership function T A (x) , indeterminacy-membership function I A (x) and falsity-membership function F A (x) , denoted as follow: where In order to use SVNS to characterize the time-varying context, it is necessary to establish three membership functions for each time-varying context factor of cloudlet i , that is, to obtain the three membership values for each context factor of cloudlet i .Converting the contextual data sequence expressed in Eq. (11) to a SVNS, it can be expressed as follows:

The context SVNS generation using backward cloud model
In order to establish the three membership functions of the time-varying context, cloud model [29](CM) is used to complete the transformation expressed in Eq. ( 5).The cloud model is a cognitive model that implements the duplex transformation of qualitative concepts and quantitative data.The contextual data sequence have been acquired in section 4.1, so the current problem is one that goes from quantitative (data sequence) to qualitative (degree of membership).
The cloud model has three numerical features: expectation Êx , entropy Ên , and super- entropy Ĥe .Êx is the expectation of the spatial distribution of cloud drops in the theoreti- cal domain, which represents the basic certainty of the qualitative concept; Ên represents the measure of uncertainty of the qualitative concept, which reflects the range of values that can be accepted by this concept in the theoretical domain.Ĥe is the entropy of the entropy Ên , which is the uncertainty of the entropy and expresses the deviation of the cloud model.Therefore, Êx can be taken as the truth-membership T A of SVNS, Ên as the indeterminacy- membership I A , and Ĥe as the falsity-membership F A , that is, In this paper, hybrid cloud and cloud models both refer to the word 'cloud' .To distinguish them, hybrid cloud is used to refer to nodes or clusters in distributed computing.It is a computational paradigm.However, cloud, cloud model, cloud droplet and other related words are all terms in cloud theory, which involves uncertain concepts in the artificial intelligence field.
In cloud model, a cloud consists of cloud drops.A cloud drop is a realization of a qualitative concept, and a certain number of cloud drops can express a cloud.Here, the value of one-dimensional time-varying context of cloudlet i at moment j can be regarded as a cloud drop.Its sequence of values describing the dimensional context at q moments can characterize the cloud model which is denoted as CM con (i) .That is, CM con (i) = (con 1 i , con 2 i , ..., con q i ) .For cloudlet i , use the membership calculation scheme shown in Eq. ( 13) -Eq.(15).That is, the backward cloud generator is selected to establish a context cloud model for each dimension as follows: where con ∈ {L, C, D, M} , con j i denotes the time-varying context sequence of a certain context of cloudlet i , i ∈ {1, 2, ..., p} , j ∈ {1, 2, ..., q}.
A element in the SVNS A is called single-valued neutrosophic number (SVNN), which is expressed as {T A , I A , F A } .For the cloudlet i , the original time-varying context data sequences of each dimension generates three numeric features through the backward cloud generator, that is, three SVNNs are generated.
So far, the transformation from the time-varying context data sequence of the candidate cloudlets to the context SVNN has been completed, which can be expressed as follow: Therefore, the time-varying contextual numerical sequence matrix CON (cloudlet j i ) p×4 of the p candidate cloudlets is transformed into the following SVNS context matrix as follows: (15) where i ∈ {1, 2, ..., p}, con ∈ {L, C, D, M} .Each row vector of the matrix SVNS(i) repre- sents the four-dimensional context SVNNs of cloudlet i , and the four column vectors respectively correspond to the SVNS of all candidate cloudlets for the four-dimensional context.
The method of transformation from the original context time-varying sequence to the context SVNS proposed in this paper is extensible.Under specific scenario, other customization decision-making factors can also be extended to take into account.

Time-varying context-aware cloudlet decision
After obtaining the SVNN of each time-varying contextual attribute of the candidate cloudlet, the optimal cloudlet offloading decision can be made.In this paper, the offloading problem is transformed into a multi-criteria decision-making (MCDM) problem.
Here, the MCDM based on NS are represented by SVNN, which can characterize the ambiguity of decision information.For the SVNS context matrix SVNS(cloudlet con i ) p×4 , some unique appropriate operators under the NS computing system are selected to determine the optimal cloudlet.

Candidate cloudlet assessment by neutrosophic operation (1) the weight of contextual attribute by SVNS entropy
In MCDM problems, different contextual attributes contribute to the decision at different degrees, and thus should be assigned different weight values.In this paper, the weights of each contextual attribute in the SVNS environment are derived using the NS entropy [30].The entropy of SVNS is used to describe the degree of uncertainly of SVNS, which is defined as follow: where A c is the complementary set [30] of A and it satisfies that In this paper, the weight corresponding to each context attribute is completely unknown, which is consistent with the characteristics of entropy.Therefore, the corresponding weights for each attribute are calculated as follows: where con ∈ {L, C, D, M} denotes four contextual attributes, E(A con ) denotes the entropy of the SVNS of the four context properties, that is, the entropy of SVNS represented by the four column vectors of SVNS(cloudlet con i ) p×4 .

SVNS
Next, the contextual SVNS aggregated into the SVNN of the candidate cloudlet based on the SVNS weighted average aggregation operator SVNSWA ω [26].The operation will aggregate each row in the matrix SVNS(cloudlet con i ) p×4 to derive the SVNN of candidate cloudlet i as follows: This operation aggregates each row in the matrix SVNS(cloudlet con i ) p×4 , (2) cloudlet score calculation by NS score function After obtaining the SVNN of cloudlet i , the score of each candidate cloudlet is calcu- lated using the NS score function [25] which is an important metric in SVNN ranking.The score of cloudlet i is calculated as follow: where T i , I i and F i are the truth-membership value, indeterminacy-membership value and falsity-membership value of cloudlet i , respectively.The cloudlet with the highest score is the optimal cloudlet.Now, we have the preliminaries score of cloudlet i as the target cloudlet with the time-varying context feature.

Composite score by movement periodicity
Studies on human mobility have shown that users often move back and forth to several places, showing periodicity and predictability in their movements [23].Therefore, we propose a prediction algorithm for cloudlet usage based on tail sequence matching and calculate the predicted cloudlet usage probability.Finally, make the optimal cloudlet decision with the help of this probability and mentioned NS score function.

Definition 1 Tail matching subsequence (TMS).
A mobile user's cloudlet history usage sequence are denoted as S = (S 1 , S 2 , S 3 , ..., S n ) .Its tail subsequences with length l are denoted as SE(l) = (S n−l+1 , ..., S n−1 , S n ) .If there is a subsequence of S with length of l, In the historical use sequence S, there may be more than one TMS corresponding to a tail subsequence SE of a particular length l.If these TMSs exist in S, the next element of TMS will most likely be the next element of SE as the prediction target cloudlet.

Definition 2 Tail-matched prediction cloudlet (TMC). A mobile user's cloudlet his
In the example shown in Fig. 3, a historical usage sequence of cloudlets by mobile users is cloudlet A, D, B, F , C , and so on.We can see ADBF is a TMS of length 4, and BF is a TMS of length 2. The corresponding TMC C and E can also be obtained.According to TMS and TMC, the prediction algorithm of cloudlet usage is detailed in algorithm 1.

Algorithm 1 Prediction algorithm for cloudlet usage based on tail sequence matching (PCTSM)
Obviously, the length of SE is not fixed, and there may be more than one TMS.Therefore, for multiple TMSs, they are given corresponding weights.There will be duplicate elements in TMCs .We remove these duplicate elements, and then record the duplicate times of elements in TMCs as num 1 , num 2 , ..., num n and the corresponding TMS length as len 1 , len 2 , ..., len n .Obviously, the larger num and len are, the higher the probability of using the cloudlet next.The using probability is calculated as: where ω 1 and ω 2 denote the weight of duplicate times of TMC and the length of TMS, respectively, j ∈ {1, 2, ..., n} , and n is the number of non-repeating cloudlet in TMCs.
We filter out the cloudlets that are not in the prediction range to reduce the computational complexity.For the cloudlets in the prediction range, the score of cloudlet i will be updated using the probability prob i , and the composite score of cloudlet i will be calcu- lated as: (19)  where Cscore i is the composite score of cloudlet i after considering movement periodicity.The best cloudlet is the one with the highest composite score.

Time-varying context-aware cloudlet decision algorithm
The time-varying context-aware cloudlet decision algorithm based on neutrosophic set(TConNS) is shown in Algorithm 2.
Algorithm 2 Time-varying context-aware cloudlet decision algorithm based on neutrosophic set (TConNS) In TConNS, step 3 to step 8 convert the context raw data sequence into a context SVNS matrix with a time complexity of 4 •O(p) .Step 9 to step 16 use the SVNS matrix to make decisions, and the time complexity is 4 •O(p) .The time complexity of the entire algorithm is C •O(p) , where C represents the |con|, that is the number of context dimen- sions considered.

The experiment, results and discussion
In this section, we conduct several experiments to evaluate the TConNS with better performance.Section 5.1 describes the experimental environment and performance metrics.Section 5.2 compares the TConNS with other three related offloading schemes and analyzed.

Experimental settings (1) experimental environment
In this paper, we use Advantech EIS-D210 [31] (3846MIPS, 1.5GHz, 4GB RAM) as the parameter of cloudlet and use Dell PowerEdge (31790MIPS, 3.0GHz, 768GB RAM) as (20) Cscore i = score i * prob i the parameter of cloud server.The service scope of the cloudlet is set as 50 m, the bandwidth between the user and the cloudlet is set to 100Mbps, and the bandwidth between the user and the cloud server is set as 1Gbps [32].The task size is allocated according to uniform distribution with an average value of 4600 M instructions and the data transfer size of each task is also allocated in the same way with an average value of 750 kilobytes [33].
The experiment was run on Windows 1020H2, using the python language, version 3.9.Coordinate distances are calculated using python's geodesic package, and numpy and pandas are used for matrix manipulation and data analysis. (

2) datasets
The experiments in this paper use the EUA dataset [34] and the Alibaba cluster dataset [35].The EUA dataset collects geographic locations of edge servers and mobile users in the Melbourne, Australia area, and can be used to study mobility in edge environments.The Alibaba cluster dataset records data related to the actual production of 4000 servers over an 8-day period.We extract two kinds of data on CPU utilization and load of the servers from the dataset.Network conditions are measured by network latency.
(3) Comparing algorithms and evaluation metrics To verify the effectiveness of TConNS, we compare TConNS with three other contextaware offloading schemes.
(a) appAware [15]: This scheme offloads tasks to different cloudlets depending on the requested application type, and tasks will be offloaded to the cloud computing center when no suitable cloudlets is available; (b) mCloud [14]: In this scheme, different offloading locations are selected by the currently available wireless media of the mobile device.TOPSIS multi-attribute decision making is performed when multiple available wireless media exist; (c) VMM [19]: A mobility-aware task offloading model is proposed.As the user moves, the task is switched between different cloudlets until the task execution is completed.
(4) Baselines Four baseline methods were used to further verify the effects of mobility, network conditions, load and CPU utilization on cloudlet selection.These four baselines are simplified versions of TConNS.They are: TCon-wL (without load) that does not consider the load of cloudlet, TCon-wC (without cpuUtil) that does not consider the CPU utilization of cloudlet, TCon-wD (without delay) that does not consider network conditions and TCon-wM (without mobility) that does not consider users' mobility.
We consider three metrics: (a) the average number of task failures; (b)the response time of task completion and (c) energy consumption.A Task whose response time exceeds the delay threshold is defined as a failed task.

Case study
Assumed that there are 10 candidate cloudlets near the user.Considering the periodicity of the user's movement, the TMC predicted by algorithm 1 are cloudlets B, D, G and I.The matching subsequence length and the matching times are returned.Assuming that the weights of matching sequence length and times of matches are equal, the predicted cloudlet usage probability is calculated using Eq. ( 19).All the above results are shown in Table 1.
For cloudlet B, D, G and I, within the prediction range, the original data of the four context attributes within 20 moments are taken to characterize the time-varying properties.After normalizing the data, the time-varying context data are transformed into SVNS of the cloudlets' contexts using Eq.(13 * ) -Eq. (15 * ), i.e., the matrix SVNS(cloudlet con i ) p×4 , as shown in Table 2.
Next, the weights of each context attribute are calculated using Eq. ( 16) to obtain ω con = (0.24, 0.27, 0.22, 0.27) , where con ∈ {L, C, D, M} .We use Eq.(17) to aggregate the SVNS of cloudlets on the time-varying contexts into the SVNN of each candidate cloudlet, and finally, use Eq.(18) and Eq. ( 20) to calculate the score and the composite score of each candidate cloudlets, as shown in Table 3.
The cloudlet I, which has the highest score, exhibits high truth-membership, low indeterminacy-membership and falsity-membership for each context parameter.Its score is the highest.However, it is not the final choice because the user has the highest probability to access cloudlet D considering the periodicity of user movement, and its composite score is the highest.Therefore, here the cloudlet D is the optimal cloudlet.

Comparative analysis
(1) Proportion of tasks offloaded to different locations Figure 4 shows the percentage of 100 tasks offloaded to different locations by using three schemes.When the cloudlet does not meet the requirements of the task to be processed, appAware and mCloud choose to process the task on the local device or the center cloud instead of looking for another cloudlet.In appAware, the proportion of offloading to cloud is larger due to only the availability of the application to process a certain type of task on the cloudlet.In the experiment of mCloud, only the wireless medium is considered as a contextual condition, and only the availability of the wireless medium  is used to decide where to process the task.When there is no available WIFI media, there are a large number of tasks processed locally on the device.
(2) Number of failed tasks The number of task failures is measured when the number of tasks is 20, 40, 60, 80, and 100, respectively.The number of task failures of TConNS and the comparison experiments are shown in Fig. 5.
TConNS captures the user's movement tendency by predicting the user's residence time in the cloudlet scope.If the expected residence time in a cloudlet is small, this cloudlet is assigned a small truth-membership and a small comprehensive score.Thus, this cloudlet cannot become the best cloudlet, avoiding task migration and reducing the number of task failures.In VMM, as users move, tasks switch between different cloudlets leads to a considerable increase in the number of failed tasks.In addition, TConNS considers multiple contextual attributes and selects the best cloudlet to provide highquality service for tasks and reduce the number of task failures, which is more comprehensive than appAware and mCloud that only consider a single context.Furthermore, the data sequence of the most recent period is chosen by TConNS to characterize the time-varying properties of the attributes.The appropriate context in the most recent period is also appropriate in the most recent future, which has a significant impact on best cloudlet decision.Selecting the best cloudlet can reduce the number of failed tasks.
(3) Response time and energy consumption The comparisons of the response time and energy consumption between TConNS and the other three algorithms when processing different number of tasks are shown in Fig. 6 and Fig. 7.The average response time of TConNS is about 49% lower and the average energy consumption is about 46% lower compared to the other schemes.
The above comparison results show the comprehensive effect of TConNS is better.The large proportion of tasks offloaded to the cloudlet (see Fig. 4) and the small number of  It can be seen that the fusion of these four context properties is crucial to the choice of cloudlet.In our TConNS, the cloudlet is chosen with the impact of multiple contextual attribute information taken into account, rather than modeling from a single And, it can be that each contextual factor has a different degree of influence on the selection of cloudlets and the offloading of tasks.Among them, the load is the most 'prominent' and has the greatest impact on the results.This is consistent with the weights of attributes calculated using the entropy weight method as shown in Eq. ( 16), and also indicates the effectiveness of the entropy weight method.In summary, TConNS fully considers the four context attributes of cloudlet load, CPU utilization, network conditions and user mobility to select the best cloudlet from the global perspective, which is better than considering only the single-dimensional context method.

Conclusion
In this paper, we investigated task offloading and edge server selection under mobile edge computing.A time-varying context-aware cloudlet decision framework based on the NS was proposed.Four context attributes with time-varying characteristics, including load, CPU utilization, network conditions and mobile residence time, were considered for multi-attribute cloudlet decision making.The neutrosophic set is used to tory usage sequence is S = (S 1 , S 2 , ..., S n ) , S ′ = (S ′ m , S ′ m+1 , ..., S ′ m+l ) is a TMS of S, and then the cloudlet indicated by the next access location of S ′ in S, i.e., S ′ m+l+1 is a TMC for that user.

Fig. 3
Fig. 3 Illustrate a mobile user's historical usage sequence of cloudlets.ADBF is a tail matching subsequence (TMS) of length 4, and BF is a TMS of length 2. The tail-matched prediction cloudlet is C and E correspondingly

Fig. 4
Fig. 4 Proportion comparison of offloading to different locations.The figure shows the percentage of 100 tasks offloaded to three different locations (mobile device itself, cloudlets and the central cloud) by using three schemes

Fig. 5 Fig. 6
Fig. 5 Comparison of failed tasks.The figure shows the number of failure tasks of TConNS and the comparison schemes.The number of task failures is measured when the number of tasks is 20, 40, 60, 80, and 100, respectively.It validates that TconNS can reduce the number of failed tasks

Fig. 7 Fig. 8
Fig. 7 Comparison of energy consumption.The figure shows the comparison of energy consumption between TConNS and the other three algorithms when processing different number of tasks (n=20, 40, 60, 80, 100).The average energy consumption of TConNS is about 46% lower compared to the other schemes

Fig. 9 Fig. 10
Fig. 9 Comparison of the response time with baselines.The figure shows the comparison of response time between TConNS and the other four baselines when processing different number of tasks (n=20, 40, 60, 80, 100)

Table 1
TMC related information

Table 2
SVNS of cloudlets on time-varying contexts

Table 3
Candidate cloudlets' SVNN and its score