## 2 Proposed Spectrum-Sharing Scheme
### Utility Function  
To know how much profit users can obtain, we should find a way to quantify existing revenue and costs. For licensed user \(i\), the profit function consists of three parts: Revenue from leasing spectrum to unlicensed users, revenue from providing service to ongoing licensed connections, and the cost induced by quality of service (Qos) degradation of the licensed user [25]. Therefore, the profit function of licensed user \(i\) can be formulated by:  
\[\begin{array}{c}\prod_{i}(P)=P_{i}\times\sum\limits_{j=1}^{N}\left(D_{j} \times x_{ij}\right)+c_{1}\times M_{i}-c_{2}\times M_{i}\times\left(B_{i}^{ req}-k_{i}^{(l)}\frac{W_{i}-\sum\limits_{j=1}^{N}\left(D_{j}\times x_{ij}\right)}{M_{i}} \right)^{2}\\ st.\sum\limits_{j=1}^{N}\left(D_{j}\times x_{ij}\right)\leq W_{i},\ i=1, \ldots,M\\ \sum\limits_{i=1}^{M}x_{ij}\leq 1,\ j=1,\ldots,N\\ x_{ij}\in\{0,\ 1\},\ i=1,\ldots,M;\ j=1,\ldots,N\end{array}, \tag{1}\]  
where \(P\) is the set containing all licensed users' spectrum prices, that is, \(P=\{P_{1},\ldots\ P_{i},\ldots\ P_{M}\}\), \(x_{ij}=1\) if unlicensed user \(j\) purchases spectrum from licensed user \(i\); otherwise, \(x_{ij}=0\), \(M_{i}\) is the number of ongoing licensed connections, \(c_{1}\) and \(c_{2}\) denote the weights for the revenue and cost function, respectively; \(B_{i}^{req}\) is the spectrum demand for an ongoing licensed connection; and \(k_{i}^{(l)}\) is the spectral efficiency of wireless communication for licensed user \(i\)'s service provider, and can be obtained by:  
\[k_{i}^{(l)}=\frac{B_{i}^{req}}{W_{i}/M_{i}}, \tag{2}\]  
In this paper, we assume that once licensed user \(i\) decides to provide an unlicensed user with service, it will completely meet the spectrum demand of the unlicensed user. However, for an unprofitable market, an unlicensed user has the right to not choose any licensed user, namely, \(\sum\limits_{i=1}^{M}x_{ij}=0\). Related to the bandwidth, SNR, and spectrum price, the utility function of unlicensed user \(j\) is made up of the revenue gained from transmitting and the payment for radio resource usage. It can be calculated as follows:  
\[\begin{array}{c}U_{j}(P)=&\omega_{j}\times D_{j}\times\sum\limits_{i=1}^{M }\left(k_{ij}^{(u)}\times x_{ij}\right)-D_{j}\times\sum\limits_{i=1}^{M} \left(x_{ij}\times P_{i}\right)\\ &\hskip 28.452756 ptst.\sum\limits_{i=1}^{M}x_{ij}\leq 1,\ j=1,\ldots,N\\ &x_{ij}\in\{0,\ 1\},\ i=1,\ldots,M;\ j=1,\ldots,N\end{array}, \tag{3}\]  
where \(\omega_{j}\) is the income from the per-transmission rate of unlicensed user \(j\), and, in this paper, it also represents the importance of unlicensed user \(j\)'s data; \(k_{ij}^{(u)}\) is the spectral efficiency of wireless communication by unlicensed user \(j\) using licensed user \(i\)'s spectrum, and can be obtained from Reference [26]:  
\[k_{ij}^{(u)}=\log_{2}\left(1+K\times\gamma_{ij}\right),\ \text{where}\ K=\frac{1.5}{ \ln(0.2/BER^{tar})}, \tag{4}\]  
where \(\gamma_{ij}\) is the SNR and is used to reflect the heterogeneous nature of WSN; \(BER^{tar}\) is the target bit-error rate.  
Some existing studies have proven that, when the spectrum demand from unlicensed users is continuous, the utility-price curve of a licensed user is continuous and strictly convex [20]. However, as shown in Figure 2, the discontinuous spectrum demands in this paper leads to discontinuous and straight utility-price lines. If the spectrum price varies within a limited range, the spectrum demand will not change, which is the reason why the utility of a licensed user is only proportional to its spectrumprice. The spectrum price that reaches the peak point of a licensed user's utility in a continuous situation no longer applies to a discontinuous situation. Note that, with an increase in spectrum price, each breakpoint means a reduction of buyers and the slope of each line decreases gradually.