Zero-day attack detection method based on unsupervised learning and peacock courtship algorithm

Through the combination of unsupervised learning and peacock courting algorithm, an independent learning and optimization detection system was built, which solved the problems of relying on labeled data, low parameter optimization efficiency and insufficient adaptability in zero-day attack detection, and achieved efficient and accurate Unknown attack detection, adapt to changes in the network environment.

CN118944942APending Publication Date: 2024-11-12苏州信思科技有限公司
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411090056.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing zero-day attack detection methods rely on labeled data, and the parameter optimization efficiency is inefficient, it is difficult to take into account both detection efficiency and accuracy, and lack adaptability, so it is unable to effectively detect unknown attack patterns and adapt to changes in the network environment.

Method used

Adopting detection methods based on unsupervised learning and peacock courtship algorithm, by constructing unsupervised learning models and dynamic immune unsupervised learning models, combining peacock courtship algorithm to optimize parameters, adaptive learning and global search are realized, and the universality and flexibility of the detection system are improved. sex.

Benefits of technology

Significantly improve the detection accuracy and real-timeness of unknown zero-day attacks, optimize the parameters of unsupervised learning model, enhance the robustness and detection performance of the system, and can efficiently identify and detect unknown attacks without labeled data, adapt to Network traffic changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944942A_ABST
    Figure CN118944942A_ABST
Patent Text Reader

Abstract

The invention discloses a zero-day attack detection method based on unsupervised learning and a peacock courtship algorithm. The method comprises the following steps: S1, constructing a network traffic data set; s2, preprocessing the collected network flow data set; s3, constructing an unsupervised learning model by using the preprocessed network traffic data set; s4, applying the peacock courtship algorithm to the unsupervised learning model, and performing global search and optimization on parameters of the unsupervised learning model; s5, deploying the optimized unsupervised learning model into an actual network environment; s6, according to an output result of the unsupervised learning model, identifying a potential zero-day attack behavior; and S7, retraining and optimizing the unsupervised learning model regularly. According to the method, the unsupervised learning model is constructed to perform anomaly detection, and the peacock courtship algorithm is utilized to optimize the parameters of the unsupervised learning model, so that the universality and flexibility of the detection system are improved, and accurate detection and real-time early warning of potential zero-day attacks are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of zero-day attack detection, and in particular to a zero-day attack detection method based on unsupervised learning and a peacock courtship algorithm. Background Art

[0002] In today's information age, network security issues are becoming increasingly severe. Zero-day attacks, as the most threatening type of attack, are highly concealed and destructive because they exploit vulnerabilities that have not yet been made public or patched, and have become a major challenge in the field of network security. Traditional attack detection methods mostly rely on supervised learning, which requires a large amount of labeled data for unsupervised learning model training. For unknown attack modes, traditional methods are difficult to effectively detect. In addition, the performance of unsupervised learning models for detection depends to a large extent on parameter settings. Traditional parameter optimization methods are often inefficient and it is difficult to find the optimal parameter combination within a reasonable time, resulting in unsatisfactory detection results.

[0003] Existing zero-day attack detection methods are mainly divided into feature-based detection and behavior-based detection. Feature-based detection methods rely on known attack features, such as feature strings, feature codes, etc., but this method cannot detect unknown attacks. Behavior-based detection methods detect by analyzing abnormalities in network traffic or system behavior, but they rely on manually set thresholds and rules, are prone to false positives, and have limited detection effects on unknown attacks. In addition, existing detection systems have deficiencies in parameter optimization and lack effective global optimization methods, making it difficult to balance detection efficiency and accuracy.

[0004] Unsupervised learning has become an important direction for solving the problem of zero-day attack detection because it does not rely on labeled data and can perform pattern recognition and anomaly detection through the structure and characteristics of the data itself. However, traditional unsupervised learning models also face some challenges in practical applications. First, the construction and training of unsupervised learning models require a lot of computing resources, and the setting of unsupervised learning model parameters has a great influence on the detection effect. How to effectively optimize the parameters of unsupervised learning models is a key issue. Secondly, when facing large-scale, high-dimensional network traffic data, existing unsupervised learning models are prone to fall into local optimal solutions, resulting in poor detection results.

[0005] In addition, existing zero-day attack detection methods also have certain limitations in anomaly detection and early warning. Most traditional methods rely on fixed thresholds and rules, which are difficult to adapt to the ever-changing network environment and diverse attack methods. The dynamic immune unsupervised learning model simulates the learning and memory mechanism of the biological immune system to achieve anomaly detection of network traffic data. It has adaptive learning capabilities and can continuously optimize its own detection strategy to improve detection results. However, how to effectively combine the dynamic immune unsupervised learning model with the unsupervised learning model to further improve the accuracy and real-time performance of detection is still a problem that needs to be solved.

[0006] In summary, the existing technologies in the field of zero-day attack detection have the following major defects: they rely on labeled data and cannot effectively detect unknown attack patterns; parameter optimization is inefficient and it is difficult to balance detection efficiency and accuracy; anomaly detection and early warning methods are single and lack adaptive capabilities. Summary of the invention

[0007] One purpose of the present invention is to propose a zero-day attack detection method based on unsupervised learning and peacock courtship algorithm. The present invention constructs an unsupervised learning model for anomaly detection, uses the peacock courtship algorithm to optimize the unsupervised learning model parameters, combines the dynamic immune unsupervised learning model for adaptive learning, improves the versatility and flexibility of the detection system, and realizes accurate detection and real-time warning of potential zero-day attacks.

[0008] A zero-day attack detection method based on unsupervised learning and peacock courtship algorithm according to an embodiment of the present invention includes the following steps:

[0009] S1. Construct a network traffic data set and extract multiple feature vectors to characterize the behavior characteristics of the network traffic data;

[0010] S2, preprocessing the collected network traffic data set, including noise removal, normalization and data transformation;

[0011] S3, using the preprocessed network traffic data set to build an unsupervised learning model, and train the unsupervised learning model through a self-organizing map network to identify abnormal patterns in network traffic;

[0012] S4. Apply the peacock courtship algorithm to the unsupervised learning model, perform global search and optimization on the parameters of the unsupervised learning model, and optimize the detection performance of the unsupervised learning model;

[0013] S5. Deploy the optimized unsupervised learning model to the actual network environment, monitor network traffic in real time, extract real-time traffic features and input them into the model for analysis;

[0014] S6. Based on the output of the unsupervised learning model, identify potential zero-day attack behaviors, issue warning signals in a timely manner when anomalies are detected, and generate attack reports;

[0015] S7. Regularly retrain and optimize the unsupervised learning model to ensure that the unsupervised learning model adapts to new network traffic patterns and attack methods.

[0016] Optionally, the S1 includes:

[0017] S11, collecting network traffic data, recording the timestamp, source IP address, destination IP address, source port, destination port, protocol type and packet length of each network traffic data packet;

[0018] S12. Construct an initial network traffic data set based on the collected network traffic data:

[0019] D={d1,d2,…,d n};

