Network flow independent coding method suitable for flow sequence frequency domain feature extraction
Standardized network traffic data through spline interpolation, the problems of heterogeneity and timing inconsistency of traffic data in network attack detection are solved, feature extraction efficiency and data processing are improved, and efficient processing and information completeness of large-scale traffic is achieved. Keep sexually.
Patent Information
- Application Number
- CN202411090956.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-29
AI Technical Summary
The prior art has problems such as dependence on specific scenarios, difficulty in handling large-scale traffic data and traffic customization in network attack detection, resulting in low detection efficiency and information loss.
Through spline interpolation, the timestamps and packet size in network traffic are standardized, and the isometric flow sequence is constructed, and the problems of traffic data are solved and the efficiency and accuracy of traffic feature extraction and data processing are improved.
It realizes data standardization, improves feature extraction efficiency, reduces information loss, maintains the integrity and accuracy of the original data, and can efficiently process large-scale traffic data.
Smart Images

Figure CN119051920A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of simulation calculation, and in particular to a network flow independent encoding method suitable for extracting frequency domain features of flow sequences. Background Art
[0002] Nowadays, cyber attacks have penetrated into various critical Internet applications, such as IoT systems, enterprise networks, and industrial infrastructure. Abnormal traffic analysis is an important means of detecting cyber attacks. Abnormal traffic analysis based on deep learning has achieved remarkable results, but there are still some shortcomings.
[0003] (1) Traffic analysis can only be performed in specific scenarios. For example, the Chinese patent with publication number CN113705619A is only for the detection of encrypted malicious traffic. The Chinese patent with publication number CN114268468A is only for vulnerability detection in smart grid systems.
[0004] (2) There are still difficulties in processing large-scale traffic data. For example, the patent with publication number CN113347659B uses LSTM and CNN to analyze traffic. However, LSTM cannot process sequences of large magnitude. For sequences of more than 1,000 magnitude or longer, problems such as gradient explosion may occur. In addition, each LSTM unit node means that there are 4 fully connected layers. If the time series span is large and the network is deep, there will be problems such as large amount of calculation and high time consumption. Due to the CNN pooling layer, using it to extract traffic features will lose certain valuable information.
[0005] (3) Traffic customization cannot be avoided. Due to the contradiction between the homogeneous input required by the neural network and the heterogeneity of the traffic itself, usually, before converting the traffic into a vector, the traffic needs to be customized to adapt to the subsequent input. For example, in the Chinese patent with publication number CN105830377B, the traffic needs to be cut before subsequent processing. This step undoubtedly damages the integrity of the information. Summary of the invention
[0006] The purpose of the present invention is to disclose a network flow independent encoding method suitable for frequency domain feature extraction of flow sequences, standardize the timestamps and data packet sizes in network traffic through spline interpolation, solve the problems of heterogeneity and timing inconsistency of traffic data, thereby improving the efficiency and accuracy of feature extraction and subsequent data processing.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] The present invention provides a network stream independent encoding method suitable for extracting frequency domain features of stream sequences, comprising:
[0009] The first step is to collect traffic data;
[0010] The second step is to obtain data packets from the collected traffic data and attribute the data packets to the corresponding flows;
[0011] The third step is to construct a non-equidistant flow sequence based on the attributes of the data packets;
[0012] The fourth step is to interpolate the non-equidistant flow sequence to obtain the equidistant flow sequence.
[0013] Preferably, the second step comprises:
[0014] The original traffic containing data packets collected in the file pcap format is input into the stream coding model, and each data packet is attributed to the corresponding flow according to the five-tuple information of the data packet <source IP, source port, destination IP, destination port, protocol>.
[0015] Preferably, the third step comprises:
[0016] Let k represent the number of packets contained in the flow. For a packet P belonging to the flow i , extract its transmission start time Transfer end time Packet size i , transmission direction d i , then a flow can be expressed as:
[0017]
[0018] So far, for flow F, a non-equidistant flow sequence based on its properties has been constructed.
[0019] Preferably, for the transmission direction d i , when the source address of the data packet is greater than the destination address, then d i is equal to 1, otherwise, d i is -1.
[0020] Preferably, the fourth step comprises:
[0021] Cubic spline interpolation is used as the interpolation method to interpolate the non-equidistant flow sequence. i ,x i+1 ], the formula for cubic spline interpolation is as follows:
[0022] S(x)=a i +b i (xx i )+c i (xx i ) 2 +d i (xxi ) 3
[0023] Among them, a i , b i , c i and d i is the coefficient to be determined;
[0024] The interval [x i ,x i+1 ] and then obtain the flow sequence of equal distances through the simulation equation;
[0025] By this method, the time and size data of non-equidistant flow series are interpolated respectively. As the dependent variable, and d i s i As two The independent variables of are constructed by the above interpolation method to construct equidistant sequences about the size and time of data packets in the flow.
[0026] Beneficial effects:
[0027] (1) Data standardization is achieved. Through spline interpolation, the uneven flow data is standardized to facilitate subsequent processing.
[0028] (2) Efficient processing, providing uniform data input for fast Fourier transform and improving feature extraction efficiency.
[0029] (3) Reduced information loss, no need to compress or customize traffic data, and maintained the integrity and accuracy of the original data. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0031] Figure 1 It is a schematic diagram of a network stream independent encoding method suitable for extracting frequency domain features of stream sequences according to the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] like Figure 1 As shown, the present invention provides a network stream independent encoding method suitable for extracting frequency domain features of stream sequences, comprising:
[0034] The first step is to collect traffic data;
[0035] The second step is to obtain data packets from the collected traffic data and attribute the data packets to the corresponding flows;
[0036] The third step is to construct a non-equidistant flow sequence based on the attributes of the data packets;
[0037] The fourth step is to interpolate the non-equidistant flow sequence to obtain the equidistant flow sequence.
[0038] Preferably, the second step comprises:
[0039] The original traffic containing data packets collected in the file pcap format is input into the stream coding model, and each data packet is attributed to the corresponding flow according to the five-tuple information of the data packet <source IP, source port, destination IP, destination port, protocol>.
[0040] Preferably, the third step comprises:
[0041] Let k represent the number of packets contained in the flow. For a packet P belonging to the flow i , extract its transmission start time Transfer end time Packet size i , transmission direction d i , then a flow can be expressed as:
[0042]
[0043] So far, for flow F, a non-equidistant flow sequence based on its properties (time, size) has been constructed.
[0044] Preferably, for the transmission direction d i , when the source address of the data packet is greater than the destination address, then d i is equal to 1, otherwise, d i is -1.
[0045] Preferably, the fourth step comprises:
[0046] Interpolation is performed for non-equidistant sequences. Considering the number of packets in a flow under normal circumstances, the experimental results are used as a benchmark.
[0047] Cubic spline interpolation is used as the interpolation method to interpolate the non-equidistant flow sequence. i ,x i+1 ], the formula for cubic spline interpolation is as follows:
[0048] S(x)=a i +b i (xx i )+c i (xx i ) 2 +d i (xx i ) 3
[0049] Among them, a i , b i , c i and d i is the coefficient to be determined;
[0050] The interval [x i ,x i+1 ] and then obtain the flow sequence of equal distances through the simulation equation;
[0051] By this method, the time and size data of non-equidistant flow series are interpolated respectively. As the dependent variable, and d i s i As two The independent variables of are constructed by the above interpolation method to construct equidistant sequences about the size and time of data packets in the flow.
[0052] The simulation equation is an equation obtained after determining the coefficients in the formula S(x) by the method of undetermined coefficients. It is a four-variable linear equation determined by four points (the four points are derived from the non-equidistant flow sequence above).
[0053] Through the above steps, the present invention can independently encode each network flow and generate a flow sequence vector suitable for extracting frequency domain features of the flow sequence.
[0054] This paper introduces a new flow coding model that can generate a unified representation of network flows, enable in-depth study of network flow characteristics, and collectively analyze the basic information of network packets, flows, and interrelationships:
[0055] (1) Achieve large-scale traffic processing
[0056] The present invention assigns data packets to corresponding flows according to five-element information (source IP, source port, destination IP, destination port, protocol), and encodes each network flow separately so that multiple flows can be processed in parallel to realize the processing of large-scale network traffic.
[0057] (2) Dealing with traffic heterogeneity
[0058] Generally, in a traffic feature extraction system based on deep learning, the traffic itself needs to be processed to achieve the purpose of converting heterogeneous traffic into homogeneous input vectors, such as traffic cutting (splitting overly long traffic into multiple streams) and information compression (using structures such as convolutional neural networks to compress traffic information). However, through the data processing process proposed in this patent, heterogeneous traffic can be converted into homogeneous vectors without traffic cutting and information compression, so as to subsequently extract frequency domain features in the traffic sequence and obtain richer information.
[0059] (3) Generate traffic sequence suitable for fast Fourier transform processing
[0060] The present invention generates an equidistant flow sequence by interpolating a non-equidistant flow sequence while ensuring processing efficiency, so that the flow information can be processed by fast Fourier transform.
[0061] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A network stream independent coding method suitable for extracting frequency domain features of stream sequences, characterized in that: include: The first step is to collect traffic data; The second step is to obtain data packets from the collected traffic data and attribute the data packets to the corresponding flows; The third step is to construct a non-equidistant flow sequence based on the attributes of the data packets; The fourth step is to interpolate the non-equidistant flow sequence to obtain the equidistant flow sequence.
2. A network stream independent coding method suitable for extracting frequency domain features of stream sequences according to claim 1, characterized in that: The second step includes: The original traffic containing data packets collected in the file pcap format is input into the stream coding model, and each data packet is attributed to the corresponding flow according to the five-tuple information of the data packet <source IP, source port, destination IP, destination port, protocol>.
3. A network stream independent coding method suitable for extracting frequency domain features of stream sequences according to claim 1, characterized in that: The third step includes: Let k represent the number of packets contained in the flow. For a packet P belonging to the flow i , extract its transmission start time Transfer end time Packet size i , transmission direction d i , then a flow can be expressed as: So far, for flow F, a non-equidistant flow sequence based on its properties has been constructed.
4. A network stream independent coding method suitable for extracting frequency domain features of stream sequences according to claim 3, characterized in that: For the transmission direction d i , when the source address of the data packet is greater than the destination address, then d i is equal to 1, otherwise, d i is -1.
5. A network stream independent coding method suitable for extracting frequency domain features of stream sequences according to claim 3, characterized in that: The fourth step includes: Cubic spline interpolation is used as the interpolation method to interpolate the non-equidistant flow sequence. i ,x i+1 ], the formula for cubic spline interpolation is as follows: S(x)=a i +b i (x-x i )+c i (x-x i ) 2 +d i (x-x i ) 3 Among them, a i , b i , c i and d i is the coefficient to be determined; The interval [x i ,x i+1 ] and then obtain the flow sequence of equal distances through the simulation equation; By this method, the time and size data of non-equidistant flow series are interpolated respectively. As the dependent variable, and d i s i As two The independent variables of are constructed by the above interpolation method to construct equidistant sequences about the size and time of data packets in the flow.
Citation Information
Cited By
Intelligent matching method for watershed hydrology-ecology-sediment factor process simulation equation and related equipment
CN120256972A
