# A Fuzzy-Logic-Based Load Balancing Scheme for a Satellite-Terrestrial Integrated Network
## 2 Materials and Methods
### The Fuzzy Evaluation Metric  
Existing load balancing methods are usually performed reactively after the overloading occurs. Active load balancing adapts the network in advance to prevent overloading and improve performance. Therefore, this paper firstly proposes a metric to pre-evaluate the impact of users on overloading, which helps the networks to make further decisions. Considering the differences in carrier frequency and bandwidth between TN and NTN, and the difficulty of explicitly evaluating overload tendency, fuzzy control is utilized [29] for the metric. It provides a unified measurement to evaluate the impact of users on overloading in STIN. An adaptive neuro fuzzy network (ANFN) is utilized to build the fuzzy system. The training network is shown in Figure 2. In the following, the structure of each layer of the network is described. Figure 1: Diagram of load balancing in a satellite–terrestrial integrated network. In the input layer, SNR, relative speed and data rate are selected as the inputs by considering the Shannon formula \(C=B\log_{2}(1+SNR)\): SNR and the target rate. Channel with low SNR needs more bandwidth to transmit data at the same target rate, which is more likely to cause overload. In addition, if the user is getting closer to the cell, SNR between them will get better, otherwise it will get worse. Additionally, if the SNR is the same, users with higher data rates will require more bandwidth. Measurements of SNR and data rate requirements are in the same way in both RAT. The movement of user could be expressed by the relative speed between user and cell. Since the satellite is far from the Earth, the moved distance of the user in a short period of time can be ignored relative to the satellite height. Thus, the speed relative to the satellite is considered to be 0 in this paper. It is difficult to directly judge whether SNR, relative speed and data rate are high or not. Therefore, we take them as the three inputs in the \"input\" layer. The \"inputmf\" layer uses membership functions to convert input values into fuzzy values. Commonly utilized membership functions are triangular, trapezoidal, Gaussian and bell-shaped. Since the relationship between inputs and output is not linear, the Gaussian membership function was selected. \[f(x,c,\sigma)=e^{-\frac{(x-c)^{2}}{2c^{2}}}, \tag{5}\]  
where \(c\) determines the center position of the function. \(\sigma\) determines the width of the function. Both \(c\) and \(\sigma\) are trained by the ANFN. The fuzzy system has three inputs, and there are \(P\), \(Q\) and \(R\) fuzzy concepts for each input, respectively. The membership degrees of inputs to different fuzzy concepts could be calculated via the membership functions. In this paper, both \(P\), \(Q\) and \(R\) are set to 5, based on five fuzzy concepts: very bad (VB), bad (B), medium (M), good (G) and very good (VG). For each input, there are five membership functions subjecting to the same distribution with different parameters. The \"rule\" layer pairs \(P\) fuzzy concepts of the first input, \(Q\) fuzzy concepts of the second input and \(R\) fuzzy concepts of the third input to obtain \(P\times Q\times R\) fuzzy rules. T-S fuzzy reasoning is utilized in the proposed fuzzy system. For the \(l\)th rule, the first input \(x\) is \(X_{i}\), the second input \(y\) is \(Y_{j}\) and the third input \(z\) is \(Z_{k}\). The mapping result \(u_{l}\) is calculated by  
\[u_{l}=p_{l}x_{i}+q_{l}y_{j}+r_{l}z_{k}+c_{l}, \tag{6}\]  
Figure 2: Adaptive neuro fuzzy network structure. where \(l=(i-1)QR+(j-1)R+k\); \(i\in[1,P],j\in[1,Q],k\in[1,R]\). \(p_{l}\), \(q_{l}\), \(r_{l}\) and \(c_{l}\) are parameters of the \(l\)th rule trained by ANFN; \(X_{i}\), \(Y_{j}\) and \(Z_{k}\) are the \(i\)th, \(j\)th and \(k\)th fuzzy concepts of the three inputs; \(x_{i}\), \(y_{j}\) and \(z_{k}\) are the membership degree values calculated by the corresponding membership functions. The \"outputmf\" layer uses weighted average method to consider the influence of each fuzzy rule comprehensively.