[0020] Among them, d i Represents the feature vector of the i-th data packet;

[0021] S13, extract multiple feature vectors X={x1,x2,…,x m}, each eigenvector x i Characterize the behavioral characteristics of network traffic data, including the average packet length L avg , the packet arrival rate R, the distribution of each protocol type P = {p1,p2,…,p k}, the distribution of source IP addresses and destination IP addresses src and IP dst ;

[0022] S14, vectorize the extracted feature vectors to generate the final network traffic feature data set:

[0023] X f ={x f1 ,x f2 ,…,x fm};

[0024] Among them, each feature vector x fi Contains a combination of all features used to characterize the behavioral characteristics of network traffic data.

[0025] Optionally, the S3 includes:

[0026] S31, the preprocessed network traffic feature dataset X f Perform segmentation to generate training data set X train and validation dataset Xval ;

[0027] S32. Build a dynamic immune unsupervised learning model to achieve preliminary classification and anomaly detection of network traffic data;

[0028] S33. Based on the output of the dynamic immune unsupervised learning model, an adaptive clustering tree model is constructed to hierarchically cluster and optimize the preliminary classification results;

[0029] S35, verify the data set X val Input the trained adaptive clustering tree model to evaluate the performance of the unsupervised learning model.

[0030] Optionally, the dynamic immune unsupervised learning model realizes abnormal detection of network traffic data by simulating the learning and memory mechanism of the biological immune system. The construction of the dynamic immune unsupervised learning model includes:

[0031] Initialize the immune cell library:

[0032] C={c1,c2,…,c k};

[0033] Among them, c i represents the i-th immune cell, which is used to detect abnormal patterns in network traffic, and its feature vector is v i , including various network traffic characteristics;

[0034] Define the fitness function f(c i ,x), used to measure immune cell c i The similarity with the input feature vector x:

[0035]

[0036] Among them, f(c i ,x) is a measure of immune cell c i The response strength to the input feature vector x, which represents a data packet or traffic segment, ∥v i -x∥ indicates immune cells v i The Euclidean distance between the input feature vector x and the input feature vector x. The smaller the distance, the higher the similarity and the more likely it is normal traffic. The larger the distance, the greater the possibility of abnormality.

[0037] The training data set X train Input into the immune cell library, for each input feature vector x, according to the fitness function f(c i ,x) Calculate the fitness value of each immune cell and select the immune cell c with the highest fitness value w As matching cells;

[0038] According to the matching cell c w The fitness value is learned and updated by memory:

[0039] When the fitness value is higher than the preset threshold θ, the information of x is fused to the matching cell c. w In the above example, update its feature vector v w :

[0040] v w =v w +η(xv w )+α1·exp(-β1·∥xv w ∥ 2 )·(xv w );

[0041] Among them, η is the learning rate, which controls the amplitude of the update, α1 and β1 are parameters that control information fusion, which adjust the intensity and range of the update, and x is the current input feature vector, which represents a data packet or traffic segment in the network traffic;

[0042] When the fitness value is lower than the threshold θ, a new immune cell c is generated. new And add the immune cell library, the new feature vector v new is x;

[0043] The immune cell library is periodically optimized, including removing low-fitness cells that have not been matched for a long time and clustering optimization of high-frequency matching cells, and finally the optimized immune cell library feature vector set V is obtained.

[0044] Optionally, an adaptive clustering tree model is constructed based on the immune cell library feature vector set V optimized by the dynamic immune unsupervised learning model:

[0045] In each dynamic immune cell node N i , calculate the feature vector set V output by the dynamic immune unsupervised learning model i The weighted centroid c i ′ :

[0046]

[0047] Among them, V i is the dynamic immune cell node N i The set of eigenvectors in , c i ′ is the dynamic immune cell node N i The weighted centroid of represents the typical flow characteristics of the center of the dynamic immune cell node, μ i ′ is the dynamic immune cell node N iThe average value of the eigenvectors in i ′ is the dynamic immune cell node N i The standard deviation of the eigenvectors in ;

[0048] Calculate all feature vectors and centroid c in the dynamic immune cell node i ′ The Mahalanobis distance d(v,c i ′ ):

[0049]

[0050] Among them, d(v,c i ′ ) is the characteristic vector v and the dynamic immune cell node centroid c i ′ The Mahalanobis distance between the feature vector and the center of the dynamic immune cell node is used to measure the discreteness of the feature vector and the dynamic immune cell node center. i ′ is the dynamic immune cell node N i The covariance matrix of represents the distribution of feature vectors in dynamic immune cell nodes;

[0051] If the maximum Mahalanobis distance d within a dynamic immune cell node max (N i ) is greater than the splitting threshold θ ′ , then the dynamic immune cell node is split and the covariance matrix S of all eigenvectors in the dynamic immune cell node is calculated i ′ :

[0052]

[0053] The covariance matrix S i ′ Perform eigenvalue decomposition, select the eigenvector corresponding to the maximum eigenvalue as the split direction, and assign the eigenvector to two child dynamic immune cell nodes N according to the split direction i ′ 1 and N i ′ 2:

[0054] N i ′ 1={v∈V i ∣(vc i ′ ) T v ′ 1≤τ ′};

[0055] N i′ 2={v∈V i ∣(vc i ′ ) T v ′ 1>τ ′};

[0056] Among them, v ′ 1 is the covariance matrix S i ′ The eigenvector corresponding to the maximum eigenvalue of indicates the splitting direction, τ ′ is the splitting threshold, which is used to determine the distribution of feature vectors;

[0057] Pair dynamic immune cell node N i ′ 1 and N i ′ 2 Repeat the above steps until the maximum depth d is reached. ′ max Or the number of feature vectors in the dynamic immune cell node is less than the minimum number of samples n ′ min .

[0058] Optionally, the S4 includes:

[0059] S41. Initialize the population of the peacock courtship algorithm and define the position vector of each peacock in the population:

[0060] P={p1,p2,…,p n};

[0061] Among them, p i represents the position vector of the i-th peacock, corresponding to the parameter combination of the unsupervised learning model;

[0062] S42, define the fitness function f(p i ), used to measure each peacock position vector p i The performance of the corresponding unsupervised learning model in zero-day attack detection. The fitness function combines the detection rate, false alarm rate, and detection delay, taking into account the accuracy, false alarm rate, and response speed of the unsupervised learning model:

[0063] f(p i )=α2·DR(p i )-β2·FAR(p i )-γ2·DL(p i );

[0064] Among them, DR (p i ) represents the detection rate, FAR(p i ) represents the false alarm rate, DL(p i) represents the detection delay, α2, β2 and γ2 are weight coefficients used to balance the importance of detection rate, false alarm rate and detection delay;

[0065] S43, sorting the population of the peacock courtship algorithm according to the fitness function value, and selecting the peacock with the highest fitness value as the leading peacock p best , the remaining peacocks are grouped according to their fitness values ​​to form several peacock groups;

[0066] S44. The unsupervised learning model is used to update the positions of the peacocks in each peacock group. The position update rules include:

