Spark Spectrum Allocation for D2D Communication in Cellular Networks

: The device-to-device (D2D) technology performs explicit communication between the terminal and the base station (BS) terminal, so there is no need to transmit data through the BS system. The establishment of a short-distance D2D communication link can greatly reduce the burden on the BS server. At present, D2D is one of the key technologies in 5G technology and has been studied in depth. D2D communication reuses the resources of cellular users to improve system key parameters like utilization and throughput. However, repeated use of the spectrum and coexistence of cellular users can cause co-channel interference. Aiming at the interference problem under the constraint of fair resource allocation and improving the system throughput, this paper proposes an effective resource optimization scheme based on the firework method. The main idea is to expand the weighted sum rate and convert the allocated resource expression into fireworks to determine the correlation matrix. The simulation results show that, compared with the existing scheme, this scheme improves system performance by reducing interference.


Introduction
With the rapid popularization of mobile computing, users have higher expectations and requirements for the speed and capacity of wireless networks, which has led to a sharp increase in the demand for spectrum resources from mobile terminals [1,2]. In response to the growing mobile service demands of the Internet and the Internet of Things (IoT), 5G mobile communication systems have proposed performance indicators that can support peak rates of up to tens of Gbps and large-scale connection There are various studies on resource optimization of D2D communication. Lee et al. [20] proposed a resource allocation method based on graph coloring to allocate spectrum resources among users in pairs. Multiple D2D users use the same spectrum, but it does not think that D2D user pairs and cellular users reuse the same spectrum. Cai et al. [21] allocates the downlink resources of the cellular system according to the interference distance limit between D2D and cellular users, thereby allowing a single D2D user to utilize the resources of multiple cellular users. In the same time instance, a cellular user resource may be shared by multiple D2D pairs. Zhang et al. [22] allows the resources of the same cellular user to be used for any number of D2D users, constructs a hypergraph according to the interference conditions of users in the system, and allocates resources for D2D users according to the hypergraph. However, none of the above documents considers the issue of fairness in the process of spectrum resource allocation. Li et al. [23] proposed a resource allocation scheme based on auction theory, which modified multiple auctioneers through the process of auction mechanism. Li et al. [24] proposed a weighted reward and punishment D2D resource allocation algorithm, adding reward and punishment factors in the resource allocation process to improve the quality of D2D users with poor channel quality, but Li et al. [23,24] do not allow D2D users reuse the spectrum resources occupied by cellular users.
Saraereh et al. [25] proposes a resource allocation scheme based on QoS clustering, which introduces D2D user satisfaction and comprehensively considers the channel conditions and user satisfaction of D2D users for resource allocation. All of the above ideas are based on the idea of greedy algorithm. The final distribution result is obtained by finding a series of local optimal solutions, so it is easy to transform the final result into a locally optimal solution. In order to further save cellular network resources and improve network spectrum efficiency, D2D communication allows the use of resource multiplexing to establish transmission, so that the cellular network can ensure system throughput when resources are scarce. However, D2D users (DU) and traditional cellular users (CU) will introduce new interference problems in the resource reuse mode. Therefore, we need to reuse and allocate resources to reduce the impact of D2D users on original cellular users. One of the core issues is the impact of interference.
In order to expand the system throughput and ensure the fairness of resource allocation for D2D users, this paper proposes a new resource allocation scheme based on fireworks, which allows a cellular user's spectrum resources to be allocated to multiple D2D users and one D2D user. Users can reuse the spectrum resources of multiple cellular users at the same time and ensure fairness among D2D users. The optimization problem is transformed into solving the approximate optimal resource allocation matrix, and the problem is searched in the global scope through the improved pyrotechnic method.
The rest of this article is structured as follows. Section 2 introduces the system model and problem description. Section 3 introduces our proposed algorithm. Section 4 evaluates the proposed system and discusses the simulation results. Finally, in the smallest part, we came to a conclusion.

