## 4 Results and Discussion
### Grid Service Traffic Prediction Based on LSTM  
In traffic services, especially for the grid service, current traffic may be influenced by the previous moments. LSTM can capture the long-term dependencies in sequential data and handle the temporal relationships between input data. By training, it can learn the periodicity, trend, and special events in traffic, and then use these features for prediction.  
Figure 7: The impact of traffic type number on classification accuracy.  
The LSTM model performs well in traffic prediction tasks. It is applied to dynamically predict service traffic in the power 5G network slice, thereby adjusting the service carrying requirements of the network slice.  
The traffic prediction algorithm utilizes a publicly available dataset from Internet source providers (ISP) to verify the effectiveness of the prediction model [32]. Each traffic data point in the dataset is measured at one-hour intervals, resulting in a total of 1232 data points. After reading in the dataset, the traffic data are normalized and split into training and testing datasets with an 8:2 ratio [33]. Time series data are then created, and the time series length is set. Based on TensorFlow, LSTM and BILSTM models are established and trained on the training dataset, obtaining the loss values for both the training and the testing datasets during the training process. Finally, predictions are made and the denormalized results are compared to the true values. The data processing flowchart for the BILSTM model is shown in Figure 9.  
Figure 10 shows the loss values of the LSTM and BILSTM as the model is continuously trained. Figure 10a shows the loss values for the training set and Figure 10b shows the loss values for the test set. It can be seen that the loss values in both the training and test sets gradually decrease, with the loss values in both the training set being lower than those in  
Figure 8: Heat map of the confusion matrix at 10 for the category.  
Figure 9: Flow chart of data processing in LSTM and BILSTM model.  
the validation set. Loss and val_loss represent training error and testing error, respectively. At the same time, the loss values of the BILSTM model were both lower than those of the LSTM model. Therefore, the use of the BILSTM model for prediction is more effective and can basically satisfy the task of traffic prediction in the power network slicing.  
As shown in Table 4, multiple predicted values were obtained by changing the time series length. According to the comparison results of MAPE, it can be seen that the smallest error was obtained when the time series length was set to 10. The comparison chart of the predicted results and actual values shown in Figure 11 was based on the BILSTM model with a time series length set to 10. At this point, the MAPE of the BILSTM model was 6%. The red solid line shows the actual values of the test set and the black dashed line shows the predicted values based on the BILSTM model. As can be seen from the figures, the two curves are in good agreement. Figure 12 shows a statistical histogram of the different relative errors and it can be seen that about 90% of the predicted data have a relative error of less than 10%. Table 5 and Figure 13 show the comparison of MAPE under the BILSTM method used in this paper with the four methods mentioned in [32]. From the table and bar chart, it can be seen that the use of BILSTM method has reduced the MAPE of this dataset and gives better and stable prediction results.  
Figure 11: Comparison of flow forecast results.  
Figure 12: Histogram of statistics corresponding to MAPE values.  
Figure 13: MAPE values for different methods.