1 Introduction

1.1 Background and motivation

The mobile Internet and Internet of Things (IoT) applications [1,2,3,4] are experiencing an explosive growth in recent years, calling for much higher computation capacity for intelligent processing. Mobile Edge Computing (MEC) emerging as a promising computing allocation scheme [5] enables the interconnected devices to complete many complicated and computation-intensive tasks. Yet, on one hand, these devices mostly suffer from the constrained power supply and limited processing capabilities [6]. On the other hand, an arbitrary strategy to upload local tasks to the cloud will not only increase the burden of cloud but also consume much unnecessary resource. The edge-cloud computing paradigm provides a promising opportunity by offloading the computing tasks of mobile devices to nearby servers (edge clouds) or Base Stations (BSs), which can prominently reduce the computation cost and energy [7]. The limitation of shared wireless bandwidth however restricts the entire offloading tasks, only allowing a portion of tasks to move to the cloud servers [8]. Meanwhile, the limited bandwidth and computation resources also cannot allow all mobile tasks to be offloaded to resourceful BSs. Given that a device is covered by overlapping communication range of multiple BSs, a random task selection strategy will result in inefficient channel utilization and link imbalance. Therefore, an efficient strategy is necessary to decide which tasks should be offloaded to proper BSs to achieve higher energy efficiency and more beneficiaries.

1.2 Limitation of prior work

The resource allocation in MEC offloading is one of the key challenges, and there exists many studies for offloading strategy design. In recent works, the formulated problems and optimization objectives of task offloading are different. There are several representative works for further discussion. In the literature of Zhi et al. [9], it focused on the optimization problem of minimizing user task completion time under limited bandwidth resources. And the system model was formulated by Users Devices (UD) and a single BS. Chen at al. [10] formulated several computation decision-making behaviors for devices as a game in MEC. Though they considered the task computation cost between local devices, BS and remote cloud, the selection of BS under the coverage of multiple BSs was ignored. Hao et al. [11] proposed a relatively low-complexity algorithm for energy saving, and the energy efficiency is compared with both local computation and offloading situations. In the paper of Tran et al. [12], it took into account the optimization of energy and time, and it also discussed the resource allocation problem with multi-BSs scenario. But the BS selection strategy and number of uploading tasks are not involved. Other existing researches [13, 14] also proposed a variety of scheduling algorithms that mainly focused on energy efficiency and computation delay. However, these prior works usually ignored the number of migration tasks, which are actually highly dependent on the channel capacity and the task transmission rate. In general, the computation task is offloaded, which indicates that a requirement of an application has been satisfied. To some extent, the higher number of offloading tasks, the more requests will be completed in the network. Hence, the amount of offloading tasks is related to the user’s experience. At the same time, most of them also ignored considering the multi-BS selection scenario, which can render imbalanced task loads for different BSs. In particular, we are also interested in the problem of Multi-BS offloading scenarios and BS load balance in the case of unevenly distributed terminals. In order to further explain the differences in current solutions, we compare state-of-the-art solutions as presented in Table 1.

Table 1 The comparison of several task offloading algorithms

Therefore, the multi-BS selection methods with limited channel capacity are valuable to discuss in MEC.

1.3 Contributions and organization

There are several key challenges in our task offloading selection scenario. First, mobile devices are usually densely distributed and covered by more than one BS. An improper BS selecting scheme will result in imbalanced workload and poor offloading performance for the whole system. Besides, given the massive number of terminal devices in practical applications, a model with exceptional scalability and versatility is required. Moreover, a practical task offloading system needs to consider multiple optimization objectives such as efficiency and energy. It is getting even more complicated to simultaneously integrate multiple objectives together to achieve a terrific offloading selection strategy.

In this paper, we formulate the task offloading model as an optimization problem, and theoretically prove the NP-hardness to achieve the optimal solution. Besides, a BS selection scheme is taken into account to expand the data capability in the overlapping coverage scenarios. A Multi-BS based Genetic Algorithm named M-COGA is proposed to solve the task offloading selection in both single and multiple BS scenarios. The algorithm focuses on offloading as many tasks as possible with the maximum cost. And this cost includes energy consumption and computation time for local computing tasks. The number of offloading tasks is jointly considered in our design purpose. Furthermore, the proposed M-COGA algorithm is optimized in mutation operation according to the modeling characteristics of task offloading. From the simulation results, the optimized M-COGA algorithm has fewer iterations. Besides, for the multi-BS coverage scenario, we also consider the approach flexibility as well as link load balance. And an enhanced dynamic tasks offloading algorithm is further proposed. We verify the efficiency of our algorithm under the condition of both uniform and non-uniform distribution of covered nodes. In general, our algorithm achieves superior performance in task selection, computation cost offloading, BS load balancing, and energy efficiency. Besides, the algorithm in the dynamic task offloading model also greatly improves the task migration efficiency in the ultra density networks. Numerical evaluations demonstrate the superiority of our solution.

