# Dynamic Divide Grouping Non-Orthogonal Multiple Access in Terrestrial-Satellite Integrated Network
## 4 Dynamic User Pairing Method
The results show that the difference of satellite communication channel gain is ultimately determined by the distance between the user and the beam center. Based on the relationship model of user elevation angle, beam angle and distance, different distance intervals can be divided. Then, the NOMA user pairing with stable channel differences can be constructed by distance model. Specially, the users in each distance interval do not need to sort the channel gain, and the joined users can be pairing according to their distance interval. When the users change dynamically, they only need to determine the changing distance interval and do not need to reorder all user, which can improve the scalability of user pairing. Furthermore, the complexity can be reduced to \(O(N)\). As shown in Figure 4, the users are assumed to be randomly deployed in a disc, i.e., the cell controlled by the base station. The radius of the disc is \(d_{max}\), and the base station is located at the center. To pair two users for the implementation of NOMA, we assume that the disc is divided into two regions as shown in \[L_{j}=\left(\frac{v}{4\pi fjh_{j}}\right)^{2}. \tag{13}\]1 The first region is a smaller disc with radius \(d_{med}\), (\(d_{med}\leq d_{max}\)) and the base station located at its origin. The second region is a ring, constructed from disc by removing the first region. According to the distance between users and BS or satellite, users are put into different distance intervals to form a set of users. Then, the optimal user pairing is selected according to the interval difference, the specific steps of user pairing are as follows. (1) Traverse all users \(N_{u}\): based on the user's position, the distance between the user and the BS or the center of the beam coverage area \(d_{i}\) is obtained. (2) Distance interval division: the center point of BS or beam coverage area is shown in Figure 4, the user terminal density is \(\lambda_{u}\), which follows the homogeneous Poisson point process. Denoting \(d_{med}\) as the distance corresponding to the users number \(\frac{N_{u}}{2}\), according to the user distribution, the interval \([d_{\min},d_{\max}]\) is divided into two intervals, which are expressed as \(Q_{1}=[d_{\min},d_{med}]\) and \(Q_{2}=[d_{med},d_{\max}]\). The users number in \(Q_{1}\) is \(P(N_{k}=k)=\frac{\mu_{1}^{k}}{\Gamma^{2}}e^{-\mu_{1}}\), \(\mu_{1}=\pi(d_{med}^{2}-d_{\min}^{2})\lambda_{\mu}\), and the users number in \(Q_{2}\) is \(P(N_{k}=k)=\frac{\mu_{2}^{k}}{\Gamma^{2}}e^{-\mu_{2}}\), \(\mu_{2}=\pi(d_{max}^{2}-d_{med}^{2})\lambda_{\mu}\). \[L_{j}=\left(\frac{v}{4\pi fjh_{j}}\right)^{2}. \tag{13}\]2 Relationship between beam gain and distance. Each interval obtained from the first level partition is divided into two levels, and \(q\) is defined as the number of partitions. To ensure the equal number of users in each interval, we have  
\[L_{j}=\left(\frac{v}{4\pi fjh_{j}}\right)^{2}. \tag{13}\]3  
with  
\[L_{j}=\left(\frac{v}{4\pi fjh_{j}}\right)^{2}. \tag{13}\]4  
According to the number of users \(\frac{N_{u}}{2q}\) corresponding to the interval, the distance boundary value of the corresponding interval \([d_{i-1},d_{i}]\) can be obtained, i.e, the subinterval \(i(1\leq i\leq q)\) in the first interval is expressed as \(Q_{1,i}=[d_{1,i-1},d_{1,i}]\), the subinterval \(i\) in the second interval is expressed as \(Q_{2,i}=[d_{2,i-1},d_{2,i}]\). (3) Partition user set: traverse all users and divide them into corresponding intervals according to channel gain, then a user set \(S_{i,j}\) can be obtained. (4) Generate user pairing: according to the interval index, the user set of secondary interval is paired.