Abstract

Blockchain technology has been widely used in many fields. However, the proof of work (PoW) problem in the mining process of mobile devices requires a large amount of computing resources and energy consumption, which brings huge challenges to mobile devices. Mobile edge computing (MEC) can effectively solve the above problems, allowing mobile devices to offload tasks to edge servers to relieve the pressure of limited computing resources on mobile devices. Nonorthogonal multiple access (NOMA) is good at improving spectrum efficiency, so that the system can accommodate more users. In this paper, we propose a new NOMA-based MEC-enabled blockchain framework. Under the conditions of a given task execution deadline, the decision of offloading, local computing resource allocation, user clustering and admission control, and transmit power control is jointly optimized to minimize the total cost of the system. Since the problem is hard to solve, we decouple it into subproblems for low-complexity solutions. First, we propose two heuristic algorithms to obtain the binary offloading decision and user association, and then closed-form solutions of local resource allocation and transmit power control are obtained under the required delay constraints. Simulation results show that our proposed algorithms perform good in cost reduction compared with other baseline algorithms.

1. Introduction

In recent years, smart user devices, Internet of Things (IoT) devices, and their running smart applications have been widely popularized, and blockchain technology has also been widely used in various industrial applications [1], such as IoT and healthcare. Blockchain technology uses blockchain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, and uses cryptography to ensure the security of data transmission and access. Its essence is a decentralized database, and the core problem is to solve mining puzzles. Blockchain users or miners need to run a mining puzzle, that is, to solve the proof of work (PoW) problem, which is a computing process that requires intensive computing resources. However, mobile devices have limited resources and are usually unable to participate in the mining process. Mobile edge computing (MEC) [2] provides an effective solution to address the challenge. It offloads the computing tasks of mobile devices to the edge of the wireless network [3], thereby improving computing efficiency and reducing delay. Meanwhile, the explosively increasing IoT user equipments make the scare wireless resources further strained, which degrades the task offloading performances of MEC. In recent years, nonorthogonal multiple access (NOMA) [4, 5] has attracted lot of attention in the MEC domain for enhancing the performance of computation offloading. With NOMA, a group of users can offload their own tasks simultaneously using the same channels, and thus each user can enjoy more wireless channels [6] and/or time slots [7], and the system could be able to accommodate more users [8].

On the one hand, many literature studies have proposed various methods to solve the offloading problem in the mobile blockchain networks, such as the method based on convex optimization. In [9], the authors offloaded some computationally intensive tasks to an untrusted MEC server and proposed a hash computing ordering (HCO) mechanism to enable the untrusted MEC server to provide a fairer distribution of computing resources for all mobile users. In [10], the authors proposed a blockchain-enabled IoT-edge-cloud computing architecture that benefits both from mobile cloud computing (MCC) and MEC, where MEC servers offer lower latency computing services, while MCC servers provide stronger computation power. In [11], the authors studied the calculation of moving edges for blockchain mining tasks. Based on Stackelberg theory, the pricing and consumption of computing resources are attributed to leader-follower coupling game, and an efficient offloading algorithm for mining tasks is proposed.

On the other hand, several studies have investigated the NOMA-based MEC system, where energy consumption minimization for user equipment is always the first concern. In [12], the authors formulated a joint user clustering and transmit power control problem and proposed a matching-coalition approach for problem solving. In [13], the authors applied NOMA to enable massive connectivity to support energy-efficient MEC in IoT networks by joint communication and computation resource allocation optimization. In [14], the authors studied task processing delay minimization issues in a multiuser NOMA-based MEC network by optimizing tasks partition ratios and transmit power control. In [15], the authors studied the energy consumption reduction in a NOMA-based MEC system by jointly optimizing the transmit time and power.

From the above works, we find that there is still a lack of research on the optimal strategy for implementing mining task offloading in mobile blockchain. Therefore, this paper considers the joint optimization of data offloading and resource allocation to improve the offloading efficiency in the blockchain network. In addition, user clustering and resource allocation [16, 17] optimization are important factors in NOMA-based MEC system, and users’ energy consumption minimization is the most general goal of the optimization. The above works only considers user clustering, resource allocation, and power control issues, in which all users offload their tasks to the MEC server, without considering the optimization of task offloading decisions. In most IoT scenarios, this is not reasonable, as the local processing power is not used and the capacity of the MEC server is limited; thus, the task processing fails when the user is not received. Moreover, when the number of IoT devices is too huge, then local and MEC server could not afford, and hence, cloud is necessary. Motivated by the above considerations, we consider the joint optimization of offloading decision, user clustering and admission control, and computation resource allocation and transmit power control in a NOMA-based mixed edge and cloud-enabled blockchain network. We intend to minimize the energy consumption in local and MEC processing, minimize the economical pay in cloud processing mode, and maximize mining profits. Most importantly, we ensure all users’ tasks are processed successfully, i.e., no user will fail in task processing. The formulated problem includes binary, integer, and continuous variables, so it is hard to solve.