The rest of this paper is organized as follows. The computation offloading system model is presented in Section 2. Section 3 introduces the multiple BS system model. Then, we propose a genetic algorithm and the application under dynamic task offloading scenario in Section 4. In Section 5, we present the numerical experiments and analyze the results to evaluate the performance. We finally discuss the related work in Section 6, and conclude paper in Section 7.

2 Computation offloading system model

Computation offloading is usually discussed in different scenarios, and the considered factors are inconsistent in different system models [5, 10]. Given that those devices are all communicable to one or more BSs, carrying out the offloading strategy at BSs is a simple way to reduce the terminal cost. In most cases, the terminal is covered by multiple BS. We also consider a terminal set \(\mathcal {U} = \{u^{({\mathscr{B}})}_{1}, u^{({\mathscr{B}})}_{2},...,u^{({\mathscr{B}})}_{i},...,u^{({\mathscr{B}})}_{k}\}\) as the covered terminals by BS set \({\mathscr{B}}\), which \({\mathscr{B}} = \{{\mathscr{B}}_{1}, {\mathscr{B}}_{2},...,{\mathscr{B}}_{j}\}\). Generally, the j usually is a smaller number, it means that these devices are covered by one or small number of BSs, which can provide the wireless channel to the set \(\mathcal {U}\). We assume that the set \(\mathcal {U}\) will not be changed during the offloading period \(\mathcal {T}\), and each device has one task offloading requirement. Generally, the number of devices and channel gain may be changed due to the mobility of users covered by the base station. Each device may be owns more than one task, which needs offloading to the remote side. This mode of task generating task is not discussed in this paper, and it will be further discussed in future works. Therefore, the task set \(\mathcal {T}_{task}=\{L_{1}, L_{2}, ...,L_{i},...,L_{k}\}\), where \(L^{({\mathscr{B}}_{j})}_{i} \in u_{i},{\mathscr{B}}\). Each covered device only has one task in the model and the task of the device is required to offload to a near BS by centralized control of itself. In some scenarios, we need to sort these multiple tasks due to bandwidth constraints or task priority. And the simplest strategy is only uploading one task to the MEC server at the moment. As shown in Fig. 1, the task offloading scenario has four important parts, including the offloading tasks, the wireless channel, the local users, and the remote edge cloud. In this proposed system model, we focus on the computation task between terminal and BSs.

Fig. 1
figure 1

The task offloading in multi-user MEC system

The task offloading schedule can reduce the computing overhead and energy consumption of terminals. Therefore, the communication mode, mobile device and cloud play as pivotal roles in the MEC. These models are introduced in detail as follows.

2.1 Communication model

In the OFDMA communication system, the total bandwidth is partitioned into several sub-channels. And the OFDMA-based cellular network usually adopts the full-duplex (FD) ratio technology and FD based BS supports multiple half-duplex (HD) users [15]. The numerous sub-carriers of each sub-channel can be assigned to a user in a centralized model. Assume that U means the uploaded bandwidth, and the g(U) represents the channel gain for a mobile, the channel bandwidth is B, and the transmission power is SU. The N0 presents the average noise power, it is usually considered as Gaussian channel noise. Then maximum transmission bit rate CU can be calculated by equation (1)

$$ C_{U} = B*log_{2}(1+\frac{\mathnormal{g_{U}}S_{U}}{N_{0}}), $$
(1)

where CU represents the maximum data rate. It means the maximum data transfer rate can be provided to BS covered users. But it is restrained by some specific parameters of BS. In actual situations, the data transfer rate CS(U) is largely below the theoretical value of CU. Although there is data conflicting in the same spectrum, it can be improved by the physic layer channel access schedule such as CS-MUD and SCMA [16, 17]. From the equation (1), the limited transfer data rate may not satisfy the unlimited number of mobile devices to offload to the BS. For the reason of task processing efficiency, the more tasks benefited from the remote cloud, the better in MEC scenarios.

2.2 Mobile device computation model in task computation offloading

