Resource allocation strategy for blockchain-enabled NOMA-based MEC networks

Blockchain technology is getting more and more attention due to its decentralization, independence and security features. However, in wireless networks it faces a computational challenge: the proof-of-work problem. Mobile edge computing (MEC) leads to a vaild scheme by providing cloud computing capabilities to mobile devices. Non-orthogonal multiple access (NOMA) exploits the diversity properties in the power domain to further increase system throughput and spectral efficiency. In this paper, we suggest a new NOMA-based MEC wireless blockchain network to minimize system energy consumption through task offloading decision optimization, user clustering, computing resource and transmit power allocation. In order to effectively figure out this non-convex problem, we first propose a offloading decision and user clustering algorithm, and then propose a computing resource allocation algorithm based on user Quality of Service (QoS) requirements. Finally, the transmission power can be easily determined. The numerical simulation results verify that the proposed joint optimization algorithm can effectively decrease the system energy consumption.


Introduction
As the wide popularity of various smart devices and complex operations in the network, smart devices have more and more demands for communication and computing resources.The majority of these applications are computationally intensive and sluggishly sensitive [1,2], they will incur significant latency and energy consumption during runtime.Mobile edge computing (MEC) transfers the operating and storage capacity close to the users, allowing the users to load work tasks to the MEC server for processing.By taking advantage of the vast computing resources owned by edge servers, MEC can bring many benefits to people's lives, such as saving energy consumption for smart devices and reducing computational latency for tasks [3,4].It also avoids network congestion of traditional cloud computing [5].Therefore, many researchers are dedicated to studying the application of MEC in different applications.However, when data transmission is invoked over the wireless link, the performance of MEC is related to the way wireless resources are allocated during data transmission and the amount of computation offloaded by smart devices.Furthermore, to enhance the productivity of users in unloading tasks in the MEC system further, a new hybrid MEC technology is introduced in which intelligent devices can simultaneously offload computing workloads to multiple edge servers using different radio access networks [6,7].
In MEC systems, it is not enough to achieve low delay and low energy consumption for system performance improvement, the spectral efficiency of the system is also an essential consideration [8].Non-orthogonal multiple access (NOMA) [9,10] as a prospective technology nowadays.NOMA allows two or more users to jointly use a channel resource or time slot to transmit information, and uses continuous interference cancellation at the receiver end to mitigate common channel interference from user devices [11], which can enhance the efficiency of system spectrum usage [12].The potential benefits of NOMA have been demonstrated by a number of efforts, such as as enhanced system capacity, energy utilization and frequency spectrum utilization.Therefore, consider combining NOMA with MEC to expand the number of users in the network and improve spectrum utilization [13,14].Despite NOMA has many advantages, it still requires careful management of wireless resource allocation.For example, power allocation to reduce co-channel interference for users within the NOMA cluster, which has attracted a great deal of research work.
In addition, it is very important to guarantee the accuracy and reliability of billing services during the transmission of user data.However, fee information is vulnerable to disclosure or artificial manipulation.Attackers gain access to users by tracking their paid information, location privacy and other information [15].Blockchain technology is a very promising distributed technology that can be a good solution to solve the privacy and security in the network.It has the features of anonymity, security and is convenient for information interconnection [16].And it can be used in a large range of usable areas in power markets and other energy trading scenarios.For example, in [17], the authors design an energy auction system based on smart contract for users to choose safe and free power transactions.In [18], federated blockchains are used to set up multi-agent nodes through which users' choice of charging modes and transactions can be managed.Although the emergence of blockchain has greatly helped many existing efforts, the consumption of computing resources in the process of blockchain consensus is still an issues that need to be addressed urgently.Therefore, applying blockchain to MEC can improve the security of user information in MEC system during transmission.Meanwhile, MEC can be a good solution to the problem of shortage of node computing resources in blockchain.
In this paper, we discuss a system integrating NOMA and MEC for data delivery by two users over the same channel, which leads to interference between users.And use blockchain as a tool for task unload solutions under the MEC architecture.For the purpose of lessening the impact of such disturbances on system energy consumption, we propose a problem to minimize the total energy consumption of the system by jointly optimizing user offloading decisions, user pairing, computing resource division and user's sending power.This problem is extremely difficult to solve.In order to solve this question, we propose a heuristic algorithm with low complexity to solve it.We first solve for the two integer variables of user offloading decisions and user clustering, and then we allocate power and computational resources in the direction of making the system energy consumption reduced while ensuring that the maximum system latency is satisfied.The validation of the simulation part illustrates the proposed method has obvious advantages over other baseline methods.
The main content of each remaining section of the article is summarized below.In Releated works section, we introduce the research status of the system combined with NOMA and MEC and the research work on the combination of MEC and blockchain respectively.In System model section, we describe the model of the system and optimization problem.In Offloading decision and user clustering optimization section, we express the solution of offloading decision and user clustering.In Computing resource block allocation section, we present the method of computing resource division.In Transmit power control section, we propose the method of user power distribution.The simulation results of the article are presented in Simulation results section.Finally, the main points of the paper are summarized in Conclusions section.

