Intelligent detection method and system for abnormal traffic in big data scenarios
By linking the macro baseline model and the micro feature reconstruction model, and combining Holt-Winters time-series prediction and autoencoder pre-training, the problems of high false alarm rate, poor robustness and high computational cost of abnormal traffic detection in big data scenarios are solved, and intelligent detection with high accuracy and low latency is achieved.
Patent Information
- Application Number
- CN202611112149.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies for abnormal traffic detection in big data scenarios suffer from high false alarm rates, poor robustness, weak ability to identify unknown threats, and high computational overhead, making them difficult to adapt to dynamic business environments and real-time detection requirements.
A macro-based baseline model and a micro-feature reconstruction model are linked. Macro-anomaly detection is performed by Holt-Winters time series prediction and Mahalanobis distance residual analysis. Micro-detection model is built by pre-training an autoencoder and fine-tuning the meta-learning framework with few samples to achieve accurate identification of abnormal traffic.
It significantly improves the accuracy and generalization ability of abnormal traffic detection in big data scenarios, reduces computational overhead, meets real-time detection needs, and provides a highly robust intelligent detection solution.
Smart Images

Figure CN123184874A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data network security technology, specifically to an intelligent method and system for detecting abnormal traffic in big data scenarios. Background Technology
[0002] With the widespread adoption of cloud computing, big data, and distributed microservice architectures, enterprise data centers and cloud platform networks are exhibiting four major characteristics: explosive growth in traffic volume, complex traffic topology, dynamic fluctuations in business traffic, and continuous iteration of attack methods. Currently, mainstream abnormal traffic detection technologies in the industry mainly fall into two categories, both of which have significant technical shortcomings:
[0003] (1) Traditional rule-based threshold detection technology
[0004] Traffic discrimination relies on manually set fixed thresholds, blacklists / whitelists, and feature rules, which has a low technical threshold and is easy to deploy. However, this method is highly dependent on the experience of operations and maintenance personnel and can only identify simple anomalies such as brute-force attacks and high-frequency scans with known characteristics. When faced with new and covert anomaly attacks such as distributed slow scans, gradual DDoS attacks, low-frequency penetration attacks, and business-disguised traffic, it cannot capture subtle deviations in traffic. At the same time, in big data scenarios, normal business traffic fluctuates significantly with time and business activities, and fixed thresholds will cause large-scale false positives and false negatives, resulting in extremely poor overall detection robustness.
[0005] (2) Fully supervised deep learning detection technology
[0006] The model employs fully supervised algorithms such as convolutional neural networks, recurrent neural networks, and classification models, relying on massive amounts of manually labeled normal / abnormal traffic samples for training. However, it suffers from three major pain points in real-world production environments: First, abnormal network traffic is a low-probability event, resulting in scarce and extremely high collection costs for effectively labeled samples; second, attack methods are constantly evolving, leading to weak identification capabilities for unknown abnormal traffic not covered in the training set, and insufficient model generalization ability; and third, the model training cycle is long and computationally expensive, making it difficult to adapt to the low-latency requirements of real-time traffic detection in large data clusters. Summary of the Invention
[0007] In view of this, the purpose of this application is to provide an intelligent detection method and system for abnormal traffic in big data scenarios, so as to solve the problems in the background technology.
[0008] To achieve the above objectives, this application adopts the following technical solution:
[0009] The intelligent detection method for abnormal traffic in big data scenarios proposed in this application includes the following steps:
[0010] Obtain overall device-level traffic data for the first current time window and session traffic data for multiple sessions in the second current time window;
[0011] Global traffic features are extracted from the overall traffic data, and session traffic features are extracted from the session traffic data. The session traffic features include packet length distribution features, access behavior features, traffic timing fluctuation features, and connection duration distribution features.
[0012] The global traffic features are input into a pre-built macro baseline model to obtain the baseline features of the first current time window, and the macro traffic anomaly determination result of the first current time window is calculated based on the baseline features and the global traffic features.
[0013] Based on the macro-traffic anomaly determination result, session filtering is performed within the second time window to obtain target sessions. The session traffic features of the target sessions are then input into a pre-built feature reconstruction model to obtain reconstructed features. The reconstruction error between the reconstructed features and the session traffic features is calculated, and the session traffic anomaly determination result is determined based on the reconstruction error. The feature reconstruction model is constructed by pre-training an autoencoder and fine-tuning it with few samples based on a meta-learning framework.
[0014] Based on the joint analysis of the macro-level traffic anomaly determination results and the session traffic anomaly determination results, traffic detection results are obtained.
[0015] This application also provides an intelligent abnormal traffic detection system for big data scenarios, including:
[0016] The acquisition module is used to acquire overall device-level traffic data for the first current time window and session traffic data for multiple sessions in the second current time window.
[0017] The feature extraction module is used to extract global traffic features from the overall traffic data and extract session traffic features from the session traffic data. The session traffic features include packet length distribution features, access behavior features, traffic timing fluctuation features, and connection duration distribution features.
[0018] The macroscopic detection module is used to input the global traffic features into a pre-built macroscopic baseline model to obtain the baseline features of the first current time window, and calculate the macroscopic traffic anomaly judgment result of the first current time window based on the baseline features and the global traffic features.
[0019] The micro-detection module is used to perform session filtering within the second time window based on the macro-traffic anomaly determination result, obtain target sessions, input the session traffic features of the target sessions into a pre-built feature reconstruction model to obtain reconstructed features, calculate the reconstruction error between the reconstructed features and the session traffic features, and determine the session traffic anomaly determination result based on the reconstruction error. The feature reconstruction model is constructed by pre-training an autoencoder and fine-tuning with few samples based on a meta-learning framework.
[0020] The joint detection module is used to perform joint analysis based on the macro traffic anomaly determination results and the session traffic anomaly determination results to obtain traffic detection results.
[0021] The beneficial effects of this application are: the intelligent abnormal traffic detection method and system for big data scenarios proposed in this application significantly improve the accuracy and generalization ability of abnormal traffic detection in big data scenarios through the dual-engine linkage architecture of macro-dynamic baseline perception and micro-small sample adaptive detection.
[0022] First, the macro baseline model uses Holt-Winters time series forecasting and Mahalanobis distance residual analysis to adaptively fit the periodic fluctuation characteristics of business traffic, effectively distinguishing between normal business bursts and real attacks, and solving the inherent problems of high false alarm rate and poor robustness of traditional fixed threshold schemes in dynamic business environments.
[0023] Secondly, microscopic detection is based on unsupervised pre-training of autoencoders, which only requires a large amount of unlabeled normal traffic to build an accurate reconstruction model, thus getting rid of the strong dependence on a large number of abnormal labeled samples. The introduction of the MAML meta-learning framework for small sample fine-tuning enables the model to actively learn the deviation of abnormal features from the rules. Even when facing new and unknown attacks not covered in the training set, it still has strong generalization recognition ability, overcoming the dual pain points of scarce annotations and weak recognition of unknown threats in fully supervised deep learning.
[0024] Third, based on the macro-anomaly judgment results, the micro-conversation screening and on-demand detection are dynamically guided, realizing two-level intelligent linkage. While ensuring detection accuracy, the computational overhead is greatly reduced, meeting the low-latency deployment requirements of real-time traffic in big data clusters.
[0025] In summary, this application effectively overcomes the core bottlenecks of traditional rule-based thresholding and fully supervised deep learning methods in terms of dynamism, generalization, and real-time performance, providing a highly robust intelligent detection solution for network security protection in big data scenarios. Attached Figure Description
[0026] The present application will be further described below with reference to the accompanying drawings and embodiments:
[0027] Figure 1This is an architecture diagram of an intelligent abnormal traffic detection method for big data scenarios according to an embodiment of this application;
[0028] Figure 2 This is a flowchart illustrating an intelligent abnormal traffic detection method for big data scenarios in one embodiment of this application;
[0029] Figure 3 This is a schematic diagram of the autoencoder pre-training process in one embodiment of this application;
[0030] Figure 4 This is a logical structure diagram of an intelligent abnormal traffic detection system for big data scenarios shown in one embodiment of this application. Detailed Implementation
[0031] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0032] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the layers related to this application and are not drawn according to the actual number, shape and size of the layers in the actual implementation. In the actual implementation, the form, number and proportion of each layer can be arbitrarily changed, and the layer layout may also be more complex.
[0033] Numerous details are explored in the following description to provide a more thorough explanation of embodiments of this application; however, it will be apparent to those skilled in the art that embodiments of this application may be practiced without these specific details.
[0034] Figure 1 This is an architecture diagram of an intelligent abnormal traffic detection method for big data scenarios according to one embodiment of this application, as shown below. Figure 1 As shown, this application uses a data acquisition module to collect network device traffic data in real time, and inputs it into two detection branches respectively:
[0035] The macro detection branch detects the global traffic at the device level, uses the macro baseline model to perform dynamic baseline prediction and residual analysis on the overall device traffic data of the first current time window, and outputs the macro deviation score and macro anomaly judgment result of the current window.
[0036] Meanwhile, the micro-detection branch performs session reconstruction and multi-dimensional refined feature extraction on the traffic data input by the acquisition module, using a second current time window (granularity smaller than the macro window). This branch dynamically performs session filtering based on the macro anomaly judgment results—if the macro judgment is abnormal, high-suspicious sessions are filtered by source / destination IP entropy values; if the macro judgment is normal, a stranger-first sampling and timed full-scale hunting strategy is used for sampling detection. The filtered target session features are input into a feature reconstruction model built based on autoencoder pre-training and MAML meta-learning fine-tuning to obtain reconstructed features, calculate the reconstruction error of each session, and output session-level anomaly judgment results.
[0037] Finally, the joint analysis module cross-verifies the judgment results from both the macroscopic and microscopic branches, outputs a four-quadrant joint detection result, and triggers tiered alarms and targeted packet capture based on the anomaly level. Furthermore, the system periodically performs closed-loop self-updates on the macroscopic baseline model and the feature reconstruction model through manual verification and sample feedback mechanisms, achieving long-term adaptive evolution of the model.
[0038] Figure 2 This is a flowchart illustrating an intelligent abnormal traffic detection method for big data scenarios in one embodiment of this application, as shown below. Figure 2 As shown, the intelligent detection method for abnormal traffic in big data scenarios in this application mainly includes the following steps:
[0039] S210, Obtain the overall device-level traffic data for the first current time window and the session traffic data for multiple sessions in the second current time window;
[0040] Wherein, the first current time window is a time window of the first target duration before the current moment, the second current time window is a time window of the second target duration before the current moment, and the first target duration is longer than the second target duration;
[0041] In this application, bypass mirroring and traffic splitting technologies are used to connect to the core switches and gateway devices of the big data distributed cluster. All bidirectional network data packets entering and leaving the cluster are collected. It supports mainstream protocols such as TCP, UDP, ICMP, HTTP, and HTTPS. The collection granularity covers the data packet level, stream level, and session level to ensure the integrity of traffic data. At the same time, traffic slicing technology is used to adapt to massive concurrent traffic and avoid data packet loss.
[0042] The first current time window is a macroscopic detection time window, with a width equal to the first duration, used to aggregate overall traffic statistics at the device level in order to capture macroscopic trend changes in network traffic;
[0043] The second current time window is a micro-detection time window, with a width equal to the second duration, used to divide the traffic detection granularity at the session level in order to perceive the instantaneous behavioral characteristics of each session.
[0044] Macroscopic detection, based on a baseline model, performs trend prediction and residual analysis on the overall traffic of the device. This requires a sufficiently long time window to accumulate stable statistical features, filtering out instantaneous spikes and capturing periodic traffic variation patterns. Microscopic detection, on the other hand, performs refined feature extraction and reconstruction error calculation for each session. Using a short time window, it can promptly detect instantaneous anomalies such as single scans and slow attacks, preventing abnormal traffic from being overwhelmed by the averaging effect of a long window. This differentiated design of long and short time windows achieves a synergistic complementarity between macroscopic trend perception and microscopic instantaneous response.
[0045] S220, extract global traffic features from the overall traffic data and extract session traffic features from the session traffic data, wherein the session traffic features include packet length distribution features, access behavior features, traffic timing fluctuation features and connection duration distribution features;
[0046] (1) Global traffic characteristics;
[0047] The global traffic characteristics include total inbound throughput, total outbound throughput, number of data packets per second, average round-trip latency of all TCP connections, TCP retransmission rate, and number of half-open connections at the moment the window ends.
[0048] Among them, the three features of total inbound throughput, total outbound throughput, and number of data packets per second reflect the overall scale and intensity of traffic from the perspectives of bytes and packets, respectively.
[0049] The average round-trip time of all TCP connections and the TCP retransmission rate together reflect the transmission quality and congestion status of the network link.
[0050] The number of half-open connections (connections in the SYN_SENT or SYN_RECV state) at the moment the window ends is a sensitive preliminary indicator for identifying scanning attacks and distributed denial-of-service attacks.
[0051] (2) Session traffic characteristics;
[0052] This application extracts composite features from four dimensions: spatial distribution, access behavior, temporal changes, and connection status. These features are categorized into four main types and further subdivided into 16 sub-features, comprehensively depicting the essence of traffic, including:
[0053] Breaking away from the industry's single-feature extraction method, it extracts composite features from four dimensions: spatial distribution, access behavior, temporal changes, and connection status. These features are categorized into four main types and 16 sub-features, comprehensively depicting the essence of traffic.
[0054] Data packet length distribution characteristics: maximum / minimum length of a single packet, average packet length, packet length variance, proportion of small packets, and proportion of large packets;
[0055] Source and destination IP access frequency characteristics: number of destinations accessed by a single IP, frequency of access to a single destination IP, IP connection dispersion, and IP duplicate connection rate;
[0056] Traffic flow temporal fluctuation characteristics: peak traffic flow per unit time, mean traffic flow, temporal fluctuation variance, and traffic surge / descent coefficient;
[0057] Connection duration distribution characteristics: average duration of a single connection, percentage of short connections, percentage of long connections, and connection interruption rate.
[0058] (3) Standardization process;
[0059] All extracted multidimensional features are processed by a combination of Min-Max normalization and Z-Score standardization to eliminate differences in the dimensions of different features and uniformly map them to the [0,1] interval to generate structured feature vectors.
[0060] S230, the global traffic features are input into the pre-built macro baseline model to obtain the baseline features of the first current time window, and the macro traffic anomaly determination result of the first current time window is calculated based on the baseline features and the global traffic features;
[0061] In this application, a macroscopic baseline model based on the Holt-Winters third-order exponential smoothing model is constructed based on the traffic data of the previous 7 days. The specific construction process includes:
[0062] (1) Obtain the historical traffic data sequence for the third target duration prior to the current time point, wherein the historical traffic data sequence is updated on a rolling basis;
[0063] Specifically, obtain historical traffic data for 7 consecutive days prior to the current time (updated on a rolling basis, sliding with the latest data each day) as the original dataset for model training.
[0064] (2) The historical traffic data sequence is segmented based on a preset first time window to obtain multiple overall traffic data samples, wherein the width of the first time window is the first duration;
[0065] Using a first duration (e.g., 1 minute) as the window width, the historical traffic data sequence is segmented without overlap to obtain multiple overall traffic data samples. Each sample corresponds to a device-level global traffic statistics value within a time window.
[0066] (3) Extract global traffic feature samples from the overall traffic data sample;
[0067] The six-dimensional global traffic features mentioned above are extracted from each overall traffic data sample to form a six-dimensional feature vector sequence. , ,in, For time window indexing, Total inbound throughput For total outbound throughput, The number of data packets per second. The average round-trip time for all TCP connections. For TCP retransmission rate, This represents the number of half-open connections at the moment the window closes.
[0068] Furthermore, to avoid contaminating the model with extreme outliers from historical data caused by attacks or malfunctions, a residual-based MAD (Median Absolute Deviation) method is used for cleaning: First, for each feature dimension, a coarse-grained baseline value is obtained using STL decomposition or the periodic median method, and the residual is calculated; then, the MAD value of the residual is calculated, and the result satisfies... The time point is marked as an outlier, and the measured value at that time is replaced with the predicted value (imputation) instead of being directly deleted, thus ensuring the integrity of the time series. This process is iterated 2 to 3 times until convergence.
[0069] (4) Based on multiple global traffic feature samples, train the Holt-Winters third-order exponential smoothing model for each feature dimension to obtain the macro baseline model.
[0070] For feature dimensions The constructed Holt-Winters third-order exponential smoothing model is expressed as:
[0071]
[0072] In the formula, For the predicted baseline features, This is the horizontal term (based on the baseline value after smoothing from the previous window, reflecting the long-term average level of traffic). This is the trend term (based on the slope of change in the previous window, reflecting the upward or downward trend of the flow). This is a seasonal term (based on the seasonal offset at the same moment in the previous cycle, reflecting the periodic fluctuations in flow (such as daily or weekly cycles).
[0073] The recursive update formula for the three components is:
[0074]
[0075] In the formula, All are smoothing parameters. The number of time windows contained in a complete business cycle.
[0076] The updates to the three components depend on the current measured values. , while predicted value The generation of depends on the state components of the previous time window, therefore there is a strict temporal relationship between the two:
[0077] (1) First, utilize the state components of the previous time window. , , Substituting this into the prediction formula, we get... ;
[0078] (2) Obtain the current measured value of the feature. Update the three components to , , ;
[0079] (3) The updated components are stored in memory for use in the next time window prediction.
[0080] The three components work together to enable the model to simultaneously capture the horizontal baseline, trend of change, and periodic pattern of traffic, achieving accurate adaptive prediction of dynamic business traffic.
[0081] In the above process, although the predicted value of the current time window State components based on the previous time window , , This is generated. However, this is only the inference process within the model. Outside the model, the measured values of the current features in the current time window are still used. The input is fed into the model, and the model then outputs the predicted value for the current time window. The two are not contradictory.
[0082] In this application, grid search or numerical optimization (such as L-BFGS) is used to determine the optimal combination of smoothing parameters. The optimization objective is to minimize the mean squared error of the one-step prediction.
[0083]
[0084] After obtaining the optimal combination of smoothing parameters, the construction of the macroscopic baseline model is complete, which can then be used to predict the baseline feature vector of the first current time window. After obtaining the baseline feature vector of the first current time window The subsequent process of calculating the macroscopic traffic anomaly determination result for the first current time window based on the baseline features and the global traffic features includes:
[0085] S231, Calculate the residual vector between the baseline features and the global traffic features;
[0086] Specifically, the measured global traffic characteristics of the current time window With baseline feature vector Subtracting each dimension sequentially yields the residual vector. ,Right now .
[0087] S232, Based on the macroscopic baseline model, predict multiple global traffic feature samples to obtain multiple baseline feature samples, and calculate the difference between the global traffic feature samples and the baseline feature samples for each same time window to obtain multiple residual vector samples. ;
[0088] Specifically, historical global traffic characteristic data for the seven consecutive days prior to the current time point are selected as the training set; the measured characteristics of each time window in the training set are then used as the training set. Input the pre-trained Holt-Winters model to obtain the corresponding baseline predictions. Then, the residual vector samples are calculated window by window. This forms a residual vector sample set.
[0089] S233, Calculate multiple residual vector samples absolute deviation of the median And will satisfy: residual vector samples After removal, a residual vector sample sequence is obtained, where, This is the threshold coefficient;
[0090] This application uses median absolute deviation (MAD) to clean the historical residual vector sample set, so as to avoid the variance threshold being increased due to historical attack samples, which could lead to subsequent missed detections.
[0091] S234, Calculate multiple residual vector samples in the residual vector sample sequence. The mean of the residuals is obtained by taking the mean of the residuals. Based on the mean of the residuals and multiple residual vector samples in the residual vector sample sequence Calculate the cosine matrix The covariance matrix The mathematical expression is:
[0092]
[0093] In the formula, For time window indexing, This represents the number of time windows in the residual vector sample sequence;
[0094] It is a symmetric positive definite matrix. The diagonal elements reflect the variance of each feature dimension under normal fluctuations, and the off-diagonal elements reflect the correlation between different features (such as a sudden increase in throughput is often accompanied by an increase in the number of half-open connections). It is recalculated during monthly model updates, but remains unchanged during daily inference.
[0095] S235, Calculate the macroscopic flow deviation score for the first current time window based on the residual vector and the covariance matrix. The macroscopic flow deviation score The mathematical expression is:
[0096]
[0097] In the formula, This is the residual vector for the first current time window;
[0098] This score eliminates dimensional differences and correlations between feature dimensions, achieving comparable anomaly scoring on the same scale. Fluctuations in throughput and retransmission rate can be measured on the same scale.
[0099] S236, score the macroscopic flow deviation. Compared with the preset score threshold To make a comparison, in If the macroscopic flow rate of the first current time window is normal, it is determined that the macroscopic flow rate of the first current time window is normal; otherwise, it is determined that the macroscopic flow rate of the first current time window is abnormal.
[0100] threshold During the model training phase, based on the macro deviation score set of historical data, the 99.5 quantile is taken, and then based on... Perform real-time judgment:
[0101]
[0102] S240, based on the macro traffic anomaly determination result, session filtering is performed within the second time window to obtain target sessions, and the session traffic features of the target sessions are input into a pre-built feature reconstruction model to obtain reconstructed features. The reconstruction error between the reconstructed features and the session traffic features is calculated, and the session traffic anomaly determination result is determined based on the reconstruction error. The feature reconstruction model is constructed by pre-training an autoencoder and fine-tuning with few samples based on a meta-learning framework.
[0103] Macro-level anomaly detection provides deviation signals for overall device-level traffic, but cannot pinpoint specific anomalous sessions. Meanwhile, the CAE (Content Execution Architecture) model performs deep inference for each session, resulting in high computational overhead. If all sessions within the second time window are indiscriminately fed into the CAE model, the computational cost will far exceed the upper limit of real-time processing capabilities. Therefore, a session filtering stage is needed between macro and micro levels—dynamically determining the input range for micro-level detection based on macro-level detection results: when macro-level anomalies occur, high-suspicious sessions are identified through IP entropy analysis for precise targeted detection; when macro-level normalcy is achieved, a lightweight sampling strategy is switched to maintain basic coverage of latent threats. This filtering mechanism ensures that detection accuracy is not diluted while keeping CAE computational power consumption within an acceptable range. It is a crucial link in the two-level linkage architecture and a core enabling element for achieving low-latency, high-concurrency deployment. Therefore, the session sampling process includes:
[0104] S241, Macroscopic flow anomaly;
[0105] S241-1, when the macro traffic anomaly determination result indicates that the overall traffic data is abnormal, calculate the source IP entropy value and destination IP entropy value of all active IPs within the second current time window;
[0106] An active IP refers to an IP address that has transmitted at least one data packet within the second current time window. When the macro-level traffic anomaly determination result indicates that there is a device-level overall anomaly within the current time window, the system obtains all data packets within the second current time window (micro-window, with a width on the order of seconds, such as 5 seconds or 10 seconds), extracts the source IP address and destination IP address of each data packet, counts the frequency of occurrence of the source IP and destination IP, and calculates the source IP entropy value. and destination IP entropy :
[0107]
[0108]
[0109] In the formula, and These represent the total number of active source IPs and active destination IPs within the window, respectively. For the first The percentage of occurrences of each source IP address For the first The percentage of times each destination IP appears.
[0110] Entropy is used to quantify the concentration or dispersion of IP address distribution. In normal business traffic, client IPs are relatively dispersed, resulting in higher entropy values. However, in abnormal scenarios such as DDoS attacks and port scanning, traffic is often concentrated in a small number of source IPs (single-source attacks) or a small number of destination IPs (targeted attacks), leading to a significant decrease in entropy. By calculating the source IP entropy, we can identify who is initiating abnormal traffic; by calculating the destination IP entropy, we can identify who is being attacked.
[0111] S241-2, extract the header source IP set whose source IP entropy value is lower than a preset first threshold and the header destination IP set whose destination IP entropy value is lower than a preset second threshold respectively, and take the union of the two sets as the target session;
[0112] Extract the header source IP set whose source IP entropy value is lower than a preset first threshold and the header destination IP set whose destination IP entropy value is lower than a preset second threshold, and take the union of the two sets as the target session.
[0113] Specifically, the system first sorts all source IPs in the window by the number of packets from highest to lowest, and then accumulates the packet percentage of each IP starting from the highest percentage until the cumulative percentage reaches a preset threshold (e.g., 80%). These IPs constitute the header source IP set. Similarly, the target IP set in the header is obtained. .
[0114] Target Session Collection This involves extracting all sessions initiated by the source IP in the header and all sessions sent to the destination IP in the header. The union operation of the two sets is achieved by matching the 5-tuple (source IP, destination IP, source port, destination port, protocol).
[0115] Abnormal traffic may manifest as "a small number of source IPs launching a large-scale attack" (such as a single-source DDoS attack), or "a large amount of attack traffic flowing to a small number of destination IPs" (such as a targeted DDoS attack), or both. The union operation ensures that regardless of which attack mode it falls under, the relevant sessions are included in the subsequent detection scope.
[0116] S241-3, If both are below the threshold, then the intersection session is extracted first;
[0117] If both the source IP entropy value and the destination IP entropy value are below their respective thresholds (i.e., both exhibit high concentration), then sessions from the intersection of the source IP set and the destination IP set will be extracted first. Intersection sessions are processed first. The remainder of the union can be selectively added on top of this, but intersection sessions receive the highest detection priority and the shortest response latency.
[0118] S242, macroscopic flow rate is normal;
[0119] S242-1, when the macro traffic anomaly determination result indicates that there is no anomaly in the overall traffic data, extract the lightweight session features of all sessions within the second current time window;
[0120] Lightweight session features are the basic statistics required to calculate unfamiliarity, including but not limited to: total number of packets in the session, total number of bytes in the session, session duration, average packet length in the session, and number of ports included in the session. Compared with the full 16-dimensional features, lightweight feature calculation only involves counting, accumulation, and simple arithmetic operations. It does not require maintaining a complex state machine or performing advanced statistical calculations such as variance and quantiles, and the CPU overhead is negligible.
[0121] S242-2, Calculate the unfamiliarity of each session based on the lightweight session features;
[0122] The system pre-maintains a historical lightweight session feature center. (Constituted from the average of lightweight characteristics of normal traffic over a past period, updated monthly or weekly). Unfamiliarity Defined as the lightweight feature vector of the current session With historical lightweight session feature center The Euclidean distance, i.e.:
[0123]
[0124] Unfamiliarity characterizes the degree to which the current session deviates from the normal pattern of historical sessions, and is an important basis for determining whether a session needs to be deep-tested. The higher the unfamiliarity, the more the session's characteristic pattern deviates from the normal business profile, and the greater the potential for it to carry anomalies.
[0125] S242-3, Based on the unfamiliarity sampling mechanism and the random sampling mechanism, all sessions within the second current time window are sampled to obtain the target session. The higher the unfamiliarity of the session, the higher the probability of the session being sampled. The unfamiliarity is the Euclidean distance between the lightweight session feature and the center of the historical lightweight session feature.
[0126] This application adopts a hybrid sampling strategy of prioritizing unfamiliarity sampling and low-proportion random sampling to select target sessions from all sessions within the second current time window and send them to the feature reconstruction model for deep detection.
[0127] (1) The probability of each session being sampled rather than unfamiliarity Proportional; specifically, the system first calculates the sum of the unfamiliarity levels of all conversations within the window. Then, for each session, according to probability... Perform sampling. This is the magnification factor.
[0128] (2) In addition to prioritizing unfamiliarity sampling, the system performs completely random sampling on all sessions within the window at a fixed ratio (e.g., 5%-10%) to ensure that even if an attacker disguises malicious traffic characteristics as being highly consistent with the historical center (extremely low unfamiliarity), there is still a certain probability that the malicious traffic will be selected for deep detection.
[0129] The final target session set is the union of the unfamiliarity-first sampling results and the random sampling results. If the number of target sessions is lower than the preset minimum number of samples, sampling is automatically supplemented to this lower limit; if it exceeds the preset maximum number of samples, it is truncated to the upper limit according to the unfamiliarity score. After sampling, the complete 16-dimensional features of the target sessions are input into the feature reconstruction model (CAE) for accurate inference.
[0130] The construction methods for a feature reconstruction model (CAE) include:
[0131] (1) Obtain normal session traffic data samples of multiple normal sessions and multiple abnormal session traffic data samples generated during network attacks, wherein the abnormal session traffic data samples are labeled with abnormal type.
[0132] (2) Extract normal session traffic feature samples from the normal session traffic data samples and extract abnormal session traffic feature samples from the abnormal session traffic data samples;
[0133] All extracted multidimensional features are processed by a combination of Min-Max normalization and Z-Score standardization to eliminate differences in the dimensions of different features and uniformly map them to the [0,1] interval to generate structured feature vectors.
[0134] Divide the sample set into two categories:
[0135] Unlabeled normal traffic sample set: accounting for more than 95% of the total sample, taken from pure business normal traffic during the stable operation phase of the cluster, as a pre-training data source;
[0136] A small set of labeled abnormal traffic samples: Various types of abnormal traffic such as distributed slow scanning, DDoS, port probing, and penetration attacks are manually labeled. The labeled samples account for less than 5% of the total, and are used as the data source for subsequent fine-tuning with small samples.
[0137] (3) Input the normal session traffic feature samples into the autoencoder to obtain reconstructed samples; calculate the reconstruction error between the reconstructed samples and the normal session traffic feature samples, and pre-train the autoencoder based on the reconstruction error to obtain the pre-trained autoencoder.
[0138] Figure 3 This is a schematic diagram of the autoencoder pre-training process in one embodiment of this application, as shown below. Figure 3 As shown, the pre-training process includes:
[0139] We selected a deep convolutional autoencoder (CAE) as the basic model. Unlike traditional classification networks, the core idea is that the model only learns the features of normal traffic, while abnormal traffic will have a large reconstruction error due to feature deviation.
[0140] Model input: The standardized normal traffic feature vector is input into the autoencoder, which performs feature compression and dimensionality reduction, and the decoder performs feature reconstruction and restoration.
[0141] Unsupervised training: Iterative training is conducted using only unlabeled normal traffic samples to continuously optimize model weights, allowing the model to accurately fit the inherent characteristic distribution and variation patterns of normal traffic.
[0142] Reconstruction error calculation: The mean squared error (MSE) is used to calculate the difference between the original feature vector and the reconstructed feature vector of the model, which is used as the core indicator for traffic anomaly detection. The reconstruction error is then backpropagated to adjust the internal weights of the deep convolutional autoencoder (CAE) until the reconstruction error is minimized or no longer changes, thus completing the pre-training.
[0143] Static threshold initialization: After pre-training, the reconstruction error set of all normal traffic samples is statistically analyzed, and the 95th percentile is taken as the initial reconstruction error judgment threshold. This threshold can filter out errors caused by small fluctuations in normal business traffic, reducing false alarms at the source.
[0144] (4) Based on the meta-learning framework, the pre-trained autoencoder is fine-tuned using abnormal session traffic data samples of tasks with multiple abnormality type labels to obtain a feature reconstruction model.
[0145] This application innovatively integrates a Model-Independent Meta-Learning (MAML) framework, which performs secondary model optimization for a small number of labeled anomaly samples, addressing the issues of ambiguous model discrimination boundaries and weak identification of unknown anomalies in small sample sizes. Specifically, it includes:
[0146] (4-1) Meta-learning task construction: Divide different types of abnormal traffic into multiple sub-tasks, construct a multi-task few-sample learning scenario, and simulate diverse abnormal feature patterns;
[0147] (4-2) Two-layer gradient optimization: The two-layer structure of inner fast gradient update + outer global parameter optimization is adopted. A small number of abnormal labeled samples are used to quickly adjust the reconstruction rules and error judgment boundary of the autoencoder.
[0148] (4-3) Feature Deviation Pattern Learning: Guide the model to actively learn the feature deviation patterns of various abnormal traffic compared with normal traffic, rather than simply memorizing the features of abnormal samples;
[0149] The model has feature generalization ability. Even if it encounters new abnormal traffic that has not appeared in the training set, it can be accurately identified as long as there is feature deviation, which greatly improves the ability to detect unknown attacks.
[0150] Based on the trained feature reconstruction model, the 16-dimensional features mentioned above can be input into the feature reconstruction model to obtain the reconstructed features. Then, the mean squared error is used to calculate the reconstructed features. Compared with the original features Reconstruction error , The physical essence of reconstruction error is the degree of deviation between the current sample and the normal sample distribution. The greater the deviation, the greater the error and the higher the suspicion of anomaly.
[0151] After obtaining the reconstruction error, the reconstruction error is then used to determine anomalies in the session flow, including:
[0152] S243, compare the reconstruction error with a preset error threshold, wherein the error threshold is the 95th percentile of the reconstruction error after the feature reconstruction model reconstructs all training samples;
[0153] During the pre-training phase, the training samples are all clean and normal traffic that has been manually identified, and their reconstruction error represents the error distribution under normal fluctuations. Taking the 95th quantile as the threshold means that the false alarm rate of normal samples during the pre-training phase is strictly controlled within 5%, ensuring the high accuracy of the model from the source.
[0154] S244, when the reconstruction error is less than or equal to the error threshold, the current session traffic data of the second current time window is determined to be normal; otherwise, the current session traffic data of the second current time window is determined to be abnormal.
[0155] Assuming the reconstruction error of normal samples follows a unimodal distribution (such as a normal or chi-square distribution), then the threshold corresponding to the 95th quantile is significant at a certain level. The acceptance region for normal samples was defined. When the error of a new sample exceeds this threshold, it means that the sample has deviated from the main distribution area of the normal population in a statistical sense, and it is judged as an anomaly with statistical significance.
[0156] Furthermore, if the reconstruction error exceeds the error threshold, the risk level is determined based on the reconstruction error, and corresponding early warning information is output, including:
[0157] 1) Low-risk hidden anomalies: The reconstruction error slightly exceeds the error threshold (the difference between the reconstruction error and the error threshold is greater than the preset first error threshold and less than the preset second error threshold). These are mostly single, accidental detections and sporadic scanning behaviors. The abnormal session logs are only stored locally and local page alarms are triggered. No SMS notifications are pushed.
[0158] 2) Medium-risk hidden anomalies: The reconstruction error significantly exceeds the error threshold (the difference between the reconstruction error and the error threshold is greater than or equal to the preset second error threshold). These are mostly continuous low-frequency penetration, slow port scanning, and DNS tunneling. The platform pop-up alarm is triggered simultaneously, and SMS warnings are pushed. Session traffic data in the second current time window is saved for evidence collection.
[0159] S250, based on the macro traffic anomaly determination result and the session traffic anomaly determination result, a joint analysis is performed to obtain the traffic detection result.
[0160] The macro baseline model and the micro feature reconstruction model analyze traffic from different granularities and dimensions. The macro model, based on device-level aggregated features, detects temporal trend deviations and excels at identifying overall anomalies such as large-scale traffic surges and network congestion, but cannot pinpoint specific abnormal sessions. The micro model, based on session-level 16-dimensional refined features, performs reconstruction error analysis and excels at capturing session-level anomalies such as slow scans and hidden tunnels lurking in normal traffic, but full computational overhead is too high. This application's joint analysis, through cross-verification, collaboratively evaluates the detection results from the two different perspectives, eliminating their respective detection blind spots and achieving a complementary effect of macro-level perception of the overall situation and micro-level localization of specific threats, specifically including:
[0161] S251, when the macro traffic anomaly determination result indicates that the macro traffic in the first current time window is normal, and the session traffic anomaly determination result indicates that all session traffic data in the second current time window is normal, the service is determined to be stable and risk-free.
[0162] The macro baseline model output is normal, indicating that the overall device-level traffic conforms to historical periodic patterns in terms of volume, latency, and connection behavior, without significant deviations. The micro feature reconstruction model outputs normal values for all sampled sessions, indicating that the 16-dimensional refined features (packet length distribution, connection duration, access frequency, etc.) of each detected session fall within the normal distribution range. These two findings corroborate each other, demonstrating that the current network is healthy at both the macro-level and session-level details.
[0163] S252, when the macro traffic anomaly determination result indicates macro traffic anomaly in the first current time window and the session traffic anomaly determination result indicates normal session traffic data in the second current time window, it is determined that there is planned large traffic or network interruption, and the overall traffic data of the first current time window is fed back to the sample library for updating the macro baseline model and reconstructing the error threshold.
[0164] The macro baseline model detected a significant deviation from the baseline in overall device-level traffic (e.g., a sudden increase in throughput or latency), but the micro feature reconstruction model determined all detected sessions to be normal. This means that while the total traffic volume has indeed increased, each individual session remains normal at the micro feature level. For example, scheduled large-scale data migrations and continuous high traffic during peak video conferencing periods can cause global metrics to spike, but the packet length distribution, connection behavior, and protocol interactions of each session conform to normal business patterns. Micro-level normality serves as noise reduction and falsification of macro-level anomalies, eliminating the possibility of attacks and attributing anomalies to planned business activities or transient network jitter. Therefore, the system does not trigger security alarms but feeds the data from that period back to the sample database for adaptive calibration of subsequent macro baseline thresholds and micro-reconstruction error thresholds, preventing similar scenarios from being misjudged again in the future.
[0165] S253, when the macro traffic anomaly determination result indicates that the macro traffic in the first current time window is normal, and the session traffic anomaly determination result indicates that there is a session with abnormal traffic data in the second current time window, it is determined that there is a covert low-speed attack, and the session traffic data in the second current time window is saved for evidence collection.
[0166] The macro baseline model outputs normally, indicating that there are no perceptible deviations in aggregated metrics such as total volume, throughput, and latency for device-level global traffic. However, the micro feature reconstruction model detects significant reconstruction errors in one or several sessions, meaning that the 16-dimensional fine-grained features of these sessions deviate from the normal distribution. This combination points to low-volume, low-perception stealth attacks, such as slow scanning (sending a probe packet every few minutes), DNS covert tunneling (splitting data into seemingly normal DNS queries), and low-frequency penetration probing. These attacks share common characteristics: the traffic volume of a single session is extremely small, far below the sensitivity threshold of the macro baseline, and is completely overwhelmed by normal business traffic statistics; however, there are significant differences from normal sessions in fine-grained features such as packet length distribution, connection duration, and the proportion of small packets at the session level. The micro CAE model captures these subtle statistical deviations. In this case, the original data packets of the abnormal sessions are selectively preserved for forensic analysis, and due to their high stealth and harmfulness, they are usually given a high priority for handling.
[0167] S254, when the macro traffic anomaly determination result indicates macro traffic anomaly in the first current time window, and the session traffic anomaly determination result indicates that there is a session with abnormal traffic data in the second current time window, it is determined that there is an explicit large-scale attack, and the full traffic data of the first current time window is saved for evidence collection.
[0168] The macro baseline model detected a significant deviation from the baseline in overall device-level traffic (e.g., a sudden increase in throughput, a surge in half-open connections, and an increase in retransmission rate), while the micro feature reconstruction model also detected multiple abnormal sessions. These two findings corroborate each other, pointing to a high-traffic, high-impact overt attack—such as a DDoS flood attack, a worm outbreak, or a reflection amplification attack. These attacks are characterized by: massive attack traffic volume sufficient to produce perceptible deviations in global aggregate metrics (macro anomalies); and, simultaneously, significant deviations from normal patterns in finer features such as packet length distribution (e.g., numerous small packets), connection status (e.g., numerous half-open connections), and access frequency (e.g., numerous different source IPs converging on the same target) for each session within the attack traffic (micro anomalies). The joint determination of these two anomalies confirmed the authenticity and scale of the attack, triggering traffic limiting and other response measures. Furthermore, all traffic data within the abnormal time window was fully retained, providing complete raw data for subsequent source tracing and evidence collection.
[0169] When there is a large-scale, overt attack, corresponding to a high-risk anomaly level, it is often a gradual DDoS attack, a mass worm propagation attack, or a reflection amplification attack. The system triggers an emergency high-risk warning across the entire platform, and simultaneously links the gateway / firewall to issue traffic limiting and access blocking policies. It also completely saves and collects evidence of all traffic data in the first current time window, and retains the original data packets for post-incident source tracing and analysis.
[0170] S260, perform targeted packet capture from the backflow and saved traffic data samples to obtain session-level traffic data samples; send the session-level traffic data samples to the target object for manual verification, and save them to the sample library after manual verification for periodic meta-learning fine-tuning of the feature reconstruction model.
[0171] Finally, this application updates the macro baseline model and feature reconstruction model using the returned traffic data. For the overall traffic data of the time window that is macro abnormal but micro normal, it is directly included in the rolling update queue of the historical sample library and participates in the monthly threshold recalculation and smoothing parameter fine-tuning of the macro baseline model without manual verification.
[0172] For abnormal session traffic data identified by the micro-feature reconstruction model, the system performs targeted packet capture to obtain session-level raw data samples. After manual verification and confirmation by operations and maintenance personnel, the real abnormal samples are added to the abnormal sample library for monthly meta-learning fine-tuning of the feature reconstruction model.
[0173] The two types of reflux data each complete the model update according to the predetermined path, forming a closed-loop mechanism of macro-threshold adaptation and micro-labeling to ensure quality.
[0174] This application establishes a complete three-level anomaly classification and early warning system. The classification standard is uniformly based on the deviation of the conversation feature reconstruction error from the relative error threshold. It is compatible with the aforementioned four-quadrant joint analysis of all anomaly scenarios. Different levels correspond to differentiated alarm channels, traffic handling strategies, and evidence collection granularity.
[0175] (1) Low-risk anomaly: The session reconstruction error slightly exceeds the preset error threshold. It is mostly a single accidental probe or sporadic scanning behavior. Only the original data packets and feature logs of the abnormal session are retained locally. Only the front-end page issues local alarms and no SMS or platform global notifications are pushed. This level is only triggered in the case of a hidden low-speed attack scenario where the macro traffic is normal and the micro-level anomaly is detected.
[0176] (2) Medium-risk anomaly: The session reconstruction error significantly exceeds the preset error threshold, mostly due to persistent low-frequency penetration, slow port scanning, DNS covert tunnel transmission and other latent attacks; the platform pop-up alarm and the operation and maintenance personnel SMS warning are triggered simultaneously, and the abnormal session data packets are retained for subsequent source tracing and evidence collection; this level is also only triggered in the scenario where the macro traffic is normal and the micro-detection of anomalies is detected.
[0177] (3) High-risk anomalies: When there is an obvious large-scale attack, it corresponds to large-scale obvious attacks such as gradual DDoS, worm batch external connection, reflection amplification, etc. It will only be triggered when the macro traffic synchronously judges the anomaly and detects the abnormal session at the same time. The system pushes an emergency high-risk warning to the entire platform, links the gateway and firewall to issue traffic limiting and access blocking handling policies, and retains the full traffic data packets of the current macro time window, and completely retains the full amount of original network data to support in-depth source tracing analysis.
[0178] This tiered system balances the storage overhead of big data clusters with the priority of security handling. For low and medium risk scenarios, only abnormal session data is retained, while for high risk scenarios, all window traffic is retained. This reduces storage pressure while ensuring the integrity and usability of forensic data under various attack scenarios.
[0179] like Figure 4 As shown, this application also provides an intelligent abnormal traffic detection system for big data scenarios, including:
[0180] The acquisition module is used to acquire overall device-level traffic data for the first current time window and session traffic data for multiple sessions in the second current time window, wherein the first target duration is greater than the second target duration;
[0181] The feature extraction module is used to extract global traffic features from the overall traffic data and extract session traffic features from the session traffic data. The session traffic features include packet length distribution features, access behavior features, traffic timing fluctuation features, and connection duration distribution features.
[0182] The macroscopic detection module is used to input the global traffic features into a pre-built macroscopic baseline model to obtain the baseline features of the first current time window, and calculate the macroscopic traffic anomaly judgment result of the first current time window based on the baseline features and the global traffic features.
[0183] The micro-detection module is used to perform session filtering within the second time window based on the macro-traffic anomaly determination result, obtain target sessions, input the session traffic features of the target sessions into a pre-built feature reconstruction model to obtain reconstructed features, calculate the reconstruction error between the reconstructed features and the session traffic features, and determine the session traffic anomaly determination result based on the reconstruction error. The feature reconstruction model is constructed by pre-training an autoencoder and fine-tuning with few samples based on a meta-learning framework.
[0184] The joint detection module is used to perform joint analysis based on the macro traffic anomaly determination results and the session traffic anomaly determination results to obtain traffic detection results.
[0185] The present application presents an intelligent abnormal traffic detection method and system for big data scenarios. Through a dual-engine linkage architecture of macro-dynamic baseline perception and micro-small sample adaptive detection, it significantly improves the accuracy and generalization ability of abnormal traffic detection in big data scenarios.
[0186] First, the macro baseline model uses Holt-Winters time series forecasting and Mahalanobis distance residual analysis to adaptively fit the periodic fluctuation characteristics of business traffic, effectively distinguishing between normal business bursts and real attacks, and solving the inherent problems of high false alarm rate and poor robustness of traditional fixed threshold schemes in dynamic business environments.
[0187] Secondly, microscopic detection is based on unsupervised pre-training of autoencoders, which only requires a large amount of unlabeled normal traffic to build an accurate reconstruction model, thus getting rid of the strong dependence on a large number of abnormal labeled samples. The introduction of the MAML meta-learning framework for small sample fine-tuning enables the model to actively learn the deviation of abnormal features from the rules. Even when facing new and unknown attacks not covered in the training set, it still has strong generalization recognition ability, overcoming the dual pain points of scarce annotations and weak recognition of unknown threats in fully supervised deep learning.
[0188] Third, based on the macro-anomaly judgment results, the micro-conversation screening and on-demand detection are dynamically guided, realizing two-level intelligent linkage. While ensuring detection accuracy, the computational overhead is greatly reduced, meeting the low-latency deployment requirements of real-time traffic in big data clusters.
[0189] In summary, this application effectively overcomes the core bottlenecks of traditional rule-based thresholding and fully supervised deep learning methods in terms of dynamism, generalization, and real-time performance, providing a highly robust intelligent detection solution for network security protection in big data scenarios.
[0190] This embodiment also provides an electronic terminal, including: a processor and a memory;
[0191] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory so that the terminal performs any of the methods in this embodiment.
[0192] As will be understood by those skilled in the art, the computer-readable storage medium described in this embodiment allows for the implementation of all or part of the steps in the above method embodiments by computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0193] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the electronic terminal performs the steps of the above method.
[0194] In this embodiment, the memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0195] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0196] In the above embodiments, although the present application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. The embodiments of the present application are intended to cover all such substitutions, modifications, and variations falling within the broad scope of the appended claims.
[0197] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. An intelligent method for detecting abnormal traffic in big data scenarios, characterized in that, include: Obtain overall device-level traffic data for the first current time window and session traffic data for multiple sessions in the second current time window; Global traffic features are extracted from the overall traffic data, and session traffic features are extracted from the session traffic data. The session traffic features include packet length distribution features, access behavior features, traffic timing fluctuation features, and connection duration distribution features. The global traffic features are input into a pre-built macro baseline model to obtain the baseline features of the first current time window, and the macro traffic anomaly determination result of the first current time window is calculated based on the baseline features and the global traffic features. Based on the macro-traffic anomaly determination result, session filtering is performed within the second time window to obtain target sessions. The session traffic features of the target sessions are then input into a pre-built feature reconstruction model to obtain reconstructed features. The reconstruction error between the reconstructed features and the session traffic features is calculated, and the session traffic anomaly determination result is determined based on the reconstruction error. The feature reconstruction model is constructed by pre-training an autoencoder and fine-tuning it with few samples based on a meta-learning framework. Based on the joint analysis of the macro-level traffic anomaly determination results and the session traffic anomaly determination results, traffic detection results are obtained.
2. The intelligent abnormal traffic detection method for big data scenarios according to claim 1, characterized in that, Based on the macro-level traffic anomaly determination results, session filtering is performed within the second time window to obtain target sessions, including: When the macro traffic anomaly determination result indicates that the overall traffic data is abnormal, calculate the source IP entropy value and destination IP entropy value of all active IPs within the second current time window; extract the header source IP set whose source IP entropy value is lower than a preset first threshold and the header destination IP set whose destination IP entropy value is lower than a preset second threshold respectively, and take the union of the two sets as the target session; if both are lower than the threshold, then extract the intersection session first. When the macro-traffic anomaly determination result indicates that there is no anomaly in the overall traffic data, lightweight session features of all sessions within the second current time window are extracted, and the unfamiliarity of each session is calculated based on the lightweight session features. Then, all sessions within the second current time window are sampled based on the unfamiliarity sampling mechanism and the random sampling mechanism to obtain the target session. The session with higher unfamiliarity has a higher probability of being sampled. The unfamiliarity is the Euclidean distance between the lightweight session features and the center of the historical lightweight session features.
3. The intelligent abnormal traffic detection method for big data scenarios according to claim 1, characterized in that, The global traffic characteristics include total inbound throughput, total outbound throughput, number of packets per second, average round-trip latency for all TCP connections, TCP retransmission rate, and number of half-open connections at the end of the window. The method for constructing the macro-baseline model includes: Obtain a historical traffic data sequence for the third target duration prior to the current time point, wherein the historical traffic data sequence is updated on a rolling basis; The historical traffic data sequence is segmented based on a preset first time window to obtain multiple overall traffic data samples, wherein the width of the first time window is a first duration. Extract global traffic feature samples from the overall traffic data sample; The Holt-Winters third-order exponential smoothing model for each feature dimension is trained based on multiple global traffic feature samples to obtain the macro baseline model.
4. The intelligent abnormal traffic detection method for big data scenarios according to claim 3, characterized in that, The macroscopic traffic anomaly determination result for the first current time window is determined based on the baseline characteristics and the global traffic characteristics, including: Calculate the residual vector between the baseline features and the global traffic features; Based on the aforementioned macroscopic baseline model, multiple global traffic feature samples are predicted to obtain multiple baseline feature samples. Furthermore, the difference between the global traffic feature samples and the baseline feature samples within each same time window is calculated to obtain multiple residual vector samples. ; Calculate multiple residual vector samples absolute deviation of the median And will satisfy: residual vector samples After removal, a residual vector sample sequence is obtained, where, This is the threshold coefficient; Calculate multiple residual vector samples in the residual vector sample sequence The mean of the residuals is obtained by taking the mean of the residuals. Based on the mean of the residuals and multiple residual vector samples in the residual vector sample sequence Calculate the cosine matrix The covariance matrix The mathematical expression is: In the formula, For time window indexing, This represents the number of time windows in the residual vector sample sequence; The macroscopic flow deviation score for the first current time window is calculated based on the residual vector and the covariance matrix. The macroscopic flow deviation score The mathematical expression is: In the formula, This is the residual vector for the first current time window; The macro-flow deviation score Compared with the preset score threshold To make a comparison, in If the macroscopic flow rate of the first current time window is normal, it is determined that the macroscopic flow rate of the first current time window is normal; otherwise, it is determined that the macroscopic flow rate of the first current time window is abnormal.
5. The intelligent detection method for abnormal traffic in big data scenarios according to claim 1, characterized in that, The training method for the feature reconstruction model includes: Acquire normal session traffic data samples from multiple normal sessions and abnormal session traffic data samples generated during network attacks, wherein the abnormal session traffic data samples are labeled with abnormal type. Extract normal session traffic feature samples from the normal session traffic data samples, and extract abnormal session traffic feature samples from the abnormal session traffic data samples; The normal session traffic feature samples are input into the autoencoder to obtain reconstructed samples; the reconstruction error between the reconstructed samples and the normal session traffic feature samples is calculated, and the autoencoder is pre-trained based on the reconstruction error to obtain the pre-trained autoencoder. Based on the meta-learning framework, the pre-trained autoencoder is fine-tuned using abnormal session traffic data samples from tasks with various anomaly type labels to obtain a feature reconstruction model.
6. The intelligent detection method for abnormal traffic in big data scenarios according to claim 1, characterized in that, The session traffic anomaly determination result is determined based on the reconstruction error, including: The reconstruction error is compared with a preset error threshold, wherein the error threshold is the 95th percentile of the reconstruction error of the feature reconstruction model after reconstructing all training samples. When the reconstruction error is less than or equal to the error threshold, the current session traffic data of the second current time window is determined to be normal; otherwise, the current session traffic data of the second current time window is determined to be abnormal.
7. The intelligent abnormal traffic detection method for big data scenarios according to claim 1, characterized in that, Based on the joint analysis of the macro-level traffic anomaly determination results and the session traffic anomaly determination results, traffic detection results are obtained, including: When the macro traffic anomaly determination result indicates that the macro traffic in the first current time window is normal, and the session traffic anomaly determination result indicates that all session traffic data in the second current time window is normal, the service is determined to be stable and risk-free. When the macro traffic anomaly determination result indicates macro traffic anomaly in the first current time window, and the session traffic anomaly determination result indicates that all session traffic data in the second current time window is normal, it is determined that there is planned large traffic or network interruption, and the overall traffic data of the first current time window is fed back to the sample library for updating the macro baseline model and reconstructing the error threshold. When the macro traffic anomaly determination result indicates that the macro traffic in the first current time window is normal, and the session traffic anomaly determination result indicates that there is a session with abnormal traffic data in the second current time window, it is determined that there is a covert low-speed attack, and the session traffic data in the second current time window is saved for evidence collection. When the macro traffic anomaly determination result indicates macro traffic anomaly in the first current time window, and the session traffic anomaly determination result indicates that there is a session with abnormal traffic data in the second current time window, it is determined that there is an explicit large-scale attack, and the full traffic data of the first current time window is saved for evidence collection.
8. The intelligent detection method for abnormal traffic in big data scenarios according to claim 7, characterized in that, Also includes: Targeted packet capture is performed on the backflow and saved traffic data samples to obtain session-level traffic data samples; The session-level traffic data sample is sent to the target object for manual verification, and after manual verification, it is saved to the sample library for periodic meta-learning fine-tuning of the feature reconstruction model.
9. The intelligent detection method for abnormal traffic in big data scenarios according to claim 7, characterized in that, Also includes: When the current session traffic data in the second current time window is abnormal, calculate the difference between the reconstruction error and the preset error threshold; When the difference is greater than a preset first error threshold and less than a preset second error threshold, the abnormality level is determined to be low risk. When the difference is greater than or equal to a preset second error threshold, the anomaly level is determined to be medium risk; when there is an overt large-scale attack, the anomaly level is determined to be high risk, wherein the second error threshold is greater than the first error threshold. When the anomaly level is low, an alert is issued based on the local log page; when the anomaly level is medium, a platform pop-up and SMS alert are pushed; when the anomaly level is high, an emergency alert is triggered across the entire platform and the gateway is linked to perform traffic limiting and blocking. The high-risk alert is only activated when there is an anomaly in the macro traffic synchronization.
10. An intelligent abnormal traffic detection system for big data scenarios, characterized in that: include: The acquisition module is used to acquire overall device-level traffic data for the first current time window and session traffic data for multiple sessions in the second current time window. The feature extraction module is used to extract global traffic features from the overall traffic data and extract session traffic features from the session traffic data. The session traffic features include packet length distribution features, access behavior features, traffic timing fluctuation features, and connection duration distribution features. The macroscopic detection module is used to input the global traffic features into a pre-built macroscopic baseline model to obtain the baseline features of the first current time window, and calculate the macroscopic traffic anomaly judgment result of the first current time window based on the baseline features and the global traffic features. The micro-detection module is used to perform session filtering within the second time window based on the macro-traffic anomaly determination result, obtain target sessions, input the session traffic features of the target sessions into a pre-built feature reconstruction model to obtain reconstructed features, calculate the reconstruction error between the reconstructed features and the session traffic features, and determine the session traffic anomaly determination result based on the reconstruction error. The feature reconstruction model is constructed by pre-training an autoencoder and fine-tuning with few samples based on a meta-learning framework. The joint detection module is used to perform joint analysis based on the macro traffic anomaly determination results and the session traffic anomaly determination results to obtain traffic detection results.