The energy consumption and computing time in local device are frequently discussed [10, 18], we assume that device i has only one task \(L_{i} \triangleq (d_{i}, {f^{l}_{i}})\), the \({f^{l}_{i}}\) denotes the CPU cycles of mobile devices per second. Then the local computing time can be described as (2)

$$ {t^{l}_{i}}=\frac{d_{i}}{{f^{l}_{i}}}, $$
(2)

where \({t^{l}_{i}}\) can also be understood as execution time or the execution cost of a terminal user. Then, the energy consumption can be described as (3)

$$ {e^{l}_{i}} = \mathcal{J}_{i}d_{i}, $$
(3)

where \(\mathcal {J}_{i}\) denotes the coefficient consumed energy per CPU cycle. If we transform this problem as the energy consumed per bit of CPU processing, we can describe the energy consumption as equation (4)

$$ {\eta^{l}_{i}} = \frac{\mathcal{P}_{i}{t^{l}_{i}}}{\mathcal{D}_{i}}, $$
(4)

where \(\mathcal {P}_{i}\) represents the CPU power consumption. Let ti denotes the processing time of task Li. From equation (3) and (4), the processed amount of data or the number of CPU cycles for the task are proportional to the energy consumption. Note that the CPU keeps the computing frequency in the processing period and it is difficult to accurately calculate the energy consumption per cycle due to the complicated work model of a CPU. Hence, \(\mathcal {J}_{i}\) can be understood as a coefficient of energy computing. As mentioned above, the task is offloaded to the nearby BS to obtain relatively abundant computing resources. The offloading purpose is meeting a requirement of an application, and the partial offloading of a task can not return the computation results of the users. And we consider the data that a task needs to upload as a whole. After we establish the computing time and energy consumption model with (2) and (3), then task cost of the local user ui can be defined as (5)

$$ \mathcal{C}^{l}_{i} = \lambda_{t}{t^{l}_{i}} + \lambda_{e}({e^{l}_{i}} + P_{r}), $$
(5)

where λt and λe denote the weight parameters that influence the optimization target for the concerned network indicators. Pr denotes the task priority value. Because the value of \({e^{l}_{i}}\) is an assumed value in the validation protocol, and Pr is positively correlated to the task cost of local user. Then, we will not set the value in the next simulations. From equation (5), if the system cares about the energy consumption, then it can set λt < λe and λt, λe ∈ [0,1]. It is the common processing way in the weight method.

2.3 Cloud computing model

The remote cloud is considered to have sufficient computing ability, and the computing energy has no constraint due to the power supply. Some studies focus on the overall operation to reach a reasonable balanced state. For instance, the task offloading needs to satisfy \(\mathcal {C}^{l}_{i} < \mathcal {C}^{c}_{i}\), where the \(\mathcal {C}^{c}_{i}\) denotes the task computing cost in the cloud [10]. Some other studies do not only consider the computing capability of the remote cloud, but they also consider the capacity of the wireless channel. As shown in subsection 2.1, the channel capacity is limited by CU and there are \({\mathscr{M}}\) sub-channels. Their respective bandwidths make up the available bandwidth B. To get the benefits of the cloud servers through the limited bandwidth is a challenging question. However, we focus on the transmission bandwidth between terminals and BSs, and the bandwidth between the BS and the cloud is sufficient. Therefore, the paper does not consider the computing power and cost of the cloud.

3 Distributed computation offloading in multiple BSs

The proposed computation offloading has been discussed in this section. As represented in the prior section, a sub-channel is used by user i. Therefore, the channel capacity of the optional \({\mathscr{B}}\) can reach the maximum data rate (6):

$$ C^{(\mathcal{B})}_{\bar{s}} (i)=\lambda_{\gamma} \bar{B}*log_{2}(1+\frac{\mathnormal{g_{i}}S_{i}}{N_{0}}). $$
(6)

The \(\bar {B}\) represents the bandwidth of a sub-channel and λγ can be understood as channel utilization ratio. Then we can formulated the channel data rate CU as \(C_{U} \geq {\sum }_{m=1}^{n}L_{m}C_{\bar {s}} (m)\). The Lm ∈ {0, 1} denotes whether it is the determined offloading tasks, and \(C_{\bar {s}} (m)\) represents the channel ratio of task m. In the MEC scenarios, the bandwidth allocated to offloading tasks is limited. Thus, it determines that the uploaded data rate cannot be greater than the data rate under the total allocated bandwidth in a time period. Therefore, under the condition of CU, we want to get the number of uploaded tasks as much as possible. Besides, we want to reduce the most energy cost and computation cost of tasks. So the resource allocation problem under the constraints on the channel data rate can be formulated as follows:

