In order to solve the problem of traffic burst due to the increase in access points and user movement in an FTTR network, as well as to meet the demand for a high-performance network, it is necessary to rationally allocate network resources, and accurate traffic prediction is very important for dynamic bandwidth allocation in such a network. Therefore, this paper introduces a novel traffic prediction model, named CPO-BiTCN-BiLSTM-SA, which integrates the Crested Porcupine Optimizer (CPO), bidirectional temporal convolution (BiTCN), and bidirectional long short-term memory (BiLSTM) networks. BiTCN extends the traditional TCN by incorporating bidirectional data information, while BiLSTM enhances the network’s capability to learn from long sequences. Moreover, self-attention (SA) mechanisms are utilized to emphasize the crucial segments in the data. Subsequently, the BiTCN-BiLSTM-SA model is optimized by CPO to obtain the best network hyperparameters, and model training prediction is performed to achieve multi-step predictions based on single-step prediction. To evaluate the model’s generalization ability, two distinct datasets are employed for traffic prediction. Experimental findings demonstrate that the proposed model surpasses existing models in terms of the root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R2). In comparison with the traditional XGBoost model, the proposed model has an average reduction of 29.50%, 25.43%, and 25.00% in RMSE, MAE, and MAPE, respectively, with a 6.70% improvement in R2.