A method and system for blocking attack bypass based on network abnormal behavior analysis

Through the combination of the sparse reconstruction algorithm and the K nearest neighbor algorithm, the abnormal categories of network transmission data are identified and automatic bypass blocking is implemented, which solves the problem of difficulty in identifying new attacks and variant attacks with existing technologies, and improves the adaptability of abnormal network behavior detection. and accuracy, improving safety and efficiency.

CN118199971BActive Publication Date: 2024-08-30JINQICHUANG (BEIJING) TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202410314553.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2024-08-30
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

Existing abnormal network behavior detection methods are difficult to identify new attacks and variant attacks, and the huge demand for computing resources and storage space in large network environments makes it difficult to detect abnormal behaviors in a timely and accurate manner.

Method used

The sparse reconstruction algorithm is used to determine the anomaly score of network transmission data, and when the anomaly score is greater than the preset value, the K nearest neighbor algorithm is used to determine the anomaly category to achieve automated bypass blocking.

Benefits of technology

It improves the adaptability and accuracy of abnormal network behavior detection, saves computing resources, reduces manual intervention, provides multi-level and multi-dimensional network security protection, and quickly and effectively responds to abnormal situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118199971B
    Figure CN118199971B
Patent Text Reader

Abstract

The present invention provides an attack bypass blocking method and system based on network abnormal behavior analysis, which relates to the field of data processing technology. The method includes: obtaining network transmission data; determining the abnormal score of the network transmission data based on a sparse reconstruction algorithm; when the abnormal score of the network transmission data is greater than a preset abnormal score, determining the abnormal category of the network transmission data based on a K-nearest neighbor algorithm; and performing corresponding bypass blocking according to the abnormal category of the network transmission data. The present invention can accurately determine the abnormal category of the network transmission data, can be competent for network abnormal behavior detection in any scenario, adapt to the evolution of security threats, and improve the adaptability and extensibility of network abnormal behavior analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to an attack bypass blocking method and system based on network abnormal behavior analysis. Background Art

[0002] Enterprises can interconnect and share resources around the world through the Internet, but due to its openness, the security of information transmitted on the Internet will inevitably face many threats. As more and more enterprises put their business activities on the Internet, various illegal intrusions and illegal attacks on network systems have also increased. Information leakage has become a security threat with a wide impact. Therefore, it is of great significance to monitor abnormal network behavior.

[0003] The current methods for monitoring abnormal network behavior mainly include rule-based detection methods and statistics-based detection. Rule-based detection methods use predefined rules and signatures to identify known attack patterns and detect abnormal behaviors by matching specific data packets or traffic features. Statistics-based detection is based on statistical analysis of network traffic to detect abnormal patterns that do not match normal behavior.

[0004] However, as new generation applications and technologies such as cloud computing, the Internet of Things, smart cities, and mobile Internet are widely used in the industry, while promoting application innovation, they will also bring serious information security risks. The continuous development of attack and defense, the continuous evolution of security threats, and the widespread use of new applications and new technologies will also have a huge impact on the original security concepts and models. The original rule-based detection methods and statistical-based detection can no longer completely solve the security problems faced. Rule-based detection methods need to be defined in advance, so they can only detect known attack patterns. They may not have the ability to identify new attacks or variants, and it is difficult to adapt to the evolution of security threats and accurately detect new network attack behaviors. Statistical-based detection, for the increasingly large-scale network environment, the network traffic is huge, and processing and analysis require a lot of computing resources and storage space, making it difficult to detect abnormal behaviors in a timely and accurate manner. Summary of the invention

[0005] In order to solve the technical problem that the rule-based detection method in the prior art needs to be defined in advance, so it can only detect known attack patterns, and may not have the ability to identify new attacks or variants, and it is difficult to adapt to the evolution of security threats and accurately detect new network attack behaviors. Based on statistical detection, for the increasingly large-scale network environment, the network traffic is huge, and the processing and analysis require a lot of computing resources and storage space, and it is difficult to detect abnormal behaviors in a timely and accurate manner, the present invention provides an attack bypass blocking method and system based on network abnormal behavior analysis.

[0006] The technical solution provided by the embodiment of the present invention is as follows:

[0007] First aspect

[0008] An attack bypass blocking method based on network abnormal behavior analysis provided by an embodiment of the present invention includes:

[0009] S1: Obtain network transmission data;

[0010] S2: Determine an abnormality score of the network transmission data based on a sparse reconstruction algorithm;

[0011] S3: When the anomaly score of the network transmission data is greater than a preset anomaly score, determining the anomaly category of the network transmission data based on a K-nearest neighbor algorithm;

[0012] S4: Perform corresponding bypass blocking according to the abnormal category of the network transmission data.

[0013] Second aspect

[0014] An attack bypass blocking system based on network abnormal behavior analysis provided by an embodiment of the present invention includes:

[0015] processor;

[0016] A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the attack bypass blocking method based on network abnormal behavior analysis as described in the first aspect is implemented.

[0017] The third aspect

[0018] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the attack bypass blocking method based on network abnormal behavior analysis as described in the first aspect is implemented.

