STL decomposition-based deep learning type network traffic prediction method and device, computer equipment and storage medium
By decomposing and modeling network traffic data using STL decomposition and deep learning models, the problem of insufficient accuracy in network traffic prediction in existing technologies is solved, achieving higher accuracy and more stable traffic prediction, which is suitable for a variety of application scenarios and tasks.
Patent Information
- Application Number
- CN202511050409.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-05-19
- Filing Date
- 2025-07-29
- Publication Date
- 2026-11-20
AI Technical Summary
Existing network traffic prediction methods struggle to effectively capture nonlinear features when faced with complex and highly volatile network traffic data, and their generalization ability is insufficient in long-term dependent and multivariate time series scenarios, resulting in inadequate prediction accuracy.
STL decomposition is used to decompose network traffic data into trend components, periodic components and residual components, and deep learning models are used to model each component respectively. The prediction is then performed by combining the Seq2Seq model of GRU and the attention mechanism.
It significantly improves the accuracy and stability of network traffic prediction, can adapt to the traffic characteristics of different scenarios, supports multiple scenarios, multiple types and multiple task requirements, and enhances the scalability and predictive ability of the model.
Smart Images

Figure CN123145170A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network security technology, specifically to a deep learning-based network traffic prediction method, apparatus, computer device, and storage medium based on STL decomposition. Background Technology
[0002] With the widespread adoption of smart terminal devices and the development of communication technologies, network scale is continuously expanding, and the traffic generated by various network services is constantly increasing. To better manage network capacity and monitor its status, ensuring the reliability and stability of network operation, Network Traffic Management (NTM) systems have received increasing attention. Among these, network traffic prediction utilizes historical network traffic data to predict future traffic, gaining advance knowledge of network traffic trends and thereby improving network resource utilization. This is of great significance for ensuring the normal operation of services and enhancing user experience.
[0003] Currently, the network environment is becoming increasingly complex, data sources are diversified, and network traffic data exhibits significant dynamic changes. How to achieve effective traffic prediction has attracted widespread attention from researchers. At present, there are two main types of network traffic prediction methods: one is based on traditional statistical time series prediction methods, such as the Average Model (AM), Autoregressive (AR), Autoregressive Moving Average (ARMA), and their extended models. The drawback of these methods is that they are only suitable for linear prediction and cannot effectively predict complex and highly volatile network traffic data. The other type is based on neural network prediction methods, including Support Vector Regression (SVR) based on machine learning, and Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), and their improved models based on deep learning. These methods train neural networks using large amounts of data, capturing nonlinear characteristics. Finally, the test set is input into the trained neural network model to obtain the predicted value. However, their drawbacks include susceptibility to noise interference when directly modeling complex flow sequences, making it difficult to fully utilize the multiple patterns in the sequence; furthermore, these methods have insufficient generalization ability and inaccurate prediction results when dealing with scenarios involving long-term dependencies and multivariate time series.
[0004] Experiments show that network traffic time series typically exhibit obvious periodicity and trend characteristics. However, most current studies tend to focus only on predicting the overall series during modeling, essentially ignoring the crucial role of periodic fluctuations and long-term trends within the traffic series in predicting accuracy. Therefore, how to effectively decompose and model different patterns in complex traffic series to improve the accuracy of network traffic prediction has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of this invention is to provide a deep learning-based network traffic prediction method, apparatus, computer device, and storage medium based on STL (Seasonal-Trend decomposition using Loess) to overcome the insufficient accuracy of existing network traffic prediction methods and improve prediction capabilities by utilizing STL decomposition and deep learning algorithms.
[0006] Firstly, a deep learning-based method for network traffic prediction based on STL decomposition is provided, which includes the following steps:
[0007] Step 1: Collect network traffic data at designated network nodes using network traffic monitoring tools, and then perform preliminary cleaning and preprocessing on the collected raw network traffic data;
[0008] Step 1 specifically includes the following sub-steps:
[0009] Step 1.1: Using high-performance traffic monitoring tools deployed on network devices (such as terminal devices, routers, switches, and gateways), network traffic passing through the network is aggregated, filtered, and distributed at designated network nodes to collect raw network traffic data recorded in chronological order.
[0010] Step 1.2: Perform preliminary cleaning and preprocessing on the collected raw network traffic data, including removing duplicate data records, checking the integrity and consistency of the data, and repairing or deleting data points with obvious errors or anomalies. For example, filter out data packets that obviously do not conform to the network protocol format, handle cases of lost or out-of-order data packets, and ensure that the data quality meets the requirements of subsequent analysis.
[0011] Step 2: Perform STL-based data processing on the collected raw network traffic data to form a time series dataset suitable for modeling;
[0012] Step 2 specifically includes the following sub-steps:
[0013] Step 2.1: For different network traffic scenarios, sample or aggregate the preprocessed network traffic data at equal intervals, extract key feature data, including uplink and downlink data volume and uplink and downlink packet count, and construct unit or multi-dimensional network traffic feature data recorded in time sequence.
[0014] Step 2.2: Divide the extracted traffic feature data into training set, validation set and test set according to a certain ratio to ensure the scientific nature and independence of model training, validation and testing.
[0015] Step 2.3: Standardize the time series data to eliminate dimensional differences between features. Simultaneously, impute any missing values to ensure the integrity and consistency of the time series.
[0016] Step 2.4: Use the STL method algorithm to decompose the standardized time series data to obtain trend components, periodic components and residual components.
[0017] Among them, the trend component represents the long-term trend of the time series;
[0018] Among them, the periodic component represents the periodic fluctuations in the time series;
[0019] The residual component represents the randomness or noise in the time series.
[0020] Step 2.5: Perform sliding window segmentation on the decomposed time series according to a fixed time length to form the flow input sequence and the corresponding prediction output sequence, which facilitates the training and prediction of the deep learning model.
[0021] Step 2.6: Encapsulate the time series data generated by the sliding window into a data loader to provide an efficient data input interface for model training, validation, and testing.
[0022] Step 3: Based on the trend component, periodic component, and residual component data loaders obtained in Step 2, train and validate deep learning models for the trend component, periodic component, and residual component, respectively.
[0023] Step 3 specifically includes the following sub-steps:
[0024] Step 3.1: Use a Seq2Seq (Sequence to Sequence) model based on a Gated Recurrent Unit (GRU) and combine it with an attention mechanism to model the trend component. The model input is the historical data of the trend component, and the output is the future trend value;
[0025] Step 3.2: Use a GRU-based Seq2Seq model and combine it with an attention mechanism to model the periodic components and capture the periodic fluctuation characteristics;
[0026] Step 3.3: Use a GRU-based Seq2Seq model and combine it with an attention mechanism to model the residual components and predict short-term stochastic fluctuations;
[0027] Step 3.4: Set the training learning rate to 0.001;
[0028] Step 3.5: Use the mean squared error (MSE) of predicted traffic and actual traffic as the loss function for deep learning;
[0029] Step 3.6: The training process of the above model uses the AdamW optimizer to improve the model's convergence speed and stability.
[0030] Step 4: Input the test data encapsulated in Step 2 as a data loader into the network traffic prediction model trained in Step 3 to predict the trend component, periodic component, and residual component respectively. Add the results of the three to obtain the final network traffic prediction value.
[0031] Secondly, a deep learning-based network traffic prediction device based on STL decomposition is provided. The device includes a data acquisition module, a data processing module, a model training module, a model prediction module, and a model output module.
[0032] The data acquisition module is used to collect raw network traffic data from network devices and supports data sources from various network devices, including terminal devices, routers, switches, and gateways.
[0033] The data processing module is used to extract features and partition the dataset from the raw network traffic data, constructing univariate or multivariate time series data. Missing values are filled and the data is standardized to ensure data quality. The STL decomposition method is used to decompose the time series data into trend components, periodic components, and residual components, providing input data for subsequent model training and prediction. A sliding window is used to segment the feature data, and a data loader is created.
[0034] The model training module is used to construct a deep learning-based time series prediction model based on the decomposed time series components, and to perform iterative training to obtain a network traffic prediction model. For each component (trend component, periodic component, residual component), a GRU-based Seq2Seq model is used for modeling. An attention mechanism is introduced to enhance the model's ability to focus on key time steps and improve prediction accuracy. The AdamW optimizer is used to optimize the model, improving training speed and stability.
[0035] The model prediction module utilizes a trained model to independently predict the decomposed time series components. It predicts long-term trends based on the trend component, periodic fluctuations based on the periodic component, and short-term random fluctuations based on the residual component. The prediction results of all components are then weighted and synthesized to generate the final network traffic prediction value.
[0036] The model output module provides the integrated prediction results to the network management system or related application scenarios to support tasks such as traffic scheduling, resource allocation, and anomaly detection.
[0037] Thirdly, this application provides a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; when the processor executes the computer program, it implements the method described in any one of the above.
[0038] The memory is used to store computer programs;
[0039] The processor is configured to run a computer program stored in memory to execute the deep learning-based network traffic prediction method based on STL decomposition described in any of the above-mentioned methods.
[0040] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the deep learning-based network traffic prediction method based on STL decomposition described above.
[0041] Beneficial effects
[0042] A deep learning-based network traffic prediction method, apparatus, computer device, and storage medium based on STL decomposition have the following advantages compared with existing network traffic prediction methods:
[0043] 1. The method of this invention predicts the trend component, periodic component, and residual component separately through STL decomposition, avoiding the error accumulation problem of directly modeling the original time series. It can effectively handle traffic characteristics in different scenarios, such as long-term trend changes and short-term random fluctuations, significantly improving prediction accuracy and enhancing the stability of the method. Furthermore, the method of this invention supports flexible combinations of different models and has high scalability.
[0044] 2. The method of the present invention is applicable to multiple scenarios (such as smart grids, backbone networks, campus networks and home networks), multiple types (unit and multi-dimensional time series), and multiple tasks (short-term, medium-term and long-term forecasting) requirements.
[0045] 3. By using accurate traffic data predictions, network scale can be adjusted to ensure more rational allocation of network resources. In network security, accurate traffic predictions in advance enable traffic early warning and anomaly filtering. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the deep learning-based network traffic prediction method based on STL decomposition of the present invention.
[0047] Figure 2 This is a flowchart of the data processing based on STL decomposition according to the present invention;
[0048] Figure 3 A schematic diagram of the structure of the deep learning-based network traffic prediction device based on STL decomposition of the present invention. Detailed Implementation
[0049] The technical solutions of the embodiments 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, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] Reference Figure 1 The first embodiment of this invention provides a deep learning-based network traffic prediction method based on STL decomposition. This method utilizes the STL decomposition algorithm to decompose complex network traffic time series into trend components, periodic components, and residual components. Then, deep learning modeling and prediction are performed on each component separately, and finally, the prediction results are integrated and output. Specifically, it includes the following steps:
[0051] Step 1: Collect network traffic data at designated network nodes using network traffic monitoring tools, and then perform preliminary cleaning and preprocessing on the collected raw network traffic data;
[0052] Step 2: Perform STL-based data processing on the collected raw network traffic data to form a time series dataset suitable for modeling;
[0053] Step 3: Deep Learning Modeling and Prediction. Based on the trend component, periodic component, and residual component data loaders obtained in Step 1, deep learning models are trained and validated for the trend component, periodic component, and residual component, respectively.
[0054] Step 4: Prediction Result Integration. Input the test data encapsulated in Step 1 as a data loader into the network traffic prediction model trained in Step 2 to predict the trend component, periodic component, and residual component respectively. Add the results of the three to obtain the final network traffic prediction value.
[0055] In steps 1 and 2, the raw network traffic data needs to be collected using different schemes depending on the scenario. Then, the raw network traffic data is preprocessed to obtain preprocessed traffic prediction data. The preprocessed network traffic data is then fed into a data processing module based on STL decomposition to form a time-series dataset suitable for modeling. Figure 2 The data processing flowchart based on STL decomposition of the present invention includes the following sub-steps:
[0056] Step 2.1: Obtain Network Traffic Data. The WIDE dataset is maintained by the MAWI working group of the WIDE project. It provides daily internet traffic traces on the relay link from WIDE to the upstream ISP, collected as "samplepoint-F". Additionally, a real-world smart grid dataset is provided by a power grid company in Shenzhen, China. This dataset contains traffic trajectories from automatic metering terminals deployed in the 5G wireless access area between 18:27:40 and 19:27:46 on January 4, 2021.
[0057] Step 2.2: Feature Extraction. For the WIDE dataset, this invention acquires data from January 1, 2014 to December 31, 2023, performs equal-interval sampling or aggregation on network traffic data, and extracts three key data features: TotalCapSize, number of data packets, and average rate. For the smart grid dataset, this invention aggregates network traffic data with a time length of 1 second and extracts twelve features, including uplink and downlink data volume and the number of uplink and downlink packets, for multivariate time series prediction.
[0058] Step 2.3: Dataset Partitioning. The extracted traffic feature data is divided into training, validation, and test sets according to a certain ratio to ensure the scientific rigor and independence of model training, validation, and testing.
[0059] Step 2.4: Data Standardization. Standardize the time series data to eliminate dimensional differences between features. Simultaneously, impute any missing values to ensure the integrity and consistency of the time series.
[0060] Step 2.5: STL Decomposition. The STL decomposition algorithm is used to decompose the standardized time series data to obtain trend components, periodic components, and residual components.
[0061] Among them, the trend component represents the long-term trend of the time series;
[0062] Among them, the periodic component represents the periodic fluctuations in the time series;
[0063] The residual component represents the randomness or noise in the time series.
[0064] Step 2.6: Sliding Window Partitioning. The decomposed time series is divided into sliding window segments according to a fixed time length, forming the flow input sequence and the corresponding predicted output sequence, which facilitates the training and prediction of the deep learning model.
[0065] Step 2.7: Data Loader Encapsulation. The time series data generated by the sliding window is encapsulated into a data loader, providing an efficient data input interface for model training, validation, and testing.
[0066] In step 3, training and prediction are performed based on a deep learning model. A GRU-based Seq2Seq model is used for modeling. GRU is good at capturing time dependencies, and an attention mechanism is introduced to enhance the model's ability to focus on key time steps, thereby improving prediction accuracy. Specifically, this includes the following sub-steps:
[0067] Step 3.1: Use a GRU-based Seq2Seq model, combined with an attention mechanism, to model the trend component. The model input is the historical data of the trend component, and the output is the future trend value;
[0068] Step 3.2: Use a GRU-based Seq2Seq model and combine it with an attention mechanism to model the periodic components and capture the periodic fluctuation characteristics;
[0069] Step 3.3: Use a GRU-based Seq2Seq model and combine it with an attention mechanism to model the residual components and predict short-term stochastic fluctuations;
[0070] Step 3.4: Set the training learning rate to 0.001;
[0071] Step 3.5: Use the mean squared error (MSE) of predicted traffic and actual traffic as the loss function for deep learning;
[0072] Step 3.6: The training process of the above model uses the AdamW optimizer to improve the model's convergence speed and stability.
[0073] This invention utilizes STL decomposition to split and model time series data, predicting trend, periodic, and residual components separately, thus avoiding the error accumulation problem that may occur when directly modeling the original sequence. This method effectively adapts to flow characteristics in different scenarios, such as capturing long-term trend changes and short-term random fluctuations, significantly improving prediction accuracy and enhancing model stability. Furthermore, this method supports flexible combinations of different models, exhibiting high scalability. It is applicable to various application scenarios, multiple data types (univariate and multivariate time series), and multiple task requirements (short-term, medium-term, and long-term forecasting).
[0074] Reference Figure 3 The second embodiment of the present invention provides a schematic diagram of a deep learning-based network traffic prediction device based on STL decomposition. The device includes a data acquisition module, a data processing module, a model training module, a model prediction module, and a model output module.
[0075] The data acquisition module collects raw traffic data from network devices.
[0076] The data processing module cleans, extracts features, and decomposes the raw data to obtain trend, periodic, and residual components.
[0077] The model training module trains deep learning models based on component data and improves model performance through an optimizer.
[0078] The model prediction module uses the trained model to predict future traffic flow and integrates the component prediction results.
[0079] The model output module provides the prediction results to the target system, supporting further network management and optimization tasks.
[0080] In summary, the method of this invention utilizes STL decomposition to split and model time series data, predicting trend components, periodic components, and residual components separately, thus avoiding the error accumulation problem that may occur when directly modeling the original sequence. This method can effectively adapt to traffic characteristics in different scenarios, such as capturing long-term trend changes and short-term random fluctuations, significantly improving prediction accuracy while enhancing model stability. Furthermore, this method supports flexible combinations of different models, exhibiting high scalability. It is applicable to various application scenarios, multiple data types (univariate and multivariate time series), and multiple task requirements (short-term, medium-term, and long-term predictions). By providing accurate traffic prediction results, this method can not only optimize the rational allocation of network resources but also achieve traffic early warning and anomaly filtering in network security, providing important technical support for network management and optimization.
[0081] This invention also provides a computer device. The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a deep learning-based network traffic prediction program based on STL decomposition. When the processor executes the computer program, it implements the steps in the various deep learning-based network traffic prediction embodiments based on STL decomposition described above. Alternatively, when the processor executes the computer program, it implements the functions of each module in the various device embodiments described above, such as a data processing module.
[0082] A computer-readable storage medium storing a computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the deep learning-based network traffic prediction method based on STL decomposition of the present invention.
[0083] The above-described embodiments further illustrate the objectives, technical solutions, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred implementations of the present invention, and the present invention should not be limited to the content disclosed in these embodiments and the accompanying drawings. Any equivalents or modifications made without departing from the spirit of the present invention fall within the scope of protection of the present invention.
Claims
1. A deep learning-based network traffic prediction method based on STL decomposition, characterized in that, The method includes: Step 1: Collect network traffic data at designated network nodes using network traffic monitoring tools, and then perform preliminary cleaning and preprocessing on the collected raw network traffic data; Step 2: The preprocessed network traffic data is fed into a data processing system based on STL decomposition to form a time series dataset suitable for modeling; Step 3: Based on the trend component, periodic component, and residual component data loaders obtained in Step 2, train and validate deep learning models for the trend component, periodic component, and residual component, respectively. Step 4: Input the test data encapsulated in Step 2 as a data loader into the network traffic prediction model trained in Step 2, and predict the trend component result, periodic component result and residual component result respectively. Add the three results together to obtain the final network traffic prediction value. Thus, from step 1 to step 4, a deep learning-based network traffic prediction method based on STL decomposition has been completed.
2. The deep learning-based network traffic prediction method based on STL decomposition according to claim 1, characterized in that: Step 1 includes the following sub-steps: Step 1.1: Using high-performance traffic monitoring tools deployed on network devices (such as terminal devices, routers, switches, and gateways), network traffic passing through the network is aggregated, filtered, and distributed at designated network nodes to collect raw network traffic data recorded in chronological order. Step 1.2: Perform preliminary cleaning and preprocessing on the collected raw network traffic data, including removing duplicate data records, checking the integrity and consistency of the data, and repairing or deleting data points with obvious errors or anomalies. For example, filter out data packets that obviously do not conform to the network protocol format, handle cases of lost or out-of-order data packets, and ensure that the data quality meets the requirements of subsequent analysis.
3. The deep learning-based network traffic prediction method based on STL decomposition according to claim 1, characterized in that: Step 2 includes the following sub-steps: Step 2.1: For different network traffic scenarios, sample or aggregate the preprocessed network traffic data at equal intervals, extract key feature data, including uplink and downlink data volume and uplink and downlink packet count, and construct unit or multi-dimensional network traffic feature data recorded in time sequence. Step 2.2: Divide the extracted traffic feature data into training set, validation set and test set according to a certain ratio to ensure the scientific nature and independence of model training, validation and testing. Step 2.3: Standardize the time series data to eliminate dimensional differences between features. Simultaneously, impute missing values in the data to ensure the integrity and consistency of the time series. Step 2.4: Use the STL method algorithm to decompose the standardized time series data to obtain trend components, periodic components and residual components. Among them, the trend component represents the long-term trend of the time series; Among them, the periodic component represents the periodic fluctuations in the time series; The residual component represents the randomness or noise in the time series. Step 2.5: Perform sliding window segmentation on the decomposed time series according to a fixed time length to form the flow input sequence and the corresponding prediction output sequence, which facilitates the training and prediction of the deep learning model. Step 2.6: Encapsulate the time series data generated by the sliding window into a data loader to provide an efficient data input interface for model training, validation, and testing.
4. The deep learning-based network traffic prediction method based on STL decomposition according to claim 1, characterized in that: Step 3 includes the following sub-steps: Step 3.1: Use a GRU (Gated Recurrent Unit) Seq2Seq (Sequence to Sequence) model, combined with an attention mechanism, to model the trend component. The model input is the historical data of the trend component, and the output is the future trend value; Dam deformation prediction model Step 3.2: Use a GRU-based Seq2Seq model and combine it with an attention mechanism to model the periodic components and capture the periodic fluctuation characteristics; Step 3.3: Use a GRU-based Seq2Seq model and combine it with an attention mechanism to model the residual components and predict short-term stochastic fluctuations; Step 3.4: Set the training learning rate to 0.001; Step 3.5: Use the mean squared error (MSE) of predicted traffic and actual traffic as the loss function for deep learning; Step 3.6: The training process of the above model uses the AdamW optimizer to improve the model's convergence speed and stability.
5. A deep learning-based network traffic prediction device based on STL decomposition, characterized in that, The device includes: a data acquisition module, a data processing module, a model training module, a model prediction module, and a model output module. The data acquisition module is used to collect raw network traffic data from network devices, and supports data sources from various network devices, including terminal devices, routers, switches, and gateways. The data processing module is used to extract features and partition datasets from raw network traffic data, constructing univariate or multivariate time series data. Missing values are filled and standardized to ensure data quality. The STL decomposition method is used to decompose the time series data into trend, periodic, and residual components, providing input data for subsequent model training and prediction. A sliding window is used to segment the feature data, and a data loader is created. The model training module is used to construct a deep learning-based time series prediction model based on the decomposed time series components, and to perform iterative training to obtain a network traffic prediction model. For each component (trend component, periodic component, residual component), a GRU-based Seq2Seq model is used for modeling. An attention mechanism is introduced to enhance the model's ability to focus on key time steps and improve prediction accuracy. The AdamW optimizer is used to optimize the model, improving training speed and stability. The model prediction module uses a trained model to independently predict the decomposed time series components. It predicts long-term trends based on the trend component, periodic fluctuations based on the periodic component, and short-term random fluctuations based on the residual component. The prediction results of all components are then weighted and synthesized to generate the final network traffic prediction value. The model output module provides the integrated prediction results to the network management system or related application scenarios to support tasks such as traffic scheduling, resource allocation, and anomaly detection.
6. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the program, implements the method described in any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method as described in any one of claims 1 to 4.
