Long-term network traffic prediction method based on cross-domain multi-scale self-attention

Through the cross-domain multi-scale self-attention long-term network traffic prediction method, the time domain and frequency domain attention mechanism is used to extract features, which solves the problems of low network traffic prediction accuracy and poor real-time performance in the existing technology, and achieves a more efficient network. Traffic prediction effect.

CN118677792APending Publication Date: 2024-09-20INTELLIGENT MFG INST OF HFUT
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410727341.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Existing network traffic prediction models have low accuracy, large number of parameters, and poor real-time performance when predicting future network traffic sequences in complex environments. They are difficult to deal with the problem of long sequences and missing partial traffic data.

Method used

A long-term network traffic prediction method based on cross-domain multi-scale self-attention is adopted, including a pre-processing module, a hybrid feature encoding network and a linear network. Features are extracted through time-domain and frequency-domain attention mechanisms, reducing the number of parameters, improving prediction accuracy and real-time sex.

Benefits of technology

It improves the accuracy and real-time performance of network traffic prediction, reduces the number of parameters, and can effectively handle the missing traffic data in complex backgrounds, which is better than traditional deep learning and statistical models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677792A
    Figure CN118677792A
Patent Text Reader

Abstract

The invention discloses a long-term network traffic prediction method based on cross-domain multi-scale self-attention. The method comprises the following steps: 1, collecting network traffic sequence data and carrying out preprocessing; 2, establishing a network traffic prediction network, respectively extracting local detail feature branches in a time domain and a frequency domain by adopting a dual-channel feature extraction mode and using time domain and frequency domain attention mechanisms, extracting long-term trend feature branches of network traffic sequence data by using a linear layer, and fusing the local detail features to output a prediction result; and 3, constructing a loss function, training iteration until parameters of the network converge, and obtaining a network flow prediction model corresponding to the optimal parameters. According to the method, the problems of short time and low prediction precision of predicting future network flow sequence data in a complex environment can be solved, the parameter quantity of the network flow prediction method is reduced, the prediction real-time performance is improved, and accurate prediction of the missing state of partial flow data in a complex background is completed, so that the actual requirements of accuracy and rapidness are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network traffic prediction, and in particular to a method for improving a network traffic prediction model based on an attention mechanism. Background Art

[0002] With the advent and rapid development of mobile communication technologies such as the Internet of Things (IoT) and cloud computing, the number of devices connected to the Internet has increased significantly. This surge often results in a discrepancy between available network resources and demand, leading to network congestion and service disruptions. Even with dense network deployments, network traffic loads at base stations can fluctuate significantly throughout the day, with significant periods of time when base stations experience little to no traffic, highlighting the significant challenges of scaling network infrastructure to accommodate the demands of contemporary communication technologies. The combination of underutilized base station capacity and the growing number of connected devices can exacerbate network bottlenecks, impact service quality, and increase operational inefficiencies. Without strategic enhancements to network infrastructure and judicious resource allocation, service providers may experience rising costs and reduced user satisfaction, jeopardizing their competitive position in the evolving digital ecosystem.

[0003] Network traffic forecasting, which is the quantitative prediction of the amount of data on future network links, plays a vital role in addressing these challenges. By accurately predicting real-time traffic changes, base stations can be strategically activated or deactivated to optimize the balance between user experience and resource expenditure. This approach not only maintains service quality, but also helps to allocate network resources more efficiently, significantly reducing the operating costs of service providers.

[0004] Given the limited time horizon of current network traffic forecasts, responding to unforeseen events is challenging, and long-term forecasts are resource-intensive. However, the time horizon of these forecasts is limited, making it challenging to propose and implement countermeasures in a timely manner in unforeseen situations. In contrast, long-term traffic forecasts can provide early warnings for potential scenarios, which has significant advantages over short-term forecasts. Existing network traffic forecasting models often fail to meet the requirements of practical applications in real-world scenarios in terms of prediction accuracy, speed, and prediction length. Summary of the invention

[0005] The present invention aims to address the deficiencies of the above-mentioned prior art and proposes a long-term network traffic prediction method based on cross-domain multi-scale self-attention, in order to solve the problems of short prediction time and low prediction accuracy of future network traffic sequence data in complex environments, reduce the number of parameters of the network traffic prediction method, improve the real-time performance of the prediction, and complete the accurate prediction of the missing state of some traffic data under complex backgrounds, which is of great significance to the application of network traffic prediction algorithms in long sequence prediction scenarios.