[0019] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0020] In the present invention, based on the sparse reconstruction algorithm, the abnormal score of the network transmission data is determined. When the abnormal score of the network transmission data is greater than the preset abnormal score, based on the K nearest neighbor algorithm, the abnormal category of the network transmission data is accurately determined, which can be competent for network abnormal behavior detection in any scenario, adapt to the evolution of security threats, and improve the adaptability and expansibility of network abnormal behavior analysis. The sparse reconstruction algorithm is combined with the K nearest neighbor algorithm. Only when the abnormal score of the network transmission data is greater than the preset abnormal score will further abnormal identification be performed, which can save computing resources, and the abnormal category identification by the K nearest neighbor algorithm can quickly and accurately identify abnormal behavior and improve the accuracy of abnormal behavior detection. Once the abnormal category of the network transmission data is determined, the system can automatically perform corresponding bypass blocking according to the preset rules. This automated response capability enables the system to respond to abnormal situations quickly and effectively, reduces the need for manual intervention, and improves safety and efficiency. Compared with the traditional rule-based detection method, the bypass blocking system combining the sparse reconstruction algorithm and the K nearest neighbor algorithm can provide more multi-level and multi-dimensional network security protection, and has better comprehensiveness and accuracy when capturing and processing network anomalies. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of 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 creative work.

[0022] Figure 1 A flowchart of an attack bypass blocking method based on network abnormal behavior analysis provided by an embodiment of the present invention;

[0023] Figure 2 A schematic diagram of the structure of an attack bypass blocking method based on network abnormal behavior analysis provided by an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of a flow chart of an anomaly score calculation method provided by an embodiment of the present invention;

[0025] Figure 4 A flowchart of an abnormal category identification method provided by an embodiment of the present invention;

[0026] Figure 5 A schematic structural diagram of an attack bypass blocking system based on network abnormal behavior analysis provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0028] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0029] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0030] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.

[0031] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0032] Reference Manual Attached Figure 1 , shows a flow chart of an attack bypass blocking method based on network abnormal behavior analysis provided by an embodiment of the present invention.

[0033] Reference Manual Attached Figure 2 , showing a structural schematic diagram of an attack bypass blocking method based on network abnormal behavior analysis provided by an embodiment of the present invention.

[0034] The embodiment of the present invention provides an attack bypass blocking method based on network abnormal behavior analysis, which can be implemented by an attack bypass blocking device based on network abnormal behavior analysis, and the attack bypass blocking device based on network abnormal behavior analysis can be a terminal or a server. The processing flow of the attack bypass blocking method based on network abnormal behavior analysis can include the following steps:

[0035] S1: Obtain network transmission data.

[0036] S2: Determine the anomaly score of network transmission data based on the sparse reconstruction algorithm.

[0037] Among them, the sparse reconstruction algorithm is an algorithm commonly used in the fields of signal processing and machine learning. Its main goal is to learn the sparse representation that best represents the original data from high-dimensional data.

[0038] In the field of network security, sparse reconstruction algorithms are often used in anomaly detection and behavior analysis. This is because normal data often only needs a small number of features to be reconstructed, which means that normal data is easier to reduce in sparse reconstruction, while abnormal data requires more features to be reconstructed, which means that normal data is easier to reduce in sparse reconstruction and more difficult to reduce in sparse reconstruction. By comparing the difference between the original data before reconstruction and the reconstructed data after reconstruction, it can help identify abnormal data.

[0039] Reference Manual Attached Figure 3 , which shows a flow chart of an abnormality score calculation method provided by an embodiment of the present invention.

[0040] In a possible implementation, S2 specifically includes sub-steps S201 to S203:

[0041] S201: Perform sparse coding on the data transmitted by each network through the autoencoder:

[0042] h=σ(W e x+b e )

[0043] Among them, h represents the hidden layer output, h also represents sparse coding, σ() represents the nonlinear activation function, and W e represents the weight matrix from the input layer to the hidden layer, x represents the original data, b e Represents the bias component from the input layer to the hidden layer.

[0044] S202: According to the hidden layer output, each transaction data point is decoded and reconstructed by the self-decoder:

[0045]

[0046] in, Represents the reconstructed data, W d represents the weight matrix from the hidden layer to the output layer, b d Represents the bias component from the hidden layer to the output layer.

[0047] It should be noted that the autoencoder can learn effective feature representation of the data and perform sparse coding through the output of the hidden layer, thereby realizing feature extraction of the original data, which helps to capture the potential patterns and features in the data, thereby better describing the structure of the data transmitted by the network.

[0048] S203: Determine an abnormal score of the network transmission data according to the difference between the reconstructed data and the original data.

[0049] In the present invention, the method of sparse encoding and decoding reconstruction by autoencoder can effectively extract data features, reduce data dimensions, filter noise, adaptively learn data features, and realize automatic anomaly detection. The advantage of this method is that it can learn more effective feature representation from raw data through an end-to-end learning process, and calculate the anomaly score of network transmission data through reconstruction error, providing an effective means for abnormal network behavior analysis.

[0050] In a possible implementation, S203 specifically includes: calculating the abnormal score of the network transmission data according to the following formula:

[0051]