[0067] According to the position of the dominant peacock best and the current peacock position p i To perform the suction operation:

[0068]

[0069] Among them, r1 is a random number, t is the number of iterations, and σ1 is a parameter that controls the range of attraction;

[0070] Perform repulsion operation based on the distance between peacocks:

[0071]

[0072] Among them, r2 is a random number, p j (t) is the position vector of other peacocks;

[0073] S45. Combining the characteristics of unsupervised learning, the peacock position vector is further optimized for domain characteristics. On the updated peacock position vector P(t+1), fine-tuning is performed according to the domain characteristics, so that the updated unsupervised learning model parameters can adapt to changes in network traffic and characteristics of zero-day attacks.

[0074] S46, perform fitness evaluation on the optimized peacock position vector P(t+1), and calculate the new fitness value f(p i (t+1)), and update the fitness value ranking in the population, select the new dominant peacock p best ;

[0075] S47, repeat steps S44 to S46 until the preset number of iterations is reached or the fitness function value converges, and finally obtain the optimized unsupervised learning model parameter combination P opt .

[0076] Optionally, the S45 includes:

[0077] S451, for each updated peacock position vector p i(t+1) Perform domain feature analysis and combine unsupervised learning models to calculate the fitness change of the peacock position vector in the current network traffic environment;

[0078] S452. Combined with the characteristics of the unsupervised learning model, determine the adjustment range and adjustment step of the domain feature, and define the domain feature adjustment function g(p i ,Δp), used to fine-tune the peacock position vector:

[0079]

[0080] Among them, p i represents the position vector of the peacock, represents the parameter combination of the unsupervised learning model, Δp represents the adjustment step size, and controls the amplitude of the position vector adjustment. represents the fitness function f(p i ) is used to guide the adjustment direction;

[0081] S453, calculate each peacock position vector f(p i ) And adjust the function g(p according to the characteristics of the domain i ,Δp) to obtain the adjusted peacock position vector p i ′ (t+1):

[0082]

[0083] Among them, p i ′ (t+1) represents the adjusted peacock position vector, p i (t+1) represents the peacock position vector before adjustment;

[0084] S454, the adjusted peacock position vector p i ′ (t+1) is input into the unsupervised learning model for performance evaluation and the adjusted fitness value f(p i ′ (t+1)), the fitness value is used to measure the detection performance of the unsupervised learning model under the current network traffic environment;

[0085] S455, compare the adjusted fitness value f(p i ′ (t+1)) and the fitness value before adjustment f(p i (t+1)):

[0086]

[0087] If the adjusted fitness value f(p i′ (t+1)) is higher than the fitness value f(p i (t+1)), then the adjusted peacock position vector p i ′ (t+1) is used as the new peacock position vector, otherwise the original peacock position vector remains unchanged.

[0088] Optionally, the S6 includes:

[0089] S61. Obtain the output results of the unsupervised learning model:

[0090] O={o1,o2,…,o n};

[0091] Among them, i Represents the detection result of the i-th network traffic data, including anomaly score and classification label;

[0092] S62, set the abnormal detection threshold θ1, when the output result o i When the anomaly score exceeds the threshold θ1, it is identified as a potential zero-day attack behavior;

[0093] S63. Perform cluster analysis on the identified potential zero-day attack behaviors based on the anomaly score and feature vector x. i Group abnormal traffic and identify group characteristics of similar attack behaviors;

[0094] S64. Generate an attack report based on the results of identification and cluster analysis. The report includes:

[0095] Attack time: records the timestamp when abnormal behavior is detected;

[0096] Attack source information: including source IP address and source port;

[0097] Attack features: including anomaly scores and feature vectors;

[0098] Attack type analysis: Based on the unsupervised learning model and cluster analysis results, infer the attack type and possible attack path;

[0099] S65. Convert key information in the attack report into an early warning signal and send it to the network administrator in real time. The early warning signal includes detailed information on abnormal traffic and recommended protective measures.

[0100] S66. Log all detected abnormal behaviors and establish an abnormal behavior database for reference in subsequent analysis and unsupervised learning model training. The log content includes detailed information, detection time and treatment measures for each abnormal behavior.

[0101] S67. Regularly analyze the abnormal behavior database, combine new network traffic data and detection results, and continuously optimize the parameters of the unsupervised learning model and the peacock courtship algorithm.

[0102] The beneficial effects of the present invention are:

[0103] The present invention solves the deficiencies of the prior art in the field of zero-day attack detection, such as reliance on labeled data, low efficiency of parameter optimization, and lack of adaptive capabilities. By combining unsupervised learning with the peacock courtship algorithm, a detection system capable of autonomous learning and optimization is constructed, which significantly improves the versatility and flexibility of the system. On the basis of the unsupervised learning model, the dynamic immune mechanism is used for adaptive learning, so that the system can efficiently identify and detect unknown zero-day attacks in the absence of labeled data. The introduction of the peacock courtship algorithm solves the problem of low efficiency of parameter optimization. Through global search and rapid convergence, the optimal configuration of the parameters of the unsupervised learning model is achieved, further improving the detection performance and accuracy. In addition, the combined application of domain feature optimization enables the unsupervised learning model to adapt to the dynamic changes of network traffic, improves the robustness and accuracy of detection, and provides an efficient and accurate solution to cope with the increasingly severe network security challenges, with broad application prospects and important practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0105] Figure 1 The present invention provides a flowchart of a zero-day attack detection method based on unsupervised learning and peacock courtship algorithm. DETAILED DESCRIPTION

[0106] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0107] refer to Figure 1 , a zero-day attack detection method based on unsupervised learning and peacock courtship algorithm, comprising the following steps:

[0108] S1. Construct a network traffic data set and extract multiple feature vectors to characterize the behavior characteristics of the network traffic data;

[0109] In this implementation, S1 includes:

[0110] S11, collecting network traffic data, recording the timestamp, source IP address, destination IP address, source port, destination port, protocol type and packet length of each network traffic data packet;

[0111] S12. Construct an initial network traffic data set based on the collected network traffic data:

[0112] D={d1,d2,…,d n};

[0113] Among them, d i Represents the feature vector of the i-th data packet;

[0114] S13, extract multiple feature vectors X={x1,x2,…,x m}, each eigenvector x i Characterize the behavioral characteristics of network traffic data, including the average packet length L avg , the packet arrival rate R, the distribution of each protocol type P = {p1,p2,…,p k}, the distribution of source IP addresses and destination IP addresses src and IP dst ;

[0115] S14, vectorize the extracted feature vectors to generate the final network traffic feature data set:

[0116] X f ={x f1 ,x f2 ,…,x fm};

[0117] Among them, each feature vector x fi Contains a combination of all features used to characterize the behavioral characteristics of network traffic data.

[0118] S2, preprocessing the collected network traffic data set, including noise removal, normalization and data transformation;

[0119] S3, using the preprocessed network traffic data set to build an unsupervised learning model, and train the unsupervised learning model through a self-organizing map network to identify abnormal patterns in network traffic;