Releated works
In recent years, blockchain has a number of merits, such as decentralization, invariance and transparency, which can handle the security issues faced by edge computing [19].In addition, blockchain is also critical to improving performance in other domains, such as intelligent healthcare, surveillance networks, smart cities, and the Internet of Things [20].While blockchain is easy to use in other areas, it also has a major disadvantage, and can be scaled to a small extent.Therefore, its application in the above aspects still has some limitations.For enhancing the functionality of blockchain, edge computing data can be leveraged to scale it.In [21], for the purpose of enhancing the security and stability of cache management, the authors design a new edge cache scheme based on block chain.[22] proposes an incentive scheme for blockchain-based video flow that makes video conversion and user collaboration more secure and reliable.In [23], the authors propose a service-oriented blockchain system architecture to make task offloading between boundary servers more secure in the MEC environment.
The authors of [24] presents a non-trustworthy MEC work verification scheme based on mobile blockchain and design a one-time sorting algorithm for this scheme to more equitably supply computing resources to all IoT mobile users.In [25], the authors develop a framework for collaborative computing offloading and resource partitioning in blockchain and MEC combined systems [26] proposed a task offloading model combining MEC and blockchain, which can guarantee user privacy security while reducing offloading time and energy consumption cost.In [27] , the authors propose a secure unloading framework based on block chain to save the energy consumption of network equipment with low delay cost.However, the majority of these efforts use inefficient consensus mechanisms, ignoring the consideration of throughput issues.In this case, important information is easily leaked, which will threaten the security performance of the system.
As the core key technology of 5G, NOMA can meet the requirements of low cost, low latency and less power consumption of massive connections in the system.Therefore, the integration of NOMA technology and MEC may dramatically improve the big data storage and data transmission rate of the internet of things.Nowadays, many researchers have investigated NOMA-based MEC systems from different perspectives.In [28], the authors jointly optimize transmit energy beamforming, transmit power, and time allocation to maximize the computational efficiency of strong users.In [29], the authors propose a general hybrid offloading of NOMA-MEC systems that minimizes the total energy consumption of the model.The authors of [30] utilize NOMA to achieve large-scale connectivity, which improves the energy efficiency of offloading by optimizing the problem of associating wireless and computing resources [31] combines MEC with NOMA technology to divide the resources of NOMA-MEC system in ultra-dense networks and optimize them effectively.In [32], the problem of joint work unloading and resource partitioning in NOMA-HetNets is investigated to make the energy usage of the system model even lower.In [33], the authors consider the offloading requirements of users near and far, and proposes a delay-aware offloading algorithm based on NOMA cooperative MEC network.
Encouraged by the above research, it can reflect that the user's offloading decision [34] and resource division [35,36] are very important for the feature optimization of the NOMA-based MEC system.This paper proposes a NOMA-based MEC wireless blockchain network to minimize system energy consumption through optimizing offload forms, user pairing, computing resource partitioning and power partitioning.And the performance of the system is advanced by these strategies.