[0052] Among them, S represents the anomaly score, H x represents the permutation entropy of the original data, represents the permutation entropy of the reconstructed data, β represents the weight coefficient of the permutation entropy term, x represents the original data, represents the reconstructed data, || || represents the two-norm operation, and (1-β) represents the weight coefficient of the reconstruction deviation term when calculating the anomaly score.

[0053] Among them, those skilled in the art can set the size of the weight coefficient β of the permutation entropy term according to actual conditions, and the present invention does not limit this.

[0054] In the present invention, the information of permutation entropy and reconstruction error is combined to comprehensively analyze the abnormal situation of network transmission data. Permutation entropy reflects the randomness and complexity of data, and reconstruction error reflects the reconstruction accuracy of data. The combination of the two can more accurately judge abnormal data.

[0055] Among them, permutation entropy is a statistic used to measure the complexity and randomness of time series, and is usually used to analyze the characteristics of nonlinear and non-stationary time series. It measures the irregularity and complexity of the sequence by calculating the permutation pattern of the time series.

[0056] Optionally, the permutation entropy of the original data is calculated as follows:

[0057] The original data is divided into multiple overlapping data segments of equal duration according to a preset step size in time.

[0058] Among them, those skilled in the art can set the size of the preset step size according to actual conditions, and the present invention does not limit it.

[0059] It should be noted that the original data is divided into multiple overlapping data segments according to time, and the permutation entropy is calculated for each segment. This can better capture the characteristics and changes of the data in different time periods, making the calculation of the permutation entropy more accurate and comprehensive. Dividing the data segments according to time helps to maintain the continuity of the time series. This ensures that the calculation of the permutation entropy will not be discontinuous in time, which is more in line with the actual situation of time series data.

[0060] Each data segment is sorted according to the data amount to obtain an arrangement result.

[0061] Calculate the probability of each arrangement occurring.

[0062] According to the probability of each permutation result, the permutation entropy is calculated:

[0063]

[0064] Among them, H represents the permutation entropy, p j represents the probability of the jth arrangement result occurring, log() represents an exponential function with base 10, j=1,2,…,m, m represents the total number of all possible arrangement results.

[0065] In a possible implementation, the training method of the sparse reconstruction algorithm specifically includes:

[0066] Introduce regularization terms and sparse penalty terms to construct the objective function of the sparse reconstruction algorithm:

[0067]

[0068] Among them, F() represents the objective function, θ represents the sparse reconstruction parameter set, and x represents the original data. represents the reconstructed data, || || represents the two-norm operation, λ1 represents the weight coefficient of the reconstruction bias term when constructing the objective function, Z() represents the regularization function, W represents the weight matrix, W={W e ,W d}, λ2 represents the weight coefficient of the regularization term, S() represents the sparse penalty function, f() represents the sparse feature function, f(x) represents the sparse feature representation of the original data, and λ3 represents the weight coefficient of the sparse penalty term.

[0069] Among them, those skilled in the art can set the weight coefficient λ1 of the reconstruction deviation term, the weight coefficient λ2 of the regularization term, and the weight coefficient λ3 of the sparse penalty term when constructing the objective function according to actual conditions, and the present invention does not limit this.

[0070] It should be noted that the introduction of regularization terms can effectively control the complexity of the model and avoid overfitting during the training process. Regularization terms usually penalize the weight matrix, making the model more inclined to learn simple and general features rather than over-relying on noise or anomalies in the training data.

[0071] Furthermore, the sparse penalty function penalizes sparse features, encouraging the model to learn a sparser feature representation, which helps to extract key features in the data, reduce redundant information, and improve the generalization and anti-interference capabilities of the model. Through the sparse penalty term, the model tends to learn sparse features with only a small number of non-zero elements, which can help identify the most important features in the data, reduce the dimension of the data, and thus reduce the computational complexity and storage requirements.

[0072] In actual application, the features in the original data are divided into multiple groups according to certain rules or feature attributes, and the features in each group have some commonality or correlation. For sparse features, the purpose of grouping is to better utilize the correlation between features, thereby improving the performance and generalization ability of the model.

[0073] Optionally, the sparse penalty function is specifically:

[0074]

[0075] Among them, f k (x) represents the kth group of features in the sparse feature representation of the original data, p k It represents the number of features in the kth group of features, k = 1, 2…, K, and K represents the total number of feature groups.

[0076] In the present invention, the form of this sparse penalty function combines the grouping sparsity of the feature group and the feature quantity penalty, and has flexibility, multi-dimensional feature selection capabilities and the suppression of overfitting. By introducing this penalty function, it is helpful to train a more sparse and representative feature representation, improve the generalization ability and interpretability of the model, and reduce the complexity of the model and the risk of overfitting.

[0077] Of course, the sparse penalty function may also be in other forms, such as L1 norm penalty function, L2 norm penalty function, Elastic Net function, SCAD function, etc. The present invention does not limit the specific form of the sparse penalty function.

[0078] Taking minimizing the objective function of the sparse reconstruction algorithm as the goal, the optimal sparse reconstruction parameter set is determined and the sparse reconstruction algorithm is trained.

[0079] Specifically, the objective function of the sparse reconstruction algorithm can be minimized, and the sparse reconstruction parameters can be searched through an improved sparrow search algorithm to determine the optimal sparse reconstruction parameter set to complete the training of the sparse reconstruction algorithm.