[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:

[0007] The present invention provides a method for long-term network traffic prediction based on cross-domain multi-scale self-attention, which comprises the following steps:

[0008] Step 1: Collect network traffic data and perform preprocessing of slicing, scaling, and filling to obtain the preprocessed network traffic data set Data = {X1, X2, ..., X n , ..., X T}; where X n ∈R M×I represents the nth network flow data after preprocessing, T represents the total number of network flow data, I represents the historical window length, and M represents the number of data types in the network flow data;

[0009] Step 2: Build a network traffic prediction network, including: preprocessing module, hybrid feature encoding network, linear network, and n Processing is performed to obtain the predicted network traffic data X n,out ∈R M×O ; Where O represents the future window length;

[0010] Step 2.1: The preprocessing module processes X n Processing is performed to obtain the nth network traffic feature X n,feed ;

[0011] Step 2.2: The hybrid feature encoding network is used to n,feed Processing is performed to obtain the nth network traffic local detail feature X n,Local ;

[0012] Step 2.3: The linear network is used to n After processing, the nth network traffic global trend characteristic data X is obtained n,Global ∈R M×O ;

[0013] The linear network is n,Local and X n,Global After weighted processing, the predicted future n-th network traffic data X with a window length of O is obtained. n,out ;

[0014] Step 3: Use the stochastic gradient descent method to train the network traffic prediction network, and use the MSEloss loss to calculate the network loss until the loss converges or reaches the maximum number of iterations, then stop the training to generate a network traffic prediction model corresponding to the optimal parameters, which is used to predict the future long-term network traffic data of the unit-level area.

[0015] The long-term network traffic prediction method based on cross-domain multi-scale self-attention described in the present invention is also characterized in that the preprocessing module in step 2.1 includes: a patching layer, a position encoding layer, and a scalar projection layer;

[0016] The Patching layer will be X n Split into Patch block sequence Lp represents the block length of the Patch block, and N represents the number of Patch blocks;

[0017] The position encoding layer is X n,p Perform position encoding to obtain the nth position encoding result d model Represents feature dimension;

[0018] The scalar projection layer is X n,p Perform scalar projection and obtain the nth scalar projection result comp n and the nth position encoding result Pos n After adding, we get the nth network traffic feature

[0019] The hybrid feature encoding network in step 2.2 includes: a hybrid feature encoding module and a tiled head module; wherein the hybrid feature encoding module includes: a TAM time domain attention mechanism module, a FAM frequency domain attention mechanism module and a feedforward layer;

[0020] Step 2.2.1. X n,feed As query matrix Q, key matrix K, value matrix V, they are input into TAM temporal attention mechanism module, and c×ln(L Q ) rows of random vectors, and calculate the sparsity score S(q i , K), thereby obtaining the first u row vectors with the largest sparsity score, and the remaining L Q -u row vectors are set to zero at the corresponding positions in the query matrix Q to obtain the sparsity measure moment Finally, the standard attention mechanism is used to calculate The n-th temporal attention features of K and V Among them, c and u are constants, L Q Represents the total number of rows in the query matrix Q;

[0021] Step 2.2.2, X n,feed Input into the FAM frequency domain attention mechanism module and perform n,feed After Fourier transform, the selection mode vector is obtained, and c×ln(L Q) row pattern vector, and the remaining Fc×ln(L Q ) pattern vectors are set to zero, so that the processed selection pattern vectors are used as the selection query matrix Select Key Matrix and the selection value matrix Finally, the standard attention mechanism is used to calculate and After the attention feature is obtained, the inverse Fourier transform is performed to obtain the nth frequency domain attention feature Where F represents the total number of rows of the selection pattern vector;

[0022] Step 2.2.3 X n,T and X n,F After the addition fusion of the feedforward layer, the nth mixed feature code is obtained

[0023] Step 2.2.4, X M After the mapping process of the tiled head module, the dimension is M×N×L p After the mapping features are processed, the splicing process is performed to obtain the splicing features with a dimension of M×I. Finally, after the linear layer mapping, the nth network traffic local detail feature X is obtained. n,Local ∈R M×O .

[0024] The electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the long-term network traffic prediction method, and the processor is configured to execute the program stored in the memory.

[0025] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the long-term network traffic prediction method when the computer program is executed by a processor.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] 1. The present invention uses a linear network as a global trend feature extraction module. Compared with the traditional deep neural network used for trend extraction of network traffic time series data, it has the characteristics of fewer parameters and simple implementation, and is more helpful to improve the real-time performance of the network traffic prediction model.