System Model
Consider a system model with M cellular users and N D2D users in a cellular system denoted by C i (i = 1, 2, . . . , M) and D j (i = 1, 2, . . . , N), respectively. Each D2D user pair has a transmitting end D t j and a receiving end D r j . The D2D user communicates with the uplink spectrum resources of the multiplexed cellular system as shown in Fig. 1. We assume that the uplink in the system is fully loaded and so the cellular users occupy all spectrum resources. The spectrum resources occupied by each cellular user are resource blocks (RB). The spectrum resources occupied by each cellular user are orthogonal to each other without interference. The spectrum resource occupied by the cellular user C i is regarded as resource block i. Since power allocation is not considered in this article, the transmit power of D2D and cellular users are both fixed values, and it is further assumed that the BS has channel state information (CSI) of the link between users in the system.
Taking into account the difference in the transmission content between the D2D user pairs, the transmission rate requirements are also different. Therefore, according to user transmission content, D2D user pairs are further divided into D2D user pairs with lower throughput requirements and target users. The throughput is R l obj , and the target throughput is R h obj for D2D user pairs with higher throughput requirements. We assume that a resource block can be split with several D2D users, and these D2D users occupy multiple resource blocks at the same time. Since resource blocks can be shared by multiple D2D users, cellular users will be affected by D2D users who repeatedly use the same spectrum resources.  Let α ij be the channel reuse factor. If the spectrum resource of the cellular user C i is reused by the D2D user, then α ij = 1, otherwise α ij = 0. Therefore, the Signal to Interference and Noise Ratio (SINR) of the cellular user C i can be written as, D2D user pairs and all users using the same spectrum resources will be interfered by cellular users. Therefore, the SINR of D j received by the D2D user can be expressed as, In Eqs. (1) and (2), P c represents the transmit power, P d denotes the transmit power of the cellular and D2D users on any resource block respectively. G i,B is the channel gain from the cellular user to the base station, G j,B is the channel gain of the D2D transmitter to the base station, and G j,j is the channel gain from the D2D transmitter to the receiver, and G j,j is the channel gain between different D2D pair, G i,j is the channel gain from the cellular user to the D2D receiver, and N 0 is the Gaussian white noise power. The rate of the cellular user C i to the D2D user D j is expressed by Shannon's formula, we have where B 0 is the spectrum bandwidth. Since D2D users can reuse the spectrum resources of multiple cellular users, only considering the maximum throughput in the resource allocation process may enable some users to have better channel conditions. However, the low throughput requirements will result in excessive spectrum resources. This leads to a waste of resources, and some users with high D2D throughput requirements cannot obtain sufficient spectrum resources. For fair insurance among D2D users, we introduce D2D user satisfaction, which is defined as follows, where R obj,j is the target throughput rate of D j , so the average satisfaction degree of D2D users is computed by, In order to ensure the fairness between D2D users and the quality of system throughput, the applicable constraints are, Subjected to Eqs. (8) and (9) indicate that the SNR and noise ratio of the cellular user and D2D user pair must be greater than the minimum SNR threshold, where γ c i,min and γ d j,min represent the minimum acceptable signal-to-interference-to-noise ratio for cellular user and threshold for D2D users. Eq. (10) shows that spectrum resources are reused by D2D users at the same time, and that the spectrum resources of cellular users can be shared among multiple D2D users at the same time, as shown in the Eq. (11). Since the optimization problem is non-linear, the best solution may not be obtained. And, there is no guarantee that the final result will be the optimal solution. Therefore, this paper uses the firework algorithm to search for the optimal solution globally from the perspective of the objective function, and the result gradually approaches the optimal solution.

Proposed Algorithm
The proposed algorithm is divided into the following subsections.

Problem Conversion
Since this work assumes that the allocation of spectrum resources to all cellular users is completed, the optimization result of this work is to find an approximately optimal D2D user-to-resource allocation matrix X M×N = α ij in order to extend the weight and system rate. The rows and columns of the matrix are spectrum resources and D2D user pairs, respectively.
Define the cellular user interference matrix I c = [a ij ] as an M × N matrix. If the C i and the D j cannot meet the conditions described in Eqs. (12) and (13), then a ij = 1. This means the the two mutual interference between users is too large, and D j cannot occupy cellular user spectrum C i , then, Define the interference matrix I d = [b ij ] between D2D user pairs as an N × N matrix. If the D2D user pairs cannot meet the conditions described in Eq. (14), then b ij = 1 indicates that the interference between two D2D users is too high. If large, the same spectrum resource cannot be reused. Otherwise, From Eqs. (1) and (8), we derived that the maximum tolerable interference I i BS,max of the BS on the spectrum resources occupied by the cellular user C i is From Eqs. (2) and (9), the maximum tolerable interference I j d,max of the D2D user D j on the spectrum i, we have: which can be further transformed into, The Eq. (17) is a matrix X of D2D resources to which compute the greatest adaptability. Among them, is the feasible region of the solution under the constraints of the interference matrix I c , I d and Eqs. (18) and (19), s ave (X ) is the the average satisfaction of the distribution matrix X of D2D users.