System model
Consider a scenario where NOMA-assisted MEC wireless blockchain network, there are U users in the system and base stations (BSs) provides task offloading service by wirelessly connecting to MEC server.The blockchain is taken as a non-centralized database to record trade performed in the network and to manage data security between mobile terminal and MEC server.Figure 1 shows the vehicle network structure of blockchain and MEC.The model diagram mainly consists of two parts, device layer and edge layer respectively.The users are defined as U = {1, 2, ..., U } , each user can be a miner to record transactions executed in the network through a blockchain application, and that each miner has an indivisible task, each task represented by u = {L u , C u , T max u } , where L u is the input-data size (in bits), C u is the size of Fig. 1 System model the workload (in CPU cycles per bit), T max u is the maximum delay.In addition, each NOMA group will be distributed a quadrature channel with bandwidth B. Tasks can be binary offloaded, i.e., computing tasks cannot be divided into multiple parts and must be processed locally or completely offloaded to the MEC server.We denote it by x u , x u = 0 means the task is executed locally and x u = 1 represents the work is transferred to the MEC for execution.The mainly used notations are presented in Table 1.

Local model
When tasks can can execute itself locally, define the processing capability of user u in local is f max u , the execution time T loc u is The energy consumption E loc u is given by where α is a coefficient depending on chip architecture.

MEC model
When the users is unloaded to the MEC server, the users are divided into M groups, the groups are orthogonal and the users in the group share a channel using NOMA.Denote M = {1, 2, ..., M} as the set of groups, and the number of acceptable users in each group is K. β m,k u , ∀m ∈ M, ∀k ∈ K as the binary variable to indi- cate the allocation of user u to kth order of NOMA (1) group m.Here, if β m,k u = 1 is allocated to NOMA group m, and β m,k u = 0 otherwise.Define h u as the channel gain for user u transmission task.In NOMA uplink, users with high channel gain are allocated the maximum power possible.Therefore, to effectively apply SIC to decode signals, we assume that the user channel gain is ranked as Users in each group share the same frequency resources, resulting in interference.Consider interference signals from other users in the group, the signal to interference plus noise ratio (SINR) of the user u in group m can be expressed as where p mec u is the sending power of user u in the group m, h u is the channel gain of the user u in the group m, p mec j is the transmit power of user j in the group m, h j is the chan- nel gain of the user j in the group m. σ 2 is the noise power.So the task transmit rate of user u in the group m is given by Based on R u , the transmit delay and the energy con- sumption of user u in the group m are When the task is sent to the MEC for processing, there will be latency.Compute resources in each MEC server are provided in the form of compute resource blocks (CRBs), and the ability to deal with tasks of each CRB is f unit CPU cycles per second.Therefore, the task process- ing delay of user u during this process is where p idle u is the power of user u when waiting, and α m u represents the number of computing resource blocks allocated to user u by group m.So the total processing delay and total energy consumption of the user task u is (3)

L u
The input data size of the task u

System delay and energy consumption
Based on the latency and energy consumption between local processing and MEC processing, the latency of user u is The energy consumption of user u is defined as