[0120] In this implementation, S3 includes:

[0121] S31, the preprocessed network traffic feature dataset X f Perform segmentation to generate training data set X train and validation dataset X val ;

[0122] S32. Build a dynamic immune unsupervised learning model to achieve preliminary classification and anomaly detection of network traffic data;

[0123] S33. Based on the output of the dynamic immune unsupervised learning model, an adaptive clustering tree model is constructed to hierarchically cluster and optimize the preliminary classification results;

[0124] S35, verify the data set X val Input the trained adaptive clustering tree model to evaluate the performance of the unsupervised learning model.

[0125] In this embodiment, the dynamic immune unsupervised learning model realizes abnormal detection of network traffic data by simulating the learning and memory mechanism of the biological immune system. The construction of the dynamic immune unsupervised learning model includes:

[0126] Initialize the immune cell library:

[0127] C={c1,c2,…,c k};

[0128] Among them, c i represents the i-th immune cell, which is used to detect abnormal patterns in network traffic, and its feature vector is v i , including various network traffic characteristics;

[0129] Define the fitness function f(c i ,x), used to measure immune cell c i The similarity with the input feature vector x:

[0130]

[0131] Among them, f(c i ,x) is a measure of immune cell c i The response strength to the input feature vector x, which represents a data packet or traffic segment, ∥v i -x∥ indicates immune cells v i The Euclidean distance between the input feature vector x and the input feature vector x. The smaller the distance, the higher the similarity and the more likely it is normal traffic. The larger the distance, the greater the possibility of abnormality.

[0132] The training data set X train Input into the immune cell library, for each input feature vector x, according to the fitness function f(c i ,x) Calculate the fitness value of each immune cell and select the immune cell c with the highest fitness value w As matching cells;

[0133] According to the matching cell c wThe fitness value is learned and updated by memory:

[0134] When the fitness value is higher than the preset threshold θ, the information of x is fused to the matching cell c. w In the above example, update its feature vector v w :

[0135] v w =v w +η(xv w )+α1·exp(-β1·∥xv w ∥ 2 )·(xv w );

[0136] Among them, η is the learning rate, which controls the amplitude of the update, α1 and β1 are parameters that control information fusion, which adjust the intensity and range of the update, and x is the current input feature vector, which represents a data packet or traffic segment in the network traffic;

[0137] When the fitness value is lower than the threshold θ, a new immune cell c is generated. new And add the immune cell library, the new feature vector v new is x;

[0138] The immune cell library is periodically optimized, including removing low-fitness cells that have not been matched for a long time and clustering optimization of high-frequency matching cells, and finally the optimized immune cell library feature vector set V is obtained.

[0139] In this embodiment, an adaptive clustering tree model is constructed based on the immune cell library feature vector set V optimized by the dynamic immune unsupervised learning model:

[0140] In each dynamic immune cell node N i , calculate the feature vector set V output by the dynamic immune unsupervised learning model i The weighted centroid c i ′ :

[0141]

[0142] Among them, V i is the dynamic immune cell node N i The set of eigenvectors in , c i ′ is the dynamic immune cell node N i The weighted centroid of represents the typical flow characteristics of the center of the dynamic immune cell node, μ i ′ is the dynamic immune cell node N i The average value of the eigenvectors in i′ is the dynamic immune cell node N i The standard deviation of the eigenvectors in ;

[0143] Calculate all feature vectors and centroid c in the dynamic immune cell node i ′ The Mahalanobis distance d(v,c i ′ ):

[0144]

[0145] Among them, d(v,c i ′ ) is the characteristic vector v and the dynamic immune cell node centroid c i ′ The Mahalanobis distance between the feature vector and the center of the dynamic immune cell node is used to measure the discreteness of the feature vector and the dynamic immune cell node center. i ′ is the dynamic immune cell node N i The covariance matrix of represents the distribution of feature vectors in dynamic immune cell nodes;

[0146] If the maximum Mahalanobis distance d within a dynamic immune cell node max (N i ) is greater than the splitting threshold θ ′ , then the dynamic immune cell node is split and the covariance matrix S of all eigenvectors in the dynamic immune cell node is calculated i ′ :

[0147]

[0148] The covariance matrix S i ′ Perform eigenvalue decomposition, select the eigenvector corresponding to the maximum eigenvalue as the split direction, and assign the eigenvector to two child dynamic immune cell nodes N according to the split direction i ′ 1 and N i ′ 2:

[0149] N i ′ 1={v∈V i ∣(vc i ′ ) T v ′ 1≤τ ′};

[0150] N i ′ 2={v∈V i∣(vc i ′ ) T v ′ 1>τ ′};

[0151] Among them, v ′ 1 is the covariance matrix S i ′ The eigenvector corresponding to the maximum eigenvalue of indicates the splitting direction, τ ′ is the splitting threshold, which is used to determine the distribution of feature vectors;

[0152] Pair dynamic immune cell node N i ′ 1 and N i ′ 2 Repeat the above steps until the maximum depth d is reached. ′ max Or the number of feature vectors in the dynamic immune cell node is less than the minimum number of samples n ′ min .

[0153] This implementation adopts an unsupervised learning model, which does not rely on a large amount of labeled data. Through the self-organizing mapping network and the dynamic immune unsupervised learning model, the network traffic data is analyzed and pattern recognized in real time to automatically detect abnormal traffic characteristics. Using the dynamic immune mechanism, the unsupervised learning model can continuously learn and memorize new normal traffic patterns, enhancing the detection ability of new and unknown attacks. The adaptive learning mechanism enables the system to maintain high detection accuracy and flexibility in the face of changing network environments and diverse attack methods.

[0154] S4. Apply the peacock courtship algorithm to the unsupervised learning model, perform global search and optimization on the parameters of the unsupervised learning model, and optimize the detection performance of the unsupervised learning model;

[0155] In this implementation, S4 includes:

[0156] S41. Initialize the population of the peacock courtship algorithm and define the position vector of each peacock in the population:

[0157] P={p1,p2,…,p n};

[0158] Among them, p i represents the position vector of the i-th peacock, corresponding to the parameter combination of the unsupervised learning model;

[0159] S42, define the fitness function f(p i ), used to measure each peacock position vector p iThe performance of the corresponding unsupervised learning model in zero-day attack detection. The fitness function combines the detection rate, false alarm rate, and detection delay, taking into account the accuracy, false alarm rate, and response speed of the unsupervised learning model:

[0160] f(p i )=α2·DR(p i )-β2·FAR(p i )-γ2·DL(p i );

[0161] Among them, DR (p i ) represents the detection rate, FAR(p i ) represents the false alarm rate, DL(p i ) represents the detection delay, α2, β2 and γ2 are weight coefficients used to balance the importance of detection rate, false alarm rate and detection delay;

[0162] Define the detection rate DR(p i ), which represents the accuracy of the unsupervised learning model in detecting zero-day attacks:

[0163]