$$ \begin{aligned} \mathcal{Z}_{\mathcal{N}_{m}, \mathcal{V}_{c}} = & \begin{pmatrix} \mathop{\max} \limits_{\mathcal{N}_{m}} f(\mathcal{N}_{m})\\ \mathop{\max} \limits_{\mathcal{V}_{c}} f(\mathcal{V}_{c}) \end{pmatrix} \\=& \begin{pmatrix} \mathop{\max} \limits_{\mathcal{N}_{m}} {\sum}_{m=1}^{n}L_{m}*C_{\bar{s}}(m)\\ \mathop{\max} \limits_{\mathcal{V}_{c}} {\sum}_{m=1}^{n}L_{m}*\mathcal{C}^{l}_{i}(m) \end{pmatrix}\\ & s.t. ~~~C_{U} \geq \sum\limits_{m=1}^{n}L_{m}C_{\bar{s}} (m)\\ &L_{i} \leq N_{t}, i \in N_{t}, C_{i} \leq C_{\bar{s}}(i) \end{aligned} $$
(7)

Equation (7) describes the demand of task offloading. The purpose of the scenario requires that maximum tasks \(\mathcal {N}_{m}\) which need to offload to the cloud. Unfortunately, it should face the limited bandwidth. And the compute offloading still needs to consider the energy efficiency \({\sum }^{m}_{i=1} {e^{l}_{i}} \) and the compute time \({\sum }^{m}_{i=1} {t^{l}_{i}}\). In the model, cloud computing capabilities are considered to be sufficient. Both the energy cost and computing time require maximum value \(\mathcal {V}_{c}\) to reduce the burden. Obviously, this is a multi-objective optimization problem. And unfortunately, it is extremely challenging to obtain an optimal solution.

Theorem 1: The problem of finding the maximum number of offloading tasks as presented in (7) is NP-hard.

Proof: It is well known that the classical knapsack problem is defined as follows. There is a set of n items, where each item i has a value pi and a weight wi. The capacity of the bag is represented as c. The problem can be formulated as finding the maximum profit with a set of items. This model can be described as

$$ \begin{aligned} \begin{array}{l} \max\sum\limits_{i=1}^{n} p_{i}x_{i}~~~~~~~~~~~~\\ s.t.~~~\sum\limits_{i=1}^{n} w_{i}x_{i} \leq c ~~~~~\\ x_{i} \in {0,1}, j=0,1,...,n. \end{array} \end{aligned} $$
(8)

where xi means whether the item is in the knapsack or not. And it is well known as an NP-hard problem [19]. Turning back to our task offloading problem, the \(C_{U} \geq {\sum }_{m=1}^{n}L_{m}(m)C_{\bar {s}} (m)\). If we consider the cost \(\mathcal {C}^{l}_{i}\) as the value of item and the \(C_{\bar {s}} (m)\) is thought as the weight, the capacity of bags can be considered as the limited channel bandwidth. The formulated resource allocation problem also takes into account the maximization of the number of offloading tasks. Thus, if the number of uploading tasks is ignored, this problem can be reduced to a case of the knapsack problem. We therefore prove that our problem is NP-hard.

Then, we need to make the decision of computation offloading to decide which tasks should be offloaded. In a similar way, the selected tasks should have the maximum cost. In this way, this strategy will minimize the overall burden of the terminals.

4 The genetic algorithm for tasks offloading

In this section, the proposed optimization problem is formulated as the equation (7), and the offloading schedule is designed with a heuristic search method. To solve this NP-hard problem, this proposed genetic algorithm focuses on closing the optimal performance.

4.1 Initialization model

First, a matrix In is given to express the decision of computation offloading. The number of rows in the matrix represents the number of offloading decision combinations.

$$ In = \begin{bmatrix} \delta_{1,1} & \delta_{1,2} & ...&\delta_{1,k} \\ \delta_{2,1} & \delta_{2,2} & ...&\delta_{2,k} \\ ... & ... & ...&... \\ \delta_{m,1} & \delta_{m,2} & ...&\delta_{m,k} \\ \end{bmatrix}, $$
(9)

where the δij means the task number j, and each matrix row represents the offloading task order form set \(\mathcal {T}_{task}\). The matrix is established by a random way at the beginning, each task index is unique and δij ∈ [1, k]. Besides, the initial matrix is executed in each period tp. The size of the row is n = k, which denotes the number of pending offloading tasks in the BS. And the fitness function \(\psi _{f}(\bar {N_{t}}, \mathcal {C}^{l}_{i}) \) needs to be given according to the optimized object

