## 3 Network Resource Awareness and Resource Status Prediction
### Resource State Prediction Based on LSTM  
Resource status data exhibit nonlinear characteristics due to dynamic topological features. Traditional regression prediction methods perform poorly on nonlinear data, failing to meet the requirements for both accuracy and real-time performance. However, prediction models based on artificial intelligence can effectively enhance the prediction performance for nonlinear data. Neural networks, such as recurrent neural network models, are commonly used as prediction models, but they encounter the issue of exponentially decaying or growing back-propagated gradients in long time series, leading to problems of gradient vanishing or exploding during the training process [23]. These issues make it difficult for the model to learn the long-term dependencies in sequential data. LSTM, a lightweight intelligent prediction model, introduces cell states and gating mechanisms to discard, retain, and update certain information over long sequences, which effectively addresses the long-term dependency issues arising from cumulative long time series data, achieving the goal of accurate forecasting [24]. Therefore, a resource status prediction algorithm based on LSTM is proposed. This algorithm dynamically predicts the resource status of each node with the prediction step set as the awareness latency.  
The dataset contained 500 samples and was divided into three parts in chronological order, with 70% of the data used as the training set, 15% as the validation set, and the remaining 15% as the test set. Input samples for the training set were generated using a sliding window \(\mathrm{T_{w}}\), which contains 10 to 15 time slices of perceptual data. The predicted output sequence has a length of a single time slice, and the prediction target is \(\mathrm{x_{f}}\). The batch size was set to 32, and the number of epochs was 30. The model consists of an input layer, LSTM layer, and output layer. The dimension of the input layer was set to \(\mathrm{(T_{w},N_{w})}\), and \(\mathrm{N_{w}}\) is the number of features. The LSTM layer consists of a three-layer structure, with dropout layers placed between them. The output layer consists of a fully connected layer and a regression layer, with the fully connected layer employing a linear activation function. The loss function uses mean squared error as \(\mathrm{MSE}=\frac{1}{\mathrm{T_{k}}}\sum\limits_{i=1}^{\mathrm{T_{k}}}\left( \mathrm{y}_{i}-\hat{\mathrm{y}}_{i}\right)^{2}\). Taking \(\mathrm{X_{f}}\) as the input, \(\mathrm{h_{f-1}}\) as the hidden state, and the cell state as \(\mathrm{V_{f-1}}\), the LSTM computation steps are as follows:  
\[\mathrm{f_{f}}=\sigma\Big{(}\mathrm{W}_{f}\cdot[\mathrm{h_{f-1}},\mathrm{x_{f} }]+\mathrm{b_{f}}\Big{)}, \tag{11}\]  
where \(\mathrm{W}_{f}\) is the weight matrix for the state, \(\mathrm{b_{f}}\) is the bias vector, and \(\sigma(t)\) is the sigmoid function, with output values in the interval [0, 1], indicating which information is discarded in the cell state, retaining a certain proportion [25].  
\[i_{t}=\sigma(\mathrm{W}_{i}\cdot[\mathrm{h_{f-1}},\mathrm{x_{f}}]+\mathrm{b_{ f}}), \tag{12}\]  
\[\widetilde{C}_{t}=\mathrm{tanh}\mathrm{h}(\mathrm{W}_{V}\cdot[\mathrm{h_{f-1}},\mathrm{x_{f}}]+\mathrm{b_{V}}), \tag{13}\]  
where \(\mathrm{tanh}\) is the activation function, \(\mathrm{W}_{i}\) and \(\mathrm{W}_{V}\) are the state weight matrices, \(\mathrm{b_{i}}\) and \(\mathrm{b_{V}}\) are the bias vectors. The model determines whether the current input information is written to the memory cell. The cell status is updated based on the above results:  
\[\mathrm{V_{f}}=\mathrm{f_{f}}\odot\mathrm{V_{f-1}}+i_{t}\odot\widetilde{ \mathrm{V}}_{t}, \tag{14}\]where \(\odot\) is the element-wise multiplication function. Then, the output memory cell information is controlled:  
\[y_{t}=\sigma(W_{o}\cdot[h_{t-1},x_{t}]+b_{o}), \tag{15}\]  
\[h_{t}=y_{t}\odot\tan h(V_{t}), \tag{16}\]  
where \(W_{o}\) is the state weight matrix, and \(b_{o}\) is the bias vector.