Energy-efficient and intelligent cooperative spectrum sensing algorithm in cognitive radio networks

Green communication is the demand of current and future wireless communication. As the next-generation communication network, cognitive radio network also needs to meet the requirements of green communication. Therefore, improving energy efficiency is an inevitable requirement for the development of cognitive radio networks. However, there is a need to compromise sensing performance while improving energy efficiency. To take into account the two important indicators of sensing performance and energy efficiency, a grouping algorithm is proposed in this article, which can effectively improve the energy efficiency while improving the spectrum sensing performance. The algorithm obtains the initial value of the reliability of the nodes through training, and sorts them according to the highest reliability value, then selects an even number of nodes with the highest reliability value, and divides the selected nodes into two groups, and the two groups of nodes take turns in Alternate work. At this time, other nodes not participating in cooperative spectrum sensing are in a silent state, waiting for the instruction of the fusion center. The experimental results show that compared with the traditional algorithm, the proposed algorithm has a great improvement in the two indicators of sensing performance and energy efficiency.


Introduction
With the development of wireless communication technology and the increasing number of communication equipment, the spectrum resources for wireless communication are increasingly scarce. The challenge of wireless communication technology is how to use the scarce spectrum resources efficiently. According to the report of the Federal Communications Commission, 1 only a small part of the available radio spectrum has been effectively utilized, and the rest has not been used or fully utilized. 2 Therefore, it is necessary to improve spectrum utilization and dynamic spectrum access opportunities. To increase spectrum access opportunities in the dynamic scene, cognitive radio technology needs to be incorporated into the existing radio access network. 3 Cognitive radio networks can adapt to the surrounding radio environment according to its own cognition. 4 It can intelligently access the authorized spectrum and effectively improve the spectrum utilization. A cognitive radio network consists of a primary user (PU) and nodes, these nodes are cognitive users (CU), also known as secondary users. The cognitive radio network starts spectrum sensing, detects free frequency bands, and School of electronics and Information Engineering, Hunan University of Science and Engineering, Yongzhou, China makes preparations for random access. 5 With the development of cognitive radio technology, green communication has become more and more important, so energy efficiency is a technical parameter that needs to be considered in the development of communication technology. 6 The definition of energy efficiency in this article is the ratio of the energy consumption of data transmission operations to the total energy consumption of the cognitive network in a cycle. Each coalition senses one of the channels while guaranteeing that the necessary detection and false alarm probability thresholds are satisfied. Other nodes, that decide to sense none of the channels, turn off their sensing module at the sensing period, to extend the network lifetime. 7 Energy efficiency is an important parameter of cognitive radio networks. 8 In the literature, 9 cooperative spectrum sensing based on optimal resource allocation and energy capture is used to improve energy efficiency. With the development of 5G technology, the importance of energy efficiency has also increased. Literature 10 introduced a wireless power transmission scheme to save energy and solve the problem of large energy consumption caused by high data rates. To improve the efficiency of spectrum sensing in 5G technology, Uwaechia and Mahyuddin 11 proposed a multimodal cooperative spectrum sensing scheme with efficient spectrum sensing in fading channels. In the literature, 12 the author proposed a multi-channel Internet of Things with dynamic spectrum sharing to improve the throughput of the Internet of Things. In Lee et al., 13 the energy efficiency scheme in cognitive radio networks balances spectrum sensing performance and throughput. In the literature, 14 broadband spectrum sensing considers the balance of spectrum sensing performance and throughput. Li and Han 15 considered the Markov traffic of cognitive radio networks and the balance of spectrum sensing performance and throughput derived from energy efficiency. Since the algorithm includes a Markov-based cognitive radio network, it is easier to be realized. Huang et al. 16 achieved a balance between spectrum sensing performance and throughput when considering the PU traffic. The work done in the literature 17 shows that the energy consumption of the circuit is an important factor to be considered when evaluating the energy efficiency of the entire system. To reduce energy consumption on the basis of Salah et al., 18 the power optimization of system parameters is considered in the literature, 19 but this is only applicable to traditional radios, not to cognitive wireless networks. The work only focuses on the energy consumption in the process of sensing and transmission, while ignoring the energy consumption of the circuit. To enhance the reliability of robust cooperative spectrum sensing, the article proposed a new data fusion scheme based on clustering algorithm and distributed detection, in addition to an adapted threshold based on controlled false alarm probability. 20 In cognitive radio networks, spectrum sensing itself consumes a lot of energy, and ineffective spectrum sensing increases energy consumption. Therefore, there is a need to improve spectrum sensing to increase energy efficiency. In the literature, 21 the author proposed a group sensing scheme based on convex optimization, which improves the energy efficiency in cognitive radio networks by jointly optimizing the perception time and power allocation, and realizes the spectrum sensing problem as convex optimization. In Huang and Wang,22 hidden Markov models and multilayer perceptrons are used to effectively predict the spectrum. The spectrum efficiency and energy efficiency have been improved, but the predicted energy consumption and computational complexity have increased. Therefore, this algorithm is not a suitable method for improving energy efficiency. In the literature, 23 the author uses the convex transformation iterative algorithm to propose a power allocation scheme to achieve energy efficiency, and expresses this problem as a fractional programming problem. In the literature, 24 the energy efficiency of cognitive radio networks is achieved by robust power allocation based on channel state information, which transforms the optimization problem into an extreme value problem considering energy and throughput. In the literature, 25 energy efficiency optimization is formulated as a non-convex function, but only one factor of optimization is considered, namely, power allocation. The chaotic particle swarm algorithm tends to converge early without obtaining the global optimal value. 26 In real-time scenarios, considering different aspects of spectrum sensing, the problem of non-deterministic polynomial optimization with non-convexity is more complicated. 27 Cognitive-based approaches may increase the spectrum efficiency by sharing resources opportunistically from unlicensed/licensed network, and the proposed scheme is functioning using the energy exposure with group creation algorithm for subchannel detection. 28 From the above-mentioned literature review, it can be seen that the existing literature cannot solve the equality problem among CU, and cannot improve the sensing performance and energy efficiency under the premise of considering the equality of users. To solve the above problems, this article proposes a new energysaving algorithm based on dynamic grouping. The algorithm selects a limited number of nodes with the highest reliability to participate in cooperative spectrum sensing in a sensing cycle, and divides the selected nodes into two groups. The two groups of nodes work, in turn, to continuously detect the target frequency band, while taking into account the performance of spectrum sensing and energy efficiency. The experimental results show that the energy efficiency obtained by the grouping algorithm in this article is better than that of the traditional algorithm.