Problem formulation
We developed a strategy to minimize the total system energy consumption by optimizing task offloading decision = {x u } , user clustering B = {β m,k u } , computing resources A = {α m u } and power allocation P = {p mec u } .Specifically, a user set is a group of users who need to complete a communication task, and these users are regarded as a set of users.On the other hand, the clustering representation is based on the NOMA as the encoding technology in our study, so the SIC technology is adopted for decoding.In the decoding, all users in the user set need to be assigned to different clusters, and the subcarrier is shared in each cluster.The optimization problem is formulated as Where (C1) is the maximum completion delay, T u represents the maximum assignable power of user u, and T max u indicates the maximum tolerable delay; (C2) is that the transmitting power should be less than its maximum value, Where p max u represents the maximum assignable power of user u; (C3) indicates that each user can only have one uninstall option; (C4) is the integer constraints on computational resource blocks devide in MEC servers;(C5) requires each user can only be assigned in one way.Problem (P 1 ) is a mixed integer nonlinear programming problem, so we decouple it to solve multiple subproblems and developed a heuristic algorithm for solving.(10

Offloading decision
Since the optimization goal modeled in this paper minimizes system energy consumption.Therefore, we can minimize system energy consumption by offloading decision optimization.We propose a heuristic algorithm to get the user to uninstall the choice of the way = {x u }, u ∈ U .Our main idea is summarized as: according to the maximum tolerable delay T max u to determine where the user task is suitable for processing.The main steps are as follows u , task is offloaded to MEC processing server, and we divide the user into the MEC set N mec .
Through the above two steps, the solution of binary variable unloading decision is obtained.The specific steps are summarized in lines 1-9 in Algorithm 1.

User clustering
According to the NOMA uplink principle and SIC demodulation principle, the greater the channel gain gap, the smaller the interference between users.Therefore, we propose a heuristic algorithm to divide two users into a cluster.The allocation principle is as follows: select users with large channel gain differences as possible as a group.For example, if the system has ten users and the channel gain is sorted in descending order as it will be divided into five clusters: user 1 and user 6 in the first cluster, user 2 and user 7 in the second cluster, user 3 and user 8 in the third cluster, user 4 and user 9 in the fourth cluster, user 5 and user 10 in the fifth cluster.The specific user clustering diagram is shown in Fig. 2. See lines 10-15 of algorithm 1 for detailed user assignment steps.

Computing resource block allocation
After the offloading decision and user clustering, computing resources need to be allocated to users, and the original optimization problem (P 1 ) will be transformed into Assuming there are adequate computing sources in the MEC to serve the users.When allocating computing resource blocks, each user wants more computing resource blocks to complete their tasks, but for the system, different computing resource blocks allocated to different users will bring different energy gains.Therefore, we perform two rounds of computing resource block allocation: (i) Allocate a number of computing resource blocks to each user to ensure that the user's minimum latency requirement is met.(ii) We define the delay gain for a single user: , where α u denotes the current amount of computing resource blocks allocated to user u, T mec,α u u and T mec,α u +1 u are the delays when user u is allocated with α u and α u + 1 computing resource block, respectively.For the remaining blocks of computing resources, the user with the largest user delay gain is chosen as the computing resource during each iteration.As a result, the whole procedure of distribution is carried out in the direction of decreasing energy consumption gain.Based on the above idea, our computing resource allocation algorithm is detailed in Algorithm 2. (15)

Algorithm 2 Heuristic Computing Resource Block Allocation
Optimization Algorithm

Transmit power control
After the offloading decision and the solution of MEC user clustering are obtained, the optimization problem (P 1 ) will degenerate into the problem of optimizing MEC power allocation, which is Since each cluster in the MEC utilizes orthogonal sub-carriers, there is no interference generated between clusters during power allocation.The power allocation method remains the same across clusters, so we will only focus on power allocation within a cluster.The objective of this paper is to reduce the energy consumption associated with task processing while ensuring user latency.Since multiple users share the same resources within a cluster, we propose a low-complexity power control strategy to enhance performance during demodulation.
(i) First, arrange users in descending order of channel gain, and for the last user, i.e., user K, let T mec K = T max K , and get p mec K .(ii) After p mec K is given, according to formula (5), the transmit power of user K − 1 can be obtained, i.e. p mec K −1 .(iii) When p mec K and p mec K −1 are given, p mec K −2 ...p mec 1 can be obtained in turn by the same method.
(16) For ease of understanding, we propose joint offloading decision, user clustering.The working flow chart of computing resource allocation and power allocation algorithm is shown in Fig. 3.

Simulation results
In this piece, we evaluate the advantages of the joint optimization algorithmic steps proposed in the paper.The parameter settings for the evaluation are displayed in Table 2.This chapter will validate the advantages of our proposed algorithm.The proposed method is compared with each of the following two solutions.(i) Random offloading scheme: users randomly offload their work to MEC for processing.In addition, the user pairing, power and computing resources are divided in the way proposed in this paper.(ii) Random computing resource segmentation scheme: the computational resources are divided randomly, while the rest is in the same way as proposed in Table 2.
Figure 4 shows the trend of the total energy consumption of the system with the overall number of users.The total power consumption in this paper is the weighted sum of the transmission power consumption of user tasks and computing power consumption of server processing tasks.When the overall number of users increases, the total energy of the system is rising.It is observed from the figure that the aggregate system energy of each scheme rises with the increase of the aggregate number of users, which is consistent with the analysis result, but the aggregate system power consumption of the algorithm proposed in this chapter is the lowest.Due to the optimized allocation of transmission power and computational resources to the users, so the aggregate energy demand of the proposed scheme is smaller than the random power mechanism.Similarly, the scheme proposed in this text also optimizes user clustering, so the performance of the algorithm is the best as the number of users changes.
Figure 5 shows the impact of task offloading workloads C u on the aggregate energy demand of the system.When C u rises, the system energy requirements of the three algorithms increases for the following reasons.The first reason is that the higher C u means fewer feasible tasks in local processing, and more users submit tasks to MEC server for processing, so more energy needs to be consumed.The second reason is that in MEC processing, the higher C u means that task processing requires more resource blocks under a given tolerable delay constraint, thus consuming more energy, resulting in an increase in the total energy consumption of the system.It can be seen intuitively from the figure that the performance of the scheme proposed in this paper is the best.
In Fig. 6, the influence of maximum allowable delay on total energy requirements is plotted.When T max u increases, users do not need to allocate more resource blocks to meet the delay, that is, the number of resource pieces assigned to each user has become smaller.According to the objective function, the energy consumed by MEC server computing tasks will increase, thus resulting the energy demand of the system becomes larger.Since the benchmark algorithm does not optimize user clustering and resource allocation, the energy consumption  Maximum tolerable latency, T max u 0.3 s generated is greater than that of the proposed in the text.We can observe the idea in the paper from the picture is optimal in terms of energy consumption reduction.Figure 7 shows how the application parameters of the input data size D u affect the system energy consump- tion E u .This graph is consistent with our understand- ing, that is to say, the energy demand will increase with the increase of input data D u , and therefore the greater the total system energy consumption value.In addition, this method optimizes unloading decision and resource allocation at the same time, and its performance is always in the optimal state, followed by the random computing resource scheme, and the random offloading scheme has the worst performance.
Figure 8 shows the effect of local processing capability f max u on E u , where the total system energy consumption increases for all algorithms.As f max u increases, when the user's local processing power is sufficient to support the responsibility of handling the task, it can handle most applications with good performance, so it does not need to transfer tasks to the MEC server.However, the resource joint optimization scheme figured out in this paper produces the lowest energy requirements.This is because the algorithm incorporates offloading decisions, MEC user clustering, and other related optimizations.The random offloading scheme does not optimize the assignment of tasks, so most of the assignments will be completed in the MEC server, and the resulting energy requirements is relatively large.

uThe power of user u h u The channel gain of the user u σ 2 u
The user u is grouped into the kth cluster of NOMA group m γ uThe SINR of user u in NOMA group m p mec u The noise powerf unitThe processing capacity of each CRBp idle uThe power consumption of user u when waitingα mThe number of computing resource blocks in MEC processing allocated to user u by NOMA group mx uThe offloading decisions of task u

Fig. 3
Fig.3The workflow of joint optimization algorithm

Table 2
Simulation parameters