For this purpose, we devote to propose low-complexity algorithm for easy implementation. First of all, we use two heuristic algorithms to solve binary offload decision and user association, respectively, and then obtain the closed-form solutions of local resource allocation. In addition, the closed-form solutions of MEC transmission power control and cloud center power control are solved under the premise of satisfying the delay constraint. Simulation results show that the low-complexity algorithm proposed by us can effectively reduce the system cost compared with other simplified methods.

The remainder of this paper is organized as follows. In Section 2, the system model is presented and the problem is formulated. Section 3 provides the offloading decision optimization. Admission control and user clustering are presented in Section 4; the local computation resource allocation is developed in Section 5, and Section 6 presents the transmit power control. Section 7 develops the simulation results and discussion. Section 8 concludes the paper.

2. System Model

We consider a NOMA-based MEC and cloud-enabled blockchain network, consisting of access points (APs), randomly distributed users, and a remote cloud center. Each AP is equipped with a MEC server by wired link, as shown in Figure 1. In the following, the MEC server and AP are used interchangeably. Denote is the set of users and is the set of APs. We assume that the users who offload their tasks to a MEC server via NOMA [18, 19] form a group because of each user can offload its task to a MEC server. Let denotes the set of groups, and the maximum number of users in each group that can be served by an AP is . So, all APs could accommodate at most users. In particular, we assume that each group is assigned an orthogonal subchannel with bandwidth . The same group of users offloads their tasks to the AP over the same subchannel. Lastly, we assume that the MEC servers and the APs have complete channel status information (CSI).

Especially, there is a remote cloud center, and users can also offload tasks to the cloud center. The cloud has enough computing resources and wireless bandwidth for users, but when a user chooses to offload the task to it, it charges for the use of bandwidth and computing resources.

Each user acts as a miner, running a blockchain application to record transactions performed in the network [20]. Denote as the task of miner . Each task is characterized by the input size [21], i.e., the number of bits that must be transferred from the user to the AP, and the workload , i.e., the processing density (in CPU cycles per bit). is the deadline to complete the task. Then, we have , where is the size of processing workload (in CPU cycles). We assume that all APs and miners in the blockchain network supported by NOMA-based MEC have the computing power to provide task execution services. Mining tasks that cannot be calculated locally by the miner can be offloaded to nearby access points. Therefore, each miner can execute tasks locally or offload to the MEC server (AP ) or cloud center for execution. We use , , and to denote the task of miner is processed by miner itself, or by MEC server , or the cloud center, respectively [3, 22].

2.1. Local Processing

When the task is processed locally, denote the local processing capability of user is , we havewhere is the local computation resource allocation, which is constrained by , and depends on the nature of application, e.g., computational complexity of application. is a coefficient.

2.2. MEC Processing

In the area, there are MEC servers providing services for users. Thus, in the MEC processing model, each user could offload its task to any one of them. Suppose user offloads its task to MEC server , the task transmit rate is given bywhere is the transmit power of user when offloading to MEC server and the binary variable is the access control, where indicates user is served by MEC and otherwise. Based on , the transmit delay and the energy consumption of user are given by

When the task is processed by the MEC server, the user will wait for the result. The task processing delay and the energy consumption of user in the process are given bywhere is the power consumption of user when waiting and is the computation resource allocated by MEC server , which is a constant in this paper. The delay and energy consumption in MEC processing model are given by

Users who have tasks offloaded to the MEC server will get extra profit. The profit for completing the mining task is given bywhere ($) is mining rewards and (in $/J) is the unit price of energy consumption.

2.3. Cloud Processing

When user offloads its task to the cloud center, it will be allocated with exclusive bandwidth , and processing resource . The transmit rate of user in cloud processing mode is given by

The delay in cloud processing mode can be given by

The cloud operator will charge users for using communication and computation resources, where the prices are () and ($/(CPU cycles per second)), respectively.

Therefore, the cost paid by user in communication and task processing are given by

2.4. Total Delay and Total Cost

Based on the above delays in different modes, the total delay of user is given by

The total cost of user is defined aswhere (in $/J) and (a dimensionless number) are the weight parameters.

2.5. Problem Formulation