[0028] 2. The present invention constructs the TAM time domain attention mechanism module and the FAM frequency domain attention mechanism module in the hybrid feature encoding module, which enhances the feature information expression in the network traffic sequence data from the two dimensions of time domain and frequency domain, so that the model can focus on the network traffic data itself, more accurately identify and eliminate noise data, while avoiding the loss of effective data features, and reducing the interference of complex noise information, and using context-aware weights to enhance local features, which enables the network to effectively extract local features of network traffic when facing local complex environments, and improves the expression ability of local features of network traffic, thereby improving the prediction accuracy of network traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a flowchart of a training method for a network traffic prediction model according to an embodiment of the present invention;

[0030] Figure 2 is a structural diagram of a network traffic prediction model according to an embodiment of the present invention;

[0031] Figure 3 is a schematic diagram of a temporal self-attention mechanism according to an embodiment of the present invention;

[0032] Figure 4 Schematic diagram of a frequency domain self-attention mechanism according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In this embodiment, a long-term unit-level network traffic prediction method based on cross-domain multi-scale self-attention is proposed. Figure 1 As shown, the following steps are included:

[0034] Step 1: Collect network traffic data and perform preprocessing of slicing, scaling, and filling to obtain the preprocessed network traffic data set Data = {X1, X2, ..., X n , ..., X T}; where X n ∈R M×I represents the nth network flow data after preprocessing, T represents the total number of network flow data, I represents the historical window length, and M represents the number of data types in the network flow data;

[0035] Step 2: If Figure 2 As shown in Figure 1, a network traffic prediction network is constructed, including: preprocessing module, hybrid feature encoding network, linear network, and X n Processing is performed to obtain the predicted network traffic data X n,out ∈R M×O ; Wherein, O represents the future window length; in this embodiment, I=96, O=96, 192, 288, 384, M=5.

[0036] Step 2.1, the preprocessing module includes: Patching layer, position encoding layer, and scalar projection layer;

[0037] Patching layer will be X n Split into Patch block sequence L p Indicates the length of the Patch block, and N indicates the number of Patch blocks. In this embodiment, L p =8, N=48.

[0038] The position encoding layer is X n,p Perform position encoding to obtain the nth position encoding result d model Represents the model feature dimension; in this embodiment, the position encoding uses a fixed encoding method, and the dimension d of the scalar projection model =128;

[0039] Scalar projection layer pair X n,p Perform scalar projection and obtain the nth scalar projection result comp n and the nth position encoding result Pos n After adding, we get the nth network traffic feature

[0040] Step 2.2, the hybrid feature encoding network includes: a hybrid feature encoding module and a tiled head module; wherein the hybrid feature encoding module includes: a TAM time domain attention mechanism module, a FAM frequency domain attention mechanism module and a feedforward layer;

[0041] Step 2.2.1, TAM temporal attention mechanism module is as follows Figure 3 As shown, X n,feed As query matrix Q, key matrix K, value matrix V, they are input into TAM temporal attention mechanism module, and c×ln(L Q ) rows of random vectors, and calculate the sparsity score S(q i , K), thereby obtaining the first u row vectors with the largest sparsity score, and the remaining L Q -u row vectors are set to zero at the corresponding positions in the query matrix Q to obtain the sparsity measure moment Finally, the standard attention mechanism is used to calculate The n-th temporal attention features of K and V Among them, c and u are constants, L Q Represents the total number of rows in the query matrix Q;

[0042] In this embodiment, L Q=48, c=5, u=20, and the number of attention heads is 16.

[0043] In the specific implementation, the calculation formula of the sparsity score is: Among them, q i ,k j represents the i-th row of the query matrix Q and the j-th row of the key matrix K. L K represents the total number of rows of the key matrix K, and d represents k j The dimension of the vector. In this embodiment, L K =48.

[0044] Using Attention Mechanism K, and V to calculate the temporal attention features The corresponding time domain features In this embodiment, d is 8.

[0045] Step 2.2.2, FAM temporal attention mechanism module is as follows Figure 4 As shown, X n,feed Input into the FAM frequency domain attention mechanism module and perform n,feed After Fourier transform, the selection mode vector is obtained, and c×ln(L Q ) row pattern vector, and the remaining Fc×ln(L Q ) pattern vectors are set to zero, so that the processed selection pattern vectors are used as the selection query matrix Select Key Matrix and the selection value matrix Finally, the standard attention mechanism is used to calculate and After the attention feature is obtained, the inverse Fourier transform is performed to obtain the nth frequency domain attention feature Wherein, F represents the total number of rows of the selection pattern vector; in this embodiment, F=20, the number of attention heads is 16, and d is the dimension of the scalar projection / the number of attention heads 8.