[0080] S3: When the anomaly score of the network transmission data is greater than a preset anomaly score, the anomaly category of the network transmission data is determined based on a K-nearest neighbor algorithm.

[0081] Reference Manual Attached Figure 4 , which shows a flow chart of an abnormal category identification method provided by an embodiment of the present invention.

[0082] In a possible implementation, determining the abnormal category of network transmission data based on the K nearest neighbor algorithm in S3 specifically includes sub-steps S301 to S305:

[0083] S301: Calculate the distance between the feature vector of the network transmission data and the feature vector of each data sample in the database:

[0084]

[0085] Among them, D i represents the distance between the feature vector of the current network transmission data and the feature vector of the i-th network transmission data in the database, x represents the current network transmission data, f represents the sparse feature representation of the current network transmission data, l represents the flow disturbance value of the current network transmission data, τ represents the delay disturbance value of the current network transmission data, d represents the bandwidth disturbance value of the current network transmission data, x i represents the i-th data sample, f i represents the sparse feature representation of the i-th data sample, l i represents the flow disturbance value of the i-th data sample, τ i represents the delay disturbance value of the i-th data sample, d i represents the bandwidth disturbance value of the i-th data sample, η1 represents the weight coefficient of sparse coding, η2 represents the weight coefficient of traffic disturbance value, η3 represents the weight coefficient of delay disturbance value, and η4 represents the weight coefficient of bandwidth disturbance value.

[0086] Among them, technical personnel in this field can set the size of the sparse coding weight coefficient η1, the traffic disturbance value weight coefficient η2, the delay disturbance value weight coefficient η3 and the bandwidth disturbance value weight coefficient η4 according to actual conditions, and the present invention does not limit this.

[0087] It should be noted that by calculating the distance between the feature vector of the network transmission data and the sample in the database, the similarity or difference between the current data and the data sample in the database can be determined. This distance calculation method can be used for anomaly detection. When the distance between the data and the normal data is large, it may indicate that the data belongs to the abnormal category.

[0088] Furthermore, multiple features such as sparse features, traffic disturbance values, delay disturbance values, and bandwidth disturbance values ​​are considered. By calculating their distances, the contribution of these features to anomaly detection can be comprehensively considered.

[0089] Optionally, the flow disturbance value is calculated as follows:

[0090] l=l max -l min

[0091] Among them, l represents the traffic disturbance value of the current network transmission data, l max Indicates the maximum transmission flow of the current network transmission data, l min Indicates the minimum transmission flow in the current network transmission data.

[0092] It should be noted that the traffic disturbance value can describe the degree of change in the network transmission data flow. When the traffic disturbance value is large, it means that the network transmission data has a large fluctuation in transmission flow, which may be an indication of abnormal behavior. The traffic disturbance value can be used as an indicator for anomaly detection. Abnormal network transmission data may cause large fluctuations in traffic, so by observing the changes in the traffic disturbance value, it can be determined whether the data is abnormal.

[0093] Optionally, the delay disturbance value is calculated as follows:

[0094] τ=τ max -τ min

[0095] Among them, τ represents the delay disturbance value of the current network transmission data, τ max Indicates the maximum delay in the current network transmission data, τ min Indicates the minimum delay in current network transmission data.

[0096] It should be noted that the delay disturbance value can describe the degree of change in the network transmission data delay. When the delay disturbance value is large, it means that the network transmission data has a large fluctuation in transmission delay, which may be an indication of abnormal behavior. The delay disturbance value can be used as an indicator for anomaly detection. Abnormal network transmission data may cause large fluctuations in delay, so by observing the changes in the delay disturbance value, it can be determined whether the data is abnormal.

[0097] Optionally, the bandwidth disturbance value is calculated as follows:

[0098] d=d max -d min

[0099] Among them, τ represents the bandwidth disturbance value of the current network transmission data, τ max Indicates the maximum bandwidth of the current network transmission data, τ min Indicates the minimum bandwidth of current network transmission data.

[0100] It should be noted that the bandwidth perturbation value can describe the degree of change in the bandwidth of network transmission data. When the bandwidth perturbation value is large, it means that the network transmission data has a large fluctuation in bandwidth, which may be an indication of abnormal behavior. The bandwidth perturbation value can be used as an indicator for anomaly detection. Abnormal network transmission data may cause large fluctuations in bandwidth, so by observing the changes in the bandwidth perturbation value, it can be determined whether the data is abnormal.

[0101] S302: Arrange the data samples in the database in descending order according to the distance from the current network transmission data.

[0102] S303: Select K data samples with the highest ranking as K nearest neighbors of the current network transmission data.

[0103] S304: Count the probabilities that the K nearest neighbors belong to each abnormal category.

[0104] It should be noted that by counting the probabilities of the K nearest neighbors belonging to each anomaly category, we can better understand the probability distribution of the current data belonging to different anomaly categories, which helps to more accurately identify and classify anomaly categories.

[0105] S305: Taking the abnormal category with the highest probability as the category to which the current network transmission data belongs.