In this paper, we intend to minimize the total system cost, i.e., the energy consumption for local and MEC processing, economic payments in cloud processing mode, and additional profits from mining tasks for miners. In particular, minimizing economic payments has a higher priority. We achieve the purpose by jointly optimizing the offloading decision , the access control and user clustering , the local computation resource allocation , and the transmit power control in MEC and cloud processing modes, i.e., and , respectively. The problem is formulated aswhere (C1) is the task completion deadline; (C2) is the constraint on local computation resource allocation; (C3) and (C4) are the constraints on transmit power control in MEC and cloud processing, respectively; (C5) and (C6) require that each user task can only be processed in one place, i.e., local, or a certain MEC server, or the cloud center; (C7) is the binary constraint on access control, and (C8) requires that the maximum number of users per AP service should not exceed . Problem contains binary, integer, and continuous variables, which is generally nonconvex and hard to solve. In the following sections, we will propose low-complexity algorithms to solve it.

3. Offloading Decision Optimization

In this section, we propose a low-complexity algorithm to obtain the offloading decision-making , as shown in Algorithm 1.

(1)Initialization: set , , , , ,
(2)fordo
(3)ifthen
(4)  , , remove from
(5)else
(6)  , , remove from
(7)end if
(8)end for
(9)ifthen
(10), ,
(11)fordo
(12)  
(13)  
(14)end for
(15) Sort the users in ascending order according to
(16) Remove the end users from to , and we set
(17) Remove the rest users in to , and we set
(18)else
(19) Among the users in , perform Algorithm 2 for access control, where users are selected for MEC processing, and put the users into , and set
(20) Remove the users to , and set
(21)end if
(22)Output: .

Since the tasks processed on cloud will be charged for fees, so we encourage users as much as possible to process their tasks either locally by themselves or offload their tasks to the MEC servers. Moreover, for the noncloud processing tasks, we encourage as many users to offload their tasks to the MEC servers for energy saving. Our main idea can be briefed as the following steps:(i)We divide all the users in into two subsets, local feasible set and local infeasible set .(ii)Next, we judge whether . If yes, this means the number of local infeasible users is smaller than the capacity that the MEC servers can afford. Therefore, let all the users in offload their tasks to MEC processing and there’s no need to offload tasks to the cloud server. Moreover, in order to save energy for users and thus to decrease the system energy consumption while guaranteeing latency requirement, it is necessary to saturate the number of users of the MEC servers as much as possible. The MEC server with the best channel gain, i.e., , will reduce the data transmission delay, the user with a larger workload, i.e., , means that the task is more complex and less suitable for local processing, users with smaller data transmission, i.e., means lower transmission delay. Combining these three factors, we define a new parameter . The larger , the less suitable the task of user is to be processed locally. Therefore, according to the size of , move users from local feasible set out to MEC processing.(iii)If , this means some tasks have to be offloaded for cloud processing, and users have to pay some fees for task processing. We should pick out users to MEC processing, and the rest tasks will be offloaded to the cloud.

Performing the above steps, the offloading decision can be obtained. The proposed offloading decision-making algorithm is summarized in Algorithm 1.

(1)Initialization:
(2)Set , ,
(3)
(4)
(5)fordo
(6)fordo
(7)  
(8)  
(9)end for
(10)end for
(11)whiledo
(12)
(13)ifthen
(14)  , ,
(15)  Remove from
(16)  Set
(17)  
(18)else
(19)  Remove from
(20)  Set
(21)end if
(22)end while
(23)Output: user admission control and clustering ; the rest users in which will offload their tasks to the cloud center.

4. Admission Control and User Clustering

After offloading decision-making, users are picked out, and their tasks will be processed by the MEC servers. Next, we will allocate the users to the MEC servers.

Since we intend to minimize the energy consumption of MEC processing, a new parameter is defined. The MEC server with the best channel gain, i.e., , will reduce the data transmission delay, and the server with the most computation resource, i.e., , will reduce the task processing delay. Thus, the larger the , the user is more would like to access MEC server , the smaller the delay in processing its tasks, and the smaller the power consumption. Based on the above idea, our admission control and user clustering algorithm are detailed in Algorithm 2.

After Algorithms 1 and 2 are performed, the offloading decision, admission control and user clustering are obtained, i.e., the user set is divided into several subsets, including (i) the local processing set , where the offloading decision of tasks is ; (ii) MEC processing subsets, and in each subset , the offloading decision , and the admission control , and all users in each subset will offload their tasks to MEC server sharing the same bandwidth via NOMA; (iii) the cloud processing set , where each user in this set will offload their tasks for cloud processing.

For the users in , we need to perform local computation resource allocation optimization ; for the users in each and in , we need to perform transmit power control optimization, i.e., we need to determine and , respectively.

5. Local Computation Resource Allocation

For the users in , we need to perform local computation resource allocation for local task processing energy consumption minimization, and we have

For user , given the data input size , a coefficient and computational complexity of application , the energy consumption is only affected by the local computing resource allocation. In order to minimize the energy consumption while ensuring the delay requirements, let , so that we only need the minimum computing resources that meet the latency requirements, and get .

6. Transmit Power Control