[0046] The combination of the TAM time-domain attention mechanism module and the FAM frequency-domain attention mechanism module can fuse the correlation information of different time scales, allowing the network to better understand the timing information of network traffic data, improving the model's perception of the temporal relationship between network traffic data, and helping the TAM time-domain attention mechanism module and the FAM frequency-domain attention mechanism module to more accurately capture fine-grained traffic information.

[0047] Step 2.2.3 X n,T and X n,F After the addition fusion of the feedforward layer, the nth mixed feature code is obtained In this embodiment, the hybrid feature encoding module is composed of an FFN feedforward layer, and the output and input of the feedforward layer are added, and normalization is performed after residual connection. The specific implementation formula is shown in formula (2):

[0048] X M =Norm(FFN(X T +X F )+X T +X F ) (2)

[0049] In formula (2), FFN represents the feedforward neural network in the standard Transformer model.

[0050] Step 2.2.4, X M After the mapping process of the tiled head module, the dimension is M×N×L p After the mapping features are processed, the splicing process is performed to obtain the splicing features with a dimension of M×I. Finally, after the linear layer mapping, the nth network traffic local detail feature X is obtained. n,Local ∈R M×O ; In this example, the input dimension of the hybrid feature encoding mapping linear layer is d model =128, the mapping dimension is L p =16, the input dimension of the linear layer after splicing is I, and the mapping dimension is O, where I represents the history window length and O represents the prediction window length.

[0051] Step 2.3: Linear network for X n After processing, the nth network traffic global trend characteristic data X is obtained n,Global ∈R M×O ; In this example, the linear network contains three linear layers. The input dimension of the first linear layer is 96, and the mapping dimensions of the linear layers are 128, 512, and O, respectively, where O represents the prediction window length.

[0052] Linear network pair X n,Local and x n,Global After weighted processing, the predicted future n-th network traffic data X with a window length of O is obtained. n,out ;

[0053] Step 3: Use the stochastic gradient descent method to train the network traffic prediction network, and use the MSEloss loss to calculate the network loss until the loss converges or reaches the maximum number of iterations, then stop the training to generate a network traffic prediction model corresponding to the optimal parameters, which is used to predict the future long-term network traffic data in the unit-level area.

[0054] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.

[0055] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.

[0056] The experiment is based on the 64-bit operating system Ubuntu 18.04LTS, and the deep learning framework is Pytorch v1.8.0. The CPU is Intel(R)Core(TM)i9-10900K, and the GPU is NVIDIA GeForce RTX3080. The Adam optimizer is used for training, and the initial learning rate is set to 0.0001. Starting from the 20th epoch, it will be reduced to 80% of its value for a total of 50 epochs. If no improvement in the test loss is observed on the validation set for 15 consecutive epochs, early stopping is implemented. The batch size is set to 64.

[0057] The evaluation indicators of the Milan data set and the Trentino data set are used in the experiment. MSE (Mean Squared Error) is the mean square error, which is the expected value of the square of the difference between the predicted value and the true value, and is used to measure the accuracy of the prediction model. MAE (Mean Absolute Error) is the mean absolute error, which is the expected value of the absolute value of the difference between the predicted value and the true value, and is used to measure the average error of the prediction model. RSE (Relative Squared Error) is the relative mean square error, which is the ratio of the mean square error to the variance of the true value, and is used to measure the relative accuracy of the prediction model.

[0058] The trained network is tested on the Milan dataset and the Trentino dataset. Compared with other mainstream network traffic prediction algorithms, it has the characteristic of higher simultaneous prediction accuracy under models with similar model parameters, as shown in Table 1, where Milan represents the Milan dataset and Trentino represents the Trentino dataset.

[0059] Table 1 Comparison of experimental results on Milan dataset and Trentino dataset

[0060]

[0061]

[0062] The results in Table 1 show that the network traffic prediction effect of the present invention is better than the current mainstream deep learning and traditional statistical network traffic prediction models, including the current mainstream deep learning network traffic prediction models: GCformer, PatchTST, DLinear, FEDformer, Autoformer, Informer, LSTM, traditional statistical network traffic prediction model: ARIMA, Ours represents the network traffic prediction model proposed by the present invention. In terms of the evaluation accuracy index, the network traffic prediction model proposed by the present invention achieved the best effect, while balancing the model size and speed, which proves the effectiveness and potential of the present invention in promoting the field of network traffic prediction. The present invention has a good application space and prospect, and provides methods and ideas for the practical application of network traffic prediction in the future.

Claims