[0106] In the present invention, the anomaly detection and classification method based on the K-nearest neighbor algorithm combines distance calculation, statistical probability and flexible parameter adjustment, which can effectively identify and classify abnormal behaviors of network transmission data, and improve the accuracy and applicability of detection.

[0107] In a possible implementation, the training method of the K nearest neighbor algorithm specifically includes:

[0108] Construct the loss function for the K-nearest neighbor algorithm.

[0109] Specifically, the loss function may adopt one or more of a cross entropy loss function, a mean square error loss function, and a logarithmic loss function.

[0110] A sample data set is obtained, where the sample data set includes multiple training samples, and each training sample includes a feature vector.

[0111] Each training sample is classified using the K nearest neighbor algorithm.

[0112] With the goal of minimizing the function value of the loss function, the parameters of the K nearest neighbor algorithm are searched through the improved sparrow search algorithm, and the optimal parameter set of the K nearest neighbor algorithm is determined to complete the training of the K nearest neighbor algorithm.

[0113] Among them, the parameters of the K nearest neighbor algorithm include: the number of neighbors K, the weight coefficient η1 of sparse coding, the weight coefficient η2 of traffic disturbance value, the weight coefficient η3 of delay disturbance value, and the weight coefficient η4 of bandwidth disturbance value.

[0114] In a possible implementation, the objective is to minimize the function value of the loss function, and the parameters of the K nearest neighbor algorithm are searched by an improved sparrow search algorithm to determine the optimal parameter set of the K nearest neighbor algorithm, specifically including:

[0115] Initialize the sparrow population, which contains multiple individuals, each of which represents a feasible parameter set.

[0116] The inverse of the loss function is used as the fitness function of the improved sparrow search algorithm:

[0117]

[0118] Among them, δ() represents the fitness function, L() represents the loss function, and θ* represents the parameter set of the K nearest neighbor algorithm.

[0119] Individuals in a sparrow population were classified into finders, followers, and anti-predators.

[0120] It should be noted that by dividing the sparrow individuals into discoverers, followers, and anti-predators, the algorithm can perform global search and local search at the same time. During the iteration process, the discoverer calculates the distance with other sparrow individuals to find the optimal neighbor individuals with higher fitness values, thereby promoting global search. Followers and anti-predators search in local areas, which helps to converge to the local optimal solution faster.

[0121] Calculate the distance between the current discoverer and other sparrow individuals:

[0122] D j =||XX j ||2

[0123] Among them, D j represents the distance between the current discoverer and the jth sparrow individual, X represents the parameter set represented by the current discoverer, and X jrepresents the parameter set represented by the j-th sparrow individual, and || ||2 represents the binary norm calculation.

[0124] The sparrow individual with the highest fitness value among the sparrow individuals whose distance to the current discoverer is less than the preset distance is taken as the optimal neighbor individual.

[0125] At each iteration, the finder's position is updated according to the following formula:

[0126]

[0127] in, represents the position of the i-th discoverer at the t+1th iteration, represents the position of the i-th individual at the t-th iteration, exp() represents the exponential function with the natural constant e as the base, i represents the index value of the individual, r1 represents a random number between 0 and 1, T represents the maximum number of iterations, R2 represents the alarm value, ST represents the safety threshold, w represents the adaptive weight factor, and f b represents the fitness of the current global optimal individual, R represents a random number in the interval 0 to 1 that obeys a normal distribution, and I represents the unit column matrix.

[0128] Among them, the innovative introduction of the adaptive weight factor w can be dynamically adjusted during the iteration process, making the change of the step size more flexible. When R2<ST, w·r1·f b The role of is to explore around the current position.

[0129] It should be noted that the introduction of adaptive weight factors can make the search process more diverse and global, helping to avoid falling into the local optimal solution. The adjustment of the adaptive weight factor can balance the algorithm between exploring and utilizing the current optimal solution, avoiding falling into the local optimal solution in the early stage.

[0130] As the traditional sparrow search algorithm is easy to fall into the local optimal solution, mutation processing is introduced to the sparrow individuals.

[0131] Generate a random number and compare it with the mutation probability. If the random number is smaller than the mutation probability, update the position of the discoverer twice:

[0132]

[0133] Wherein, r2 represents a random number between 0 and 1.

[0134] In the present invention, by introducing mutation processing, the algorithm can have more randomness in the search process, thereby increasing the diversity of the search, helping to avoid the algorithm from falling into the local optimal solution, and improving the algorithm's global search ability. Mutation processing can prompt the algorithm to conduct a wider exploration in the search space, try to jump out of the limitations of the local optimal solution, and help find a better solution. This can increase the possibility of the algorithm finding the global optimal solution.

[0135] Optionally, the mutation probability is specifically:

[0136]

[0137] Among them, P t represents the mutation probability at the tth iteration, P0 represents the initial mutation probability, PT represents the termination mutation probability, and e represents the natural constant.

[0138] It should be noted that the lower mutation probability at the beginning helps the algorithm to make more use of the solution space near the current optimal solution and perform local optimization, thereby accelerating convergence. As the number of iterations increases, the mutation probability increases, which helps the algorithm gradually jump out of the local optimal solution and conduct more extensive exploration, balancing the relationship between exploration and utilization. In the early stage, more attention can be paid to exploring the breadth of the search space, and in the later stage, more attention can be paid to the depth of the search space, which helps to search the solution space more comprehensively.