$$ \psi_{f}(\bar{N_{t}}, \mathcal{C}^{l}_{i}) = \lambda^{f}_{\bar{N_{t}}}M(\bar{N_{t}})+\lambda^{f}_{\mathcal{C}}M(\mathcal{C}^{l}_{i}), $$
(10)

where the \(\lambda ^{f}_{\bar {N_{t}}}\) and \(\lambda ^{f}_{\mathcal {C}}\) denotes the coefficient separately. The M function is a mapping function, which can solve the problem of adding non-similar physical dimensions. They are mapped in [0, δ], then it can be compared within a quantified range. And \(\bar {N_{t}}\) represents the determined offloading tasks, and it takes values from matrix row δi,.... Besides, \(\mathcal {C}^{l}_{i}\) means the cost value of determined offloading tasks, which has been described in the equation (5).

4.2 The tasks selection processing by M-COGA

First of all, a terminal needs to determine the set \({\mathscr{B}}\) which the terminal can communicate with. Then, this terminal will request the remaining bandwidth \(\widetilde {C}^{({\mathscr{B}})}_{\bar {s}}\) with the BS set \({\mathscr{B}}\). And the BS with the maximum value of channel capacity \(\widetilde {C}^{(i)}_{\bar {s}}\) will be selected. Then, M-COGA establishes the matrix with random values. Then, the M-COGA conducts the following four phases of operation: roulette algorithm, elite retention strategy, cross operation, and mutation operation.

Roulette Algorithm (RA): RA can be described as roulette wheel selection strategy in GA. In RA, there are three steps for matrix reorganization. First, the fitness value of matrix In should be calculated as the set fv(i = 1, 2, 3..., m). Second, the survival probability pr(ri) is calculated by equation (11)

$$ p_{r}(r_{i})=\frac{f^{v}(r_{i})}{{\sum}^{m}_{j=1}f^{v}(r_{j})}, $$
(11)

After we calculated the pr(ri), we can get a vector of one column m rows. It represents the probability that each row of tasks can be selected for the next step. Third, pr(ri) is used to select rows based on a virtual roulette. The row with a relatively high survival probability will be selected multiple times, and the selection processing ends after the vector pr(ri) traversal is complete. Then the m times selecting operations will establish a new matrix Inr.

Elite Retention Strategy (ERS): The ERS just selects a maximum fitness value of a row in Inr, the best row is kept at the row m + 1. Thus, a new matrix Ine is established.

Cross Operation (CO): M-COGA randomly selects two rows of Ine (except the m + 1 row) for crossing operation. And it generates an index p, and p ∈ {pN|1 ≤ pNt}, then the two rows will change the values before δp,... between the two rows with distance one or two position. Besides, a crossing probability Pc, which is introduced in [20], can be described as (12)