1. A long-term network traffic prediction method based on cross-domain multi-scale self-attention, characterized in that: The following steps are involved: Step 1: Collect network traffic data and perform preprocessing such as slicing, scaling, and filling to obtain the preprocessed network traffic data set Data = {X1, X2, ..., X n ,...,X T }; where X n ∈R M×I represents the nth network flow data after preprocessing, T represents the total number of network flow data, I represents the historical window length, and M represents the number of data types in the network flow data; Step 2: Build a network traffic prediction network, including: preprocessing module, hybrid feature encoding network, linear network, and n Processing is performed to obtain the predicted network traffic data X n,out ∈R M×O ; Where O represents the future window length; Step 2.1: The preprocessing module processes X n Processing is performed to obtain the nth network traffic feature X n,feed ; Step 2.2: The hybrid feature encoding network is used to n,feed Processing is performed to obtain the nth network traffic local detail feature X n,Local ; Step 2.3: The linear network is used to n After processing, the nth network traffic global trend characteristic data X is obtained n,Global ∈R M×O ; The linear network is n,Local and X n,Global After weighted processing, the predicted future n-th network traffic data X with a window length of O is obtained. n,out ; Step 3: Use the stochastic gradient descent method to train the network traffic prediction network, and use the MSEloss loss to calculate the network loss until the loss converges or reaches the maximum number of iterations, then stop the training to generate a network traffic prediction model corresponding to the optimal parameters, which is used to predict the future long-term network traffic data of the unit-level area.

2. According to claim 1, a long-term network traffic prediction method based on cross-domain multi-scale self-attention is characterized in that: The preprocessing module in step 2.1 includes: a patching layer, a position encoding layer, and a scalar projection layer; The Patching layer will be X n Split into Patch block sequence L p Indicates the block length of the Patch block, and N indicates the number of Patch blocks; The position encoding layer is X n,p Perform position encoding to obtain the nth position encoding result d model Represents feature dimension; The scalar projection layer is X n,p Perform scalar projection and obtain the nth scalar projection result comp n and the nth position encoding result Pos n After adding, we get the nth network traffic feature 3. According to claim 1, a long-term network traffic prediction method based on cross-domain multi-scale self-attention is characterized in that: The hybrid feature encoding network in step 2.2 includes: a hybrid feature encoding module and a tiled head module; wherein the hybrid feature encoding module includes: a TAM time domain attention mechanism module, a FAM frequency domain attention mechanism module and a feedforward layer; Step 2.2.

1. X n,feed As query matrix Q, key matrix K, value matrix V, they are input into TAM temporal attention mechanism module, and c×ln(L Q ) rows of random vectors, and calculate the sparsity score S(q i ,K), thereby obtaining the first u row vectors with the largest sparsity score, and the remaining L Q -u row vectors are set to zero at the corresponding positions in the query matrix Q to obtain the sparsity measure matrix Finally, the standard attention mechanism is used to calculate The n-th temporal attention features of K and V Among them, c and u are constants, L Q Represents the total number of rows in the query matrix Q; Step 2.2.2, X n,feed Input into the FAM frequency domain attention mechanism module and perform n,feed After Fourier transform, the selection mode vector is obtained, and c×ln(L Q ) row pattern vector, and the remaining Fc×ln(L Q ) pattern vectors are set to zero, so that the processed selection pattern vectors are used as the selection query matrix Select Key Matrix and the selection value matrix Finally, the standard attention mechanism is used to calculate and After the attention feature is obtained, the inverse Fourier transform is performed to obtain the nth frequency domain attention feature Where F represents the total number of rows of the selection pattern vector; Step 2.2.3 X n,T and X n,F After the addition fusion of the feedforward layer, the nth mixed feature code is obtained Step 2.2.4, X M After the mapping process of the tiled head module, the dimension is M×N×L p After the mapping features are processed, the splicing process is performed to obtain the splicing features with a dimension of M×I. Finally, after the linear layer mapping, the nth network traffic local detail feature X is obtained. n,Local ∈R M×O .

4. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the long-term network traffic prediction method according to claim 1 or 2, and the processor is configured to execute the program stored in the memory.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the long-term network traffic prediction method according to claim 1 or 2 are executed.

Citation Information

Cited By

  • Weather data prediction method based on sequence segmentation and frequency domain attention

    CN119167067A

  • Internet of Things perception data prediction method based on deep learning

    CN119577373A

  • Iot sensing data prediction method based on deep learning

    CN119577373B

  • Network traffic prediction method based on local downsampling and sparse frequency grouping

    CN119603116A