Network traffic prediction method, device, equipment and medium based on deep learning
Through deep learning methods, the time and spatial characteristics of network traffic data are extracted and integrated, and the problem of large prediction errors in the state of short burst traffic is solved, and the prediction accuracy is achieved.
Patent Information
- Application Number
- CN202210003743.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2042-01-04
AI Technical Summary
When existing network traffic prediction methods face short-term burst traffic states, it is difficult to identify and predict, resulting in large errors in prediction results.
Deep learning-based approaches are adopted to extract temporal and spatial features by acquiring network traffic data, preprocessing data, using convolutional neural networks and long and short-term memory networks, and fusion features through a multimodal attention mechanism network for prediction.
It effectively reduces the error of the prediction results, improves the accuracy of the prediction results, and can better capture the fluctuations and development trends of traffic data.
Smart Images

Figure CN114462679B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a network traffic prediction method, device, equipment and medium based on deep learning. Background Art
[0002] Network traffic is an important indicator to measure the operating status of the entire network. Constructing a network traffic prediction model based on the characteristics of network traffic can better understand the performance of various functions on the network, provide early warning of various network congestion, and ensure the quality of network services.
[0003] At present, there are many methods for network traffic prediction, including neural networks, trend prediction, etc. Although the above methods reflect the characteristics of traffic to a certain extent, since the above methods do not process the characteristics of traffic data, when the traffic appears in a short-term burst state, it is difficult for the neural network to identify it, resulting in large errors in the prediction results. Summary of the invention
[0004] The present invention provides a network traffic prediction method, device, equipment and medium based on deep learning, so as to reduce the error of the prediction result and improve the accuracy of the prediction result.
[0005] In a first aspect, in order to solve the above technical problems, the present invention provides a network traffic prediction method based on deep learning, comprising:
[0006] Get network traffic data;
[0007] Preprocessing the network traffic data to obtain traffic prediction data;
[0008] Extracting features of the traffic prediction data based on a convolutional neural network and a long short-term memory network to obtain temporal features and spatial features;
[0009] The temporal features and the spatial features are fused according to a multimodal attention mechanism network to obtain a network traffic prediction result.
[0010] Preferably, before obtaining the network traffic data, the method further includes:
[0011] Set different collection cycles according to data types;
[0012] Corresponding data is collected based on the collection cycle.
[0013] Preferably, the preprocessing of the network traffic data to obtain traffic prediction data includes:
[0014] Segmenting the network traffic data to obtain a pre-training sequence;
[0015] According to the acquisition cycle and the preset time step, the observation time and the prediction lead time are obtained;
[0016] Traffic prediction data is obtained based on the pre-training sequence, the observation time and the prediction lead time.
[0017] Preferably, the fusing of the temporal features and the spatial features according to the multimodal attention mechanism network to obtain a network traffic prediction result includes:
[0018] Performing weight extraction according to the multimodal attention mechanism network to obtain weight values corresponding to the temporal features and the spatial features;
[0019] The time feature and the space feature are fused according to the weight value to obtain a network traffic prediction result.
[0020] Preferably, the method further comprises:
[0021] Constructing a loss function according to the Tanh activation function, the weight value, the time feature and the spatial feature;
[0022] Based on minimization of the loss function, the weight value is adjusted.
[0023] Preferably, the network traffic data includes trend data, periodicity data and proximity data.
[0024] In a second aspect, the present invention provides a network traffic prediction device based on deep learning, comprising:
[0025] A data acquisition module, used to acquire network traffic data;
[0026] A preprocessing module, used for preprocessing the network traffic data to obtain traffic prediction data;
[0027] A feature extraction module, used to extract features from the traffic prediction data based on a convolutional neural network and a long short-term memory network to obtain temporal features and spatial features;
[0028] The feature fusion module is used to fuse the temporal features and the spatial features according to the multimodal attention mechanism network to obtain a network traffic prediction result.
[0029] Preferably, the feature fusion module includes:
[0030] A weight extraction unit, used to extract weights according to the multimodal attention mechanism network to obtain weight values corresponding to the temporal features and the spatial features;
[0031] The feature fusion unit is used to fuse the time feature and the space feature according to the weight value to obtain a network traffic prediction result.
[0032] In a third aspect, the present invention also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the deep learning-based network traffic prediction method described in any one of the above is implemented.
[0033] In a fourth aspect, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned deep learning-based network traffic prediction methods.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] By pre-training the network traffic data, the present invention can smooth out the fluctuation behavior of the traffic data to a great extent, reduce the influence of random factors on the traffic data, and make the development direction of the data closer to the real development trajectory; at the same time, the traffic prediction data is feature extracted and then the features are fused. During the fusion process, a multimodal attention mechanism network is used to measure the influence weights of the temporal features and the spatial features, and finally the network traffic prediction is realized. For this purpose, the error of the prediction result can be reduced and the accuracy of the prediction result can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flowchart of a network traffic prediction method based on deep learning provided by the first embodiment of the present invention;
[0037] Figure 2 is a schematic diagram of preprocessing results provided by an embodiment of the present invention;
[0038] Figure 3 is a schematic diagram of a prediction process of a prediction value provided by an embodiment of the present invention;
[0039] Figure 4 is a schematic diagram of a prediction process of eight prediction values provided by an embodiment of the present invention;
[0040] Figure 5 It is a schematic diagram of the structure of a network traffic prediction device based on deep learning provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] Reference Figure 1 The first embodiment of the present invention provides a network traffic prediction method based on deep learning, comprising the following steps:
[0043] S11, obtaining network traffic data;
[0044] S12, preprocessing the network traffic data to obtain traffic prediction data;
[0045] S13, extracting features from the traffic prediction data based on a convolutional neural network and a long short-term memory network to obtain time features and spatial features;
[0046] S14, fusing the temporal features and the spatial features according to the multimodal attention mechanism network to obtain a network traffic prediction result.
[0047] In step S11, the network traffic data includes trend data, periodic data and proximity data. Different collection cycles need to be set according to the data type, and then the corresponding data is collected based on the collection cycle.
[0048] Specifically, before data collection, working days and rest days should be distinguished, and then the data should be sampled. The time collection period of trend data is 1 week, so as to reflect the trend change of data in the area; the time collection period of periodic data is 1 day, so as to reflect the periodic change of traffic data; the collection period of proximity data is 1 hour, so as to reflect the change of data at different adjacent times. Furthermore, the network traffic data finally obtained includes different time scales.
[0049] In step S12, the network traffic data needs to be preprocessed to obtain traffic prediction data, including:
[0050] Segmenting the network traffic data to obtain a pre-training sequence;
[0051] According to the acquisition cycle and the preset time step, the observation time and the prediction lead time are obtained;
[0052] Traffic prediction data is obtained based on the pre-training sequence, the observation time and the prediction lead time.
[0053] Specifically, refer to Figure 2 , Figure 2 This is the pre-training sequence. In order to pre-process the data, the data is split and the s -(T o +T a ) starts until T s Data between, where T o Indicates the historical data that can be directly obtained, T s Indicates the moment of prediction. Historical data is divided into "encoded" data and "predicted" data. The number of "predicted" data is affected by different time steps t and the time window α to be advanced. If the step size and the time window in advance are larger, the number of "predicted" data will be smaller, T a To predict the lead time, it means to advance T a Time to start predicting T s The data value at the moment.
[0054] Furthermore, if the step length is t = 14, then the observation time length is T o =αt=14α, observation time is 6α, prediction lead time is T a =3α, the size of α needs to be determined according to the different collection cycles mentioned above, then 8α flow prediction data can be generated according to the observation time. For example, the prediction value of t=7 is as follows Figure 3 As shown, the predicted values for 8-14 are Figure 4 shown.
[0055] It should be noted that after completing the pre-training sequence, the historical data is divided into "encoded" data and "predicted" data. The "encoded" data is used to summarize the past traffic characteristics, and the "predicted" data is used to infer what will happen in the future. Under the influence of different time steps, there will be multiple predicted values of network traffic data. By fusing multiple predicted data of the "predicted" data, the pre-training of the "predicted" data sequence is achieved. This pre-training smoothes the fluctuation behavior of traffic data to a large extent, reduces the impact of random factors on traffic data, and makes the development direction of the data closer to the real development trajectory. Preferably, the pre-trained sequence can also be placed in the long short-term memory network, and the multi-scale prediction of traffic data can be achieved through different positions of the pre-training sequence and different numbers of iterations.
[0056] In step S13, the traffic prediction data is feature extracted based on the convolutional neural network and the long short-term memory network to obtain time features and space features. Among them, the convolutional neural network (CNN) is good at capturing spatial relationships, and the long short-term memory network (LSTM) is good at capturing time dependencies, thereby generating time features and space features of trend data, periodic data, and proximity data.
[0057] In step S14, the temporal features and the spatial features are fused according to the multimodal attention mechanism network to obtain a network traffic prediction result, including:
[0058] Performing weight extraction according to the multimodal attention mechanism network to obtain weight values corresponding to the temporal features and the spatial features;
[0059] The time feature and the space feature are fused according to the weight value to obtain a network traffic prediction result.
[0060] Among them, the process of Tanh activation function is:
[0061]
[0062] is the network traffic prediction result, w1 and w2 are the weights of time and space features respectively, and f CNN refers to the spatial characteristics after splicing; f LSTM Refers to the time characteristics after splicing.
[0063] Further, a loss function is constructed according to the Tanh activation function, the weight value, the time feature and the spatial feature;
[0064] Based on minimization of the loss function, the weight value is adjusted.
[0065] Specifically, the loss function is:
[0066]
[0067] In this embodiment, a multimodal attention network (Modality Attention Net) is used to fuse temporal features and spatial features, and the error is combined to achieve adaptive adjustment of the weights of three types of data and two features.
[0068] By pre-training the network traffic data, the present invention can smooth out the fluctuation behavior of the traffic data to a great extent, reduce the influence of random factors on the traffic data, and make the development direction of the data closer to the real development trajectory; at the same time, the traffic prediction data is feature extracted and then the features are fused. During the fusion process, a multimodal attention mechanism network is used to measure the influence weights of the temporal features and the spatial features, and finally the network traffic prediction is realized. For this purpose, the error of the prediction result can be reduced and the accuracy of the prediction result can be improved.
[0069] Reference Figure 5 The second embodiment of the present invention provides a network traffic prediction device based on deep learning, comprising:
[0070] A data acquisition module, used to acquire network traffic data;
[0071] A preprocessing module, used for preprocessing the network traffic data to obtain traffic prediction data;
[0072] A feature extraction module, used to extract features from the traffic prediction data based on a convolutional neural network and a long short-term memory network to obtain temporal features and spatial features;
[0073] The feature fusion module is used to fuse the temporal features and the spatial features according to the multimodal attention mechanism network to obtain a network traffic prediction result.
[0074] Preferably, the device further comprises:
[0075] The cycle setting module is used to set different collection cycles according to the data type;
[0076] The data acquisition module is used to acquire corresponding data based on the acquisition cycle.
[0077] Preferably, the preprocessing module comprises:
[0078] A data segmentation unit, used for segmenting the network traffic data to obtain a pre-training sequence;
[0079] A time acquisition module, used to obtain the observation time and the prediction lead time according to the acquisition cycle and the preset time step;
[0080] A preprocessing unit is used to obtain traffic prediction data based on the pre-training sequence, the observation time and the prediction advance time.
[0081] Preferably, the feature fusion module includes:
[0082] A weight extraction unit, used to extract weights according to the multimodal attention mechanism network to obtain weight values corresponding to the temporal features and the spatial features;
[0083] The feature fusion unit is used to fuse the time feature and the space feature according to the weight value to obtain a network traffic prediction result.
[0084] Preferably, the device further comprises:
[0085] A function construction module, used to construct a loss function according to the Tanh activation function, the weight value, the time feature and the spatial feature;
[0086] A weight value adjustment module is used to adjust the weight value based on minimization of the loss function.
[0087] It should be noted that the network traffic prediction device based on deep learning provided in an embodiment of the present invention is used to execute all the process steps of the network traffic prediction method based on deep learning in the above embodiment. The working principles and beneficial effects of the two correspond one to one, and thus will not be elaborated herein.
[0088] In summary, the present invention can smooth out the fluctuation behavior of traffic data to a great extent through pre-training of network traffic data, reduce the impact of random factors on traffic data, and make the development direction of data closer to the real development trajectory; at the same time, the traffic prediction data is feature extracted and then the features are fused. During the fusion process, a multimodal attention mechanism network is used to measure the influence weights of temporal features and spatial features, and finally network traffic prediction is realized. For this purpose, the error of the prediction result can be reduced and the accuracy of the prediction result can be improved.
[0089] The embodiment of the present invention further provides a terminal device. The terminal device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a network traffic prediction program based on deep learning. When the processor executes the computer program, the steps in the above-mentioned embodiments of the network traffic prediction method based on deep learning are implemented, such as Figure 1 Alternatively, when the processor executes the computer program, the functions of each module / unit in the above-mentioned device embodiments are implemented, such as the feature extraction module.
[0090] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the terminal device.
[0091] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of terminal devices and do not constitute a limitation on the terminal device. The terminal device may include more or fewer components than the above components, or may combine certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0092] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.
[0093] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0094] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0095] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0096] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A network traffic prediction method based on deep learning, characterized in that: include: Set different collection cycles according to data types; Collecting corresponding data based on the collection cycle; Get network traffic data; Preprocessing the network traffic data to obtain traffic prediction data; Extracting features of the traffic prediction data based on a convolutional neural network and a long short-term memory network to obtain temporal features and spatial features; The temporal features and the spatial features are integrated according to a multimodal attention mechanism network to obtain a network traffic prediction result; Wherein, the preprocessing of the network traffic data to obtain traffic prediction data includes: Segmenting the network traffic data to obtain a pre-training sequence; According to the acquisition cycle and the preset time step, the observation time and the prediction lead time are obtained; Obtaining flow prediction data based on the pre-trained sequence, the observation time, and the prediction lead time; The method of fusing the time feature and the space feature according to the multimodal attention mechanism network to obtain a network traffic prediction result includes: Performing weight extraction according to the multimodal attention mechanism network to obtain weight values corresponding to the temporal features and the spatial features; The time feature and the space feature are integrated according to the weight value to obtain a network traffic prediction result; The network traffic prediction method based on deep learning also includes: Constructing a loss function according to the Tanh activation function, the weight value, the time feature and the spatial feature; Based on minimization of the loss function, the weight value is adjusted.
2. The network traffic prediction method based on deep learning according to claim 1 is characterized in that: The network traffic data includes trend data, periodicity data and proximity data.
3. A network traffic prediction device based on deep learning, characterized in that: include: The cycle setting module is used to set different collection cycles according to the data type; A data acquisition module, used for acquiring corresponding data based on the acquisition cycle; A data acquisition module, used to acquire network traffic data; A preprocessing module, used for preprocessing the network traffic data to obtain traffic prediction data; A feature extraction module, used to extract features from the traffic prediction data based on a convolutional neural network and a long short-term memory network to obtain temporal features and spatial features; A feature fusion module, used to fuse the temporal features and the spatial features according to a multimodal attention mechanism network to obtain a network traffic prediction result; Wherein, the preprocessing module includes: A data segmentation unit, used for segmenting the network traffic data to obtain a pre-training sequence; A time acquisition module, used to obtain the observation time and the prediction lead time according to the acquisition cycle and the preset time step; A preprocessing unit, configured to obtain flow prediction data based on the pre-training sequence, the observation time and the prediction lead time; Wherein, the feature fusion module includes: A weight extraction unit, used to extract weights according to the multimodal attention mechanism network to obtain weight values corresponding to the temporal features and the spatial features; A feature fusion unit, used for fusing the time feature and the space feature according to the weight value to obtain a network traffic prediction result; The network traffic prediction device based on deep learning also includes: A function construction module, used to construct a loss function according to the Tanh activation function, the weight value, the time feature and the spatial feature; A weight value adjustment module is used to adjust the weight value based on minimization of the loss function.
4. A terminal device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the network traffic prediction method based on deep learning as described in any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the network traffic prediction method based on deep learning as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Node fault prediction method for large-scale cluster system
CN111027591A
Protocol traffic identification method based on GRU network
CN111970169A
Regional network flow prediction method based on deep learning
CN112291808A
Short-term traffic flow prediction method and system, electronic device and storage medium
CN112435462A