System model
To illustrate the basic idea of this article, Figure 1 shows the topology of the cognitive radio network in this article. Figure 1 displays a cognitive radio router (CRR), multiple CU and multiple PU distributed in the cognitive radio network area. 29 The main user has priority to work, and the CU waits for an opportunity to occupy the idle frequency band of the main user. The interactions between these users are described below. First, PU with data to transmit send their data messages to CRR, trying to find possible secondary relays, while PU with no traffic to transmit will remain silent. Second, a CRR receives requests from the PU and broadcasts them to CU within its coverage area. CU who need a primary channel calculate energy efficiency based on the information received from the CRR and knowledge of their own data and power budget, and feed back the decision on whether to participate in the cooperation to the CRR. Finally, after getting the decision of the CU, the CRR notifies the specific PU to establish a wireless connection with the CU if possible. In the actual working process of cognitive radio network, it is not necessary for all nodes to participate in cooperative spectrum sensing at the same time, because the number of nodes participate in cooperative sensing has nonlinear relationship with sensing performance, the sensing performance will not increase linearly with the increase in the number of nodes. Therefore, the algorithm in this article groups the nodes and each group works, in turn. When one group works, the other groups are in the state of data transmission or rest.
It should be noted that in the design of this article, even though some CU may refuse to cooperate, due to the large number of CU in the cognitive radio network, the PU can still be easily paired with a certain CU to find the secondary medium. The CU that is successfully paired with the PU will perform the data relay transfer of the PU, so that the CU can more easily grasp the various a priori parameters of the PU, which provides help for other CU to wait for opportunities to occupy the PU frequency band. In this article, the selected two groups work, in turn. When one group performs spectrum sensing operation, the other group performs data transmission. While the unselected node is a node with poor sensing performance, it does not participate in cooperative spectrum sensing and is in a silent state.
Establish a dynamic interleaved grouping work model based on the dual constraints of node energy consumption and sensing performance Before the nodes are grouped, all nodes are trained to obtain the initial reliability value. In this article, the initial reliability value of each node will be calculated, and the learning intensity of each node is the same, and they all participate in the training under the same conditions, which can more fairly reflect the performance of each node and provide a theoretical basis for the selection of nodes. The learning intensity of each node is the same, which is not affected by the sensing ability and transmission performance, and is all learned under the same conditions, which is more conducive to identifying the performance of the node and preparing for the selection of good nodes.
The reliability value of the node is calculated by the fusion center and stored in the fusion center. The node reliability here refers to the learning ability and the probability of no error, and its value is calculated using formula (1): The above formula P j represents the learning intensity of the j-th node, 30 and N represents the number of nodes, the learning intensity of each node is the same. The fusion center selects the top reliability M(M ł N ,M is an even number) nodes to participate in cooperative sensing, and interleaves the selected M nodes into two groups. The reliability value of the node is calculated by the fusion center and stored in the fusion center, and does not need to be transmitted. This has been explained in the revision of the article. The number M of selected nodes is determined according to the threshold requirement of the detection probability, that is to say, when the detection probability meets the requirement, the increase in nodes is stopped to meet the requirement of energy efficiency. When the requirement of detection probability is met, M will not change, otherwise the value of M will be changed to meet the requirement of detection probability. They were divided into two groups, each group takes turns to work with equal probability, and the specific grouping method is shown in Figure 2.
In Figure 2, the nodes selected to participate in cooperative sensing are interleaved. The specific design idea of interleaved grouping is to divide the M(M ł N ) nodes in Figure 2 into two groups, each group contains M = 2 nodes. In a sensing cycle, the two groups of nodes work in equal time, in turn, to perform spectrum sensing operation and data transmission operation respectively. The time-sharing work is shown in Figure 3.
In the grouping work structure of Figure 3, within a sensing period T , the time for each group to perform sensing operations is t 1 = T 2 , and the time for transmitting data is the same as t 2 = T À t 1 = T 2 . The energy consumed by the j-th node in a sensing period is expression as follows: In the above formula, f s is the adoption frequency of sensing nodes. Here, it is assumed that the sampling frequency of all nodes is the same. e 0 refers to the energy consumed by a single node in one sampling, also known as the benchmark energy consumption unit. The value  of n j is 0 or 1. When the value is 1, it means that the node is transmitting data. When the value is 0, it means that the node is not transmitting data. C 0 refers to the transmission power required for transmitting data within the unit distance. Here, the unit distance is set to 1 m. h j refers to the channel gain of the data transmission channel of the second node. d j Indicates the data transmission distance.