[0139] In the present invention, the introduction of a mutation probability mechanism that changes with the number of iterations helps the algorithm to gradually adjust the exploration strategy during the search process, balance exploration and utilization, increase diversity, and adaptively adjust the search strategy, thereby improving the global search capability and robustness of the algorithm.

[0140] Update the follower's position according to the following formula:

[0141]

[0142] in, represents the position of the i-th follower at the t+1th iteration, represents the global worst position at the tth iteration, A represents the optimal position of the discoverer at the t+1th iteration. + =A T (AA T ) -1 , A represents a random row matrix, the elements in A are 1 or -1, and m represents the total number of individuals in the population.

[0143] Update the position of the anti-predator according to the following formula:

[0144]

[0145] in, represents the position of the i-th anti-predator at the t+1th iteration, represents the global optimal position at the tth iteration, τ represents the step size control parameter, R3 represents a random number between -1 and 1, and f i represents the fitness of the current individual, f g represents the fitness of the individual in the optimal position, f w represents the fitness of the individual in the worst position, and ε represents a hyperparameter that avoids the denominator being 0.

[0146] When the number of iterations reaches the maximum number of iterations, the individual with the highest current fitness is output, and the parameter set represented by the individual with the highest fitness is taken as the optimal parameter set and output.

[0147] In the present invention, the optimal parameter set of the K nearest neighbor algorithm can be effectively determined by using the improved sparrow search algorithm. The algorithm has strong global search capability, adaptability and diversity maintenance characteristics, and can achieve good optimization effects in different problem scenarios.

[0148] S4: Perform corresponding bypass blocking according to the abnormal category of network transmission data.

[0149] Specifically, bypass blocking specifically refers to connecting a blocking device to a switch in a bypass form, and the blocking device is specifically used to shield IP addresses and ports, shield specified domain names and URLs, and / or shield specified TCP packets.

[0150] In a possible implementation, S4 specifically includes sub-steps S401 and S402:

[0151] S401: Determine the IP address, port range, domain name, URL and / or TCP message that needs to be blocked according to the abnormality category.

[0152] Specifically, static rules combined with dynamic modulation strategies can be used for bypass blocking. On the one hand, it can be set according to known attack patterns and abnormal behaviors, and pre-defined. When the corresponding abnormal category is detected, the system will block it according to the rules. For example, for a specific abnormal category, the malicious IP address or IP address segment that needs to be blocked is set in advance. The port range that needs to be blocked is set according to the abnormal category to block access to specific ports. On the other hand, dynamic adjustments can be made based on real-time abnormal detection results, which can respond to different types of abnormal behaviors more flexibly and in real time, and improve the system's ability to respond to abnormal situations. For example, the anomaly detection algorithm detects that a certain IP address is performing abnormal behavior, adds the IP address to the blocking list, and temporarily blocks the access of the IP. It detects that the port range corresponding to the abnormal category is attacked, and temporarily blocks the access of these port ranges. When abnormal behavior is detected in certain domain names or URLs, these domain names or URLs can be immediately added to the blocking list to block access to them. When abnormal TCP message types or contents are detected, these messages are immediately blocked.

[0153] S402: Shielding the determined IP address, port range, domain name, URL and / or TCP message by blocking the device.

[0154] In the present invention, the IP address, port range, domain name, URL and / or TCP message that needs to be blocked is determined in an automated manner according to the abnormal category, so that the network abnormality can be responded to quickly and timely. No manual intervention is required, which can reduce the response time and improve the real-time performance and efficiency of the system. The target that needs to be blocked can be accurately determined according to the abnormal category, thereby preventing the spread of malicious attacks. The source of abnormal data and related information can be blocked in a timely manner to curb the spread of attack behaviors and protect network security. Corresponding bypass blocking based on the abnormal category of network transmission data can automatically respond to network abnormalities, prevent the spread of malicious attacks, protect system and data security, and improve network reliability. It also has flexibility and accuracy to effectively respond to various network security threats.

[0155] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0156] In the present invention, based on the sparse reconstruction algorithm, the abnormal score of the network transmission data is determined. When the abnormal score of the network transmission data is greater than the preset abnormal score, based on the K nearest neighbor algorithm, the abnormal category of the network transmission data is accurately determined, which can be competent for network abnormal behavior detection in any scenario, adapt to the evolution of security threats, and improve the adaptability and expansibility of network abnormal behavior analysis. The sparse reconstruction algorithm is combined with the K nearest neighbor algorithm. Only when the abnormal score of the network transmission data is greater than the preset abnormal score will the abnormal identification be further performed, which can save computing resources, and the abnormal category identification by the K nearest neighbor algorithm can quickly and accurately identify abnormal behavior and improve the accuracy of abnormal behavior detection. Once the abnormal category of the network transmission data is determined, the system can automatically perform corresponding bypass blocking according to the preset rules. This automated response capability enables the system to quickly and effectively respond to abnormal situations, reduces the need for manual intervention, and improves safety and efficiency. Compared with the traditional rule-based detection method, the bypass blocking system combining the sparse reconstruction algorithm and the K nearest neighbor algorithm can provide more multi-level and multi-dimensional network security protection, and has better comprehensiveness and accuracy when capturing and processing network anomalies.

