## 4 Terminal Load and Communication
### Analysis of Terminal Load  
The training process of the FL-AHNEAP method is divided into two parts: the representation learning on the attributed heterogeneous network and the link prediction model based on the neural network. The representation learning on the attributed heterogeneous network uses the noise contrastive estimation (NCE) loss function to optimize the model parameters. According to the idea of NCE, for each sample, N other labels are first sampled to generate negative samples. At first, we calculate the input node embedding vector \(v_{i,r}\), according to Formula (4), and then construct the optimization model parameters of log-likelihood function of the binary logistic regression:  
\[ \begin{split} l_{i}=\log\left({\it sigmoid}(W_{p}^{T}v_{i,r}) \right)+\sum_{k=1}^{K}\log\left(1-{\it sigmoid}(W_{n}^{T}v_{i,r})\right)\\ =\log\left({\it sigmoid}\left(W_{p}^{T}v_{i,r}\right)\right)+ \sum_{k=1}^{K}\log\left({\it sigmoid}(-W_{n}^{T}v_{i,r})\right)\end{split}  \tag{4}\]  
When computing the node embedding \(v_{i}\), in the mobile App startup prediction scenario stated in this paper, the embedding of the same node in the three sub-networks needs to be obtained respectively. The main computing overhead comes from the process of generating node embedding representation from node features and node neighbor information. The process is mainly matrix multiplication, and the time complexity is \(O(NRDL)\), where \(N\) represents the number of nodes, \(R\) denotes the edge type, \(D\) is the dimension of the node embedding, and \(L\) represents the number of neighbor nodes selected for the generation of node edge embedding. The main computing overhead of using the NCE loss function to optimize the model is the matrix multiplication in logistic regression. The time complexity is \(O(NRD(K+1))\), and \(K\) represents the number of negative samples for each sample. The experiment of Reference [2] shows that the terminal training round has little effect on the FL-AHNEAP method, assuming five rounds of terminal training. The edge type \(R=3\), the node embedding dimension \(D=20\), the number of neighbors \(L=10\), and \(K\) is generally set to 5, and the time complexity depends on the number of nodes \(N\). When there are an increasing number of historical records, the number of nodesin the network generated based on the records will also increase, and the computing load on the terminal will become greater. In light of Reference [2], only a simple neural network with a single hidden layer is constructed in the link prediction based on neural network, so the main computing overhead is still matrix multiplication. The time complexity is \(O(N_{t}N_{a}D+N_{r}N_{a}N_{a})=O(N_{r}N_{a}(D+N_{a}))\), where \(N_{r}\) represents the number of historical records, and \(N_{a}\) represents the number of applications. There are not many applications for a user, so \((D+N_{a})\ll N_{r}\). The time complexity depends on the number of historical records of users participating in the training. In the same manner, when there are an increasing number of historical records, the computing load on the terminal will increase. In this paper, we adopt the App: AID Learning to run the terminal part of the FL-AHNEAP method on the Android system to calculate the model training time. AID Learning is a Linux virtual machine running on an Android terminal that supports a graphical interface. It is a framework and platform that supports the development of deep neural networks, with the most popular deep learning framework built in. We use the following two mobile devices with different configurations for verification:  
* Huawei P20: equipped with OS Android 10, HiSilicon Kirin 970 processor, CPU frequency 2.36 GHz, 6 GB RAM, 128 GB ROM;
* Huawei Nova2S: equipped with OS Android 9, HiSilicon Kirin 960 processor, CPU frequency 1.8 GHz, 4 GB RAM, 64 GB ROM.