A neural network-based metropolitan area network traffic prediction application method
By combining LSTM and Transformer models, the problem of insufficient prediction accuracy and adaptability in metropolitan area network traffic prediction is solved, achieving efficient and accurate traffic prediction, adapting to changes in the network environment, and optimizing network resource allocation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
- Filing Date
- 2024-10-25
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies for network traffic prediction suffer from insufficient prediction accuracy, low computational efficiency, and difficulty in adapting to dynamic changes in the network environment, especially in complex metropolitan area network environments where efficient and accurate traffic prediction is difficult to achieve.
We employ a neural network model based on LSTM and Transformer, combined with the characteristics of metropolitan area network traffic, to predict traffic through data preprocessing, a two-layer LSTM network, multiple Transformer blocks, and a self-attention mechanism. The model is deployed and dynamically adjusted through a RESTful API to adapt to changes in the network environment.
It achieves automated and high-precision network traffic prediction, improves the accuracy and stability of traffic prediction, adapts to changes in different network environments, optimizes network resource allocation, and enhances network operation efficiency.
Smart Images

Figure CN119496711B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of network traffic technology, and in particular relates to a method for predicting metropolitan area network traffic based on neural networks. Background Technology
[0002] As networks grow in scale and complexity, future networks will need to meet the demands of high bandwidth, low latency, and on-demand services. Traditional methods will no longer be able to provide optimal solutions in real time for traffic scheduling and path planning.
[0003] With the rapid acceleration of new metropolitan area network (MAN) construction, operators need to gradually migrate older MAN equipment to the new MAN environment. Scenarios such as home broadband services and routing changes require migrating from older MANs to newer ones, inevitably leading to a large number of network cutovers. Currently, key operations in the cutover process, such as cutover risk identification, impact scope confirmation, command execution, and verification, are heavily reliant on manual intervention. While there is increasing support for streamlined and orchestratable processes, there is still a lack of timely assessment of the impact on services and a deficiency in the ability to identify cutover risks. There is a need to introduce intelligent methods, such as network traffic trend prediction, to support dynamic baseline assessment, timely detection of cutover risks, and to ensure the stability of network and service quality after the cutover.
[0004] Currently, network traffic prediction primarily relies on traditional statistical models and machine learning methods. Common methods include:
[0005] (1) Time series analysis method: linear prediction models based on time series data, such as ARIMA and SARIMA, have limited ability to model complex nonlinear relationships and require expert experience and knowledge.
[0006] (2) Machine learning methods: Common methods include decision trees, linear regression, support vector machines, random forests, etc., which are suitable for classification and regression problems, but have low computational efficiency when dealing with large amounts of complex data.
[0007] (3) Deep learning methods: including models such as recurrent neural networks and long short-term memory networks, have powerful representation learning capabilities and can handle complex nonlinear relationships, but they require a large amount of computation and a lot of data for training, debugging and optimization.
[0008] The existing technology has the following drawbacks:
[0009] (1) Insufficient prediction accuracy: Traditional models have difficulty handling complex, nonlinear long-term series data when dealing with complex network traffic, and their prediction accuracy is limited, making it difficult to cope with the drastic fluctuations and diversity of traffic.
[0010] (2) Low computational efficiency: Some models have low computational efficiency when processing large-scale data, making it difficult to apply them in real time to real network environments.
[0011] (3) Difficulty in capturing complex features: Traditional models lack effective model update mechanisms and are difficult to adapt to the dynamic changes in the network environment. Summary of the Invention
[0012] In view of the shortcomings of the existing technology, the purpose of the invention is to provide a method for predicting traffic in metropolitan area networks based on neural networks. By training and optimizing a deep learning model on historical and feature data of the metropolitan area network, the accuracy of traffic prediction for IP-based networks is significantly improved.
[0013] This invention proposes a method for predicting metropolitan area network traffic based on neural networks, comprising:
[0014] S1, Data Acquisition and Preprocessing, including: collecting device IP, port, timestamp, inbound traffic, outbound traffic, and bandwidth data from historical traffic data of the metropolitan area network; performing data cleaning to handle missing and outlier values; standardizing network traffic data; and extracting time and classification features to provide input for subsequent model training.
[0015] S2, training an LSTM neural network model based on historical traffic data, includes: firstly, dividing the dataset according to time order, including a training set, a validation set, and a test set; wherein, the training set is used for model parameter learning, the validation set is used for model hyperparameter tuning and evaluation, and the test set is used for the final performance evaluation of the model;
[0016] S3. Input traffic data into a two-layer LSTM network to obtain hidden state information and feature representation. Use the LSTM encoder to capture long-term and short-term dependencies in the network traffic data and extract temporal features and related dependencies.
[0017] S4 introduces multiple Transformer blocks and extracts global dependency features through a self-attention mechanism;
[0018] S5 uses a trained two-layer LSTM model for network traffic prediction. The most recent historical traffic data is input into the LSTM decoder to gradually generate predicted traffic sequences for multiple future time points.
[0019] S6. During the training of the LSTM neural network model, an early stopping strategy is adopted to prevent overfitting. When the performance on the validation set no longer improves within a preset number of consecutive epochs, the training is automatically stopped. After training is completed, the optimal model is saved in .h5 format and applied to the test set for prediction.
[0020] S7, perform destandardization on the model prediction results to restore the original scale, including: restoring the prediction results to the scale of the original data based on the parameters used during data standardization; wherein, the parameters used during standardization include: minimum value, maximum value, mean, and standard deviation;
[0021] S8 evaluates the model's prediction results, including comparing the prediction results with actual network traffic data to assess the model's predictive performance, and using time series visualization analysis to examine the model's prediction errors and performance across different time periods.
[0022] Furthermore, in S2, the first 70% of the data is used as the training set, the next 20% as the validation set, and the last 10% as the test set.
[0023] Furthermore, in S5, the LSTM decoder, through zero vector input and combined with the hidden state information of the LSTM encoder, gradually generates a predicted traffic sequence for multiple future time points, including: predicting the traffic for the next 24 hours based on historical data at 5-minute intervals, that is, generating prediction results for 288 time points.
[0024] Furthermore, the LSTM decoder outputs prediction results step by step through a multi-layer LSTM network, and generates the final prediction value through a time-distributed dense layer.
[0025] Furthermore, after obtaining the model prediction results, the traffic will be monitored in real time and compared with the model prediction results to dynamically adjust the application strategy.
[0026] Furthermore, after the application is implemented, the effectiveness of the application is evaluated by comparing the actual traffic with the predicted traffic, problems are identified, and corrective measures are taken.
[0027] Furthermore, it also includes providing model deployment: providing a RESTful API for other systems to call, including:
[0028] It adopts the HTTP protocol and defines standardized RESTful API interfaces to facilitate other systems to call the model's capabilities;
[0029] By using the POST method, current or historical traffic data is passed in, and a future traffic prediction value is returned.
[0030] Provides an API interface to support monitoring the running status of the model;
[0031] API functionality is embedded into various network management systems of operators through capability plugins.
[0032] Furthermore, the LSTM neural network model is dynamically adjusted periodically based on changes in the network environment, including optimizing and adjusting model parameters and model structure.
[0033] Furthermore, the process of adjusting model parameters includes:
[0034] For different network environments, existing pre-trained models are fine-tuned, including freezing some layers of the model and retraining the last one or more layers of the model to adapt to the new data distribution, thereby improving the model's prediction performance in the new environment.
[0035] The learning rate is dynamically adjusted using an adaptive optimization algorithm, enabling the LSTM neural network model to adapt to different data characteristics.
[0036] Furthermore, the optimization and adjustment of the model structure includes:
[0037] The NAS architecture search method is used to automatically select the most suitable model architecture for the current network environment and optimize the model structure based on hardware resources and performance requirements.
[0038] The LSTM neural network model is decomposed into multiple functional modules, and these functional modules are dynamically combined according to different network conditions.
[0039] By introducing a gating mechanism, the LSTM neural network model can automatically select different processing paths based on the characteristics of the input traffic.
[0040] The beneficial effects of this invention are as follows:
[0041] (1) Automated Prediction: This invention utilizes LSTM and Transformer models combined with metropolitan area network traffic characteristics to automate network traffic prediction. Compared to traditional methods, no manual intervention is required, making the prediction process more efficient and intelligent. By comprehensively applying LSTM and Transformer models, adaptive feature extraction and efficient prediction are achieved, solving the problems of insufficient prediction accuracy and generalization ability in traditional methods.
[0042] (2) Improved Prediction Accuracy: Through the training and optimization of deep learning models, this invention significantly improves the accuracy of traffic prediction for IP-based networks. In critical scenarios, such as network cutovers, accurate traffic prediction can improve the success rate of cutovers, reduce the scope of service impact, and ensure the stability and quality of network cutovers. This invention dynamically adjusts model parameters and structure to adapt to changes in different network environments, providing operators with efficient and accurate traffic prediction, thereby optimizing network resource allocation and greatly improving network operation efficiency.
[0043] (3) Multi-model integration: Innovatively combining LSTM to capture the temporal features of traffic and extracting global contextual relationships through Transformer, significantly improving the accuracy and stability of traffic prediction.
[0044] (4) Adaptive optimization: By comprehensively applying LSTM and Transformer models, adaptive feature extraction and efficient prediction are achieved, which solves the problem of insufficient prediction accuracy and generalization ability in traditional methods. It also significantly improves the ability to capture drastic fluctuations such as traffic peaks in special time periods.
[0045] (5) Practicality and efficiency: This invention can dynamically adjust the model parameters and structure to adapt to changes in different network environments, providing operators with efficient and accurate traffic prediction, thereby optimizing network resource allocation and greatly improving network operation efficiency.
[0046] (6) Combining LSTM and Transformer models: By combining the advantages of LSTM and Transformer, we can make full use of LSTM’s powerful ability to capture long-term and short-term dependencies in time series, and Transformer’s superiority in parallel computing and global dependency feature extraction, thus solving the limitations of a single model in complex time series data processing.
[0047] (7) Efficient Training and Inference: The self-attention mechanism of the Transformer in this invention can accelerate training speed and reduce training time. Due to the recursive structure of the traditional LSTM model, data must be processed sequentially, resulting in slow training speed and difficulty in fully utilizing the parallel computing capabilities of modern GPUs. In contrast, the Transformer can process data in parallel. At the same time, the combination with the sequential processing capability of LSTM ensures that the model has efficient inference performance in practical applications, making it very suitable for scenarios such as real-time network traffic prediction in metropolitan area networks.
[0048] (8) Ability to handle diverse data: Traditional LSTM neural network models may have certain limitations when dealing with highly nonlinear and complex data patterns. However, the Transformer used in this invention has a flexible structure and can better handle diverse data patterns, making it highly adaptable. Therefore, the combination of the two can greatly enhance the model's ability to handle diverse data.
[0049] (9) Stability and robustness of the model: Although the traditional LSTM neural network model has good robustness, it often performs poorly when dealing with complex changes. However, due to the use of the characteristics of Transformer, the combination of the two in this invention is more stable when dealing with data fluctuations and anomalies, and can better adapt to changes in network traffic data such as metropolitan area networks.
[0050] (10) Dynamic Iterative Model Update: This invention proposes a unified traffic prediction API specification, providing services to various systems through capability plugins, and continuously adding new features and historical data to iteratively update the model. This dynamic update mechanism ensures continuous model optimization and high-precision prediction capabilities.
[0051] (11) Wide range of application scenarios: This invention is not only applicable to metropolitan area network environments, but also has a wide range of application prospects. It can be extended to other types of network operation and maintenance scenarios, enhancing the technical support capabilities for network management and optimization. Attached Figure Description
[0052] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. It is obvious that the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings.
[0053] Figure 1 This is a flowchart of a metropolitan area network traffic prediction application method based on neural networks, according to an embodiment of the present invention.
[0054] Figure 2 This is a schematic diagram of the model construction process according to an embodiment of the present invention;
[0055] Figure 3 This is a schematic diagram of the model convergence process in an embodiment of the present invention;
[0056] Figure 4 This is a schematic diagram illustrating the evaluation of model prediction results in an embodiment of the present invention;
[0057] Figure 5 This is a schematic diagram illustrating the application of the prediction method of this invention in the cutover process.
[0058] Figure 6 This is a schematic diagram illustrating real-time alarm notifications according to an embodiment of the present invention;
[0059] Figure 7 This is a schematic diagram illustrating the working principle of LSTM in an embodiment of the present invention. Detailed Implementation
[0060] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0061] Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts disclosed in this invention.
[0062] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The terms "installed," "connected," and "linked" should be interpreted broadly; for example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0063] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with some aspects of the invention as detailed in the appended claims.
[0064] The technical terms involved in this invention are explained below:
[0065] A neural network is a computational model that mimics the structure and function of the human brain, consisting of a large number of interconnected nodes (or neurons). Each node represents a specific output function, called the activation function. The connection between any two nodes represents a weighted value for the signal passing through that connection, called a weight, which is analogous to the memory of the artificial neural network. The network's output varies depending on the network's connection methods, weight values, and activation functions. The network itself is typically an approximation of a certain algorithm or function found in nature, or it may be an expression of a logical strategy, commonly used for tasks such as pattern recognition and data classification.
[0066] Recurrent Neural Networks (RNNs) are a type of recursive neural network that takes sequence data as input and recursively recursively moves along the sequence, with all nodes (recurrent units) connected in a chain-like manner. As a deep learning algorithm, RNNs possess memory, parameter sharing, and Turing completeness, giving them an advantage in learning the nonlinear features of sequences. RNNs are used in Natural Language Processing (NLP), such as in speech recognition, language modeling, and machine translation, and are also employed in various time series forecasting methods.
[0067] Long Short-Term Memory (LSTM) network: a special type of recurrent neural network that has excellent performance on time series data. The LSTM neural network model makes up for the problems of gradient vanishing, gradient exploding and insufficient long-term memory capacity of recurrent neural networks (RNNs), and is very suitable for solving data prediction with time series changes, such as network traffic, stock market, traffic flow prediction.
[0068] Autoregressive Integrated Moving Average (ARIMA) is a common time series forecasting model. When performing time series analysis, the ARIMA model identifies the data variation pattern (moving average, periodic component) based on the variation patterns of historical data, thereby enabling predictions about the future.
[0069] Metropolitan Area Network (MAN): A computer communication network established within a city to connect different local area networks (LANs) and wide area networks (WANs). Due to the use of LAN technology with active switching elements, the transmission latency in the network is relatively small. Its transmission medium is mainly optical fiber, and the transmission rate is above 100 megabits per second.
[0070] Traffic prediction: Predicting future network traffic based on historical data and models, aiming to improve the utilization of network resources and the quality of service.
[0071] Mean Squared Error (MSE) is a measure that reflects the degree of difference between the estimator and the estimated quantity, and can be used to measure prediction error.
[0072] This invention proposes a method for metropolitan area network (MAN) traffic prediction based on neural networks, relating to network service support, deep learning, and network traffic prediction technologies. The method provided by this invention mainly includes the following steps:
[0073] (1) Data preprocessing: Collect and process network traffic data, and perform standardization and feature extraction.
[0074] (2) Model training: Train the neural network model based on historical traffic data.
[0075] (3) Model prediction: Use the trained model to predict future network traffic.
[0076] (3) Model deployment: Provide a RESTful API for other systems to call.
[0077] (4) Model update: Update the model regularly to adapt to changes in the network environment.
[0078] This invention combines Long Short-Term Memory (LSTM) networks and the Transformer model to achieve high-precision prediction of network traffic data.
[0079] like Figure 1 and Figure 2 As shown in the figure, the metropolitan area network traffic prediction application method based on neural networks according to an embodiment of the present invention includes the following steps:
[0080] S1, Data Acquisition and Preprocessing, includes: collecting device IP, port, timestamp, inbound traffic, outbound traffic, and bandwidth data from historical traffic data of the metropolitan area network; performing data cleaning to handle missing and outlier values; standardizing network traffic data; and extracting time and classification features to provide input for subsequent model training.
[0081] In this step, the Z-score method is used to standardize the network traffic data.
[0082] In this step, temporal and categorical features are extracted. Temporal features include periodicity such as hourly, daily, and weekly cycles. Categorical features include device IP address and port number, as well as the device's hierarchy within the network.
[0083] S2, training an LSTM neural network model based on historical traffic data, includes: firstly, dividing the dataset according to time order, including a training set, a validation set, and a test set; wherein, the training set is used for model parameter learning, the validation set is used for model hyperparameter tuning and evaluation, and the test set is used for the final performance evaluation of the model.
[0084] Specifically, the preprocessed network traffic data is divided into training, validation, and test sets in a 7:2:1 ratio. That is, the first 70% of the data is used as the training set, the next 20% as the validation set, and the last 10% as the test set.
[0085] S3 inputs traffic data into a two-layer LSTM network to obtain hidden state information and feature representations. The LSTM encoder is used to capture long-term and short-term dependencies in the network traffic data and extract time-series features and related dependencies.
[0086] Specifically, taking the prediction of traffic every 5 minutes for the next day as an example, the traffic data of the most recent day is input into a two-layer LSTM network to obtain hidden state information and feature representations. The LSTM encoder can capture long-term and short-term dependencies in the network traffic data and extract temporal features and related dependencies. This information can provide rich context for subsequent Transformer processing.
[0087] The LSTM neural network model is introduced below:
[0088] Long Short-Term Memory (LSTM) networks have excellent performance on time series data. The LSTM neural network model makes up for the problems of gradient vanishing, gradient exploding, and insufficient long-term memory capacity of Recurrent Neural Networks (RNNs), and is very suitable for solving data prediction with time series changes, such as network traffic, stock market, traffic flow prediction.
[0089] The LSTM neural network model, through the introduction of a gating mechanism, consists of memory neurons, an input gate, an output gate, and a forget gate. The calculation principle of each control gate is as follows:
[0090] 1. Input gate: Remembers some current information. Calculate the input gate. The value and the candidate state value a of the input cell at time t t , Each value in the range is between 0 and 1, while a t The value is between -1 and 1.
[0091]
[0092] in, This represents the corresponding weight.
[0093] a t =tanh(W c ×(h t-1 ,X t )+b c (2)
[0094] in, This represents the corresponding offset.
[0095] 2. Forget Gate: Controls which information is discarded. Calculates the activation value f of the forget gate at time t. t f t Each value in the range is between 0 and 1.
[0096] f t =σ(W f ×(h t-1 ,X t )+b f (3)
[0097] Among them, W f ,b f Let represent the weights and biases of the forget gate, respectively, and σ represent the Sigmoid function.
[0098] 3. Neuron State Update: Based on the calculation results of the input gate and forget gate, the neuron state is updated to obtain the cell state update value C at time t. t :
[0099]
[0100] 4. Output Gate: This gate controls which information needs to be output. It is based on the calculated cell state update value C. t The formula for calculating the output gate can be obtained as follows:
[0101] h t =σ(W0×(h) t-1 ,X t )+b0)×tanh(C t (5)
[0102] Where W0,b0 represents the weights and biases of the output gate, and h t This is the output value of the current cell.
[0103] like Figure 7 As shown, the working principle of the LSTM neural network model is as follows:
[0104] The neuron at the current time receives the output h of the neuron at the previous time. t-1 Compared with the current input X t Calculate the forgetting gate f t Input gate Output gate o t With the hidden state C awaiting update t :
[0105] f t =σ(W f [h t-1 ,x t-1 ]+b f )
[0106]
[0107] o t =σ(W o [h t-1 ,x t-1 ]+b o )
[0108]
[0109] b. The hidden state of the previous moment C t Multiply by the forget gate, multiply the hidden state to be updated by the update gate, and add the two results to obtain the current hidden state C of the neuron. t :
[0110]
[0111] c. Current hidden state of the neuron C t The output h of the neuron at the current time is obtained by multiplying the tanh activation function with the output gate. t :
[0112] h t =o t *tanh(C t (8)
[0113] Compared to traditional recurrent neural networks, LSTM neural network models have an additional hidden state C of neurons. tThe forgetting gate is used to select and update information in the cyclic transmission of neurons. It is the main pathway for information transmission in LSTM neurons and is calculated by the forgetting gate and the input gate. t The current hidden state C of the neuron. t After it is generated, it is processed through C. t The output is calculated using the output gate and used as the output of the current neuron.
[0114] S4 introduces multiple Transformer blocks and extracts global dependency features through the Transformer self-attention mechanism.
[0115] Specifically, in this step, Transformer blocks are applied: based on the LSTM encoder, multiple Transformer blocks are introduced to further extract globally dependent features through a self-attention mechanism. The Transformer blocks include multi-head attention layers and feedforward neural network layers. Multi-head attention layers can process different parts of the data in parallel, enhancing the model's expressive power, while residual connections and layer normalization techniques improve the model's stability and training efficiency.
[0116] The Transformer is an advanced neural network model, particularly well-suited for time series and natural language processing tasks. Unlike traditional recurrent neural networks (RNNs), the Transformer relies on a self-attention mechanism, eliminating the need to process input data sequentially and thus enabling better parallel computation. This characteristic significantly improves the efficiency of the Transformer when processing large-scale data, while also addressing the vanishing and exploding gradient problems in RNNs and enhancing its ability to capture long-term dependency information.
[0117] In network traffic forecasting, the Transformer model can effectively analyze complex time-series data, achieving high-precision predictions by capturing the long-term and short-term dependencies in network traffic. This gives it significant advantages in optimizing network resource allocation, improving network stability, and reducing operational costs, thereby helping operators manage network resources more efficiently and improve overall operational efficiency and service quality.
[0118] The Transformer model processes sequential data by introducing a self-attention mechanism and a fully feedforward neural network. Its main components include a multi-head self-attention mechanism, a feedforward neural network, and positional encoding.
[0119] 1. Multi-head self-attention mechanism: This mechanism uses multiple self-attention heads to capture dependencies between different positions in a sequence.
[0120] Query, key, and value calculations:
[0121] Q = XW Q K = XW K V = XW V (9)
[0122] Where X is the input sequence, W Q W K W V These are the weight matrices for the query, key, and value, respectively.
[0123] 2. Calculation of self-attention:
[0124]
[0125] Where, d k It is the dimension of the key.
[0126] 3. Calculation of Multi-Head Self-Attention**:
[0127] MultiHead(Q,K,V)=Concat(head1,head2,…,head h W O
[0128] head1 = Attention(QW) Q ,KW k VW v ), (11)
[0129] Among them, W O It is the output weight matrix.
[0130] 4. Feedforward Neural Network: Fully connected layers are applied independently at each location to enhance the model's expressive power.
[0131] FFN(x)=max(0,xW1+b1)W2+b2 (12)
[0132] Where W1 and W2 are weight matrices, b1 and b2 are bias vectors, and max() is the ReLU activation function.
[0133] 5. Position Encoding: To preserve positional information within the sequence, positional encoding is used to inject this information into the input.
[0134]
[0135] Where pos is the position, i is the dimension index, and d is the dimension index. modelIt is the model dimension.
[0136] S5. The trained two-layer LSTM model is used for network traffic prediction. The most recent historical traffic data is input into the LSTM decoder to gradually generate predicted traffic sequences for multiple future time points.
[0137] Specifically, for example, an LSTM decoder can be used to predict traffic flow for the next day based on 5-minute intervals. The LSTM decoder uses zero-vector input and combines it with the hidden state information of the LSTM encoder to progressively generate traffic prediction data for 288 future time points. That is, predicting traffic flow for the next 24 hours based on historical data at 5-minute intervals generates prediction results for 288 time points.
[0138] The LSTM decoder outputs prediction results step by step through a multi-layer LSTM network, and generates the final prediction value through a time-distributed dense layer.
[0139] S6. During the training of the LSTM neural network model, an early stopping strategy is adopted to prevent overfitting. When the performance on the validation set no longer improves within a preset number of epochs, the training is automatically stopped. After training is completed, the optimal model is saved in .h5 format and applied to the test set for prediction.
[0140] The preset number is 5. That is, during the training of the LSTM neural network model, an early stopping strategy is used to prevent overfitting, and training is automatically stopped when the performance on the validation set no longer improves within 5 consecutive epochs.
[0141] In this step, the initial training period is set to 30 epochs, the batch size is set to 64, and the validation set split ratio is 0.20.
[0142] Specifically, during model training, an early stopping strategy is employed to prevent overfitting. The training period, batch size, and validation set split ratio are carefully set to ensure the model performs well on both the training and validation sets. After training, the model is saved and applied to the test dataset for prediction and performance evaluation.
[0143] Figure 3 This is a schematic diagram illustrating the model convergence process in an embodiment of the present invention. Figure 3As shown, during the model convergence process, the training loss (Loss) and validation loss (val_loss) significantly decreased from their initial high values to near zero. This indicates that the model successfully reduced prediction errors during training and demonstrated good prediction accuracy even on unseen validation data. The continuous decrease in loss is a key indicator of successful model training. Although the average precision (map@0.5) and validation set average precision (val_map) started low, they gradually increased as training progressed. While the numerical increase may seem small, considering that the average precision is within the range of [0,100], the improvement actually reflects the enhanced recognition and prediction capabilities of the model.
[0144] Meanwhile, as training progresses, the changes in each epoch tend to stabilize, without significant fluctuations or signs of overfitting (i.e., a sudden increase in validation loss). This indicates that the model maintains good stability during the learning process. Furthermore, the model converges relatively quickly, as evidenced by the rapid decrease in loss and the gradual improvement in accuracy. This is highly advantageous for model training in practical applications, especially when dealing with large-scale data. Overall, the training process demonstrates good performance improvement and stability of the model; the rapid reduction in loss and the continuous improvement in accuracy indicate that the model possesses excellent learning and generalization abilities. These results suggest that the model may perform well in real-world applications.
[0145] S7, perform inverse normalization on the prediction results of the LSTM neural network model to restore the original scale, including: restoring the prediction results to the scale of the original data according to the parameters used during data standardization. The parameters used during standardization include: minimum value, maximum value, mean, and standard deviation.
[0146] Specifically, based on the minimum, maximum, mean, or standard deviation used in data standardization, destandardization is performed using the Z-score standardization method to transform the data into a distribution with a mean of 0 and a standard deviation of 1. Destandardization restores the data to its original mean and standard deviation; the mathematical formula is as follows: Standardized data Restore the original scale based on the mean μ and standard deviation σ of the original data.
[0147] The prediction results are denormalized to restore the original scale for comparison and evaluation with real data. This hybrid approach, combining LSTM and Transformer models, effectively improves the accuracy and stability of network traffic prediction, making it suitable for complex time-series prediction tasks.
[0148] S8 evaluates the prediction results of the LSTM neural network model, including comparing the prediction results with actual network traffic data, evaluating the model's prediction performance, and examining the model's prediction error and performance in different time periods using time series visualization analysis.
[0149] Specifically, the prediction results are compared with actual network traffic data, and the predictive performance of the model is evaluated using metrics such as mean squared error (MSE), root mean square error (RMSE), and mean absolute error (MAE). In addition, time series visualization analysis is used to examine the prediction error and performance of the model in different time periods.
[0150] like Figure 4 As shown in the model prediction evaluation, the overall trends of inflow and outflow are relatively consistent. The predicted flow curves and actual flow curves largely match, indicating that the model's prediction effect is good. The changing trends and peak values of the two flows are very similar in certain specific periods, indicating that the model can accurately capture the trend of flow changes in most cases. In some time periods, the predicted flow deviates slightly from the actual flow, which may be due to sudden events or abnormal situations. Overall, the model's prediction results have a high degree of agreement with the actual data, and the model's predictive performance is good.
[0151] After obtaining the model's prediction results, traffic will be monitored in real time and compared with the model's prediction results to dynamically adjust the application strategy. After the application is implemented, the effectiveness of the application implementation will be evaluated by comparing the actual traffic with the predicted traffic, identifying problems and taking corrective measures.
[0152] In addition, the present invention also includes providing model deployment: providing a RESTful API for other systems to call.
[0153] Specifically, API design: adopt the HTTP protocol and define standardized RESTful API interfaces to facilitate other systems to call the model's capabilities.
[0154] Prediction Request: Use the POST method to pass in current or historical traffic data and return a predicted future traffic value.
[0155] Model status monitoring: Provides an API interface to monitor the running status of the model, such as whether it needs to be updated or optimized.
[0156] Capability Expansion: Through capability plugins, API functions can be embedded into various network management systems of operators, such as resource scheduling systems and network cutover systems. The flexibility of plugins allows this model to provide customized services for different business needs, and authentication mechanisms can be added as needed to ensure the security of the interface.
[0157] This invention supports model updates: the model is updated periodically to adapt to changes in the network environment.
[0158] Specifically, the LSTM neural network model is adjusted periodically according to changes in the network environment, including: model fine-tuning, retraining model parameters, and optimizing the model structure.
[0159] 1. Model fine-tuning and retraining
[0160] In different network environments and scenarios, by fine-tuning model parameters and appropriate retraining, the model can better adapt to new data distributions and network requirements. For example, in IPRAN networks, for bandwidth rule optimization, the model can be fine-tuned and retrained to analyze historical traffic data and predict traffic over a future period. Based on the prediction results, bandwidth allocation for other services can be optimized to ensure reasonable resource allocation and avoid over- or under-allocation.
[0161] For capacity planning issues in base station diagnostics, fine-tuning and retraining can be used to collect historical traffic data (such as daily peak, off-peak, and average traffic), analyze the temporal distribution and seasonal variations of traffic, and predict peak and off-peak periods. Based on the prediction results, resource allocation (such as spectrum allocation, power control, and user access strategies) can be adjusted to optimize resource utilization and avoid network congestion during peak hours. Simultaneously, based on demand, decisions can be made regarding whether to add new base stations or upgrade the hardware of existing base stations (such as adding transmission lines, upgrading antennas, or enhancing server processing capabilities).
[0162] Therefore, by regularly fine-tuning and retraining, the model can adapt to changes in different network environments and scenarios. The specific steps are as follows:
[0163] Fine-tuning model parameters, including:
[0164] Transfer learning and fine-tuning: For different network environments, existing pre-trained models are used and fine-tuned. Most layers are frozen, and only the parameters of the last few layers are adjusted to adapt to the new data distribution.
[0165] For example: the parameters of an existing pre-trained model are θ pretrained The training data for the new environment is D. new So, the fine-tuned parameter θ fine-tune This can be achieved by optimizing the following objective function:
[0166]
[0167] in, It is the loss function, and λ is the regularization parameter that controls the fine-tuning process.
[0168] Adaptive learning rate: The learning rate is dynamically adjusted using adaptive optimization algorithms (such as Adam and AdaGrad) so that the model can quickly adapt to different data features.
[0169] For example, when using the Adam optimization algorithm, the formula for dynamically adjusting the learning rate α is:
[0170]
[0171] in, It is the moving average of the squared gradient, and ∈ is the smoothing parameter to ensure numerical stability.
[0172] Model retraining: Regular retraining using the latest traffic data ensures the model can adapt to changing environments. Online learning is employed, updating model parameters each time new data is acquired.
[0173] 2. Optimization and adjustment of model structure
[0174] Automatic Architecture Search (NAS): Using the NAS method, this feature automatically selects the model architecture best suited to the current network environment. This method can optimize the model structure based on hardware resources and performance requirements.
[0175] For example, NAS can be defined as an optimization problem whose goal is to find the optimal model structure A. * :
[0176]
[0177] in, For all possible architecture spaces, Cost(A) is the computational cost of the architecture, such as latency or memory usage.
[0178] Modular design: The model is decomposed into multiple modules, such as multi-layer LSTM and Transformer layers, and selectively combined according to different network conditions and task requirements. Examples include LSTM layers, Transformer layers, and fully connected layers. Each module can be selected through NAS or manual strategy, using a policy function π to choose the optimal module combination M under different network environments. * :
[0179] M * =π(NetworkCondition,ResourceConstraint) (17)
[0180] Therefore, in high-latency networks, reducing the number of LSTM layers by n LSTM Increase the number of Transformer layers by n Transformer .
[0181] Gating mechanism: Introducing a gating mechanism allows the model to automatically select different processing paths based on the characteristics of the input traffic. When traffic surges, more Transformer layers can be activated to capture complex time-series features.
[0182] 3. Feedback-based adaptive mechanism
[0183] Real-time monitoring and feedback: After model deployment, prediction performance is monitored in real time, and model weights are adjusted or retrained based on feedback. For example, when the model's prediction error is large at certain times, some model parameters can be adjusted based on feedback, or the weights of historical data can be increased. The real-time adjustment mechanism can be implemented by monitoring the feedback error ∈ t To guide model updates, the specific parameter update formula is as follows:
[0184]
[0185] Where γ is the feedback adjustment step size. Time model prediction error.
[0186] Meta-learning: Meta-learning methods are used to train an auxiliary model to learn how to adjust the parameters of the main model, enabling it to quickly adapt to new network environments. For example, a meta-learner g(·) is trained, whose inputs are the current network state and model performance, and whose output is the adjustment strategy.
[0187] Δθ=g(NetworkCondition,ModelPerformance) (19)
[0188] The following is for reference. Figure 5 The application of the method of the present invention in a real-world scenario is illustrated by taking the application of traffic prediction in network cutover as an example.
[0189] Process Description: Before, during, and after the cutover, the network quality, service quality, and related equipment alarms of the ports involved in the cutover are monitored in real time. The traffic prediction model is used to automatically determine whether port traffic and other indicators show abnormal trends.
[0190] Preparation before network cutover: Before the network cutover, use this traffic prediction model to predict the traffic during the upcoming cutover period, select a low traffic period for the cutover, and plan resource allocation in advance.
[0191] Monitoring during cutover: During the cutover process, the cutover strategy is dynamically adjusted by comparing real-time traffic changes with the predicted results to ensure a smooth cutover process.
[0192] Post-cutover evaluation: After the cutover is completed, the cutover effect is evaluated by comparing the actual flow rate with the predicted flow rate, so as to quickly locate problems and take corrective measures.
[0193] Scenario 1: Routing Change: By changing the routing, the service of one port is transferred to another port, and the traffic of the current port is superimposed to the target port. Before the cutover, the traffic prediction model is used to predict the traffic capacity after the cutover and to detect potential risks such as traffic exceeding limits in a timely manner.
[0194] Scenario 2: Dynamic monitoring: Calculate a dynamic baseline by predicting the trend of daily data traffic, comparing it with the traffic data of the previous day, week, and month, and predicting the traffic after the cutover. Compare this with the actual traffic, and issue a timely warning if there is a significant deviation.
[0195] like Figure 6 As shown, by comparing the predicted value with the actual real-time traffic value, a significant difference was found around 12:00, triggering a real-time alarm.
[0196] The method provided by this invention, when applied to traffic prediction in network cutover, can achieve the following functions:
[0197] Real-time dynamic monitoring: During network cutover, the impact of the cutover is dynamically understood through real-time traffic prediction, and actual traffic data is collected and compared with predicted data. An error threshold is set, and an early warning is triggered when the error exceeds the threshold. The causes of the error are analyzed by combining historical data and the network alarm system, and corresponding measures are taken.
[0198] Advance resource planning: Before upgrading or cutting over network equipment, determine the required equipment and bandwidth resources through traffic forecasting and deploy them in advance to ensure effective management of traffic peaks during the cutover process and avoid network congestion caused by sudden traffic surges. Simultaneously, based on traffic forecasting and real-time monitoring results, develop contingency response plans to ensure that backup resources can be quickly deployed to guarantee network service continuity in the event of a sudden increase in traffic.
[0199] Reduce cutover risks: By predicting future traffic, identify periods with lower future traffic, assess the potential risks of cutover at different times, develop risk assessment reports, select the most suitable cutover time, and develop detailed contingency plans for high-risk periods to ensure rapid response in case of emergencies. During the cutover process, monitor actual traffic in real time to ensure consistency with the prediction results, and dynamically adjust the cutover plan and resource allocation based on real-time data to reduce cutover risks.
[0200] Improve operational efficiency: Automated traffic prediction and real-time monitoring systems can identify potential problems in advance, reduce the frequency and severity of emergencies, thereby improving the efficiency of network operations and maintenance. At the same time, the traffic prediction system can automatically generate reports and warnings, reducing the workload and pressure on operations and maintenance personnel, allowing them to focus on higher-value tasks and decisions.
[0201] This invention addresses the shortcomings of traditional methods in handling complex, nonlinear data, improving the accuracy and adaptability of traffic prediction. By introducing LSTM and Transformer models, it can better capture the time dependencies and nonlinear relationships in the data, achieving accurate prediction of metropolitan area network traffic, thereby improving network resource utilization and service quality.
[0202] This invention provides a professional model for metropolitan area network (MAN) traffic prediction by combining advanced neural network technologies such as LSTM (Long Short-Term Memory) and the Transformer model with the traffic characteristics of metropolitan area networks (IP-based) networks. This model significantly improves the accuracy of IP-based network traffic prediction by training and optimizing a deep learning model using historical and feature data from the MAN.
[0203] In network cutover and other operational scenarios for telecom operators, this model effectively reduces reliance on manual intervention. Through accurate traffic prediction, the model improves the success rate of network cutovers, reduces the scope of their impact on services, and thus ensures the stability and quality of network cutovers. For example, during network cutover operations, accurate traffic prediction helps operators plan resource allocation in advance, understand the cutover results and impacts dynamically in real time, reduce the occurrence of unexpected situations, and ensure the continuity and stability of network services.
[0204] This invention also enables operators to manage network resources more efficiently. By accurately predicting network traffic, operators can optimize the allocation and use of network resources, reduce resource waste, and improve overall network operation efficiency and quality. This technology is not only applicable to metropolitan area network environments but also has broad application prospects, and can be extended to other types of network operation and maintenance scenarios, providing strong technical support for network management and optimization.
[0205] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.
Claims
1. A method for predicting metropolitan area network traffic based on neural networks, characterized in that, include: S1, Data Acquisition and Preprocessing, including: collecting device IP, port, timestamp, inbound traffic, outbound traffic, and bandwidth data from historical traffic data of the metropolitan area network; performing data cleaning to handle missing and outlier values; standardizing network traffic data; and extracting time and classification features to provide input for subsequent model training. S2, a two-layer LSTM neural network model is trained based on historical traffic data, including: first, the dataset is divided into training set, validation set and test set according to time order; the training set is used for model parameter learning, the validation set is used for model hyperparameter tuning and evaluation, and the test set is used for final performance evaluation of the model. S3. Input traffic data into a two-layer LSTM neural network model to obtain hidden state information and feature representation. Use the LSTM encoder to capture long-term and short-term dependencies in network traffic data and extract temporal features and related dependencies. S4 introduces multiple Transformer blocks and extracts global dependency features through the Transformer self-attention mechanism; S5. A pre-trained two-layer LSTM neural network model is used for network traffic prediction. The most recent historical traffic data is input into the LSTM decoder to gradually generate predicted traffic sequences for multiple future time points. The LSTM decoder uses a zero vector input and combines the hidden state information of the LSTM encoder to gradually generate traffic prediction data for multiple future time points, including: predicting traffic for the next 24 hours based on historical data at 5-minute intervals, i.e., generating prediction results for 288 time points. The LSTM decoder outputs the prediction results step by step through a multi-layer LSTM network and generates the final prediction value through a time-distributed dense layer. The LSTM neural network model supports periodic updates, including: dynamically adjusting the two-layer LSTM neural network model periodically according to changes in the network environment, including: optimizing and adjusting model parameters and model structure. The process of adjusting the model parameters includes: For different network environments, existing pre-trained models are fine-tuned, including freezing some layers of the model and retraining the last one or more layers of the model to adapt to the new data distribution, thereby improving the model's prediction performance in the new environment. The learning rate is dynamically adjusted using an adaptive optimization algorithm, enabling the two-layer LSTM neural network model to adapt to different data characteristics. The optimization and adjustment of the model structure includes: The NAS architecture search method is used to automatically select the most suitable model architecture for the current network environment and optimize the model structure based on hardware resources and performance requirements. The two-layer LSTM neural network model is decomposed into multiple functional modules, and these functional modules are dynamically combined according to different network conditions. By introducing a gating mechanism, the two-layer LSTM neural network model can automatically select different processing paths based on the characteristics of the input traffic. S6. During the training of the two-layer LSTM neural network model, an early stopping strategy is adopted to prevent overfitting. The training cycle, batch size and validation set split ratio are set to ensure that the model performs well on both the training set and the validation set. When the validation set performance no longer improves within a preset number of consecutive epochs, training is automatically stopped. After training is completed, the optimal model is saved in .h5 format and applied to the test set for prediction. S7, perform destandardization on the model prediction results to restore the original scale, including: restoring the prediction results to the scale of the original data according to the parameters used during data standardization; wherein, the parameters used during standardization include: minimum value, maximum value, mean and standard deviation; S8 evaluates the model prediction results, including comparing the prediction results with actual network traffic data to assess the model's prediction performance, and combining time series visualization analysis to check the model's prediction errors and performance in different time periods.
2. The metropolitan area network traffic prediction application method based on neural networks according to claim 1, characterized in that, In S2, the first 70% of the data is used as the training set, the next 20% as the validation set, and the last 10% as the test set.
3. The metropolitan area network traffic prediction application method based on neural networks according to claim 1, characterized in that, After obtaining the model prediction results, the traffic will be monitored in real time and compared with the model prediction results to dynamically adjust the application strategy.
4. The metropolitan area network traffic prediction application method based on neural networks according to claim 1, characterized in that, After the application is implemented, the effectiveness of the application is evaluated by comparing the actual traffic with the predicted traffic, problems are identified, and corrective measures are taken.
5. The metropolitan area network traffic prediction application method based on neural networks according to claim 1, characterized in that, This also includes providing model deployment: providing a RESTful API for other systems to call, including: It adopts the HTTP protocol and defines standardized RESTful API interfaces to facilitate other systems to call the model's capabilities; By using the POST method, current or historical traffic data is passed in, and a future traffic prediction value is returned. Provides an API interface to support monitoring the running status of the model; API functionality is embedded into various network management systems of operators through capability plugins.
Citation Information
Patent Citations
Slice resource adjustment method and device, storage medium and computer equipment
CN118785257A
Network traffic prediction method and device, equipment and storage medium
CN118802583A