[0157] Reference Manual Attached Figure 5 , showing a structural schematic diagram of an attack bypass blocking system based on network abnormal behavior analysis provided by the present invention.

[0158] The present invention also provides an attack bypass blocking system 20 based on network abnormal behavior analysis, which is applied to the above-mentioned attack bypass blocking method based on network abnormal behavior analysis, and comprises:

[0159] Processor 201.

[0160] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201, the attack bypass blocking method based on network abnormal behavior analysis as in the method embodiment is implemented.

[0161] The attack bypass blocking system 20 based on network abnormal behavior analysis provided by the present invention can execute the above-mentioned attack bypass blocking method based on network abnormal behavior analysis and achieve the same or similar technical effects. To avoid repetition, the present invention will not go into details.

[0162] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0163] In the present invention, based on the sparse reconstruction algorithm, the abnormal score of the network transmission data is determined. When the abnormal score of the network transmission data is greater than the preset abnormal score, based on the K nearest neighbor algorithm, the abnormal category of the network transmission data is accurately determined, which can be competent for network abnormal behavior detection in any scenario, adapt to the evolution of security threats, and improve the adaptability and expansibility of network abnormal behavior analysis. The sparse reconstruction algorithm is combined with the K nearest neighbor algorithm. Only when the abnormal score of the network transmission data is greater than the preset abnormal score will the abnormal identification be further performed, which can save computing resources, and the abnormal category identification by the K nearest neighbor algorithm can quickly and accurately identify abnormal behavior and improve the accuracy of abnormal behavior detection. Once the abnormal category of the network transmission data is determined, the system can automatically perform corresponding bypass blocking according to the preset rules. This automated response capability enables the system to quickly and effectively respond to abnormal situations, reduces the need for manual intervention, and improves safety and efficiency. Compared with the traditional rule-based detection method, the bypass blocking system combining the sparse reconstruction algorithm and the K nearest neighbor algorithm can provide more multi-level and multi-dimensional network security protection, and has better comprehensiveness and accuracy when capturing and processing network anomalies.

[0164] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be 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 the processor may also be any conventional processor, etc.

[0165] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0166] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0167] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0168] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0169] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0170] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0172] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0174] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0175] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc., various media that can store program codes.

[0176] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, an attack bypass blocking method based on network abnormal behavior analysis as described in the method embodiment is implemented.

[0177] A computer-readable storage medium provided by the present invention can implement the steps and effects of the attack bypass blocking method based on network abnormal behavior analysis of the above method embodiment. To avoid repetition, the present invention will not go into details.

[0178] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0179] In the present invention, based on the sparse reconstruction algorithm, the abnormal score of the network transmission data is determined. When the abnormal score of the network transmission data is greater than the preset abnormal score, based on the K nearest neighbor algorithm, the abnormal category of the network transmission data is accurately determined, which can be competent for network abnormal behavior detection in any scenario, adapt to the evolution of security threats, and improve the adaptability and expansibility of network abnormal behavior analysis. The sparse reconstruction algorithm is combined with the K nearest neighbor algorithm. Only when the abnormal score of the network transmission data is greater than the preset abnormal score will further abnormal identification be performed, which can save computing resources, and the abnormal category identification by the K nearest neighbor algorithm can quickly and accurately identify abnormal behavior and improve the accuracy of abnormal behavior detection. Once the abnormal category of the network transmission data is determined, the system can automatically perform corresponding bypass blocking according to the preset rules. This automated response capability enables the system to respond to abnormal situations quickly and effectively, reduces the need for manual intervention, and improves safety and efficiency. Compared with the traditional rule-based detection method, the bypass blocking system combining the sparse reconstruction algorithm and the K nearest neighbor algorithm can provide more multi-level and multi-dimensional network security protection, and has better comprehensiveness and accuracy when capturing and processing network anomalies.

[0180] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0181] There are a few points to note:

[0182] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention, and other structures may refer to the general design.

[0183] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of the layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.

[0184] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.

[0185] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An attack bypass blocking method based on network abnormal behavior analysis, characterized in that: include: S1: Obtain network transmission data; S2: Determine an abnormality score of the network transmission data based on a sparse reconstruction algorithm; S3: When the anomaly score of the network transmission data is greater than a preset anomaly score, determining an anomaly category of the network transmission data based on a K-nearest neighbor algorithm; S4: performing corresponding bypass blocking according to the abnormal category of the network transmission data; Wherein, the S2 specifically includes: S201: Perform sparse coding on the data transmitted by each network through the autoencoder: h=σ(W e x+b e ) Among them, h represents the hidden layer output, h also represents sparse coding, σ() represents the nonlinear activation function, and W e represents the weight matrix from the input layer to the hidden layer, x represents the original data, b e Represents the bias component from the input layer to the hidden layer; S202: According to the hidden layer output, each transaction data point is decoded and reconstructed by the self-decoder: in, Represents the reconstructed data, W d represents the weight matrix from the hidden layer to the output layer, b d Represents the bias component from the hidden layer to the output layer; S203: Determine an abnormality score of the network transmission data according to a difference between the reconstructed data and the original data; Wherein, the S203 is specifically: The anomaly score of network transmission data is calculated according to the following formula: Among them, S represents the anomaly score, H x represents the permutation entropy of the original data, represents the permutation entropy of the reconstructed data, β represents the weight coefficient of the permutation entropy term, x represents the original data, represents the reconstructed data, || || represents the two-norm operation, and (1-β) represents the weight coefficient of the reconstruction deviation term when calculating the anomaly score.

