Method, device, equipment and medium for identifying encrypted homogeneous traffic of mobile applications
Through deep learning technology, the spatial and temporal feature-related graph and timing feature learning model are constructed, combined with self-supervised comparison learning and knowledge distillation learning, the problem of low homogeneous traffic recognition accuracy of encrypted mobile applications is solved, and higher recognition accuracy and network security supervision are achieved efficiency.
Patent Information
- Application Number
- CN202411230868.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-09-04
AI Technical Summary
It is difficult to accurately identify homogeneous traffic of encrypted mobile applications in prior art, and traditional methods have low recognition accuracy when processing encrypted mobile application traffic, especially in the presence of a large amount of homogeneous traffic.
Using deep learning technology, by constructing spatiotemporal and spatial feature correlation graphs based on graph structure, combining timing attention-gated cycle encoding-decoder and self-supervised comparison learning and knowledge distillation learning, the recognition model is trained to improve the recognition ability of encrypted homogeneous flow.
It significantly improves the recognition accuracy and robustness of encrypted homogeneous traffic, and can accurately identify multiple types of encrypted homogeneous traffic in complex network environments, enhancing the efficiency and intensity of cyberspace security supervision.
Smart Images

Figure CN118740525B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of traffic identification, and in particular relates to a method, device, equipment and medium for identifying encrypted homogeneous traffic of mobile applications. Background Art
[0002] With the rapid development of network communication technology and the widespread popularity of smart phones, mobile application traffic has become the main network traffic on the Internet. For the purpose of protecting user privacy and data security, more and more mobile applications use encryption protocols to ensure the security of data transmission in network communications. It is an inevitable trend for network traffic to move towards the era of full encryption. With the explosive growth of encrypted mobile application traffic, the identification and management of mobile application traffic has brought huge challenges. Compared with the identification of network traffic generated by traditional computers and other network devices, mobile applications are rich in variety and the encrypted traffic data generated is more complex, making it difficult to learn effective and robust features. In addition, there is a certain amount of homogeneous traffic in mobile applications, and the traffic generated by different applications may have similar or even identical features. Accurate analysis and identification of encrypted mobile application traffic is the basis of mobile Internet network management, which is of great significance to realizing refined traffic management, improving network service quality, ensuring cyberspace security, and strengthening network information supervision.
[0003] The homogeneity of mobile application traffic is that traffic generated by different mobile applications has similar or even identical characteristics. Many applications use mature third-party libraries (authentication libraries, advertising libraries, and analysis libraries) during development, which themselves generate network traffic. Since the network traffic generated by public libraries across applications is similar, it causes great interference to the identification of network traffic, because the same traffic data may have different classification labels.
[0004] In network traffic analysis technology, traditional methods based on port matching, rules, and deep packet inspection face failure when dealing with homogeneous traffic of encrypted mobile applications, while classic machine learning methods also face the problem of reduced analysis and identification accuracy when dealing with homogeneous traffic. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, equipment and medium for identifying encrypted homogeneous traffic of mobile applications. The deep learning technology is adopted, which has higher learning ability and stronger fitting ability, and is more helpful to learn the complex relationship and deep characteristics between encrypted network traffic data, and provides a technical solution to the analysis and identification problems of encrypted mobile application homogeneous traffic.
[0006] The object of the present invention is achieved through the following technical solutions:
[0007] A method for identifying encrypted homogeneous traffic of a mobile application, the method comprising:
[0008] In response to the obtained original data of encrypted traffic of mobile applications, preprocessing the original data is performed to extract spatiotemporal feature data;
[0009] Construct the spatiotemporal feature correlation graph of encrypted homogeneous traffic of mobile applications based on the representation of graph structure;
[0010] Construct a mobile application encrypted homogeneous traffic time series feature learning and recognition model to learn the spatiotemporal feature correlation graph;
[0011] Training the feature learning recognition model based on a spatiotemporal feature incremental learning method;
[0012] The trained feature learning recognition model is used to perform classification prediction and output the classification and recognition results of mobile application encrypted homogeneous traffic.
[0013] Furthermore, the preprocessing of the raw data to extract the spatiotemporal feature data specifically includes:
[0014] The original traffic file of the mobile application is divided into multiple bursts according to the time threshold, and the data packets in each burst are divided into flows according to the five-tuple;
[0015] Perform preliminary cleaning on the stream and delete invalid data;
[0016] Extract the first 256 bytes of the first N packets from the stream. If the stream is less than N packets or the payload length is less than 256 bytes, use 0 to fill it. Convert each byte to a decimal number. N is the number of packets to be extracted.
[0017] Distinguish the uplink and downlink directions of data packets, wherein the direction of the first data packet in a complete mobile application session flow is uplink, and the payload data with the same start address, destination address and port number as the first data packet is regarded as uplink payload data, and the rest is regarded as downlink payload data;
[0018] According to the organization of data packets in chronological order, the spatiotemporal characteristic data of encrypted traffic of mobile applications are obtained.
[0019] Furthermore, the graph structure-based representation method for constructing a temporal and spatial feature correlation graph of encrypted homogeneous traffic of mobile applications specifically includes:
[0020] Representing each flow in the burst as a graph node, extracting features from the spatiotemporal features of the mobile application encrypted data as features of the graph node, and embedding a payload sequence length, a payload data direction, and a payload data feature containing a size of 256 bytes in each graph node;
[0021] For each burst, the selected features are extracted from the m streams and constructed into m graph nodes. The graph nodes are connected to each other to obtain the spatiotemporal feature correlation graph of all bursts.
[0022] Furthermore, the construction of the mobile application encrypted homogeneous traffic time series feature learning and recognition model and the learning of the spatiotemporal feature correlation graph specifically include:
[0023] Performing random perturbations on the spatiotemporal feature correlation graph to obtain a spatiotemporal feature correlation graph with random perturbations;
[0024] A temporal feature learning and recognition model for encrypted homogeneous traffic of mobile applications based on a temporal attention gated recurrent encoder-decoder is constructed to learn and extract the temporal features of each graph node of a spatiotemporal feature correlation graph with random perturbations. The encoder of the learning and recognition model uses a gated recurrent unit to capture the temporal features and compress the temporal feature matrix into a high-dimensional feature vector. The decoder of the learning and recognition model uses a gated recurrent unit with a global attention mechanism to extract the key temporal feature vectors of the entire spatiotemporal feature correlation graph and its contextual attention feature vectors.
[0025] Furthermore, the training of the feature learning recognition model based on the spatiotemporal feature incremental learning method specifically includes:
[0026] Obtain new encrypted homogeneous traffic data of mobile applications in the network environment, and randomly select a number of new burst traffic data to establish a training sample set;
[0027] Obtaining a set of mobile application encrypted homogeneous traffic spatiotemporal feature correlation graph sample sets corresponding to a number of new burst traffic data according to the training sample set;
[0028] Performing data enhancement on the mobile application encrypted homogeneous traffic spatiotemporal feature correlation graph sample set to obtain a new spatiotemporal feature correlation graph sample, and for any correlation graph sample in the original mobile application encrypted homogeneous traffic spatiotemporal feature correlation graph sample set, after enhancement, obtaining 2 positive samples and 2 (N-1) negative samples of the same type;
[0029] Use the feature learning recognition model to perform feature learning on new spatiotemporal feature correlation graph samples and output a feature vector;
[0030] A nonlinear transformation projection head is constructed based on a two-layer perceptron network, and the projection head operation is performed to project the feature vector associated with the encrypted homogeneous traffic into the comparison space to obtain the projected feature vector.
[0031] Furthermore, the method further comprises:
[0032] The feature learning and recognition model is adaptively updated according to the incremental learning loss of spatiotemporal features. The feature learning and recognition model is updated and trained respectively using supervised contrastive learning and self-supervised relational knowledge distillation learning. The existing model is adaptively updated on the basis of retaining the existing knowledge of spatiotemporal features of encrypted homogeneous traffic.
[0033] Furthermore, the method of performing classification prediction using the trained feature learning recognition model and outputting the classification recognition result of the encrypted homogeneous traffic of mobile applications specifically includes:
[0034] The learned encrypted homogeneous traffic spatiotemporal features are input into a fully connected layer and a Softmax layer, and the encrypted homogeneous traffic classification label prediction tensor is output.
[0035] On the other hand, the present invention also provides a mobile application encrypted homogeneous traffic identification device, the device comprising:
[0036] A preprocessing module, wherein the preprocessing module preprocesses the original data in response to the obtained encrypted traffic of the mobile application, and extracts the spatiotemporal feature data;
[0037] A correlation graph construction module, wherein the correlation graph construction module constructs a temporal and spatial feature correlation graph of encrypted homogeneous traffic of mobile applications based on a representation method of a graph structure;
[0038] A model building module, wherein the model building module constructs a mobile application encrypted homogeneous traffic time series feature learning and recognition model, and learns the spatiotemporal feature correlation graph;
[0039] A model training module, wherein the model training module trains the feature learning recognition model based on a spatiotemporal feature incremental learning method;
[0040] The identification module uses the trained feature learning identification model to perform classification prediction and output the classification identification result of the mobile application encrypted homogeneous traffic.
[0041] On the other hand, the present invention also provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement any of the above-mentioned mobile application encrypted homogeneous traffic identification methods.
[0042] On the other hand, the present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement any of the above-mentioned mobile application encrypted homogeneous traffic identification methods.
[0043] The beneficial effects of the present invention are:
[0044] (1) The method provided by the present invention starts from the perspective of feature engineering. By constructing a traffic spatiotemporal feature correlation graph, the temporal characteristics of the traffic sequence are analyzed while the spatial structure characteristics of the traffic sequence are simultaneously mined. The extracted key moment features of the mobile application encrypted homogeneous traffic are more robust. The established learning recognition model has the ability to deeply learn the mobile application encrypted homogeneous traffic, which can better improve the recognition accuracy and robustness of homogeneous traffic.
[0045] (2) Aiming at the problem that mobile applications are updated more frequently and mobile encrypted traffic is more prone to traffic concept drift, the present invention proposes an adaptive training method for encrypted homogeneous traffic identification model that integrates self-supervised contrastive learning and knowledge distillation learning. Using self-supervised contrastive learning to update the model to learn the characteristics of new traffic, while using self-supervised distillation to retain the traffic feature knowledge learned by the previous model, can effectively ensure the stability of the model in an open network environment.
[0046] (3) The present invention can accurately identify various types of encrypted homogeneous traffic of mobile applications, improve the efficiency and intensity of cyberspace security supervision, conduct data set sampling tests in complex network environments, and the detection results are more in line with the needs in real network environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a flowchart of a method for identifying encrypted homogeneous traffic of mobile applications according to an embodiment of the present invention;
[0048] Figure 2 It is a schematic diagram of a flow chart of constructing a traffic correlation graph by encrypting burst traffic of a mobile application according to an embodiment of the present invention;
[0049] Figure 3 It is a structural diagram of a mobile application encrypted homogeneous traffic feature learning and recognition model based on a temporal attention gated loop and a residual parallel graph attention network in an embodiment of the present invention;
[0050] Figure 4 It is a flow chart of an adaptive incremental learning training of a mobile application encrypted homogeneous traffic feature learning and recognition model based on supervised contrastive learning and self-supervised relational knowledge distillation learning in an embodiment of the present invention;
[0051] Figure 5 It is a structural block diagram of a mobile application encrypted homogeneous traffic identification device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0053] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making any creative work shall fall within the scope of protection of the present invention.
[0054] In network traffic analysis technology, traditional methods based on port matching, rules, and deep packet inspection face failure when dealing with homogeneous traffic of encrypted mobile applications, while classic machine learning methods also face the problem of reduced analysis and identification accuracy when dealing with homogeneous traffic.
[0055] In order to solve the above technical problems, the following embodiments of the method, device, equipment and medium for identifying encrypted homogeneous traffic of mobile applications of the present invention are proposed.
[0056] Example 1
[0057] Reference Figure 1 ,like Figure 1 FIG. 1 is a flowchart of a method for identifying encrypted homogeneous traffic of mobile applications according to an embodiment of the present invention. The method specifically includes the following steps:
[0058] Step 1: Preprocess the collected raw data of mobile application encrypted traffic and extract the spatiotemporal feature data in the traffic load.
[0059] Step 2. Construct a spatiotemporal feature correlation graph of encrypted homogeneous traffic of mobile applications based on the graph structure representation.
[0060] Step 3. Construct a mobile application encrypted homogeneous traffic temporal feature learning and recognition model based on the temporal attention gated recurrent unit and the residual parallel graph attention network to learn the encrypted homogeneous traffic spatiotemporal feature vector.
[0061] Step 4. Train the encrypted homogeneous traffic feature learning and recognition model of mobile applications based on the incremental learning method of spatiotemporal features, and adaptively update the feature learning and recognition model according to the incremental learning loss of spatiotemporal features.
[0062] Step 5. Use the constructed model to perform classification prediction, input the learned encrypted homogeneous traffic spatiotemporal features into a fully connected layer and a Softmax layer, and output the classification and recognition results of mobile application encrypted homogeneous traffic.
[0063] Specifically, in this embodiment, step 1 specifically includes the following sub-steps:
[0064] 1.1 The original traffic file of the mobile application is divided into multiple bursts according to the time threshold. The data packets in each burst are divided into flows according to the five-tuple (IP, port, protocol). This process is completed using the Tshark tool that comes with WireShark.
[0065] 1.2 Use Tshark to perform preliminary cleaning on the stream and delete the timed-out retransmission packets, duplicate confirmation packets, and RESET packets.
[0066] 1.3 Use PyShark to extract the first 256 bytes of the first N packets from the stream. Streams with less than N packets or packets with a payload length less than 256 bytes are padded with 0. Convert each byte to a decimal number (0-255), where N is the number of packets to be extracted.
[0067] 1.4 Distinguish the upstream and downstream directions of data packets, define the direction of the first data packet in a complete mobile application session flow as upstream, and treat the payload data with the same start address, destination address and port number as the first data packet as upstream payload data, and the rest as downstream payload data.
[0068] 1.5 Arrange the temporal and spatial characteristic data of encrypted traffic of mobile applications in the order of the time sequence of the data packets.
[0069] Reference Figure 2 ,like Figure 2 FIG. 2 is a flow chart of constructing a traffic correlation graph by encrypting burst traffic of a mobile application in this embodiment. Specifically, in this embodiment, step 2 specifically includes the following sub-steps:
[0070] 2.1 Multiple bursts in traffic are represented as: , the multiple flows in each burst are represented as: .
[0071] 2.2 Based on the representation method of graph structure, each flow in the burst is represented as a graph node, and features are extracted from the spatiotemporal characteristics of mobile application encrypted data as the features of the graph nodes. Each graph node is embedded with the payload sequence length, payload data direction and payload data features containing 256 bytes in size.
[0072] 2.3 For a burst The selected features of the m flows are extracted and constructed into m graph nodes, and the graph nodes are connected to each other to obtain the flow correlation graph of this burst.
[0073] 2.4 Repeat steps 2.2 and 2.3 for the divided T bursts in sequence until all bursts in the traffic are traversed, and obtain the spatiotemporal feature correlation graphs of T mobile application encrypted homogeneous traffic.
[0074] Reference Figure 3 ,like Figure 3 The figure shows a structural diagram of a mobile application encrypted homogeneous traffic feature learning and recognition model based on a temporal attention gated loop and a residual parallel graph attention network in this embodiment. Specifically, in this embodiment, step 3 specifically includes the following sub-steps:
[0075] 3.1 The constructed temporal and spatial feature correlation graph of encrypted homogeneous traffic of mobile applications is randomly perturbed so that the context flow in the traffic can enhance the features of the homogeneous traffic and reduce the noise interference of some irrelevant traffic.
[0076] A traffic spatiotemporal characteristic correlation graph is represented as , where the adjacency matrix A represents the connectivity relationship between each node in the graph, and the feature matrix Represents the spatiotemporal feature vector of each node embedding. An exit strategy is adopted to generate an adjacency matrix with random perturbations , perturb the feature matrix by randomly setting some elements of A to 0. Specifically, given an adjacency matrix with Traffic spatiotemporal characteristics correlation diagram After that, first generate a random binary mask matrix , then and Multiply to generate the perturbed adjacency matrix , as shown in the formula.
[0077] ;
[0078] in , , is a binary mask matrix elements, i=1,2...M, represents the Bernoulli distribution, is the perturbation factor, which can control the proportion of shielded edges. Perturbing the adjacency matrix allows each node to ignore the characteristics of a certain node and only collect information from their adjacent subsets, thereby reducing the dependence on special neighbors and improving the robustness and robustness of the model.
[0079] 3.2 Repeat the steps in 3.1 for random perturbation of T encrypted homogeneous traffic spatiotemporal feature correlation graphs to obtain T spatiotemporal feature correlation graphs with random perturbations. .in =< >, .
[0080] 3.3 Constructing a temporal feature learning model for encrypted homogeneous traffic based on temporal attention gated recurrent encoder-decoder. The learning model consists of a temporal attention gated recurrent encoder-decoder, where the encoder uses a gated recurrent unit to capture the temporal features and compress the temporal feature matrix into a high-dimensional feature vector, and the decoder uses a gated recurrent unit with a global attention mechanism to the high-dimensional feature vector and further extract the key temporal feature vector of the entire spatiotemporal feature correlation graph and its context attention feature vector.
[0081] 3.3.1 Yes Each graph node of performs temporal feature extraction under the temporal attention gated recurrent encoder, and compresses the temporal feature matrix into a high-dimensional temporal feature vector. The temporal attention gated recurrent encoding used is calculated as follows:
[0082] ;
[0083] in, It means that the high-dimensional time series feature vector at the i-th moment is obtained after the gated recurrent unit is learned and calculated. represents the learning computation function of the gated recurrent unit, is the first The flow of time, It is The hidden state value of the traffic time series feature at the moment is used to record the time series context features learned in the gated learning model.
[0084] The specific implementation process of learning calculation function is:
[0085] (1) Setting the feature reset gate is used to determine the forgetting of historical time series features during the learning process. The specific calculation formula is:
[0086] ;
[0087] in, is the parameter matrix, is the reset gate of the gated learning model at the i-th moment, It is the hidden state value of the traffic timing feature at the i-1th moment, which is used to record the timing context features learned in the gated learning model. represents the activation function sigmoid, Represents the concatenation operator.
[0088] (2) Setting the feature update gate is used to determine whether the time series feature is passed to the next state during the learning process. The specific calculation formula is:
[0089] ;
[0090] in, is the parameter matrix, is the update gate of the gated learning model at the i-th moment, It is the hidden state value of the traffic time series feature at the i-1th moment.
[0091] (3) Set the update output of the candidate hidden state. The specific formula is:
[0092] ;
[0093] in, represents the candidate hidden state value for the traffic time series feature at the i-th moment, A matrix of weight parameters representing candidate hidden states.
[0094] (4) Calculate the output feature vector under the gated loop mechanism , the specific formula is:
[0095] ;
[0096] (5) Repeat steps (1) to (4) until The N graph nodes of the encoder complete the calculation of the gated recurrent unit, completing The time series feature compression and high-dimensional feature vector extraction are obtained, that is, the encoded high-dimensional time series feature vector .
[0097] ;
[0098] 3.3.2 Repeat step 3.3.1 until all T spatiotemporal feature correlation graphs with random perturbations complete the temporal feature compression and high-dimensional feature vector extraction under the encoder.
[0099] 3.3.3 Encoded high-dimensional time series feature vector A gated recurrent decoder operation with global attention mechanism is performed to further extract the key temporal feature vectors of the entire spatiotemporal feature correlation graph and its contextual attention feature vectors.
[0100] (1) Encoded high-dimensional time series feature vector Perform gated recurrent decoding and global attention calculations as follows:
[0101] ;
[0102] in, represents the learning computation function of the gated recurrent unit, is the feature vector output by the gated cyclic decoding at the i-1th moment, is the hidden state value of the time series feature vector under the decoder at the i-1th moment, which is used to record the key time series context features learned in the gated learning model. Initially, The assignment is expressed as: ,Will The assignment is expressed as: = .
[0103] (2) Use the attention mechanism to extract the decoded temporal feature vector The key context features of its adjacent vectors are used to analyze the temporal feature vector using the attention coefficient. Normalization is performed, and the specific calculation formula is:
[0104] ;
[0105] in, Represents the time series feature vector under the decoder Relative to the gated recurrent encoder output feature vector The normalized attention coefficient of , T represents the feature vector , exp() represents the natural exponential function.
[0106] (3) Calculate the updated output of the gated recurrent decoding with global attention mechanism , the specific formula is:
[0107] ;
[0108] (4) Calculate the gated recurrent decoding output vector with attention mechanism of the i-th high-dimensional feature vector , that is, the key temporal context features further extracted from the i-th high-dimensional feature vector, the specific calculation formula is:
[0109] ;
[0110] in, Indicates status Linear transformation of .
[0111] (5) Repeat steps (1) to (4) until the time series feature vector All its adjacent vectors complete the attention coefficient calculation and obtain the time series feature vector Closely associated key contextual temporal feature vectors .
[0112] 3.3.4 Further repeat the operation in 3.3.3 to make T time series feature vectors T key context time series feature vectors are extracted, and the output result of the entire time series feature vector is given.
[0113] 3.5 Use the residual parallel graph attention network to extract the spatial structural features of the encrypted homogeneous traffic contained in the correlation graph. and right Perform graph attention operation to obtain the feature matrix after aggregating neighbor nodes :
[0114] .
[0115] is used and right Perform graph attention operation to obtain the feature matrix after aggregating neighbor nodes. Yes Yes Use and right Perform graph attention operation to obtain the feature matrix after aggregating neighbor nodes.
[0116] The residual parallel graph attention network assigns different weights to neighboring nodes through a multi-head attention mechanism, thereby focusing on and learning the node features of its neighborhood. The graph attention neural network contains two layers of graph attention layers (residual layer and attention layer), and uses the attention mechanism to calculate the degree of association between different nodes, namely the attention coefficient. The input of this layer is the node sequence in the correlation graph. , where N represents the number of nodes in the graph and F represents the feature dimension of the graph nodes. The attention layer alone cannot fully express the features of the nodes. It is necessary to use linear transformation to perform preliminary spatial feature extraction on the graph nodes. This process can be achieved through the shared weight matrix After performing linear transformation, the attention coefficients between nodes are calculated. . Indicates the importance of the feature of node j to node i, Represents the attention mechanism.
[0117] 3.5.1 The residual layer design in the model adopts a residual calculation structure, which can effectively avoid the problem that the noise information from higher-order fields is propagated to the central node due to the increase in the number of graph attention layers, thereby causing the feature prediction accuracy to decrease.
[0118] ;
[0119] in, is the dimension transformation matrix. The residual layer is regarded as a linear transformation of the input feature vector, which converts the dimension of the input feature vector to the same dimension as the output feature vector. , F represents the feature dimension of the graph node, is the residual eigenvector matrix obtained after the linear transformation of the eigenvector of the i-th node, , is the dimension of the feature vector after linear transformation.
[0120] 3.5.2 The calculation of graph attention in the model is to normalize the attention coefficient between node i and all its neighboring nodes. The formula is as follows:
[0121] ;
[0122] in, represents the neighbor node set of node i, LeakyReLU represents the activation function, Represents the attention mechanism. The normalized attention coefficient is used to aggregate neighbor nodes, and the attention coefficient is multiplied by the corresponding neighbor nodes after linear transformation and then summed as the final output of the node.
[0123] 3.5.3 Based on step 3.5.2, the model further adopts a multi-head self-attention mechanism. Specifically, the attention mechanism is extended to multiple heads, that is, the attention operation is extended K times, and then the final features are connected, which is specifically expressed as:
[0124] ;
[0125] in, Indicates connection, is the normalized attention coefficient calculated by the kth attention mechanism for node i, is the weight matrix of the corresponding input linear transformation, is the ELU nonlinear activation function, is a graph node sequence The spatiotemporal feature vector of the i-th node after spatial feature enhancement learning using the residual parallel graph attention network.
[0126] 3.5.4 Repeat steps 3.5.1 to 3.5.3 until the graph node sequence All nodes have completed spatial feature enhancement learning
[0127] 3.5.5 Further, perform the following calculation to fuse the spatiotemporal features of all graph nodes and obtain the output feature vector The specific formula is:
[0128] .
[0129] Reference Figure 4 ,like Figure 4 FIG. 1 is a flowchart of the adaptive incremental learning training of the mobile application encrypted homogeneous traffic feature learning and recognition model based on supervised contrastive learning and self-supervised relational knowledge distillation learning in this embodiment, wherein PCAP represents the current mobile application encrypted traffic data, represents the positive and negative sample supervision contrast loss, represents the instance relation distillation loss. Specifically, in this embodiment, step 4 specifically includes the following sub-steps:
[0130] 4.1 Obtain new encrypted homogeneous traffic data of mobile applications in the network environment again, and randomly select N new burst traffic data to establish a training sample set.
[0131] 4.2 Execute steps 1 and 2 on the traffic data in the training sample set to obtain a set of mobile application encrypted homogeneous traffic spatiotemporal feature correlation graph sample sets corresponding to N burst traffic. .
[0132] 4.3 Perform data enhancement on N encrypted homogeneous traffic spatiotemporal feature correlation graph samples to obtain 2N new spatiotemporal feature correlation graph samples For any correlation graph sample, after enhancement, 2 positive samples of the same type and 2(N-1) negative samples are obtained.
[0133] 4.4 Use the learning model established in step 3 to learn the features of 2N new spatiotemporal feature correlation graph samples and output the feature vector .
[0134] 4.5 Constructing a nonlinear transformation projection head based on a two-layer perceptron network , performs the projection head operation to transform the feature vector associated with the encrypted homogeneous traffic Projected into the contrast space, the projected eigenvector is obtained .
[0135] ;
[0136] 4.6 Use supervised contrastive learning and self-supervised relational knowledge distillation learning to update and train the learning model respectively, and adaptively update the existing model on the basis of retaining the existing knowledge of the spatiotemporal characteristics of encrypted homogeneous traffic.
[0137] 4.6.1 Use supervised contrastive learning to update the learning model and calculate the sample The positive and negative sample supervision contrast loss is calculated as follows:
[0138] ;
[0139] in, represents the feature vector output by the projection head, express The index set of positive samples, .
[0140] 4.6.2 Use self-supervised relational knowledge distillation learning to update the constructed model.
[0141] (1) Calculate the similarity vector between the projected feature vectors after data enhancement. The similarity vector is defined as follows:
[0142] ;
[0143] in, Represents the similarity vector between a projected feature vector and other projected feature vectors. represents the similarity measure of two projected feature vectors, It represents the constructed encrypted homogeneous traffic spatiotemporal feature learning model, and k represents the temperature hyperparameter.
[0144] The similarity calculation formula is as follows:
[0145] ;
[0146] in, represents the feature vector output by the projection head, and k represents the temperature hyperparameter.
[0147] (2) The method based on relational knowledge distillation adjusts the change of the overall feature relationship between training samples by adding self-supervised distillation loss. The self-supervised relational distillation loss quantifies the difference between the current model and the past model on a set of similar vectors of traffic samples, and the parameters of the past / current model are represented as and , the instance relation distillation loss is defined as:
[0148] ;
[0149] Among them, the fixed model weights captured at the end of the previous model training task are used as the reference model , self-supervised relational knowledge distillation extracts the learned representation into the current training model , and Represent the hyperparameters of the new and old models respectively. The preservation of traffic features is achieved by adjusting the overall structural changes of the learned representation. The overall structure here is the similarity vector between samples, that is, the structural knowledge selected by the temporal and spatial feature correlation graph of encrypted homogeneous traffic of mobile applications.
[0150] 4.6.3 Comprehensively calculate the supervised contrast loss and relational distillation loss to update the model parameters. The comprehensive loss is calculated as:
[0151] ;
[0152] Perform model parameter update operation: ;
[0153] in, Represents the new model, represents the old model, I represents the anchor index set, λ represents the proportion of knowledge distillation loss, represents the learning rate, represents the gradient operator, is the gradient of the loss function L.
[0154] It should be noted that the above model parameter update operation is a computer program execution operation, which means that the original Subtract the value of Afterwards, new .
[0155] 4.7 Repeat step 4.6 until all augmented data samples have been trained.
[0156] Specifically, in this embodiment, step 5 specifically includes the following sub-steps:
[0157] ;
[0158] Among them, the Softmax() function is a normalized exponential function, is the predicted probability distribution of encrypted homogeneous traffic categories, C represents the number of encrypted homogeneous traffic categories of mobile applications, and is the learnable parameter matrix.
[0159] From the perspective of feature engineering, this embodiment constructs a traffic spatiotemporal feature correlation graph, which analyzes the temporal characteristics of the traffic sequence and simultaneously mines the spatial structure characteristics of the traffic sequence. The extracted key moment features of the mobile application encrypted homogeneous traffic are more robust, and the established learning and recognition model has the ability to deeply learn the mobile application encrypted homogeneous traffic, which can better improve the recognition accuracy and robustness of homogeneous traffic.
[0160] In view of the problem that mobile applications are updated more frequently and mobile encrypted traffic is more prone to traffic concept drift, this embodiment proposes an adaptive training method for encrypted homogeneous traffic identification model that integrates self-supervised contrastive learning and knowledge distillation learning. Using self-supervised contrastive learning to update the model to learn the characteristics of new traffic, while using self-supervised distillation to retain the traffic feature knowledge learned by the previous model, can effectively ensure the stability of the model in an open network environment.
[0161] This embodiment can accurately identify various types of encrypted homogeneous traffic of mobile applications, improve the efficiency and intensity of supervision of cyberspace security, conduct data set sampling tests in complex network environments, and the detection results are more in line with the needs in real network environments.
[0162] Example 2
[0163] Reference Figure 5 ,like Figure 5 The figure is a structural block diagram of the mobile application encrypted homogeneous traffic identification device of this embodiment, and the device specifically includes the following structures:
[0164] A preprocessing module, in response to the acquired original data of encrypted traffic of mobile applications, preprocesses the original data and extracts spatiotemporal feature data;
[0165] A correlation graph construction module, which constructs a temporal and spatial feature correlation graph of encrypted homogeneous traffic of mobile applications based on the representation of graph structure;
[0166] Model building module, the model building module builds a mobile application encrypted homogeneous traffic time series feature learning and recognition model, and learns the spatial-temporal feature correlation graph;
[0167] Model training module, the model training module trains the feature learning recognition model based on the spatiotemporal feature incremental learning method;
[0168] Identification module,The identification module uses the trained feature learning identification model to perform classification prediction and output the classification and identification results of mobile application encrypted homogeneous traffic.
[0169] Example 3
[0170] This preferred embodiment provides a computer device, which can implement the steps in any embodiment of the mobile application encrypted homogeneous traffic identification method provided in the embodiments of the present application. Therefore, the beneficial effects of the mobile application encrypted homogeneous traffic identification method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0171] Example 4
[0172] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, which stores multiple instructions, and the instructions can be loaded by a processor to execute the steps of any embodiment of the mobile application encrypted homogeneous traffic identification method provided by the embodiment of the present invention.
[0173] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0174] Since the instructions stored in the storage medium can execute the steps in any mobile application encrypted homogeneous traffic identification method embodiment provided in the embodiments of the present invention, the beneficial effects that can be achieved by any mobile application encrypted homogeneous traffic identification method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0175] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for identifying encrypted homogeneous traffic of mobile applications, characterized in that: The method comprises: In response to the obtained original data of encrypted traffic of mobile applications, the original data is preprocessed to extract spatiotemporal feature data, specifically including: The original traffic file of the mobile application is divided into multiple bursts according to the time threshold, and the data packets in each burst are divided into flows according to the five-tuple; Perform preliminary cleaning on the stream and delete invalid data; Extract the first 256 bytes of the first N packets from the stream. If the stream is less than N packets or the payload length is less than 256 bytes, use 0 to fill it. Convert each byte to a decimal number. N is the number of packets to be extracted. Distinguish the uplink and downlink directions of data packets, wherein the direction of the first data packet in a complete mobile application session flow is uplink, and the payload data with the same start address, destination address and port number as the first data packet is regarded as uplink payload data, and the rest is regarded as downlink payload data; According to the time sequence of the data packets, the temporal and spatial characteristic data of the encrypted traffic of the mobile application are obtained; Based on the representation of graph structure, the spatiotemporal feature correlation graph of encrypted homogeneous traffic of mobile applications is constructed, including: Representing each flow in the burst as a graph node, extracting features from the spatiotemporal features of the mobile application encrypted data as features of the graph node, and embedding a payload sequence length, a payload data direction, and a payload data feature containing a size of 256 bytes in each graph node; Extract the selected features from the m streams in each burst and construct them into m graph nodes. Connect the graph nodes to obtain the spatiotemporal feature correlation graph of all bursts. Construct a mobile application encrypted homogeneous traffic time series feature learning and recognition model to learn the spatiotemporal feature correlation graph; Training the feature learning recognition model based on a spatiotemporal feature incremental learning method; The trained feature learning recognition model is used to perform classification prediction and output the classification and recognition results of mobile application encrypted homogeneous traffic.
2. The method for identifying encrypted homogeneous traffic of mobile applications as claimed in claim 1, characterized in that: The construction of the mobile application encrypted homogeneous traffic time series feature learning and recognition model and the learning of the spatiotemporal feature correlation graph specifically include: Performing random perturbations on the spatiotemporal feature correlation graph to obtain a spatiotemporal feature correlation graph with random perturbations; A temporal feature learning and recognition model for encrypted homogeneous traffic of mobile applications based on a temporal attention gated recurrent encoder-decoder is constructed to learn and extract the temporal features of each graph node of a spatiotemporal feature correlation graph with random perturbations. The encoder of the learning and recognition model uses a gated recurrent unit to capture the temporal features and compress the temporal feature matrix into a high-dimensional feature vector. The decoder of the learning and recognition model uses a gated recurrent unit with a global attention mechanism to extract the key temporal feature vectors of the entire spatiotemporal feature correlation graph and its contextual attention feature vectors.
3. The method for identifying encrypted homogeneous traffic of mobile applications as claimed in claim 2, characterized in that: The training of the feature learning recognition model based on the spatiotemporal feature incremental learning method specifically includes: Obtain new encrypted homogeneous traffic data of mobile applications in the network environment, and randomly select a number of new burst traffic data to establish a training sample set; Obtaining a set of mobile application encrypted homogeneous traffic spatiotemporal feature correlation graph sample sets corresponding to a number of new burst traffic data according to the training sample set; Performing data enhancement on the mobile application encrypted homogeneous traffic spatiotemporal feature correlation graph sample set to obtain a new spatiotemporal feature correlation graph sample, and for any correlation graph sample in the original mobile application encrypted homogeneous traffic spatiotemporal feature correlation graph sample set, after enhancement, obtaining 2 positive samples and 2 (N-1) negative samples of the same type; Use the feature learning recognition model to perform feature learning on new spatiotemporal feature correlation graph samples and output a feature vector; A nonlinear transformation projection head is constructed based on a two-layer perceptron network, and the projection head operation is performed to project the feature vector associated with the encrypted homogeneous traffic into the comparison space to obtain the projected feature vector.
4. The method for identifying encrypted homogeneous traffic of mobile applications as claimed in claim 3, characterized in that: The method further comprises: The feature learning and recognition model is adaptively updated according to the incremental learning loss of spatiotemporal features. The feature learning and recognition model is updated and trained respectively using supervised contrastive learning and self-supervised relational knowledge distillation learning. The existing model is adaptively updated on the basis of retaining the existing knowledge of spatiotemporal features of encrypted homogeneous traffic.
5. The method for identifying encrypted homogeneous traffic of mobile applications as claimed in claim 1, characterized in that: The method of using the trained feature learning recognition model to perform classification prediction and output the classification recognition result of mobile application encrypted homogeneous traffic specifically includes: The learned encrypted homogeneous traffic spatiotemporal features are input into a fully connected layer and a Softmax layer, and the encrypted homogeneous traffic classification label prediction tensor is output.
6. A mobile application encrypted homogeneous traffic identification device, characterized in that: The device comprises: A preprocessing module, in response to the acquired original data of encrypted traffic of mobile applications, preprocesses the original data and extracts spatiotemporal feature data, specifically including: The original traffic file of the mobile application is divided into multiple bursts according to the time threshold, and the data packets in each burst are divided into flows according to the five-tuple; Perform preliminary cleaning on the stream and delete invalid data; Extract the first 256 bytes of the first N packets from the stream. If the stream is less than N packets or the payload length is less than 256 bytes, use 0 to fill it. Convert each byte to a decimal number. N is the number of packets to be extracted. Distinguish the uplink and downlink directions of data packets, wherein the direction of the first data packet in a complete mobile application session flow is uplink, and the payload data with the same start address, destination address and port number as the first data packet is regarded as uplink payload data, and the rest is regarded as downlink payload data; According to the time sequence of the data packets, the temporal and spatial characteristic data of the encrypted traffic of the mobile application are obtained; A correlation graph construction module, which constructs a temporal and spatial feature correlation graph of encrypted homogeneous traffic of mobile applications based on a representation method of a graph structure, specifically including: Representing each flow in the burst as a graph node, extracting features from the spatiotemporal features of the mobile application encrypted data as features of the graph node, and embedding a payload sequence length, a payload data direction, and a payload data feature containing a size of 256 bytes in each graph node; Extract the selected features from the m streams in each burst and construct them into m graph nodes. Connect the graph nodes to obtain the spatiotemporal feature correlation graph of all bursts. A model building module, wherein the model building module constructs a mobile application encrypted homogeneous traffic time series feature learning and recognition model, and learns the spatiotemporal feature correlation graph; A model training module, wherein the model training module trains the feature learning recognition model based on a spatiotemporal feature incremental learning method; The identification module uses the trained feature learning identification model to perform classification prediction and output the classification identification result of the mobile application encrypted homogeneous traffic.
7. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method for identifying encrypted homogeneous traffic of mobile applications as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which is loaded and executed by a processor to implement the method for identifying encrypted homogeneous traffic of mobile applications as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Intelligent network service identification method based on positive transfer learning
CN104468252A
HTTP malicious traffic detection method and device based on graph attention network
CN114422211A
Encrypted traffic classification method based on deep neural network
CN116232696A
Lightweight Internet of Things malicious traffic identification method based on knowledge distillation space-time neural network
CN116260642A
System and method for radio-based sleep monitoring
EP4162865A1