[0164] Among them, TP represents the number of true positive examples (i.e., actual zero-day attacks) that are correctly detected as positive examples, FN represents the number of true positive examples that are misclassified as negative examples, and the detection rate DR (p i ), the higher the value, the stronger the unsupervised learning model’s ability to detect zero-day attacks;

[0165] S422, define the false alarm rate FAR (p i ), which represents the false positives of the unsupervised learning model when detecting zero-day attacks:

[0166]

[0167] Among them, FP represents the number of true negative examples (i.e., zero-day attacks that do not actually exist) that are mistakenly identified as positive examples, TN represents the number of true negative examples that are correctly detected as negative examples, and the false alarm rate FAR (p i ) is lower, indicating that the unsupervised learning model has fewer false positives and better detection results;

[0168] S423, define the detection delay DL (p i ), which represents the time required for the unsupervised learning model to detect zero-day attacks from network traffic data input:

[0169]

[0170] Where N represents the total number of test samples, t iIt represents the time from the input of the i-th test sample to the output of the detection result, and the detection delay DL(p i ), the lower the unsupervised learning model is, the faster the response speed is.

[0171] S43, sorting the population of the peacock courtship algorithm according to the fitness function value, and selecting the peacock with the highest fitness value as the leading peacock p best , the remaining peacocks are grouped according to their fitness values ​​to form several peacock groups;

[0172] S44. The unsupervised learning model is used to update the positions of the peacocks in each peacock group. The position update rules include:

[0173] According to the position of the dominant peacock best and the current peacock position p i To perform the suction operation:

[0174]

[0175] Among them, r1 is a random number, t is the number of iterations, and σ1 is a parameter that controls the range of attraction;

[0176] Perform repulsion operation based on the distance between peacocks:

[0177]

[0178] Among them, r2 is a random number, p j (t) is the position vector of other peacocks;

[0179] S45. Combining the characteristics of unsupervised learning, the peacock position vector is further optimized for domain characteristics. On the updated peacock position vector P(t+1), fine-tuning is performed according to the domain characteristics, so that the updated unsupervised learning model parameters can adapt to changes in network traffic and characteristics of zero-day attacks.

[0180] S46, perform fitness evaluation on the optimized peacock position vector P(t+1), and calculate the new fitness value f(p i (t+1)), and update the fitness value ranking in the population, select the new dominant peacock p best ;

[0181] S47, repeat steps S44 to S46 until the preset number of iterations is reached or the fitness function value converges, and finally obtain the optimized unsupervised learning model parameter combination P opt .

[0182] In this implementation, S45 includes:

[0183] S451, for each updated peacock position vector pi (t+1) Perform domain feature analysis and combine unsupervised learning models to calculate the fitness change of the peacock position vector in the current network traffic environment;

[0184] S452. Combined with the characteristics of the unsupervised learning model, determine the adjustment range and adjustment step of the domain feature, and define the domain feature adjustment function g(p i ,Δp), used to fine-tune the peacock position vector:

[0185]

[0186] Among them, p i represents the position vector of the peacock, represents the parameter combination of the unsupervised learning model, Δp represents the adjustment step size, and controls the amplitude of the position vector adjustment. represents the fitness function f(p i ) is used to guide the adjustment direction;

[0187] S453, calculate each peacock position vector f(p i ) And adjust the function g(p according to the characteristics of the domain i ,Δp) to obtain the adjusted peacock position vector p i ′ (t+1):

[0188]

[0189] Among them, p i ′ (t+1) represents the adjusted peacock position vector, p i (t+1) represents the peacock position vector before adjustment;

[0190] S454, the adjusted peacock position vector p i ′ (t+1) is input into the unsupervised learning model for performance evaluation and the adjusted fitness value f(p i ′ (t+1)), the fitness value is used to measure the detection performance of the unsupervised learning model under the current network traffic environment;

[0191] S455, compare the adjusted fitness value f(p i ′ (t+1)) and the fitness value before adjustment f(p i (t+1)):

[0192]

[0193] If the adjusted fitness value f(pi ′ (t+1)) is higher than the fitness value f(p i (t+1)), then the adjusted peacock position vector p i ′ (t+1) is used as the new peacock position vector, otherwise the original peacock position vector remains unchanged.

[0194] This implementation introduces the peacock courtship algorithm to perform global search and optimization on the parameters of the unsupervised learning model. The peacock courtship algorithm simulates the peacock courtship behavior and has a strong global search capability and fast convergence capability, which effectively overcomes the shortcomings of traditional optimization algorithms in global search and convergence speed. Through multiple iterations and adaptive adjustments of the peacock courtship algorithm, the parameters of the unsupervised learning model can reach the optimal combination within a reasonable time, greatly improving the detection performance and efficiency of the unsupervised learning model.

[0195] In the optimization process, domain feature optimization is performed in combination with the characteristics of the unsupervised learning model. By calculating the fitness change of the peacock position vector in the current network traffic environment and fine-tuning it according to the fitness gradient, the optimized model parameters can better adapt to the dynamic changes of network traffic and the characteristics of zero-day attacks. Domain feature optimization not only improves the detection accuracy of the model, but also enhances the robustness of the model in complex network environments.

[0196] S5. Deploy the optimized unsupervised learning model to the actual network environment, monitor network traffic in real time, extract real-time traffic features and input them into the model for analysis;

[0197] S6. Based on the output of the unsupervised learning model, identify potential zero-day attack behaviors, issue warning signals in a timely manner when anomalies are detected, and generate attack reports;

[0198] In this implementation, S6 includes:

[0199] S61. Obtain the output results of the unsupervised learning model:

[0200] O={o1,o2,…,o n};

[0201] Among them, i Represents the detection result of the i-th network traffic data, including anomaly score and classification label;

[0202] S62, set the abnormal detection threshold θ1, when the output result o i When the anomaly score exceeds the threshold θ1, it is identified as a potential zero-day attack behavior;

[0203] S63. Perform cluster analysis on the identified potential zero-day attack behaviors based on the anomaly score and feature vector x. i Group abnormal traffic and identify group characteristics of similar attack behaviors;

[0204] S64. Generate an attack report based on the results of identification and cluster analysis. The report includes:

[0205] Attack time: records the timestamp when abnormal behavior is detected;

[0206] Attack source information: including source IP address and source port;

[0207] Attack features: including anomaly scores and feature vectors;

[0208] Attack type analysis: Based on the unsupervised learning model and cluster analysis results, infer the attack type and possible attack path;

[0209] S65. Convert key information in the attack report into an early warning signal and send it to the network administrator in real time. The early warning signal includes detailed information on abnormal traffic and recommended protective measures.

[0210] S66. Log all detected abnormal behaviors and establish an abnormal behavior database for reference in subsequent analysis and unsupervised learning model training. The log content includes detailed information, detection time and treatment measures for each abnormal behavior.

[0211] S67. Regularly analyze the abnormal behavior database, combine new network traffic data and detection results, and continuously optimize the parameters of the unsupervised learning model and the peacock courtship algorithm.