Interleaved grouping algorithm
Assuming that all M nodes in the list of Figure 2 participate in cooperative sensing, the total energy consumed by all nodes in a sensing period can be derived from equation (2) as follows: Assuming that the channel gains between all nodes and the fusion center are constant h, then equation (3) can be abbreviated as follows: After interleaving grouping, the detection probability (P d ) of each group can be expressed as follows: In the above formula, X = 1 indicates that the node judges that the PU exists, and w j indicates the weight of the j-th node. The calculation formula can be expressed as follows: The meaning of each parameter in formula (5) and (6) is as described in the literature. 31 Similarly, the false alarm probability (P f ) of each group can be expressed as follows: And the energy consumption of each group can be expressed as follows: In the above formula, L = M=2 represents the number of nodes in each group, and k is the group number index.
Using the sensing structure in Figure 3, the average point-to-point throughput between nodes can be expressed as follows: T 0 and T 1 respectively represent the throughput of the node when the PU is not working and when it is working. They are related to the channel capacity and the point-to-point signal-to-noise ratio (SNR), and are assumed to be constant here. P H 0 ð Þ and P H 1 ð Þ represent the probability of the main user not working and working, respectively.
Assuming that M,T 0 ,T 1 ,f s ,n j ,d j ,P H 0 ð Þ and P H 1 ð Þ are constants, then R q is only related to P d and P f . And because E T , K is a function of the sensing period T . Therefore, the joint optimization problem of sensing performance and energy consumption can be equivalent to a constrained optimization problem, which can be expressed as: In the above formula, P d, k T ð Þ, P f , k (T ), and E T , k T ð Þ respectively represent the detection rate, false alarm rate, and energy consumption of the k-th (k 2 (1, 2)) group. g 1 , g 2 , and E g , respectively, represent the detection rate, false alarm rate, and energy consumption threshold of each group.
Special instructions, a large increase or decrease in the number of nodes does not affect the detection probability results in this article, because the detection probability is determined by the nodes with good performance, not by the number of nodes. Nodes with node performance lower than the threshold participating in cooperative sensing are not conducive to the improvement of detection probability. The algorithm in this article does not select all nodes to participate in cooperative spectrum sensing, but only selects excellent nodes whose performance is higher than the threshold to participate in cooperative spectrum sensing. Therefore, changes in the number of nodes will not have a significant impact on the detection probability results. The performance of the algorithm in this article is also very good when the number of nodes changes. However, when the number of nodes suddenly increases significantly, the calculation amount of the fusion center will increase, because the fusion center needs to periodically evaluate the performance of all nodes, so suddenly increasing the number of nodes will increase the amount of calculation, but reducing the number of nodes will help reduce the fusion center amount of calculation.
Aiming at formula (10), the greedy heuristic algorithm GG (greedy grouping) 32 is used to solve the optimal sensing period. While the sensing performance and energy consumption meet the minimum requirements, the balance between perception performance and energy consumption is achieved. The algorithm steps of using GG algorithm to solve are as follows: 1. The grouping is called an event, denoted as P.
After the P event, it is necessary to check whether the detection rate, false alarm rate and energy consumption of each group meet the minimum requirements. Compare P d, k (T ), k 2 (1, 2),P f , k (T ), k 2 (1, 2), and E T , k T ð Þ ,k 2 (1, 2) with the threshold. If all the values of k meet the minimum requirements, there must be an optimal solution, The event is recorded, and jump to (2). Otherwise, eliminate the event, change the value of T, and re-execute step (1). 2. The function in step (1) can only know whether the P event meets the minimum requirements, but cannot obtain the overall sensing performance of the P event. To solve the optimal T value of equation (10), it is necessary to evaluate the overall sensing performance of the P event and the total energy consumption during the period. To evaluate the overall sensing performance, the detection rate and false alarm rate of each group are weighted average, that is, the weighted average detection rate and the weighted average false alarm rate are used to approximate the overall detection rate and false alarm rate of the P event. According to the staggered grouping model in this article, let us set: The calculations of P d (T ) and P f (T ) are shown in (12) and (13), respectively: The total energy consumption in one cycle of the P event is re-expressed as E T , k T ð Þ. The calculation formula of E T ð Þ is as follows: When all the T values successfully recorded by the GG algorithm have been calculated P d (T ), P f (T ), and 3, step (3) is executed.
3. Solving the problem of the optimal sensing period T is essentially the problem of how to allocate the perception time. According to the requirements of formula (10), the grouping criteria can be divided into: a smaller energy consumption E T T ð Þ in a period; a larger detection rate P d T ð Þ; a smaller false alarm rate P f T ð Þ. To achieve a balance between E T T ð Þ, P d T ð Þ and P f T ð Þ. Using the dynamic programming algorithm to solve formula (4), the best sensing period can be obtained as follows: In the above formula, a 1 , a 2 and a 3 are weighting factors, and a 1 + a 2 + a 3 = 1 and dðÞ are evaluation indexes. After the optimal T is obtained, E T ,P d ' P d , and P f ' P f can be obtained, and R p can be obtained by substituting P d and P f into formula (9).

