Network traffic prediction method based on neural network and linear regression
By combining NA-MEMD algorithm, neural network and linear regression model, the correlation of gateway equipment is judged, and the problem of inaccurate network traffic prediction is solved, and more accurate network traffic prediction is achieved.
Patent Information
- Application Number
- CN202510822922.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-19
AI Technical Summary
The prior art cannot effectively determine whether there is mutual influence between the two gateway devices, resulting in inaccurate network traffic prediction.
By counting historical network traffic data, using NA-MEMD algorithm for decomposition, we can judge whether there is a strong correlation between gateway devices, and build a neural network and linear regression model based on the correlation to predict network traffic. We can use LSTM neural network model and multiple linear regression model for joint or classified modeling.
It improves the accuracy of network traffic prediction, realizes targeted joint or classified modeling, and improves the prediction effect.
Smart Images

Figure CN120342894A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to network traffic prediction, and particularly to a network traffic prediction method based on neural network and linear regression. Background Art
[0002] In order to solve network congestion and achieve better network resource allocation, network traffic prediction has become a very important link. However, at present, two gateway devices may exist in the same large network. When performing network traffic prediction currently, it is often impossible to determine whether there is an interaction between the two gateway devices based on network traffic data, which has an adverse impact on network traffic prediction. Summary of the Invention
[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a network traffic prediction method based on neural network and linear regression, which can access historical network traffic data, determine whether two gateway devices have strong correlation, and perform joint or classification modeling methods accordingly to achieve network traffic prediction and improve the accuracy of prediction.
[0004] The purpose of the present invention is achieved by the following technical solutions: A network traffic prediction method based on neural network and linear regression, comprising the following steps: S1. For two gateway devices with network connections, count the historical network traffic data within the first time period to obtain the historical network traffic sequences of the two gateway devices within the first time period; S2. Use the NA-MEMD algorithm to , perform decomposition, and then determine whether and have strong correlation; S3. According to whether and have strong correlation, train the network traffic prediction model: If and have strong correlation, then construct a network traffic prediction model based on neural network and linear regression, construct a joint training set according to the historical network traffic data of the two gateway devices within the first time period, and jointly train the network traffic prediction model; If and do not have strong correlation, then based on neural network and linear regression, construct network traffic models for the two gateway devices respectively, and then use the historical network traffic data of the two gateway devices within the first time period to construct their respective training sets, and train their respective network traffic prediction models respectively; S4. Use the trained network traffic prediction model to predict network traffic.
[0005] The beneficial effects of the present invention are as follows: The present invention can determine whether two gateway devices have strong correlation through historical network traffic data, and carry out combined or classified modeling methods accordingly to achieve network traffic prediction, improving the accuracy of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 It is a flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0007] The technical solution of the present invention will be further described in detail below with reference to the drawings, but the protection scope of the present invention is not limited to the following.
[0008] As Figure 1 shown, a network traffic prediction method based on neural network and linear regression includes the following steps: S1. For two gateway devices with network connections, count the historical network traffic data within the first time period to obtain the historical network traffic sequences of the two gateway devices within the first time period; S2. Use the NA-MEMD algorithm to , decompose, and then judge whether there is a strong correlation between and ; S3. According to whether there is a strong correlation between and , train the network traffic prediction model: If and have a strong correlation, then construct a network traffic prediction model based on neural network and linear regression, construct a combined training set according to the historical network traffic data of the two gateway devices within the first time period, and jointly train the network traffic prediction model; If and do not have a strong correlation, then based on neural network and linear regression, construct network traffic models for the two gateway devices respectively, and then use the historical network traffic data of the two gateway devices within the first time period to construct their respective training sets, and train their respective network traffic prediction models respectively; S4. Use the trained network traffic prediction model to predict network traffic.
[0009] The first time period includes a plurality of first sub-time periods, and the time lengths of each first sub-time period are the same. The historical network traffic sequence within the first time period is composed of the historical network traffic data within each sub-time period in chronological order; Let the historical network traffic sequence of the first gateway device be denoted as , where represents the network traffic data of the first gateway device in the i th sub-time period; Let the historical network traffic sequence of the second gateway device be denoted as , where represents the network traffic data of the second gateway device in the i th sub-time period; Among them, , t represents the number of first sub-time periods included in the first time period; when collecting the historical network traffic data of each sub-time period, it is necessary to synchronously save the quarterly information, date information, average temperature, and weather of the current sub-time period; the quarterly information includes spring, summer, autumn, and winter; the date information includes weekdays and non-weekdays; the weather includes rainy days, snowy days, sunny days, and others.
[0010] The step S2 includes: S201. Use the NA-MEMD algorithm to decompose , to obtain: Among them, " " means using the NA-MEMD algorithm to decompose the sequence, represents the jth IMF component obtained by decomposing ; represents the jth IMF component obtained by decomposing , , n represents the number of IMF components obtained after decomposing each sequence; S202. Calculate the coherence , and mutual information of : Among them, represents and the coherence of the jth IMF component; represents and The mutual information of the j-th IMF component; S203. Determine whether it satisfies: Less than a preset threshold , and Less than a preset threshold ; If it is satisfied, it is considered that and There is no strong correlation between them; If it is not satisfied, it is considered that and There is a strong correlation between them.
[0011] The first time period is 12 months, and the first sub-time period is 2 hours.
[0012] The step S3 includes: S301. Divide the network historical traffic sequence within the first time period into M consecutive network traffic subsequences. Each network traffic subsequence contains historical network traffic data of t / M sub-time periods: Among them, the M network traffic subsequences of the first gateway device are denoted as: ; The M network traffic subsequences of the second gateway device are denoted as: ; Take as a subsequence pair, ; S302. Use the NA-MEMD algorithm to decompose to obtain: S303. Use subtract , subtract to obtain the low-frequency components of and , denoted as and ; Use subtract , subtract to obtain the high-frequency components of and , denoted as and ; S304. Since the lengths of are all t / M, after the processing of steps S302~S303, , The lengths of the high-frequency and low-frequency components remain unchanged and are still t / M; S305. At Repeat steps S302 - S304; S306. Construct a multiple linear regression model; A1. First, represent the quarterly information, date information, average temperature, and weather respectively using as follows: When the quarterly information for the current sub-time period is spring and autumn, the value is 0.5, and when the quarterly information is summer and winter, the value is 1; When the date information for the current sub-time period is a working day, the value is 0.5, and when the working day is a non-working day, the value is 1; The average temperature information for the current sub-time period takes the Celsius temperature; The weather information for the current sub-time period takes 2 on rainy and snowy days, 0.8 on sunny days, and 1 for others; A2. Then construct a multiple linear regression model, denoted as: A3. Take , as y in the multiple linear regression model, and bring in the corresponding into the multiple linear regression model. Using the multiple linear regression model estimation algorithm, estimate the regression coefficients , That is, the first multiple linear regression model is obtained, which represents the linear relationship between the low-frequency component of the first gateway device and the quarterly information, date information, average temperature, and weather; Use as y in the multiple linear regression model, and bring in the corresponding into the multiple linear regression model. Using the multiple linear regression model estimation algorithm, estimate the regression coefficients , That is, the second multiple linear regression model is obtained, which represents the linear relationship between the low-frequency component of the second gateway device and the quarterly information, date information, average temperature, and weather; S307. If and there is a strong correlation between them, construct a network traffic prediction model based on neural network and linear regression. According to the historical network traffic data of the two gateway devices in the first time period, construct a joint training set and jointly train the network traffic prediction model; If and If there is no strong correlation between them, then based on neural network and linear regression, network traffic models of two gateway devices are constructed respectively. Then, using the historical network traffic data of the two gateway devices in the first time period, respective training sets are constructed, and respective network traffic prediction models are trained separately.
[0013] Further, and If there is a strong correlation between them, a network traffic prediction model based on neural network and linear regression is constructed. According to the historical network traffic data of the two gateway devices in the first time period, a joint training set is constructed, and the network traffic prediction model is jointly trained, including: Construct a joint neural network model, and the joint neural network model is an LSTM neural network model; Construct joint prediction samples; at : Take the high-frequency components corresponding to the k-th and (k + 1)-th network traffic subsequences of the two gateway devices as joint sample features, and take the (k + 2)-th network traffic subsequence as the sample label; During the training process, is used as the input of the LSTM neural network model, and the output result of the LSTM neural network model is denoted as ; At the same time, the quarterly information, date information, average temperature and weather corresponding to the (k + 2)-th network traffic subsequence of the first gateway device are input into the first multiple linear regression model to obtain the low-frequency component of the first gateway device; The quarterly information, date information, average temperature and weather corresponding to the (k + 2)-th network traffic subsequence of the second gateway device are input into the second multiple linear regression model to obtain the low-frequency component of the second gateway device; The result obtained by adding and is used to calculate the loss function value with to obtain the first loss function value L1, and the loss function uses MSE; The result obtained by adding and is used to calculate the loss function value with to obtain the second loss function value L2, and the loss function uses MSE; Then calculate the total loss function L2 = u 1 * L1 + u 2 * L2; u 1. u2 is the weighting coefficient; Use the calculated total loss function to perform forward propagation training on the joint neural network model to obtain a mature neural network model.
[0014] Furthermore, if and there is no strong correlation between them, then based on neural networks and linear regression, network traffic models for two gateway devices are respectively constructed. Then, using the historical network traffic data of the two gateway devices in the first time period, respective training sets are constructed, and the respective network traffic prediction models are trained, including: D1. Construct a first neural network model for the first gateway device. The neural network model is an LSTM neural network model; At : Take the high-frequency components corresponding to the k-th and (k + 1)-th network traffic subsequences of the first gateway device as sample features, and take the (k + 2)-th network traffic subsequence as the sample label; During the training process, is used as the input of the LSTM neural network model, and the output result of the LSTM neural network model is denoted as ; Input the quarterly information, date information, average temperature, and weather corresponding to the (k + 2)-th network traffic subsequence of the first gateway device into the first multiple linear regression model to obtain the low-frequency component of the first gateway device; Add and , and calculate the loss function value with . The loss function adopts MSE, and the first neural network model is trained by backpropagation using the loss function value; after training, the trained first neural network model is obtained; D2. Construct a second neural network model for the second gateway device. The second neural network model is an LSTM neural network model; At : Take the high-frequency components corresponding to the k-th and (k + 1)-th network traffic subsequences of the second gateway device as sample features, and take the (k + 2)-th network traffic subsequence as the sample label; During the training process, is used as the input of the LSTM neural network model, and the output result of the LSTM neural network model is denoted as ; Input the quarterly information, date information, average temperature, and weather corresponding to the (k + 2)-th network traffic subsequence of the second gateway device into the second multiple linear regression model to obtain the low-frequency component of the second gateway device. ; Input and Add the resulting sum to Calculate the loss function value. The loss function adopts MSE, and use the loss function value to perform backpropagation training on the second neural network model; After training, obtain the trained second neural network model.
[0015] In the embodiments of the present application, similarly during prediction, if and have a strong correlation, then perform joint prediction: For the first gateway device and the second gateway device, select the high-frequency components corresponding to the (M - 2)-th and (M - 1)-th network traffic subsequences of the two gateway devices as the joint sample features, input them into the trained joint neural network model, and the joint neural network model outputs ; At the same time, input the quarterly information, date information, average temperature, and weather (temperature and weather are obtained through weather forecasts) corresponding to the (M + 1)-th network traffic subsequence of the first gateway device into the first multiple linear regression model to obtain the low-frequency component of the first gateway device ; Input the quarterly information, date information, average temperature, and weather (temperature and weather are obtained through weather forecasts) corresponding to the (M + 1)-th network traffic subsequence of the second gateway device into the second multiple linear regression model to obtain the low-frequency component of the second gateway device ; The prediction result of the (M + 1)-th network sub-traffic sequence of the first gateway device (since there are M historical information and the (M + 1)-th belongs to future time) is + ; The prediction result of the (M + 1)-th network sub-traffic sequence of the second gateway device (since there are M historical information and the (M + 1)-th belongs to future time) is + ; Similarly, if and do not have a strong correlation, then perform separate predictions: Select the high-frequency components corresponding to the (M - 1)-th and M-th network traffic subsequences of the first gateway device as the sample features, input them into the trained first neural network model to obtain Input the quarterly information, date information, average temperature, and weather (temperature and weather obtained from weather forecasts) corresponding to the (M + 1)-th network traffic subsequence of the first gateway device into the first multiple linear regression model to obtain the low-frequency component of the first gateway device. The prediction result is + ; Take the high-frequency components corresponding to the (M - 1)-th and M-th network traffic subsequences of the second gateway device as sample features and send them into the trained second neural network model to obtain ; Input the quarterly information, date information, average temperature, and weather (temperature and weather obtained from weather forecasts) corresponding to the (M + 1)-th network traffic subsequence of the second gateway device into the second multiple linear regression model to obtain the low-frequency component of the first gateway device ; The prediction result is + .
[0016] The above are the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, should not be regarded as excluding other embodiments, but can be used in other combinations, modifications, and environments, and can be changed within the scope of the concept described herein through the above teachings or the techniques or knowledge in related fields. And any changes and modifications made by those skilled in the art without departing from the spirit and scope of the present invention shall fall within the protection scope of the appended claims of the present invention.
Claims
1. A network traffic prediction method based on neural network and linear regression, characterized in that: Including the following steps: S1. For two gateway devices with network connections, count the historical network traffic data within the first time period to obtain the historical network traffic sequences of the two gateway devices within the first time period; S2. Decompose and using the NA-MEMD algorithm, and then determine whether there is a strong correlation between and ; S3. Train a network traffic prediction model based on whether there is a strong correlation between and : If and there is a strong correlation between them, a network traffic prediction model based on neural network and linear regression is constructed. According to the historical network traffic data of two gateway devices in the first time period, a joint training set is constructed and the network traffic prediction model is jointly trained; If and there is no strong correlation between them, then based on neural network and linear regression, network traffic models of two gateway devices are respectively constructed, and then historical network traffic data of the two gateway devices in the first time period are used to construct their respective training sets, and their respective network traffic prediction models are trained respectively; S4. Use the trained network traffic prediction model to predict network traffic.
2. The network traffic prediction method based on neural network and linear regression according to claim 1, characterized in that: The first time period includes a plurality of first sub-time periods, and the time lengths of each first sub-time period are the same. The historical network traffic sequence within the first time period is composed of the historical network traffic data within each sub-time period in chronological order; Let the historical network traffic sequence of the first gateway device be denoted as , where represents the network traffic data of the first gateway device in the i th sub - time period; Let the historical network traffic sequence of the second gateway device be denoted as , where represents the network traffic data of the second gateway device in the i th sub - time period; Among them, , t represents the number of first sub-time periods included in the first time period; when collecting historical network traffic data for each sub-time period, it is necessary to synchronously save the quarterly information, date information, average temperature, and weather of the current sub-time period; the quarterly information includes spring, summer, autumn, and winter; the date information includes weekdays and non-weekdays; the weather includes rainy days, snowy days, sunny days, and others.
3. A network traffic prediction method based on neural network and linear regression according to claim 1, characterized in that: The step S2 includes: S201. Decompose and using the NA-MEMD algorithm to obtain: Among them, " " means that the sequence is decomposed using the NA-MEMD algorithm, represents the j-th IMF component obtained by decomposing represents the j-th IMF component obtained by decomposing , n represents the number of IMF components obtained after decomposing each sequence; S202. Calculate , coherence and mutual information : Among them, denotes and the coherence of the j-th IMF component; denotes and the mutual information of the j-th IMF component; S203. Determine whether the following conditions are met: Less than a preset threshold , and Less than a preset threshold ; If satisfied, it is considered that and There is no strong correlation between them; If not satisfied, it is considered that and have a strong correlation.
4. A network traffic prediction method based on neural network and linear regression according to claim 2, characterized in that: The first time period is 12 months, and the first sub-time period is 2 hours.
5. A network traffic prediction method based on neural network and linear regression according to claim 2, characterized in that: The step S3 includes: S301. Divide the network historical traffic sequence within the first time period into M consecutive network traffic subsequences. Each network traffic subsequence contains the historical network traffic data of t / M sub-time periods: Among them, the M network traffic subsequences of the first gateway device are denoted as: ; The M network traffic subsequences of the second gateway device are denoted as: ; Take as a subsequence pair, ; S302. Decompose using the NA-MEMD algorithm to obtain: S303. Use Subtract , Subtract , obtaining and low-frequency components of, denoted as and ; Utilize Subtract , Subtract , obtaining and high-frequency components, denoted as and ; S304. Since both have a length of t / M, after the processing of steps S302 - S303, and do not change in the lengths of their high - frequency and low - frequency components, and remain t / M; S305. When is satisfied, repeat steps S302 to S304; S306. Construct a multiple linear regression model; A1. First, represent the quarterly information, date information, average temperature, and weather respectively using for representation: When the quarterly information for the current sub - time period is spring and autumn, the value is 0.
5. When the quarterly information is summer and winter, the value is 1; When the date information of the current sub - time period is a working day, the value is 0.
5. When the working date is a non - working day, the value is 1; Average temperature information for the current sub-time period Take the Celsius temperature; Weather information for the current sub-time period Take 2 on rainy and snowy days, take 0.8 on sunny days, and take 1 otherwise; A2. Then construct a multiple linear regression model, denoted as: A3. Take , as y in the multiple linear regression model, and bring it into the corresponding into the multiple linear regression model. Using the multiple linear regression model estimation algorithm, estimate the regression coefficients , , 4. That is, the first multiple linear regression model is obtained, which represents the linear relationship between the low-frequency component of the first gateway device and the quarterly information, date information, average temperature, and weather; Utilize as y in the multiple linear regression model, and corresponding substitute into the multiple linear regression model, and use the multiple linear regression model estimation algorithm to estimate the regression coefficients , i.e., the second multiple linear regression model is obtained, which represents the linear relationship between the low-frequency component of the second gateway device and quarterly information, date information, average temperature, and weather; S307. If and have a strong correlation, construct a network traffic prediction model based on neural network and linear regression, construct a joint training set according to the historical network traffic data of two gateway devices in the first time period, and jointly train the network traffic prediction model; If and there is no strong correlation between them, then based on neural network and linear regression, network traffic models of two gateway devices are respectively constructed, and then by using the historical network traffic data of the two gateway devices in the first time period, respective training sets are constructed to train their respective network traffic prediction models.
6. A network traffic prediction method based on neural network and linear regression according to claim 5, characterized in that: The and have a strong correlation. A network traffic prediction model based on neural network and linear regression is constructed. According to the historical network traffic data of two gateway devices in the first time period, a joint training set is constructed, and the network traffic prediction model is jointly trained, including: Construct a joint neural network model, and the joint neural network model is an LSTM neural network model; Construct a combined prediction sample; at When: Take the high-frequency components corresponding to the k-th and (k + 1)-th network traffic subsequences of two gateway devices As the joint sample features, take the (k + 2)-th network traffic subsequence As the sample label; During the training process, is used as the input of the LSTM neural network model, and the output result of the LSTM neural network model is denoted as ; Meanwhile, input the quarterly information, date information, average temperature, and weather corresponding to the (k + 2)-th network traffic subsequence of the first gateway device into the first multiple linear regression model to obtain the low-frequency component of the first gateway device ; Input the quarterly information, date information, average temperature, and weather corresponding to the (k + 2)-th network traffic subsequence of the second gateway device into the second multiple linear regression model to obtain the low-frequency component of the second gateway device ; Add and The result obtained by adding them is used to calculate the loss function value to obtain the first loss function value L1, and the mean squared error (MSE) is used as the loss function; Add and The result obtained by adding them is used to calculate the loss function value to obtain the second loss function value L2, and the mean squared error (MSE) is used as the loss function; Then calculate the total loss function L2 = u 1 * L1 + u 2 * L2; u 1. u 2 is the weighting coefficient; Use the calculated total loss function to perform forward propagation training on the joint neural network model to obtain a trained joint neural network model.
7. A network traffic prediction method based on neural network and linear regression according to claim 5, characterized in that: If and do not have a strong correlation, then based on neural networks and linear regression, network traffic models for the two gateway devices are respectively constructed. Then, using the historical network traffic data of the two gateway devices in the first time period, respective training sets are constructed and the respective network traffic prediction models are trained, including: D1. Construct a first neural network model for the first gateway device, and the neural network model is an LSTM neural network model; At o'clock: Take the high-frequency components corresponding to the k-th and (k + 1)-th network traffic subsequences of the first gateway device As sample features, take the (k + 2)-th network traffic subsequence As the sample label; During the training process, is used as the input of the LSTM neural network model, and the output result of the LSTM neural network model is denoted as ; Input the quarterly information, date information, average temperature, and weather corresponding to the (k + 2)-th network traffic subsequence of the first gateway device into the first multiple linear regression model to obtain the low-frequency component of the first gateway device ; The result obtained by adding to is added to calculate the loss function value to obtain the loss function value. The loss function uses MSE, and the loss function value is used to perform backpropagation training on the first neural network model; after the training is completed, the trained first neural network model is obtained; D2. Construct a second neural network model for the second gateway device, and the second neural network model is an LSTM neural network model; At When: Take the high-frequency components corresponding to the k-th and (k + 1)-th network traffic subsequences of the second gateway device As sample features, take the (k + 2)-th network traffic subsequence As the sample label; During the training process, is used as the input of the LSTM neural network model, and the output result of the LSTM neural network model is denoted as ; Input the quarterly information, date information, average temperature, and weather corresponding to the (k + 2)-th network traffic subsequence of the second gateway device into the second multiple linear regression model to obtain the low-frequency component of the second gateway device ; The result obtained by adding to is used to calculate the loss function value. The loss function value is obtained, and the mean squared error (MSE) is used as the loss function. Then, the loss function value is used to perform backpropagation training on the second neural network model. After the training is completed, the trained second neural network model is obtained.
Citation Information
Patent Citations
Load prediction method, device and apparatus based on EEMD and LSTM
CN108985514A
Network traffic space-time prediction method and device, computer equipment and storage medium
CN112910710A
Short-term traffic flow prediction method combining data decomposition and deep learning
CN114973665A
Short-term power load prediction method based on long and short-term memory network combination
CN115169703A
Network traffic prediction method, model training method and device
CN116506305A