Algorithm Description
The explosion process of fireworks can be regarded as the process of igniting fireworks in a local space around a specific point through the sparks produced by the explosion. This explosion usually produces sparks. The firework algorithm is an intelligent optimization algorithm proposed by Tan et al. [26], which is inspired by such sparks generated when a fireworks explosion illuminates the surrounding area. The traditional firework algorithm is aimed at the optimization problem where the independent variable is a continuous space. The flower algorithm is modified to adapt to the optimization problem of the discrete two-dimensional matrix. The firework algorithm first initializes N f fireworks, and each firework X i is a two-dimensional M × N matrix that represents the resources of the D2D user. The fitness of the firework is the objective function value f(X i ) under the matching matrix X i . The improved firework algorithm described in this article mainly includes four operators known as explosion, mutation, correction rule and the selection strategy as discussed below.

Explosion Operator
Randomly generate N f initial fireworks X i (i = 1, 2, . . . , N f ) within the constraints, and then evaluate the fitness of the N f fireworks. If the fitness is high, place it in a smaller range. Then, more sparks are will be generated inside, so it has a strong local search ability, and it can perform localization in a smaller area around the fireworks with higher adaptability. If the adaptability is low, it will produce less sparks in a larger area, so it has a powerful global search capability.
To satisfy the above-mentioned differentiated requirements of fireworks explosions, the explosion radius Ai and the number of sparks N i produced by the fireworks are calculated according to the fitness of the fireworks as follows, Among them, · is the round-up function, f max and f min are the current maximum and minimum fitness values, respectively, and ε is a negligible amount to prevent division by zero errors. Define the distance between two binary two-dimensional coding matrices X m , X n as where x m,ij and x n,ij are the fundamentals in the i-th row and j-th column of the matrices X m and X n , respectively, and the explosion radius is the distance between the two fireworks. In order to avoid too many sparks from fireworks with higher adaptability and too few sparks from fireworks with lower adaptability, this article limits the number of sparks N i where round(·) is the rounding function.
Among the N i sparks generated by the explosion of firework X i , the k-th sparkX ik is generated by randomly changing the A i elements in the X i two-dimensional coding matrix.

Mutation Operator
A mutation operator is introduced to maximize the diversity of the spark population, so as to mutate the firework with the probability p m to increase the optimization space. Due to higher adaptability, fireworks will produce more and denser sparks. Therefore, the population diversity around them is poor, and a greater degree of mutation operation is required. Fireworks with lower adaptability have a larger explosion radius, so they only need to be mutated in a smaller range. In order to dynamically adjust the size of the variation array, the distinction radius is defined as, The mutation rule is to randomly change the A i,mut elements in X i to generate mutation sparks.

Amendment Rules
After the fireworks explode and mutate, the sparks produced may be outside the feasible range Ω. Therefore, some corrections to the generated sparks are required to ensure that it is a feasible solution. The revised rules can be explained through the following three processes: • The result obtained by multiplying the generated spark X i and the cellular user interference matrix I c bit by bit can ensure that the spectrum resources reused by D2D users are all available spectrum resources. • According to the D2D user interference matrix I c , check whether there is an element corresponding to the D2D user in X i that cannot reuse the same spectrum resource and is "1" at the same time. If so, set an element to "0" at random. • Check row by row whether the cumulative interference of the D2D user to the resource i in X i repeatedly using the same spectrum resource exceeds the threshold described in Eq. (15), and whether the interference between D2D user pairs that reuse the same spectrum resource exceeds Eq. (16). If the threshold exceeds the threshold, the element "1" in the row is randomly set to "0", and the check is repeated until the condition is met.

Strategy Selection
Individuals generated in each iteration (including fireworks, sparks from pyrotechnic explosions, and sudden sparks) are added to the candidate set, and N f individuals are selected as fireworks to enter the next iteration. In order to improve the convergence rate, the individual with the highest fitness in the candidate set is directly regarded as an elite individual. Go to the next iteration without making a selection. The remaining N f − 1 people are selected by roulette. The selection probability is calculated as follows where K represents the number of individuals in the candidate set. If an individual has more an individuals in the closer range, the probability of the individual being selected will decrease. After multiple iterations of the above process, the single elite firework generated is the requested resource allocation matrix.