$$ P_{c} = \left\{ \begin{array}{ll} \max(P_{c})-\frac{\max(P_{c})-\min(P_{c})*(\alpha-\beta)}{\delta^{\prime}-\beta}, \alpha > \beta, & \\ \max(P_{c})~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~, \alpha \leq \beta \end{array} \right. $$
(12)

where max(Pc) denotes the the maximum cross probability, and the min(Pc) means the minimum cross probability. α represents the maximum fitness value of the two selected rows (the two orders of offloading decisions). The β denotes the average of calculated fitness value for the whole matrix, and the \(\delta ^{\prime }\) denotes the maximum calculated fitness value for the matrix Ine. If a randomly variable seed Sd < Pc, after CO, the new matrix Inc is established. It should be noted here that the task index is unique in each row after CO. It can be achieved by traversing the task index.

Mutation Operation (MO): After the CO, we can get the new matrix Inc. The M-COGA operates the MO for each row of matrix Inc. First of all, the mutation probability [20] Pm can be described as (13)

$$ P_{m} = \left\{ \begin{array}{ll} \max(P_{m})-\frac{\max(P_{m})-\min(P_{m})*(\alpha^{\prime}-\beta)}{\delta^{\prime}-\beta}, \alpha^{\prime} > \beta, & \\ \max(P_{m})~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~, \alpha^{\prime} \leq \beta \end{array} \right. $$
(13)

The variables are similar to the equation (12). The max(Pm) represents the maximum mutation probability and the min(Pm) represents the minimum mutation probability. The \(\alpha ^{\prime }\) represents the fitness value of current MO row. The max(Pc), min(Pc) are set as 0.9 percent and 0.6 percent, respectively. Besides, max(Pm), min(Pm) are set as 0.9 percent and 0.6 percent, respectively. Each row of Inc will process the MO by the probability Pm. If a row is determined to be mutated, randomly swap the positions of the two index in the row. Such a MO iterates through the first m rows of the entire matrix Inc.

After the MO, the row with the lowest fitness value will be deleted. Then, the new matrix Inm becomes mk. The COGA will iterate until the fitness value is stable.

In the CO stage, for the dramatic changes of each row, the cross operation does not just run once and it is related to the number of initial tasks. Hence, the CO times ϕ(m) is designed as (14)

$$ \phi(m) = \frac{m}{\lambda_{b}+\lambda_{g}\delta}, $$
(14)

where λb and λg are constant coefficients, and the value of ϕ(m) is positively related to m. We present δ as a random seed. Then, the more dramatic CO operation will lead to less convergence consumption times.

figure a

4.3 An MO approach based on mutation intensity control

In the MO stage, each offloading queue combination will calculate the probability Pm according to equation (13) to obtain a new offloading task queue. In other words, the offloading queues with poor fitness values are more likely to change into new offloading queues. In the MO of Section 4, M-COGA randomly selects the two points of the queue to exchange the task, when an offloading task queue is determined to mutate. The values in the individual queue, which represent the arrangement offloading tasks. And the offloading tasks at the back of the queue can not be uploaded due to resource constraints. New offloading queues, which are generated by mutations in two near positions, are not conducive to obtain better offloading task sequences. Therefore, we design a strategy during the mutation operation to generate a new task queue. We define the mutation distance Di, which represents the distance between two swapped positions. Besides, the offloading task queue, which is represented as a row, is divided into three ranges, which is shown as Fig. 2.

Fig. 2
figure 2

The mutation distance and the range division for a task row

Then, we can describe our strategy as follows:

It is assumed that the row i is determined to execute MO with probability Pm, the two interchanged tasks xi, xj will be selected at the different ranges. The selection strategy is depended on the equation (15).

$$ \varpi(i) = \frac{\alpha^{\prime}(i)-\zeta}{\delta^{\prime}-\zeta}, $$
(15)

where the \(\alpha ^{\prime }(i)\) represents the fitness value of row i, the ζ and \(\delta ^{\prime }\) mean the minimum and maximum fitness value of Inc, respectively. If the ϖ(i) ∈ (0, 1/3], the two tasks will be randomly selected in the first range and the third range. If the ϖ(i) ∈ (1/3,2/3], the two tasks will be randomly selected in the first range and the second range. If the ϖ(i) ∈ (2/3, 1], both of two tasks will be randomly selected in the first range. In this way, an offloading task queue with a lower fitness value will have a higher Di. It means that MO will facilitate the generation task queue with better fitness value. To observe the convergence performance with the new strategy, we give the convergence times as Table 2 under different device densities according to the parameter setting in Section 5.

Table 2 The iteration count at different node densities

The algorithm is set to exit the calculation when the fitness is unchanged for 250 times. We found that the strategy effectively reduced the number of iterations except in the 30 devices scenario.

4.4 The dynamic task offloading strategy with M-COGA

As it is shown in equation (6), the computation task offloading depends on the bandwidth \(\bar {B}\) of a BS. However, in the actual task offloading scenario, the transmission time is different due to various size of tasks. In the case of constraint value \(\bar {B}\), M-COGA will be restarted after the offloaded all pending tasks are complete. Therefore, M-COGA periodically checks the available channel capability \(\bar {C}^{({\mathscr{B}})}_{a}\), which can be described as equation (16)

$$ \bar{C}^{(\mathcal{B})}_{a} = C^{(\mathcal{B})}_{\bar{s}} - \sum\limits_{i=1}^{n} Tr(i), $$
(16)

where Tr(i) is the transmission rate of task i. And n represents the total number of tasks being transmitting. Then, the rest of the pending tasks will process by M-COGA based on \(\bar {C}^{({\mathscr{B}})}_{a}\).

5 Evaluation results

We implemented the proposed scenario and the M-COGA algorithm. Then, several simulation results are presented for evaluating the performance of the M-COGA strategy. We have considered a variety of scenarios, mainly observed in the performance of three aspects: The M-COGA in single BS scenario, The M-COGA in multiple BSs scenario with random BS selection and with BS selection strategy. In the multiple BSs scenario, we also consider the uniform and non-uniform distribution of terminals in each BSs’ coverage area.

The parameters of different types of base stations are also different. For instance, Huawei BBU5900 supports up to 400 users in a single cell. A single cell covers an area of about 400 meters or more, which depends on the building block and the terrain. And the coverage can be flexibly adjusted for users [21]. However, not all of the terminals covered by a BS will have the requirement of task offloading, and the distribution of nodes is uneven in the city areas. Therefore, the offloading terminals will be less than 400 devices in a cell. Generally speaking, the uploading task size is related to the application of offloading tasks in practice. There are up to 120 mobile devices in a 1000m*1000m square area. Three BSs are distributed in this scenario, and the cover radius of each BS is 400m. The channel gain is not considered in this scenario due to the principle of the algorithm. The BS bandwidth is generally limited by radio management, and only part of the BS’s bandwidth is allowed for the purpose of task uploading. Therefore, the parameter of channel bandwidth is assumed as \(C_{\bar {U}} = 5MHz\) [22]. The transmission power Si = 100mw and the noise N0 = − 100dbm [10]. In this scenario, each device owns a task for offloading computing requirements, the \(\mathcal {J}_{i} = 8.9*10^{-12}\)J/cycle. The amount of offloading data size is randomly generated in the range of (0.175 ∗ 105,0.5 ∗ 105) bit/s. The coefficient λt and λe are set as 0.3, 0.7, separately. Since the task data is randomly generated, then, the M-COGA runs to select offloading tasks.

To verify the validity of the method, each experiment is carried out five times. The performance should be tracked at five aspects in different task density: the convergence status, the remaining capacity of the channel, the offloading tasks, offloading cost and the processing time with the proposed algorithms.

The (a) of Fig. 3 displays the algorithm convergence for a single BS scenario in different task density. It shows that the fitness value can effective convergence with M-COGA. And it works under smaller the number of tasks, the faster the convergence. As it is shown in (b) of Fig. 3, the fitness value also convergence under multiple BSs scenario. From Fig. 4, we observed the remaining bandwidth for different number of offloading tasks, there is more capacity left due to the small data offloading requirements. Besides, when ultra tasks require task offloading to BS, the remaining capacity of channel maintains at a low level. It shows the full utilization of the transmission ratio with M-COGA. In the multiple BSs scenario, there are multiple base stations in the node communication area, so the requirement of computing task offloading is more complicated. The distribution of devices in demand for task offloading may be uneven, then we consider both uniform and non-uniform nodes distribution to observe the remaining capability of BSs.

Fig. 3
figure 3

The convergency of M-COGA in variety of scenarios

Fig. 4
figure 4

The channel capability with M-COGA under single BS scenario

Figure 5(a) and (b) show that the M-COGA with BS selection strategy can work better than without the BS selection strategy under both non-uniform and uniform distribution of devices in 3 BSs scenario. From the (c) and (d) of Fig. 5, we found that the M-COGA with BS selection strategy can achieve the load balancing of the BSs as well, even if the nodes are not evenly distributed. In intensive task scenarios, the remaining space is very small. Therefore, it shows the effectiveness of residual capability control.

Fig. 5
figure 5

The channel capability with M-COGA under multiple BS scenarios

Both the terminal cost and the number of offloading tasks are the optimization targets of the M-COGA, then we respectively observed its performance in various aspects. It includes Uniform Distribution (UD) with BS Selection Strategy (SS), uniform distribution without selection strategy, Non-uniform Distribution (ND) with BS selection strategy and non-uniform distribution without BS selection strategy. From the results, with the increase of the density of pending tasks, the number of offloading tasks and the total cost are increasing. In the case of limited channel capacity, a relative balance is achieved. And the results are stable in the relatively intensive task scenes, which indicates that it near the best-optimized result in the current bandwidth situation. In general, M-COGA with the BS selection strategy is better than random BS selection strategy under the ultra density of pending tasks, therefore, the BS selection strategy is effective with M-COGA.

When M-COGA selects offloading tasks under fixed channel capacity, the selected task has a different transmission time. Therefore, we chose a dynamic task offloading strategy. If a task finished offloading, then it will release the occupied channel capacity in ultra density of pending task. We established the scenario of Fixed Channel Capacity (FCC) with or without BS selection strategy and Dynamic Offloading (DO) policy with or without BS selection strategy.

Figure 6 shows the performance of the M-COGA in four scenarios. We can see that the BS selection strategy can get better performance to some extent. Since the allocated bandwidth may be different by task offloading, we also observe the M-COGA effect under different bandwidth conditions. We have compared the M-COGA with the random and the Greedy offloading algorithm. Figure 7 indicates that the performance of M-COGA is still better than random and Greedy under different bandwidth scenarios.

Fig. 6
figure 6

The total number and the cost of offloading tasks in four scenarios

Fig. 7
figure 7

The number of task offloading tasks of the three algorithms under various bandwidths

From Fig. 8, the dynamic offloading strategy with M-COGA takes minimal time to process the computing offloading tasks for the same requirements. In the fixed channel capacity scenario, the algorithm with BS selection is also acceptable. In addition, the BS selection strategy still keeps relative low processing time under ultra task density circumstance. Therefore, dynamic unloading strategy and BS selection strategy promote the time efficiency of M-COGA in computing task offloading.

Fig. 8
figure 8

The cost of offloading tasks in different task density

We also observed the performance of M-COGA on the number and cost of computing offloading tasks in a dynamic offloading scenario. From Fig. 9(a), The M-COGA with BS selection strategy is much better than M-COGA without the BS selection strategy. The same as the cost of offloading in Fig. (9) (b), M-COGA can get to a better solution as quickly as possible.

Fig. 9
figure 9

The total number and the cost of offloading tasks over time in dynamic offloading scenarios

Therefore, from the above comparison results, M-COGA can effectively reduce the terminal computation load. And it also achieves the design purpose of the most offloading tasks under the limited channel capacity. The BS selection strategy comes out superior performance in both static and dynamic task offloading schemes under multiple BSs scenario.

6 Related work

In the research areas of computation offloading, the proposed approaches aim to energy, latency, and joint consideration, and most of them consider the offloading processing between the terminal and the cloud [23,24,25]. Zhao et al. [26] discussed the task scheduling based on the consideration of computing limitation in the edge cloud. The task offloading strategy aims to reduce task latency by coordinating the heterogeneous cloud model. Li et al. [27] aim to optimize the formulated cost model in multi-users scenarios by Deep Reinforcement Learning (DRL) method [28]. The results also achieve the proposed design purpose. The resource allocation approach in MEC is one of the key questions, and there are more studies for whole network performance progress. Changsheng et al. [18] concentrate on energy consumption and computation latency at multi-user scenarios. The proposed algorithm was designed based on priority policy to reduce the search cost. In similar task offloading scenarios, Xu et al. [10] formulate the several computation decision making among devices as a game in MEC. Min et al. [29] proposed an offloading schedule to optimize the delay and battery life of users. This approach can reduce the task duration and energy cost in the software-defined ultra-dense network. This formulated problem aims to allocated resources between cloud and edge cloud. Bi et al. [14] also consider the computing mode which includes offloading and local computing. And the transmission time is also considered in the enumeration-based optimal method. Zhiguo et al. [30] proposed a hybrid NOMA strategy which can permit partial task offloading by using a time slot. It jointly considers the power and time allocation in NOMA scenarios. These existing studies looked at both latency, energy efficiency, or physical layer. However, in the actual application scenarios, the number of tasks and the above factors will affect the MEC computation experience. In addition‡, under the multi-BS coverage, there are more flexible selection strategies to improve the offloading performance.

From some of the recent researches above, the computation offloading is a complex problem. Each method focuses on the different aspects of MEC systems. The optimized problem ignores the task numbers and decreases the maximum cost of terminal devices which are covered in the communication area of BS. Then we proposed the M-COGA to optimize the number of offloading tasks and computing cost in MEC.

7 Conclusion

With the rapid expansion of mobile applications or smart vehicle networks, more and more computing tasks will appear in the future [31]. It is reasonably prophesied that the task computation offloading will become more and more important in IoT, due to the satisfaction of a task offloading requirement can probably satisfy the needs of an intelligent application. Therefore, we proposed an M-COGA computation offloading approach based on the genetic algorithm, which decides the task offloading and adjusts the mobile terminal cost for energy efficiency, the number of offloading tasks and computing resources under limited channel capacity. Then, we not only consider the intensive tasks in one BS scenario but also proposed the BS selection strategy under multiple BSs scenario. After plenty of simulations, several results indicated that the proposed algorithm and BS selection strategy can effectively determine the offloading tasks. Besides, we also have finished the dynamic task selection scheme, which can improve the time efficiency of offloading processing. The method has the flexibility for optimized targets, it still has some aspects that have not yet been discussed. For some instances, we have not considered the CPU computing power of BSs, or some tasks with a large amount of data can not be treated fairly. And the traces of the real world should be considered to evaluate algorithms. The valuable problems deserve further discussions in the future work.