After offloading decision-making, access control and user clustering, and local computation resource allocation are obtained, problem degrades into the transmit power control optimization in MEC processing and cloud processing, respectively. For the users who choose MEC processing, we need to perform transmit power control among the users in a same cluster as follows:

For cloud processing users, we have

In order to enable tractable solutions, we use the following simple method to obtain a closed-form solution.

For cloud processing users, it can be known that each user is allocated with the same bandwidth, so the fees is only affected by . However, under the given channel gain, the uplink transmit rate is only affected by the transmit power . The larger the , the higher the . Therefore, in order to minimize the total fees while guaranteeing the delay requirement, we take the transmit power that could satisfy .

For MEC processing users in each cluster, we take the following strategy: (i) For the end user, i.e., user , we take the transmit power that could satisfy . (ii) After is determined, the transmit rate of user , i.e., in (3) is only affected by its transmit power , so we can also take the transmit power that could satisfy . (iii) When and are determined, can be obtained using the same method, and then can be determined one after another following the same way.

7. Simulation Results

In this section, we evaluate the system performance of NOMA-based MEC-enabled blockchain network. The simulation parameters are listed in Table 1.

We compare our proposed algorithm with the following algorithm. (i) Random computing offloading algorithm: users randomly offloaded their tasks to the local or MEC serves or cloud center. In addition, it will use our proposed algorithm for local computing resource allocation, cloud center power control, and MEC power control. (ii) Random power algorithm: the power is generated randomly, and other resource allocation schemes use our proposed algorithm.

Figure 2 shows how the number of users’ access affects the total cost of the system. As the number of access users in each APs increase, the energy consumption of AP processing tasks also increase, and so does the total cost of the system. The trends of the three curves in Figure 2 are consistent with our analysis. But our algorithm has the lowest cost. Since our algorithm has power optimization processing in both MEC and cloud center, the energy consumption of our algorithm is lower than that of the random power algorithm. Similarly, our algorithm also optimizes random offloading and users access, so with the increase of access point users, the cost of random offloading algorithm is higher than our algorithm.

In Figure 3, we plot the effect of the weight parameter on the system cost. As the weight parameter regulates the local energy consumption and MEC energy consumption, the local and MEC costs are on the same order of magnitude as the cloud center costs. When the weight parameter is 0, only the cost of users in the cloud center is included in the total cost. In the three curves of Figure 3, since the offloading decision and user access in the random offloading algorithm are random, the cost of users in the cloud center is the highest, that is, the total cost is also the highest. With the increase of weight parameter , the proposed algorithm has the lowest cost compared with other baseline algorithms through joint optimization of various factors.

Figure 4 plots how local processing capacity affects the total cost of the system. With the increase of local processing capacity , the number of users processing tasks locally increases, the local processing energy consumption increases, and the total system cost also increases. As can be seen from the figure, all three curves increases as local processing capacity increases. Since the local users of the random offloading algorithm are randomly generated, while our algorithm is the local users generated by the optimization algorithm, the total cost of the random offloading is higher than our proposed algorithm due to the two different offloading methods. In addition, another factor that determines cost is transmit power. Since the transmit power allocation of our algorithm is optimized, while the power allocation of the random power algorithm is random, the cost of our algorithm is lower than the random power algorithm.

In Figure 5, we show how the unit price of MEC energy consumption affects the system cost. It can be seen that, as the unit price of MEC energy consumption increases, the cost of all algorithms increases. This is in line with our intuition. As the unit price increases, the additional net income from mining will decrease. According to formula (11), the total cost of the system will increase. In addition, since our proposed algorithm is optimized in all aspects, our total cost is the least compared to other algorithms.

8. Conclusions

In this paper, we have considered the joint optimization of offloading decision, local computation resource allocation, user clustering and admission control, and transmit power control, subjecting to the task execution deadline in a NOMA-based MEC-enabled blockchain network for minimizing the system cost. To solve the problem effectively, we propose heuristic algorithms with low complexity. In our problem solution process, the offloading decision is solved based on heuristic Algorithm 1, and the user clustering and admission control are solved through Algorithm 2, and then closed-form solutions of local resource allocation and transmit power control are obtained under the required delay constraints. Simulation results show that the proposed algorithms have a good effect on cost reduction.

Data Availability

No data were used to support this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was supported in part by the Natural Science Foundation of Shaanxi Province under grant no. 2020JQ-844, Natural Science Foundation of China under grant nos. 61901367, 62001357, 61871321, and U1965102, Science and Technology Innovation Team of Shaanxi Province for Broadband Wireless and Application under grant no. 2017KCT-30-02, the National Science and Technology Major Project under grant no. 2016ZX03001016, and Project of Key Labortary of Science and Technology on Communication Network under grant no. 6142104200412.