Experimental environment description
To verify the performance of the algorithm in this article, three sets of experiments are set up. The first set of experiments is to verify the sensing performance of the grouping algorithm, which is described by two core indicators: detection probability and false alarm probability. The second set of experiments is to verify the energy efficiency of the grouping algorithm. The performance of the grouping algorithm is described by the energy efficiency comparison of different algorithms. The comparison algorithm is the equal-gain combination algorithm 33 and the node selection algorithm. 34 The third set of experiments is to find the optimal sensing period based on the grouping algorithm, and the working life of the cognitive radio network after the optimal sensing period is obtained. The working life is represented by the remaining energy. All experiments are Monte Carlo simulations with consideration of path loss and additive white Gaussian noise.
In the simulation experiment, there are 36 nodes randomly distributed in a circular area with a diameter of 1000 m, the working frequency of the PU is 50%, the transmitting power of the PU is set as a constant, the adopted frequency of the node is 1 MHz, the initial period of spectrum sensing is set as 1 ms, and the duration of the subsequent sensing period is determined by the period optimization algorithm. Computer experiments: the processor is Intel(R) Core(TM) i5-8500 CPU @ 3.00 GHz, RAM is 8.00 GB, 64-bit operating system, x64-based processor, Windows 10 Professional Edition system.

Analysis of experimental results
The impact of grouping algorithm on perception performance. To prove the superiority of the spectrum sensing performance of the grouping algorithm in this article, the performance comparison with the equalgain combination algorithm and node selection algorithm is carried out, and the two core indicators of the sensing performance of the spectrum detection probability and the false alarm probability are used to prove the grouping algorithm's performance. It can be seen from Figure 4(a) that the detection probability (P d ) of the grouping algorithm in this article is higher than the equal-gain combination algorithm and node selection algorithm when the SNR is lower than 210 dB. This is because the grouping algorithm in this article divides the selected CU into two groups, and the two groups of users take turns to perform spectrum sensing operations without interrupting the protection of the PU, so the detection probability is higher than others.
The reason why the detection probability of the node selection algorithm is higher than that of the equal-gain combination algorithm is that the node selection algorithm only selects some node with good performance to participate in the cooperative sensing operation, while the equal-gain combination algorithm is that all nodes participate in the cooperative perception. Some nodes cannot obtain ideal sensing results due to poor geographic location and other reasons. The nodes will not only have no positive effect on sensing results, but will have a negative impact, disrupting the global decision of the fusion center, so the detection probability of the node selection algorithm will be Higher than the equal-gain combination algorithm. It can be seen from Figure 4(b) that the false alarm probability (P f ) in this article is lower than the equal-gain combination algorithm and node selection algorithm when the SNR is lower than 220 dB. This is because the grouping algorithm adopts a node reliability evaluation algorithm. Before grouping, all nodes are ranked for reliability, and the top M nodes are selected to participate in cooperative sensing, which greatly reduces the probability of false alarms. The false alarm probability of the node selection algorithm is lower than that of the equal-gain combination algorithm, which is also the result of selecting only good nodes to participate in cooperative sensing.
Energy efficiency of grouping algorithm. To prove the superiority of the grouping algorithm in this article in terms of energy efficiency, it is compared with the equal-gain combination algorithm and node selection algorithm. The comparison of the three methods is carried out under the same conditions. To show the superior performance of the grouping algorithm, the SNR was changed to verify the energy efficiency of the algorithm in this article.
It can be seen from Figure 5 that the energy efficiency of the grouping algorithm in this article is higher than the node selection algorithm and the equal-gain  combination algorithm under different SNR. This is because the grouping algorithm is only one group of nodes performing spectrum sensing operations, and the other group of nodes are performing data transmission operations, which greatly reduces the energy consumed by spectrum sensing operations, increases the energy used for data transmission, and greatly improves energy efficiency.
As can be seen from Figure 5, only when the SNR is lower than 225 dB, the spectrum sensing operation time increases, the proportion in a cycle becomes larger, the data transmission operation time decreases, the proportion in a cycle becomes smaller, and the energy efficiency will be less than 50%. When the SNR is higher than 220 dB, the energy efficiency of the grouping algorithm starts to be higher than 50%. As the SNR increases, the energy efficiency of the grouping algorithm gradually increases. When the SNR reaches 0 dB, the energy efficiency can be infinitely close to 1, because the sensing operation time is very small, and the data transmission time is almost occupying the entire cycle. Table 1 lists the energy efficiency of different algorithms under each SNR, which is expressed in the form of percentage, so that the energy efficiency of different algorithms can be seen more intuitively. From Table 1, it can be seen that the energy efficiency of the grouping algorithm in this article is much higher than other traditional algorithms under the same SNR. When the SNR changes, the algorithm in this article still has obvious advantages. Only when the SNR is higher than 0 dB, the energy efficiency of the three algorithms is close to 100%.
The energy efficiency of the node selection algorithm is higher than that of the equal-gain combination algorithm under different SNR. This is because not all nodes of the node selection algorithm participate in the spectrum sensing operation, and the equal-gain combination algorithm is that all nodes participate in the spectrum sensing operation. The selected algorithm consumes less energy in the spectrum sensing operation than the equal-gain combined algorithm, but the effective energy consumption for data transmission will be more, and the energy efficiency will be higher. Threshold energy level is not considered here because the smaller the value of energy consumption is the better.
Working life of cognitive radio network based on packet algorithm. To prove the superiority of the grouping algorithm in this article in extending the working life of cognitive radio networks, the working period is represented by the residual energy. It is compared with the equal-gain combination algorithm and node selection algorithm. The comparison of the three methods is carried out under the same conditions. In Figure 6, the abscissa represents the number of sensing cycles, and the ordinate represents the residual energy of cognitive radio network. It can be seen from Figure 6 that with the increase in the number of sensing cycles, the residual energy of the three algorithms is rapidly decreasing, but the residual energy of the grouping algorithm in this article is always higher than that of the other two algorithms. When working for 105 cycles, the residual energy of the grouping algorithm is higher than that of the node. The selection algorithm is 43.4% higher than the equal-gain combination algorithm, and 100% higher than the equal-gain combination algorithm. This is because the number of nodes participating in cooperative sensing of the packet algorithm is less than the other two algorithms.  In the case of transmitting the same data, the packet algorithm needs less energy consumption, more residual energy, and more executable sensing cycle, which extends the working life of cognitive radio network. Because only some nodes are selected to participate in cooperative sensing, the energy consumption of node selection algorithm is less than that of equal-gain combination algorithm, so its residual energy is always higher than that of equal-gain combination algorithm. When the number of sensing cycles is more than 600, the residual energy of the three algorithms tends to zero, which also shows that no matter which algorithm is used, the residual energy of the cognitive network will eventually be exhausted after continuous long-time work. At this time, a new battery is needed for the cognitive radio network to start working again.

Conclusion
Energy efficiency is an important indicator of the development of cognitive radio networks. To improve the energy efficiency of cognitive radio networks, this article proposes a grouping algorithm. The algorithm only selects even number of reliable users to participate in cooperative sensing, and excludes the nodes with unreliable performance. It not only effectively improves the spectrum sensing performance, but also greatly improves the energy efficiency. The experimental results show that when the SNR is 220, the spectrum detection probability of the proposed algorithm is 50% higher than that of the traditional algorithm, the false alarm probability is 10% lower than that of the traditional algorithm, and the energy efficiency is 15% higher than that of the traditional algorithm. The following research will consider the optimization of packet, from two groups to multiple groups, and through the optimization algorithm to obtain the optimal number of packets, to further improve the energy efficiency and working life of cognitive radio network.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.