[0212] The system of this embodiment monitors network traffic in real time, uses the optimized unsupervised learning model for real-time detection, and generates attack reports based on the abnormal detection results. When a potential zero-day attack is detected, the system can issue a warning signal in a timely manner and provide a detailed attack report, including attack time, source information, feature description, and attack type analysis, ensuring that network administrators can quickly identify and respond to potential threats, take appropriate security protection measures, and reduce the risks and losses caused by attacks.

[0213] S7. Regularly retrain and optimize the unsupervised learning model to ensure that the unsupervised learning model adapts to new network traffic patterns and attack methods.

[0214] Embodiment 1:

[0215] Example 1 will verify the feasibility and effectiveness of the present invention. In a network security monitoring center of a large enterprise, network administrators are faced with a large amount of network traffic data every day. The enterprise's network environment is complex, including a variety of devices and systems, and the traffic data is huge and diverse. The enterprise's data center processes hundreds of millions of data packets every day, which may hide potential zero-day attack threats. Traditional supervised learning-based methods rely on a large amount of labeled data, but this method has limited detection effect on zero-day attacks and cannot identify and respond to new attacks in a timely manner.

[0216] In this scenario, we apply the method of the present invention to the enterprise network security monitoring system, and perform zero-day attack detection by combining the unsupervised learning model with the peacock courtship algorithm. The specific steps are as follows:

[0217] First, the enterprise's network traffic data is collected through dedicated equipment. The collected data includes basic information such as the timestamp, source IP address, destination IP address, source port, destination port, protocol type, and packet length of each data packet. Based on this information, we constructed an initial network traffic data set and extracted multiple feature vectors to characterize the behavioral characteristics of these traffic data, including the average packet length, packet arrival rate, distribution of each protocol type, and distribution of source IP addresses and destination IP addresses.

[0218] Then, the collected network traffic data is preprocessed, including noise removal, normalization and data transformation, to obtain a data set suitable for unsupervised learning model training. Using these preprocessed data sets, an unsupervised learning model is constructed, and the unsupervised learning model is trained through a self-organizing map network to identify abnormal patterns in network traffic. At the same time, the dynamic immune unsupervised learning model further improves the detection ability of abnormal traffic by simulating the learning and memory mechanism of the biological immune system.

[0219] In order to optimize the parameters of the unsupervised learning model, we introduced the Peacock Courtship Algorithm. The Peacock Courtship Algorithm performs global search and optimization of the parameters of the unsupervised learning model through steps such as initializing the population, defining the fitness function, performing position updates and fitness evaluation, ensuring that the unsupervised learning model reaches the optimal parameter combination within a reasonable time. Through this optimization process, the detection performance and efficiency of the unsupervised learning model are improved.

[0220] In actual application, we selected data from a certain day for detection. The following is a specific real case of zero-day attack detection:

[0221] Zero-day attack detection case 1:

[0222] On May 15, 2023, we found that during a certain period of time, the packet anomaly score of the host with the source IP address "192.168.1.150" continued to exceed the set threshold. Further analysis found that the source port and destination port distribution of this host were abnormal, especially the destination port was concentrated on port 8080 many times, and the packet length was longer than the common packet length. The system generated a detailed attack report, recording the following information:

[0223] Attack time: May 15, 2023 14:32;

[0224] Source IP address: 192.168.1.150

[0225] Source port: random;

[0226] Destination port: 8080

[0227] Protocol type: HTTP;

[0228] Data packet length: average 800 bytes;

[0229] Attack characteristics: frequent access to a single destination port, consistent packet length;

[0230] Attack type analysis: It is speculated to be an HTTP DDoS attack;

[0231] Based on the system's early warning signals, the network administrator quickly took protective measures, blocked the source IP address, and set a flow limit on access to destination port 8080, successfully avoiding potential attack threats.

[0232] Zero-day attack detection case 2:

[0233] On May 20, 2023, the system detected a host with a source IP address of "192.168.1.200" and a packet anomaly score of 95%. Further analysis showed that the host sent a large number of packets to multiple destination IP addresses in a short period of time, with a fixed source port of 4444 and a periodic change in packet length. The attack report recorded the following information:

[0234] Attack time: 10:17 on May 20, 2023;

[0235] Source IP address: 192.168.1.200

[0236] Source port: 4444;

[0237] Destination IP address: multiple;

[0238] Protocol type: TCP;

[0239] Data packet length: the change period is 500ms;

[0240] Attack characteristics: high-frequency attacks on multiple targets in a short period of time, and periodic changes in data packet length;

[0241] Attack type analysis: It is speculated to be botnet C&C communication;

[0242] Based on the early warning signal, the administrator immediately isolated the host where the source IP address was located, and conducted a deep scan and cleanup of the network. Multiple infected devices were discovered and processed, preventing the further spread of the botnet.

[0243] Zero-day attack detection case three:

[0244] On May 25, 2023, the system found that the host with source IP address "192.168.1.250" had a packet anomaly score of 98%, exceeding the set warning line. After in-depth analysis, it was found that the host sent a large number of UDP packets to the same destination IP address in different time periods. The packet length was very unstable and the frequency was very high. The attack report contains the following:

[0245] Attack time: 03:45 on May 25, 2023;

[0246] Source IP address: 192.168.1.250

[0247] Source port: random;

[0248] Destination IP address: 192.168.2.50

[0249] Protocol type: UDP;

[0250] Packet length: unstable, ranging from 100-1500 bytes;

[0251] Attack characteristics: high frequency and unstable length of UDP packets;

[0252] Attack type analysis: It is speculated to be a UDP Flood attack;

[0253] Based on the detailed attack report generated by the system, the administrator immediately restricted and monitored the source IP address, took measures to remove the malware, and successfully prevented the paralysis of network services.

[0254] To verify the effectiveness of the method of the present invention, we conducted several comparative experiments, using the method of the present invention and the traditional supervised learning-based method to detect the same network traffic data. The following are the specific data comparison results:

[0255] Time period: May 1, 2023 to May 31, 2023;

[0256] Location: Data center of a large enterprise;

[0257] Table 1 Data comparison between the present invention and traditional supervised learning method

[0258]

[0259] From the comparison data in Table 1 above, it can be seen that the method of the present invention is superior to the traditional supervised learning method in many aspects. Specifically:

[0260] The detection rate is significantly improved: Based on the unsupervised learning model, the method of the present invention is optimized through the peacock courtship algorithm, so that the detection rate is increased from 78.4% of the traditional method to 90.2%, which significantly enhances the recognition ability of zero-day attacks.

[0261] The false alarm rate is greatly reduced: Through dynamic immune mechanism and field feature optimization, the method of the present invention effectively reduces the false alarm rate from 5.2% of the traditional method to 2.5%, thereby improving the accuracy of detection.

[0262] Shortened detection delay: When the optimized unsupervised learning model processes network traffic, the detection delay is shortened from 15ms of the traditional method to 8ms, improving the real-time performance of the system.

[0263] Reduced optimization time: The efficient global optimization capability of the Peacock Courtship Algorithm reduces the optimization time of unsupervised learning model parameters from 120 minutes to 60 minutes, making the optimization process more efficient.

