# Wireless Traffic Prediction Based on a Gradient Similarity Federated Aggregation Algorithm
## 3 Proposed Framework and Methods
### Constructing Two-Channel Sliding Window Training Data  
The wireless traffic prediction service in general is: given \(K\) base stations, the local wireless traffic data of each base station can be represented as a dataset, as in Equation (2):  
\[d^{k}=\left\{d_{1}^{k},d_{2}^{k},d_{3}^{k},\cdots,d_{z}^{k}\right\} \tag{2}\]  
where the total time interval is \(Z\); and assuming that \(d_{z}^{k}\) is the target service volume to be predicted, then the wireless service prediction problem can be described as Equation (3).  
\[d_{z}^{k}=f(d_{z-1}^{k},d_{z-2}^{k},\cdots,d_{1}^{k};w) \tag{3}\]  
Figure 3: Enhanced data strategy.  
where \(f(\cdot)\) denotes the chosen prediction model and \(w\) denotes the corresponding parameter. The prediction model \(f(\cdot)\) can be in linear form (e.g., linear regression) or in nonlinear form (e.g., deep neural network).  
For wireless network traffic prediction techniques, to reduce data complexity, partial historical traffic data are usually used as input features, and considering that the base station network traffic is time-dependent, the traffic of each time slot can be represented as a two-channel Tensor matrix [16; 17].  
Therefore, based on the wireless traffic dataset \(d^{k}\), a set of input-output pairs \(\left\{x_{i}^{k},y_{i}^{k}\right\}_{i=1}^{n}\), where \(x_{i}^{k}\) denotes the historical traffic data associated with \(y_{i}^{k}\), can be obtained using a sliding window scheme, and \(x_{i}^{k}\) is partitioned into two time channels, i.e., adjacent time and cycle time channels, which represent the predicted target time adjacent time traffic and cycle time traffic for the corresponding time points, respectively, as in Figure 4.  
Defining \(p\) as the adjacent time point sequence dependence length, the flow of the adjacent time series can be expressed as \(\left\{d_{z-1}^{k},\cdots,d_{z-p}^{k}\right\}\), \(q\) as the periodic time dependence length, and the periodic historical sampling flow can be expressed as b, \(\mu\) is periodic. The flow prediction target of this paper is the flow value at the next time point, so Equation (3) can be described as Equation (4):  
\[\hat{g}_{i}^{k}=f\Big{(}x_{i}^{k};w\Big{)} \tag{4}\]  
The objective of the experiment is to minimize the prediction error on \(K\) clients, so the objective of the traffic prediction can be described as solving for the parameter \(w\) under the optimal solution in Equation (5):  
\[\underset{w}{\text{min}}\mathbb{\downarrow}(w)=\frac{1}{Kn}\underset{k=1}{ \sum}\underset{i=1}{\sum}\underset{i=1}{\text{min}}\mathbb{\uparrow}\Big{(}f \Big{(}x_{i}^{k};w\Big{)},y_{i}^{k}\Big{)} \tag{5}\]  
where \(\mathbb{\downarrow}\) is the loss function, which can be expressed as \(\left|f\left(x_{i}^{k};w\right)-y_{i}^{k}\right|\).  
Long Short-Term Memory (LSTM) has the powerful ability to model time series datasets, so this paper selects a LSTM Long Short-Term Memory network as the network model, sets two LSTM network layers, corresponding to the input adjacent time point dependent sequence traffic data and periodic time series dependent data in turn, after which the output data features of each channel are spliced, and finally, the features are mapped to the prediction by a linear layer.  
Figure 4: Two-channel training data.