2. The attack bypass blocking method based on network abnormal behavior analysis according to claim 1 is characterized in that: The training method of the sparse reconstruction algorithm specifically includes: Introduce regularization terms and sparse penalty terms to construct the objective function of the sparse reconstruction algorithm: Among them, F() represents the objective function, θ represents the sparse reconstruction parameter set, and x represents the original data. represents the reconstructed data, || || represents the two-norm operation, λ1 represents the weight coefficient of the reconstruction bias term when constructing the objective function, Z() represents the regularization function, W represents the weight matrix, W={W e ,W d }, λ2 represents the weight coefficient of the regularization term, S() represents the sparse penalty function, f() represents the sparse feature function, f(x) represents the sparse feature representation of the original data, and λ3 represents the weight coefficient of the sparse penalty term; Taking minimizing the objective function of the sparse reconstruction algorithm as the goal, the optimal sparse reconstruction parameter set is determined and the sparse reconstruction algorithm is trained.

3. According to claim 1, the attack bypass blocking method based on network abnormal behavior analysis is characterized in that: Determining the abnormal category of the network transmission data based on the K nearest neighbor algorithm in S3 specifically includes: S301: Calculate the distance between the feature vector of the network transmission data and the feature vector of each data sample in the database: Among them, D i represents the distance between the feature vector of the current network transmission data and the feature vector of the i-th network transmission data in the database, x represents the current network transmission data, f represents the sparse feature representation of the current network transmission data, l represents the flow disturbance value of the current network transmission data, τ represents the delay disturbance value of the current network transmission data, d represents the bandwidth disturbance value of the current network transmission data, x i represents the i-th data sample, f i represents the sparse feature representation of the i-th data sample, l i represents the flow disturbance value of the i-th data sample, τ i represents the delay disturbance value of the i-th data sample, d i represents the bandwidth disturbance value of the i-th data sample, η1 represents the weight coefficient of sparse coding, η2 represents the weight coefficient of traffic disturbance value, η3 represents the weight coefficient of delay disturbance value, and η4 represents the weight coefficient of bandwidth disturbance value; S302: Arrange the data samples in the database in descending order according to the distance from the current network transmission data; S303: Select K data samples with the highest ranking as K nearest neighbors of the current network transmission data; S304: Count the probabilities of K nearest neighbors belonging to each abnormal category; S305: Taking the abnormal category with the highest probability as the category to which the current network transmission data belongs.

4. The attack bypass blocking method based on network abnormal behavior analysis according to claim 3 is characterized in that: The training method of the K nearest neighbor algorithm specifically includes: Construct the loss function of the K nearest neighbor algorithm; Acquire a sample data set, wherein the sample data set includes a plurality of training samples, and each training sample includes a feature vector; Classify each training sample using the K nearest neighbor algorithm; Taking the minimum function value of the loss function as the goal, the parameters of the K nearest neighbor algorithm are searched through the improved sparrow search algorithm to determine the optimal parameter set of the K nearest neighbor algorithm to complete the training of the K nearest neighbor algorithm; Among them, the parameters of the K nearest neighbor algorithm include: the number of neighbors K, the weight coefficient η1 of sparse coding, the weight coefficient η2 of traffic disturbance value, the weight coefficient η3 of delay disturbance value, and the weight coefficient η4 of bandwidth disturbance value.

5. The attack bypass blocking method based on network abnormal behavior analysis according to claim 1 is characterized in that: The bypass blocking specifically refers to connecting the blocking device to the switch in a bypass form, and the blocking device is specifically used to shield IP addresses and ports, shield specified domain names and URLs, and / or shield specified TCP messages.

6. The attack bypass blocking method based on network abnormal behavior analysis according to claim 5 is characterized in that: The S4 specifically includes: S401: Determine the IP address, port range, domain name, URL and / or TCP message to be blocked according to the abnormality category; S402: Shielding the determined IP address, port range, domain name, URL and / or TCP message by the blocking device.

7. An attack bypass blocking system based on network abnormal behavior analysis, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the attack bypass blocking method based on network abnormal behavior analysis as described in any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the attack bypass blocking method based on network abnormal behavior analysis as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for detecting and classifying all-network flow abnormity on line

    CN101848160A

  • Network anomaly detection method and system based on space-time convolutional network and topology awareness

    CN111669373A

  • Abnormality detection system and method for sterile filling production line

    CN112015153A

  • Distributed denial of service attack detection method based on MCA-KMeans algorithm in SDN

    CN114844679A

  • Aviation data bus intrusion detection method based on unsupervised learning

    CN116566639A