[0264] In summary, the method of the present invention has achieved a significant technical breakthrough in zero-day attack detection, solving the shortcomings of the prior art in terms of reliance on labeled data, inefficient parameter optimization, and lack of adaptive capabilities. Through the innovative combination of unsupervised learning models and peacock courtship algorithms, the method of the present invention has significant advantages in detection accuracy, efficiency, and real-time performance, providing an efficient and reliable solution to complex and ever-changing network security challenges.

[0265] The present invention solves the deficiencies of the prior art in the field of zero-day attack detection, such as reliance on labeled data, low efficiency of parameter optimization, and lack of adaptive capabilities. By combining unsupervised learning with the peacock courtship algorithm, a detection system capable of autonomous learning and optimization is constructed, which significantly improves the versatility and flexibility of the system. On the basis of the unsupervised learning model, the dynamic immune mechanism is used for adaptive learning, so that the system can efficiently identify and detect unknown zero-day attacks in the absence of labeled data. The introduction of the peacock courtship algorithm solves the problem of low efficiency of parameter optimization. Through global search and rapid convergence, the optimal configuration of the parameters of the unsupervised learning model is achieved, further improving the detection performance and accuracy. In addition, the combined application of domain feature optimization enables the unsupervised learning model to adapt to the dynamic changes of network traffic, improves the robustness and accuracy of detection, and provides an efficient and accurate solution to cope with the increasingly severe network security challenges, with broad application prospects and important practical value.

[0266] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A zero-day attack detection method based on unsupervised learning and peacock courtship algorithm, characterized in that: The steps include: S1. Construct a network traffic data set and extract multiple feature vectors to characterize the behavior characteristics of the network traffic data; S2, preprocessing the collected network traffic data set, including noise removal, normalization and data transformation; S3, using the preprocessed network traffic data set to build an unsupervised learning model, and train the unsupervised learning model through a self-organizing map network to identify abnormal patterns in network traffic; S4. Apply the peacock courtship algorithm to the unsupervised learning model, perform global search and optimization on the parameters of the unsupervised learning model, and optimize the detection performance of the unsupervised learning model; S5. Deploy the optimized unsupervised learning model to the actual network environment, monitor network traffic in real time, extract real-time traffic features and input them into the model for analysis; S6. Based on the output of the unsupervised learning model, identify potential zero-day attack behaviors, issue warning signals in a timely manner when anomalies are detected, and generate attack reports; S7. Regularly retrain and optimize the unsupervised learning model to ensure that the unsupervised learning model adapts to new network traffic patterns and attack methods.

2. According to claim 1, a zero-day attack detection method based on unsupervised learning and peacock courtship algorithm is characterized in that: The S1 includes: S11, collecting network traffic data, recording the timestamp, source IP address, destination IP address, source port, destination port, protocol type and packet length of each network traffic data packet; S12. Construct an initial network traffic data set based on the collected network traffic data: D={d1,d2,…,d n }; Among them, d i Represents the feature vector of the i-th data packet; S13, extract multiple feature vectors X={x1,x2,…,x m }, each eigenvector x i Characterize the behavioral characteristics of network traffic data, including the average packet length L avg , the packet arrival rate R, the distribution of each protocol type P = {p1,p2,…,p k }, the distribution of source IP addresses and destination IP addresses src and IP dst ; S14, vectorize the extracted feature vectors to generate the final network traffic feature data set: X f ={x f1 ,x f2 ,…,x fm }; Among them, each feature vector x fi Contains a combination of all features used to characterize the behavioral characteristics of network traffic data.

3. According to claim 1, a zero-day attack detection method based on unsupervised learning and peacock courtship algorithm is characterized in that: The S3 includes: S31, the preprocessed network traffic feature dataset X f Perform segmentation to generate training data set X train and validation dataset X val ; S32. Build a dynamic immune unsupervised learning model to achieve preliminary classification and anomaly detection of network traffic data; S33. Based on the output of the dynamic immune unsupervised learning model, an adaptive clustering tree model is constructed to hierarchically cluster and optimize the preliminary classification results; S35, verify the data set X val Input the trained adaptive clustering tree model to evaluate the performance of the unsupervised learning model.

4. A zero-day attack detection method based on unsupervised learning and peacock courtship algorithm according to claim 3, characterized in that: The dynamic immune unsupervised learning model realizes abnormal detection of network traffic data by simulating the learning and memory mechanism of the biological immune system. The construction of the dynamic immune unsupervised learning model includes: Initialize the immune cell library: C={c1,c2,…,c k }; Among them, c i represents the i-th immune cell, which is used to detect abnormal patterns in network traffic, and its feature vector is v i , including various network traffic characteristics; Define the fitness function f(c i ,x), used to measure immune cell c i The similarity with the input feature vector x: Among them, f(c i ,x) is a measure of immune cell c i The response strength to the input feature vector x, which represents a data packet or traffic segment, ∥v i -x∥ indicates immune cells v i The Euclidean distance between the input feature vector x and the input feature vector x. The smaller the distance, the higher the similarity and the more likely it is normal traffic. The larger the distance, the greater the possibility of abnormality. The training data set X train Input into the immune cell library, for each input feature vector x, according to the fitness function f(c i ,x) Calculate the fitness value of each immune cell and select the immune cell c with the highest fitness value w As matching cells; According to the matching cell c w The fitness value is learned and updated by memory: When the fitness value is higher than the preset threshold θ, the information of x is fused to the matching cell c. w In the above example, update its feature vector v w : in w =in w +η(xv w )+α1·exp(-β1·∥xv w ∥ 2 )·(xv w ); Among them, η is the learning rate, which controls the amplitude of the update, α1 and β1 are parameters that control information fusion, which adjust the intensity and range of the update, and x is the current input feature vector, which represents a data packet or traffic segment in the network traffic; When the fitness value is lower than the threshold θ, a new immune cell c is generated. new And add the immune cell library, the new feature vector v new is x; The immune cell library is periodically optimized, including removing low-fitness cells that have not been matched for a long time and clustering optimization of high-frequency matching cells, and finally the optimized immune cell library feature vector set V is obtained.

