Method and apparatus for predicting cyberattack, computer device, and storage medium
By improving the Gray Wolf algorithm to optimize the BiLSTM model, build a time series model and optimize parameters, and identify abnormal traffic, it solves the problems of low accuracy and long reaction time of network attack detection in the existing technology, and achieves high efficiency for DoS and DDoS attacks Predict and identify.
Patent Information
- Application Number
- PCT/CN2023/117595
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-29
- Filing Date
- 2023-09-08
- Publication Date
- 2024-12-05
AI Technical Summary
Existing cyberattack detection technologies are difficult to effectively predict DoS and DDoS attacks, resulting in information leakage and resource waste, and the detection response time is long.
The BiLSTM model is optimized by using the improved gray wolf algorithm, and by acquiring and preprocessing network traffic data, building a time series model, optimizing model parameters using gray wolf optimization algorithm and hunting search strategy, identifying abnormal traffic, and setting reasonable thresholds to identify network attacks.
It improves the accuracy and response speed of network attack prediction, reduces information leakage and resource waste, avoids false alarms, and significantly improves the protection capabilities of network security.
Smart Images

Figure CN2023117595_05122024_PF_FP_ABST
Abstract
Description
A network attack prediction method, device, computer equipment and storage medium Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a network attack prediction method, device, computer equipment and storage medium. Background Art
[0002] Network security is crucial because it encompasses all forms of data and information security. Furthermore, with the continuous development of network information technology, incidents such as information leaks and phishing schemes are occurring more and more frequently. While people enjoy the convenience of the internet, they are also increasingly aware of the importance of network security. Existing security solutions include firewalls, data encryption, and intrusion detection systems. Firewalls and data encryption are passive security technologies that only protect network security after a network attack has occurred. Intrusion detection systems, on the other hand, are proactive security technologies that monitor the network in real time, effectively detecting network attacks and providing security managers with response decisions.
[0003] DoS and DDoS attacks are time-based, non-periodic attacks. They generate and send large amounts of useless data, consuming network bandwidth and system resources, rendering the attacked host unable to communicate normally with the outside world. DoS and DDoS attacks include a wide variety of types, including UDP floods, ACK floods, DNS request amplification, NTP amplification, TCP floods, HTTP floods, and SYN floods. These attacks aim to consume server bandwidth, memory, and CPU resources, forcing the server to deny or provide poor service due to resource depletion.
[0004] Summary of the Invention
[0005] The purpose of the present invention is to provide a network attack prediction method, device, computer equipment and storage medium to identify anomalies caused by network attacks and reduce information leakage and resource waste caused by network attacks.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] In a first aspect, the present invention provides a network attack prediction method, comprising:
[0008] S1: Obtain network traffic dataset;
[0009] S2: Preprocessing the network traffic data set;
[0010] S3: Perform time series modeling on the preprocessed network traffic dataset to obtain a time series;
[0011] S4: performing data feature analysis on the time series to obtain feature analysis results;
[0012] S5: Based on the feature analysis result, the network traffic data set is divided into a normal traffic data set and an attack traffic data set according to the network traffic;
[0013] S6: Initialize the parameters of the improved gray wolf algorithm;
[0014] S7: Build a prediction model and initialize the prediction model parameters;
[0015] S8: Use the Grey Wolf Optimization Algorithm (GWO) search strategy to obtain the optimal Grey Wolf first candidate X IGWO (t+1);
[0016] S9: Use the hunting DLH search strategy to obtain another candidate X for the optimal gray wolf IDLH (t+1);
[0017] S10: Compare the first candidate X IGWO (t+1) and another candidate X IDLH The fitness value of (t+1) selects the best candidate;
[0018] S11: Determine whether the fitness value of the optimal candidate is less than X i (t);
[0019] S12: If yes, update X with the best candidate i (t), otherwise X i (t) remains unchanged in the matrix Pop; X i (t) represents the position of the i-th wolf in the t-th iteration;
[0020] S13: Determine whether the maximum number of iterations has been reached. If not, proceed to the next step. Otherwise, increase the number of iterations by 1 and jump to S8.
[0021] S14: Obtaining the optimal parameter combination of the prediction model;
[0022] S15: training the prediction model based on the optimal parameter combination to obtain a converged prediction model after optimization;
[0023] S16: Based on the optimized and converged prediction model, identify anomalies caused by network attacks.
[0024] Optionally, the network traffic dataset includes: Internet traffic ec_data, network traffic DARPA99, and DDOS attack dataset DARPA00.
[0025] Optionally, preprocessing the network traffic data set specifically includes the following steps:
[0026] Normalizing the ec_data;
[0027] The DARPA99 dataset and the DARPA00 dataset are sampled at 1 minute intervals to obtain the number of packets per minute as the IP packet statistical feature IPDCF:
[0028] Among them, T i+1 -T i =1min, P t For data packets.
[0029] Optionally, performing data feature analysis on the time series to obtain feature analysis results specifically includes the following steps:
[0030] The IPDCF is sampled at a time interval of Δt=1 min, and the IPDCF value of each sampling is calculated. After m samplings, the period T is obtained: T(M,Δt)={IPDCF,i=1,2,…,M}
[0031] Where M is the length of the data set and Δt = 1 min.
[0032] Optionally, the initializing the improved gray wolf algorithm parameters specifically includes the following steps:
[0033] Randomly generate a wolf pack with a total number N = 50, a maximum number of iterations Maxiter = 10, and a problem dimension D = 4, which is the number of BiLSTM optimization parameters. The number of hidden layer units neurons1 and neurons2 in the BiLSTM, the forgetting rate dropout, and the batch size batch_size correspond to the parameter coordinates of the individual positions of the wolf pack. Set the upper and lower limits ub = [200, 200, 0.9, 10] and lb = [32, 32, 0.1, 1].
[0034] The position of wolf i in iteration t is expressed as: X i (t) = {x i1 ,x i2 ,…,x iD}0≤i≤N
[0035] The entire wolf population is stored in a matrix Pop, which has N rows and D columns, where D is the dimension of the problem.
[0036] Optionally, the optimal gray wolf first candidate X is obtained by using the gray wolf optimization algorithm GWO search strategy IGWO (t+1) specifically includes the following steps:
[0037] The wolf pack is divided into four levels according to its fitness value: α, β, δ, and ω; α is the optimal solution, β is the suboptimal solution, δ is the best solution, and ω is the candidate solution. The hunting process is guided by α, β, and δ, and ω follows α, β, and δ to move towards the prey. The position of the prey corresponds to the solution to the problem.
[0038] Select the three wolves α, β, and δ with the smallest fitness values for GWO search, and update the positions of other gray wolves ω to obtain the first candidate X IGWO (t+1);
[0039] The DLH hunting search strategy is used to obtain another candidate X for the optimal gray wolf IDLH (t+1) is specifically formulated as follows: IDLH,d (t+1)=X i,d (t)+rand×(X n,d (t)-X r,d (t))
[0040] Among them, X n,d (t) is the neighborhood N constructed from the DLH search strategy i The random neighbor selected in (t), X r,d (t) is a random wolf selected from the matrix Pop; X i,d (t) represents the position of the i-th wolf in the d-th dimension in the t-th iteration; N i (t) = {X i,d (t)|D i (X i (t), X j (t))≤R i (t),X j (t)∈Pop} R i (t)= ||X i (t)-X IGWO (t+1)||
[0041] Among them, D i It's X i (t) and X j (t) Euclidean distance between them; R i (t) is the radius of the neighborhood, X i (t) represents the position of the i-th wolf in the t-th iteration, X j (t) represents the position of the jth wolf in the tth iteration.
[0042] Optionally, based on the optimized converged prediction model, identifying anomalies caused by network attacks specifically includes the following steps:
[0043] The attack traffic data set is input into the optimized and converged prediction model to conduct attack experiments;
[0044] Statistical analysis is performed on the IPDCF value intervals of the normal flow and the predicted flow, and the IPDCF value intervals of the normal flow and the predicted flow are obtained [a, b] and [c, d];
[0045] Get the maximum value Z of the IPDCF value interval [c, d] of the predicted flow;
[0046] Calculate the average error A between the IPDCF value of the predicted flow and the IPDCF value of the normal network, and set the threshold U = Z + A;
[0047] When the deviation X between the actual value and the predicted value is greater than or equal to the preset threshold U, it is considered to be abnormal traffic, and it can be determined that there is a network attack; when the deviation between the actual value and the predicted value is less than the preset threshold U, it is considered to be normal network congestion.
[0048] In a second aspect, the present invention provides a network attack prediction device, comprising:
[0049] A network traffic data set acquisition module is used to acquire a network traffic data set;
[0050] and a processing module, configured to pre-process the network traffic data set;
[0051] The time series modeling module is used to perform time series modeling on the preprocessed network traffic dataset to obtain a time series;
[0052] A feature analysis module is used to perform data feature analysis on the time series to obtain feature analysis results;
[0053] A network traffic data set division module is used to divide the network traffic data set into a normal traffic data set and an attack traffic data set according to the network traffic based on the feature analysis result;
[0054] Initialization module, used to initialize the parameters of the improved gray wolf algorithm;
[0055] A prediction model building module is used to build a prediction model and initialize prediction model parameters;
[0056] The first candidate determination module is used to obtain the optimal gray wolf first candidate X using the gray wolf optimization algorithm GWO search strategy. IGWO (t+1);
[0057] The second candidate determination module is used to obtain the best gray wolf candidate X using the hunting DLH search strategy. IDLH (t+1);
[0058] Comparison module, used to compare the first candidate X IGWO (t+1) and another candidate X IDLHThe fitness value of (t+1) selects the best candidate;
[0059] The first judgment module is used to judge whether the fitness value of the optimal candidate is less than X i (t);
[0060] An updating module, configured to update X with the most preferred candidate when i (t), otherwise X i (t) remains unchanged in the matrix Pop; X i (t) represents the position of the i-th wolf in the t-th iteration;
[0061] The second judgment module is used to judge whether the maximum number of iterations has been reached. If not, the next step is executed. Otherwise, the number of iterations is increased by 1 and the process jumps to the first candidate determination module.
[0062] An optimal parameter combination determination module is used to obtain the optimal parameter combination of the prediction model;
[0063] A training module, configured to train the prediction model based on the optimal parameter combination to obtain a converged prediction model after optimization;
[0064] The network attack identification module is used to identify anomalies caused by network attacks based on the prediction model that converges after optimization.
[0065] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above method when executing the computer program.
[0066] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above method when executed by a processor.
[0067] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0068] This paper proposes an IGWO-BiLSTM network attack prediction model. The IGWO method can solve the problems of the original GWO method, such as slow convergence, premature loss of population diversity, and easy entrapment in local optimality. IGWO-BiLSTM predicts normal network traffic and sets reasonable thresholds to identify anomalies caused by network attacks, thereby reducing information leakage and resource waste caused by network attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0070] FIG1 is a schematic diagram of the structure of the IGWO-BiLSTM model of the present invention;
[0071] FIG2 is a flow chart of the IGWO-BiLSTM of the present invention;
[0072] FIG3 is a schematic diagram of the normalization of the ec_data data set of the present invention;
[0073] FIG4 is a schematic diagram of the data characteristics of DARPA99 week 1 for 5 days according to the present invention;
[0074] FIG5 is a partial comparison diagram of the actual value and the predicted value of ec_data of the present invention;
[0075] FIG6 is a comparison diagram of the actual value and the predicted value of DARPA99 of the present invention;
[0076] FIG7 is a schematic diagram of the results of a simulated attack experiment of the present invention. DETAILED DESCRIPTION
[0077] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.
[0078] The purpose of the present invention is to provide a network attack prediction method, device, computer equipment and storage medium to identify anomalies caused by network attacks and reduce information leakage and resource waste caused by network attacks.
[0079] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0080] The present invention provides a network attack prediction method, comprising:
[0081] S1: Obtain network traffic dataset.
[0082] This paper uses three datasets: internet traffic from a dedicated Internet service provider (ISP) (denoted by ec_data); three weeks of network traffic collected by the Massachusetts Institute of Technology Lincoln Laboratory in 1999 (denoted by DARPA99); and a DDOS attack dataset collected by the Massachusetts Institute of Technology Lincoln Laboratory in 2000 (denoted by DARPA00). The ec_data and DARPA99 datasets are used to demonstrate the universality of the prediction model, while the DARPA00 dataset is used for attack experiments.
[0083] S2: Preprocessing the network traffic dataset.
[0084] Specifically, the ec_data dataset collects 14,772 sets of network traffic data from July 6, 2005 to July 28, 2005, with sampling intervals of 5 minutes. The dataset is normalized.
[0085] in, is the normalized value, x is the original value, and x min is the minimum value, x max is the maximum value;
[0086] The DARPA99 dataset provides three weeks of training data for the 1999 DARPA intrusion detection project. Weeks 1 and 3 do not contain any attacks as training data, while week 2 contains a subset of attacks from 1998 and several new attacks as test data. The DARPA99 and DARPA00 datasets are sampled at 1-minute intervals, and the number of packets per minute is used as the IP packet count feature (IPDCF).
[0087] Among them, T i+1 -T i =1min, P t For data packets.
[0088] S3: Perform time series modeling on the preprocessed network traffic dataset to obtain a time series.
[0089] S4: Performing data feature analysis on the time series to obtain feature analysis results.
[0090] The IPDCF in step S2 is sampled at a time interval of Δt = 1 min, and the IPDCF value of each sampling is calculated. After m sampling times, T is obtained, T(M,Δt) = {IPDCF, i = 1, 2, ..., M} (3)
[0091] Where M is the length of the data set, Δt = 1 min;
[0092] The network traffic data in the ec_data dataset has periodicity at the macro level and frequent bursts at the micro level.
[0093] The DARPA99 dataset has a period of d and a time interval of min. The data at a fixed time every day show a relatively fixed trend.
[0094] S5: Based on the feature analysis result, the network traffic data set is divided into a normal traffic data set and an attack traffic data set according to the network traffic.
[0095] The specific steps include:
[0096] Step 5.1: Use normal network traffic data to train the prediction model and use attack traffic data to conduct attack experiments.
[0097] Step 5.2: Divide the time series obtained from S2 and S3 into training and test sets in a ratio of 7:3;
[0098] Step 5.3: Use sliding window technology for normal traffic data and attack traffic data respectively, select a window with a length of 60 and a width of 1, set the step size to 10, and perform sliding interception on the time series network traffic data.
[0099] S6: Initialize the parameters of the improved gray wolf algorithm.
[0100] Specifically, the wolf pack is randomly generated with a total number N = 50, a maximum number of iterations Maxiter = 10, the dimension D of the problem is the number of BiLSTM optimization parameters D = 4, the number of hidden layer units (neurons1, neurons2), the forgetting rate (dropout), and the batch size (batch_size) of the BiLSTM correspond to the parameter coordinates of the individual positions of the wolf pack, and the upper and lower limits ub = [200, 200, 0.9, 10] and lb = [32, 32, 0.1, 1] are set;
[0101] The position of wolf i in iteration t is expressed as: X i (t) = {x i1 ,x i2 ,…,x iD}0≤i≤N
[0102] The entire wolf population is stored in a matrix Pop with N rows and D columns, where D is the dimension of the problem.
[0103] S7: Build a prediction model and initialize the prediction model parameters.
[0104] Specifically include:
[0105] The selected BiLSTM model includes: two layers of BiLSTM, one layer of Dropout, and one layer of Dense;
[0106] Initialize the number of hidden layer units (neurons1, neurons2), forgetting rate (dropout), and batch size (batch_size) of BiLSTM to: neurons1 = 128, neurons2 = 64, dropout = 0.4, batch_size = 5, and the maximum number of iterations is 500;
[0107] The fitness function is the mean squared error (MSE) between the predicted value and the true value. The fitness value of the individual wolf pack is calculated using formula (4) and the fitness value is returned to IGWO.
[0108] Among them, Y i is the true value, is the predicted value.
[0109] S8: Use the Grey Wolf Optimization Algorithm (GWO) search strategy to obtain the optimal Grey Wolf first candidate X IGWO (t+1).
[0110] S9: Use the hunting DLH search strategy to obtain another candidate X for the optimal gray wolf IDLH (t+1).
[0111] Specifically include:
[0112] The Grey Wolf Optimizer (GWO) algorithm divides wolves into four levels based on their fitness: α, β, δ, and ω. α is the optimal solution, β is the suboptimal solution, δ is the best solution, and ω is the candidate solution. The hunting process is guided by α, β, and δ, with ω following α, β, and δ toward the prey. The prey's position corresponds to the solution to the problem.
[0113] MSE is the expected value of the square of the difference between the true value and the predicted value. The larger the value, the greater the error. The three wolves α, β, and δ with the smallest fitness values are selected for GWO search, and the positions of other gray wolves ω are updated to obtain the first candidate X. IGWO (t+1).
[0114] S10: Compare the first candidate X IGWO (t+1) and another candidate X IDLH The fitness value of (t+1) is used to select the best candidate.
[0115] In the DLH search strategy, Wolf X iEach dimension of the new position of (t) is calculated by formula (5), X IDLH,d (t+1)=X i,d (t)+rand×(X n,d (t)-X r,d (t)) (5)
[0116] Among them, X n,d (t) is the neighborhood N constructed from the DLH search strategy i The random neighbor selected in (t), X r,d (t) is a random wolf selected from Pop;
[0117] DLH neighborhood N i (t) is constructed by formula (6)
[0118] Among them, D i It's X i (t) and X j (t) Euclidean distance between them; R i (t) is the radius of the neighborhood, DLH uses X i (t)’s current position and candidate position X IGWO The Euclidean distance between (t+1) is calculated by using formula (7) to calculate the radius of the neighborhood.
[0119] S11: Determine whether the fitness value of the optimal candidate is less than X i (t).
[0120] S12: If yes, update X with the best candidate i (t), otherwise X i (t) remains unchanged in the matrix Pop; X i (t) represents the position of the i-th wolf in the t-th iteration.
[0121] The specific formula is as follows:
[0122] S13: Determine whether the maximum number of iterations has been reached. If not, proceed to the next step. Otherwise, increase the number of iterations by 1 and jump to S8.
[0123] S14: Obtain the optimal parameter combination of the prediction model.
[0124] S15: Training the prediction model based on the optimal parameter combination to obtain a converged prediction model after optimization.
[0125] The optimal parameter combination includes: neurons1, neurons2, dropout, batch_size. These parameters are input into IGWO-BiLSTM and trained to obtain an optimized and converged IGWO-BiLSTM network prediction model. Network attack data is input into the prediction model to compare normal network traffic with attack network traffic, which can predict attacks in a timely and accurate manner.
[0126] S16: Based on the optimized and converged prediction model, identify anomalies caused by network attacks.
[0127] The optimal parameter combination is substituted into the BiLSTM training prediction model, and the mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE) and coefficient of determination (R 2 ) is used as the evaluation metric to compare the prediction performance of the improved Grey Wolf Optimized RNN (IGWO-RNN), improved Grey Wolf Optimized LSTM (IGWO-LSTM), improved Grey Wolf Optimized GRU (IGWO-GRU), and the improved Grey Wolf Optimized BiLSTM (IGWO-BiLSTM) proposed in this paper;
[0128] Input attack data into the prediction model and conduct attack experiments;
[0129] The IPDCF value intervals of normal and predicted flows are statistically analyzed to obtain the IPDCF value intervals [a, b] and [c, d] of normal and predicted flows. The maximum value Z of the IPDCF value interval [c, d] of the predicted flow is obtained. The average error A between the IPDCF value of the predicted flow and the IPDCF value of the normal network is calculated. The threshold U = Z + A is set. From formula (9), it can be obtained that when the deviation X between the true value and the predicted value exceeds the preset threshold U, it is considered to be abnormal traffic, and it can be determined that there is a network attack behavior; when the deviation X between the true value and the predicted value is large but does not exceed the preset threshold U, it is considered that normal network congestion other than abnormality has occurred.
[0130] Example
[0131] In response to the continuous occurrence of information leakage, phishing networks and other incidents, and the low accuracy of existing network attack prediction models and the long attack detection response time, a network attack prediction method based on the improved Grey Wolf algorithm and optimized BiLSTM is provided. This embodiment uses PyCharm as the development platform, Python as the development language and PyTorch as the deep learning framework, and adopts the above-mentioned method of the present invention to predict network traffic attacks. The specific process is as follows:
[0132] Step 1: Use dedicated Internet Service Provider (ISP) Internet traffic (ec_data), as shown in Figure 3; 3 weeks of network traffic collected by MIT Lincoln Laboratory in 1999 (DARPA99), as shown in Figure 4; and a DOS and DDOS attack dataset collected by MIT Lincoln Laboratory in 2000 (DARPA00).
[0133] Step 2: Using the network traffic obtained in step 1 as input, as shown in Figure 1, load the prediction model in this method. The IGWO-BiLSTM prediction process is shown in Figure 2, and the prediction of network traffic attack is obtained. The local comparison chart of the true value and predicted value of ec_data is shown in Figure 5, and the comparison chart of the true value and predicted value of DARPA99 is shown in Figure 6.
[0134] Step 3: The evaluation indicators used in this invention include mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE) and coefficient of determination (R 2 );
[0135] The specific formula is as follows:
[0136] Among them, Y i represents the true value, represents the predicted value, Represents the mean of the true values.
[0137] Step 4: Conduct an attack experiment on the prediction model to obtain attack prediction results. As shown in Figure 7, at the 36th minute, the deviation between the true value and the predicted value exceeds the threshold, and it is determined that a network attack has occurred at this time. At the 80th to 90th minute, although the deviation between the true value and the predicted value is large, it does not exceed the threshold. It is not determined as a network attack, but rather as an increase in the user's actual network demand at this time, to avoid false alarms.
[0138] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0139] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A network attack prediction method, characterized in that: include: S1: Obtain network traffic dataset; S2: preprocessing the network traffic data set; S3: Perform time series modeling on the preprocessed network traffic data set to obtain a time series; S4: performing data feature analysis on the time series to obtain feature analysis results; S5: Based on the feature analysis result, the network traffic data set is divided into a normal traffic data set and an attack traffic data set according to the network traffic; S6: Initialize the parameters of the improved grey wolf algorithm; S7: construct a prediction model and initialize prediction model parameters; S8: Use the Grey Wolf Optimization Algorithm GWO search strategy to obtain the optimal Grey Wolf first candidate X IGWO (t+1); S9: Use the hunting DLH search strategy to obtain another candidate X for the optimal gray wolf IDLH (t+1); S10: Compare the first candidate X IGWO (t+1) and another candidate X IDLH The fitness value of (t+1) selects the best candidate; S11: Determine whether the fitness value of the optimal candidate is less than X i (t); S12: If yes, update X with the most preferred candidate i (t), otherwise X i (t) remains unchanged in the matrix Pop; X i (t) represents the position of the i-th wolf in the t-th iteration; the matrix Pop includes the entire population of wolves; S13: Determine whether the maximum number of iterations has been reached. If not, proceed to the next step. Otherwise, increase the number of iterations by 1 and jump to S8. S14: Obtaining the optimal parameter combination of the prediction model; S15: training the prediction model based on the optimal parameter combination to obtain a prediction model that converges after optimization; S16: Based on the optimized converged prediction model, identify anomalies caused by network attacks.
2. The network attack prediction method according to claim 1, characterized in that: The network traffic data sets include: Internet traffic ec_data, network traffic DARPA99 and DDOS attack data set DARPA00.
3. The network attack prediction method according to claim 2, characterized in that: Preprocessing the network traffic data set specifically includes the following steps: Normalizing the ec_data; The DARPA99 dataset and the DARPA00 dataset are sampled at 1 minute intervals to obtain the number of packets per minute as the IP packet statistical feature IPDCF: Among them, T i+1 -T i =1min, P t For data packets.
4. The network attack prediction method according to claim 3, characterized in that: Performing data feature analysis on the time series to obtain feature analysis results specifically includes the following steps: The IPDCF is sampled at a time interval of Δt=1 min, and the IPDCF value of each sampling is calculated. After m samplings, the period T is obtained: T(M,Δt)={IPDCF,i=1,2,…,M} Where M is the length of the data set and Δt = 1 min.
5. The network attack prediction method according to claim 1, characterized in that: Initializing the improved Grey Wolf Algorithm parameters specifically includes the following steps: A wolf pack is randomly generated, with a total number of N = 50, a maximum number of iterations Maxiter = 10, a dimension of the problem D = 4, the number of BiLSTM optimization parameters, the number of hidden layer units neurons1 and neurons2, the forgetting rate dropout and the batch size batch_size corresponding to the parameter coordinates of the individual positions of the wolf pack, and upper and lower limits ub = [200, 200, 0.9, 10], lb = [32, 32, 0.1, 1]; The position of the i-th wolf in the t-th iteration is expressed as: X i (t)={x i1 ,x i2 ,…,x iD }0≤i≤N The entire population of wolves is stored in a matrix Pop, which has N rows and D columns, where D is the dimension of the problem.
6. The network attack prediction method according to claim 1, characterized in that: The gray wolf optimization algorithm GWO search strategy is used to obtain the optimal gray wolf first candidate X IGWO (t+1) specifically includes the following steps: The wolf pack is divided into four levels according to the fitness value: α, β, δ and ω; α is the optimal solution, β is the suboptimal solution, δ is the best solution, and ω is the candidate solution. The hunting process is guided by α, β, and δ. ω follows α, β, and δ to move towards the prey. The position of the prey corresponds to the solution to the problem. Select the three wolves α, β, and δ with the smallest fitness values for GWO search, and update the positions of other gray wolves ω to obtain the first candidate X IGWO (t+1); The DLH hunting search strategy is used to obtain another candidate X for the optimal gray wolf IDLH (t+1) The specific formula is as follows: X IDLH,d (t+1)=X i,d (t)+rand×(X n,d (t)-X r,d (t)) Among them, X n,d (t) is the neighborhood N constructed from the DLH search strategy i The random neighbor selected in (t), X r,d (t) is a random wolf selected from the matrix Pop; X i,d (t) represents the position of the i-th wolf in the d-th dimension in the t-th iteration; N i (t)={X i,d (t)|D i (X i (t),X j (t))≤R i (t),X j (t)∈Pop} R i (t)=||X i (t)-X IGWO (t+1)|| Among them, D i Yes X i (t) and X j (t) Euclidean distance between them; R i (t) is the radius of the neighborhood, X i (t) represents the position of the i-th wolf in the t-th iteration, X j (t) represents the position of the jth wolf in the tth iteration.
7. The network attack prediction method according to claim 4, characterized in that: Based on the prediction model that converges after optimization, identifying anomalies caused by network attacks specifically includes the following steps: The attack traffic data set is input into the optimized and converged prediction model to conduct attack experiments; Statistical analysis is performed on the IPDCF value intervals of the normal flow and the predicted flow, and the IPDCF value intervals of the normal flow and the predicted flow are obtained [a, b] and [c, d]; Get the maximum value Z of the IPDCF value interval [c, d] of the predicted flow; Calculate the average error A between the IPDCF value of the predicted flow and the IPDCF value of the normal network, and set the threshold U = Z + A; When the deviation X between the actual value and the predicted value is greater than or equal to the preset threshold U, it is considered to be abnormal traffic, and it can be determined that there is a network attack; when the deviation between the actual value and the predicted value is less than the preset threshold U, it is considered that normal network congestion has occurred.
8. A network attack prediction device, characterized in that: include: A network traffic data set acquisition module is used to acquire a network traffic data set; and a processing module, for preprocessing the network traffic data set; The time series modeling module is used to perform time series modeling on the preprocessed network traffic data set to obtain a time series; A feature analysis module, used to perform data feature analysis on the time series to obtain feature analysis results; A network traffic data set division module, used for dividing the network traffic data set into a normal traffic data set and an attack traffic data set according to the network traffic based on the characteristic analysis result; Initialization module, used to initialize the parameters of the improved gray wolf algorithm; A prediction model building module is used to build a prediction model and initialize prediction model parameters; The first candidate determination module is used to obtain the optimal gray wolf first candidate X using the gray wolf optimization algorithm GWO search strategy IGWO (t+1); The second candidate determination module is used to obtain another optimal gray wolf candidate X using a hunting DLH search strategy. IDLH (t+1); Comparison module, used to compare the first candidate X IGWO (t+1) and another candidate X IDLH The fitness value of (t+1) selects the best candidate; The first judgment module is used to judge whether the fitness value of the optimal candidate is less than X i (t); An updating module, for updating X with the most preferred candidate when yes i (t), otherwise X i (t) remains unchanged in the matrix Pop; X i (t) represents the position of the i-th wolf in the t-th iteration; The second judgment module is used to judge whether the maximum number of iterations has been reached. If not, the next step is executed. Otherwise, the number of iterations is increased by 1, and the process jumps to the first candidate determination module. An optimal parameter combination determination module is used to obtain the optimal parameter combination of the prediction model; A training module, used for training the prediction model based on the optimal parameter combination to obtain a prediction model that converges after optimization; The network attack identification module is used to identify anomalies caused by network attacks based on the prediction model that converges after optimization.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
DDoS attack detection method based on chaos theory analysis
CN110557397A
Detection method and system for low-rate DDoS attack
CN113206859A
Cloud platform task scheduling method based on dimension learning strategy and grey wolf optimization
CN115454612A
Network attack prediction method and device, computer equipment and storage medium
CN116668318A
Method for anomaly classification of industrial control system communication network
US20220269258A1
Cited By
Textile process optimization method based on artificial intelligence
CN119335883A
Terminal equipment integrated deployment method and system based on edge intelligent analysis
CN119835092A
Tubular pile bearing capacity prediction method based on IGWO-BP neural network
CN119918358A
Pipe pile bearing capacity prediction method based on igwo-bp neural network
CN119918358B
Anti-ash-blocking control method and device for boiler air preheater
CN120101572A