Results and Discussion
In order to test the authenticity and fairness of the proposed scheme, this section gives the Monte Carlo simulation results based on MATLAB. Tab. 1 shows the parameters of the simulation experiment. In order to analyze the advantages of proposed algorithm, three resource allocation algorithms are selected for comparison based on the graph coloring [21] and QoS clustering [25]. The proposed algorithm does not consider the fairness of D2D users. The proposed algorithm does not consider the fairness of D2D users and takes different throughput requirements of D2D users after bandwidth normalization as R l obj = 20 bit/s and R h obj = 40 bit/s. Simulation results are obtained with 50 iterations.  Fig. 2 shows that when there are a fixed number of 10 cellular users and multiple D2D users, the system throughput will continue to change with the number of iterations. We witness that the system throughput will increase as the number of iterations increases. By increasing the number of D2D users N = 30, the throughput growth trend stabilizes after 30 iterations; when N = 70, the throughput growth trend only stabilizes after 50 iterations. We also noticed that increasing the number of users in the system also increases the number of iterations required for the algorithm to reach convergence. Since these four algorithms all allow one spectrum resource to be shared with multiple D2D users, the number of D2D users is increased. As the interference between systems is increasing, the growth trend is gradually slowing down. It can be seen from the results that the algorithm has the highest total system throughput without considering D2D user satisfaction, but after considering the fairness of D2D users, the total system throughput is reduced. Compared with the algorithms proposed in Cai et al. [21] and Saraereh et al. [25], the use of intelligent optimization algorithms greatly improves the throughput of the system. Therein, we observed that as the number of D2D user pairs increases, the satisfaction of the four algorithms gradually decreases. This trend shows that when the available spectrum resources are less, the more D2D users there are, the more difficult it is to obtain sufficient spectrum resources. After considering the fairness of resource allocation, the proposed algorithm shows a greater improvement in the average satisfaction of D2D users than when fairness is not considered. Due to the low total system throughput of the algorithm proposed in Fodor et al. [14], D2D user satisfaction is significantly lower than the proposed algorithm, while the average satisfaction of the three algorithms proposed in Castanheira et al. [10] is higher. Fig. 5 describes the average throughput rate that D2D users with lower throughput requirements and D2D users with higher throughput requirements in the system can achieve with 10 cellular user and 70 D2D users after the bandwidth is normalized. Our algorithm proposed and the algorithm proposed in Saraereh et al. [25] have significantly improved the average throughput rate of D2D users with higher throughput requirements, while the average throughput rate of D2D users with lower throughput requirements has a certain degree of decrease. However, regardless of the proposed algorithm for D2D users with lower throughput requirements or D2D users with higher throughput requirements, the average throughput rate is higher than the algorithm proposed in Saraereh et al. [25]. Fig. 6 shows the total system interference of the proposed algorithm and the algorithms in Cai et al. [21] and Saraereh et al. [25], where D2D has increased interference for comparison. We observe that compared with existing algorithms, this algorithm has less interference, making it more stable and reliable. Due to adaptive behavior, it has powerful functions in dense user environments.   Fig. 7 shows the spectrum efficiency when CUE increases. We have noticed that the spectral efficiency of all algorithms increases with the increase of CUE. Compared with Cai et al. [21] and Saraereh et al. [25], our proposed algorithm has better spectral efficiency. In addition, compared with Cai et al. [21] and Saraereh et al. [25], proposed algorithm has better QoS for a large number of users.  This work proposes a D2D resource management mechanism that deploys the idea of fireworks for D2D resource allocation in D2D networks. The main idea is to maximize the weighted sum rate and convert the resource allocation expression to fireworks to determine the correlation matrix. We consider certain constraints to reduce interference problems. The convergence rate of the improved pigeon swarm algorithm has been improved up to 87.5%. At the same time, the proposed resource management mechanism improves the spectrum utilization rate, reduces the interference problem in the system, and optimizes the system throughput with 82% efficiency. The interference of the overall system is reduced to 83%. As an extension of this work, mmWave is deployed in the proposed D2D algorithm and its effectiveness is evaluated through different important parameters. In addition, the algorithm does not consider resource allocation under multiple cells, so further research can be carried out on this basis.