5. A zero-day attack detection method based on unsupervised learning and peacock courtship algorithm according to claim 4, characterized in that: Based on the immune cell library feature vector set V optimized by the dynamic immune unsupervised learning model, an adaptive clustering tree model is constructed: In each dynamic immune cell node N i , calculate the feature vector set V output by the dynamic immune unsupervised learning model i The weighted centroid c i ′ : Among them, V i is the dynamic immune cell node N i The set of eigenvectors in , c i ′ is the dynamic immune cell node N i The weighted centroid of represents the typical flow characteristics of the center of the dynamic immune cell node, μ i ′ is the dynamic immune cell node N i The average value of the eigenvectors in i ′ is the dynamic immune cell node N i The standard deviation of the eigenvectors in ; Calculate all feature vectors and centroid c in the dynamic immune cell node i ′ The Mahalanobis distance d(v,c i ′ ): Among them, d(v,c i ′ ) is the characteristic vector v and the dynamic immune cell node centroid c i ′ The Mahalanobis distance between the feature vector and the center of the dynamic immune cell node is used to measure the discreteness of the feature vector and the dynamic immune cell node center. i ′ is the dynamic immune cell node N i The covariance matrix of represents the distribution of feature vectors in dynamic immune cell nodes; If the maximum Mahalanobis distance d within a dynamic immune cell node max (N i ) is greater than the splitting threshold θ ′ , then the dynamic immune cell node is split and the covariance matrix S of all eigenvectors in the dynamic immune cell node is calculated i ′ : The covariance matrix S i ′ Perform eigenvalue decomposition, select the eigenvector corresponding to the maximum eigenvalue as the split direction, and assign the eigenvector to two child dynamic immune cell nodes N according to the split direction i ′ 1 and N i ′ 2: N i ′ 1={v∈V i ∣(vc i ′ ) T v ′ 1≤τ ′ }; N i ′ 2={v∈V i ∣(vc i ′ ) T v ′ 1>τ ′ }; Among them, v ′ 1 is the covariance matrix S i ′ The eigenvector corresponding to the maximum eigenvalue of indicates the splitting direction, τ ′ is the splitting threshold, which is used to determine the distribution of feature vectors; Pair dynamic immune cell node N i ′ 1 and N i ′ 2 Repeat the above steps until the maximum depth d is reached. ′ max Or the number of feature vectors in the dynamic immune cell node is less than the minimum number of samples n ′ min .

6. The zero-day attack detection method based on unsupervised learning and peacock courtship algorithm according to claim 1 is characterized in that: The S4 includes: S41. Initialize the population of the peacock courtship algorithm and define the position vector of each peacock in the population: P={p1,p2,…,p n }; Among them, p i represents the position vector of the i-th peacock, corresponding to the parameter combination of the unsupervised learning model; S42, define the fitness function f(p i ), used to measure each peacock position vector p i The performance of the corresponding unsupervised learning model in zero-day attack detection. The fitness function combines the detection rate, false alarm rate, and detection delay, taking into account the accuracy, false alarm rate, and response speed of the unsupervised learning model: f(p i )=α2·DR(p i )-β2·FAR(p i )-γ2·DL(p i ); Among them, DR (p i ) represents the detection rate, FAR(p i ) represents the false alarm rate, DL(p i ) represents the detection delay, α2, β2 and γ2 are weight coefficients used to balance the importance of detection rate, false alarm rate and detection delay; S43, sorting the population of the peacock courtship algorithm according to the fitness function value, and selecting the peacock with the highest fitness value as the leading peacock p best , the remaining peacocks are grouped according to their fitness values ​​to form several peacock groups; S44. The unsupervised learning model is used to update the positions of the peacocks in each peacock group. The position update rules include: According to the position of the dominant peacock best and the current peacock position p i To perform the suction operation: Among them, r1 is a random number, t is the number of iterations, and σ1 is a parameter that controls the range of attraction; Perform repulsion operation based on the distance between peacocks: Among them, r2 is a random number, p j (t) is the position vector of other peacocks; S45. Combining the characteristics of unsupervised learning, the peacock position vector is further optimized for domain characteristics. On the updated peacock position vector P(t+1), fine-tuning is performed according to the domain characteristics, so that the updated unsupervised learning model parameters can adapt to changes in network traffic and characteristics of zero-day attacks. S46, perform fitness evaluation on the optimized peacock position vector P(t+1), and calculate the new fitness value f(p i (t+1)), and update the fitness value ranking in the population, select the new dominant peacock p best ; S47, repeat steps S44 to S46 until the preset number of iterations is reached or the fitness function value converges, and finally obtain the optimized unsupervised learning model parameter combination P opt .

7. A zero-day attack detection method based on unsupervised learning and peacock courtship algorithm according to claim 6, characterized in that: The S45 includes: S451, for each updated peacock position vector p i (t+1) Perform domain feature analysis and combine unsupervised learning models to calculate the fitness change of the peacock position vector in the current network traffic environment; S452. Combined with the characteristics of the unsupervised learning model, determine the adjustment range and adjustment step of the domain feature, and define the domain feature adjustment function g(p i ,Δp), used to fine-tune the peacock position vector: Among them, p i represents the position vector of the peacock, represents the parameter combination of the unsupervised learning model, Δp represents the adjustment step size, and controls the amplitude of the position vector adjustment. represents the fitness function f(p i ) is used to guide the adjustment direction; S453, calculate each peacock position vector f(p i ) And adjust the function g(p according to the characteristics of the domain i ,Δp) to obtain the adjusted peacock position vector p i ′ (t+1): Among them, p i ′ (t+1) represents the adjusted peacock position vector, p i (t+1) represents the peacock position vector before adjustment; S454, the adjusted peacock position vector p i ′ (t+1) is input into the unsupervised learning model for performance evaluation and the adjusted fitness value f(p i ′ (t+1)), the fitness value is used to measure the detection performance of the unsupervised learning model under the current network traffic environment; S455, compare the adjusted fitness value f(p i ′ (t+1)) and the fitness value before adjustment f(p i (t+1)): If the adjusted fitness value f(p i ′ (t+1)) is higher than the fitness value f(p i (t+1)), then the adjusted peacock position vector p i ′ (t+1) is used as the new peacock position vector, otherwise the original peacock position vector remains unchanged.

8. The zero-day attack detection method based on unsupervised learning and peacock courtship algorithm according to claim 1 is characterized in that: The S6 includes: S61. Obtain the output results of the unsupervised learning model: O={o1,o2,…,o n }; Among them, i Represents the detection result of the i-th network traffic data, including anomaly score and classification label; S62, set the abnormal detection threshold θ1, when the output result o i When the anomaly score exceeds the threshold θ1, it is identified as a potential zero-day attack behavior; S63. Perform cluster analysis on the identified potential zero-day attack behaviors based on the anomaly score and feature vector x. i Group abnormal traffic and identify group characteristics of similar attack behaviors; S64. Generate an attack report based on the results of identification and cluster analysis. The report includes: Attack time: records the timestamp when abnormal behavior is detected; Attack source information: including source IP address and source port; Attack features: including anomaly scores and feature vectors; Attack type analysis: Based on the unsupervised learning model and cluster analysis results, infer the attack type and possible attack path; S65. Convert key information in the attack report into an early warning signal and send it to the network administrator in real time. The early warning signal includes detailed information on abnormal traffic and recommended protective measures. S66. Log all detected abnormal behaviors and establish an abnormal behavior database for reference in subsequent analysis and unsupervised learning model training. The log content includes detailed information, detection time and treatment measures for each abnormal behavior. S67. Regularly analyze the abnormal behavior database, combine new network traffic data and detection results, and continuously optimize the parameters of the unsupervised learning model and the peacock courtship algorithm.

Citation Information

Cited By

  • Network environment detection method based on unsupervised learning

    CN119544372A

  • Network abnormal behavior detection method and system based on multi-element prompt learning

    CN120915550A