A data processing method and system based on deep learning

Through the combination of deep learning algorithms and embedding layers, the problem of scarcity of labeled data packets in the QUIC transmission protocol is solved, accurate classification of unlabeled data flows is achieved, and the accuracy and efficiency of network traffic classification are improved.

CN118468139BActive Publication Date: 2024-09-24SHANDONG YUANQIAO INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410909673.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-09-24
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

The network traffic classification method based on deep learning faces the problem of scarcity of labeled data packets in the QUIC transmission protocol, resulting in poor training results for unlabeled data packets, and it is difficult for the model to fully learn the characteristics of the traffic pattern, affecting the classification accuracy.

Method used

A deep learning algorithm is used to build an initial network traffic classification model for preliminary learning and prediction of unlabeled QUIC data flows. By adding embedding layers and data standardization, the model is trained to learn contextual information of unlabeled data flows, and combined with real-time data for preprocessing and classification to improve classification accuracy.

Benefits of technology

It improves the classification accuracy and data processing accuracy of unlabeled QUIC data streams, enhances the support capabilities of network management and security monitoring, reduces over-fitting phenomena, and improves the generalization ability and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468139B
    Figure CN118468139B
Patent Text Reader

Abstract

The present application relates to a data processing method and system based on deep learning, and to the field of data processing technology, wherein the data processing method includes the steps of first modeling, historical data collection and processing, classification model training, and real-time data collection and processing; the data processing system includes a modeling module, a historical data collection and processing module, a classification model training module, and a real-time data collection and processing module. The present application combines the characteristics of deep learning algorithms and QUIC data streams, and through two-stage modeling and training, constructs an efficient and accurate network traffic classification model, thereby improving the accuracy of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method and system based on deep learning. Background Art

[0002] In network communications based on the QUIC transport protocol, accurately classifying network traffic is a crucial task, which involves classifying network traffic or data packets into corresponding applications, protocols or services so that network managers can effectively monitor traffic, allocate resources and manage security. With the expansion of network scale and the complexity of traffic, traditional classification methods are difficult to meet the needs of modern network management.

[0003] In recent years, network traffic classification methods based on machine learning have gradually emerged, among which deep learning technology is particularly eye-catching. Deep learning models rely on their powerful feature learning capabilities to automatically extract useful features from raw data and use them for classification tasks. Currently, researchers have explored a variety of deep learning models, such as sequence neural networks (such as GRU) and encoding neural networks (such as AutoEncoder), to handle different types of network traffic features.

[0004] Although the network traffic classification method based on deep learning has achieved certain results, it still faces some challenges and shortcomings. In the related technology, labeled data packets are used to train the classification model. However, due to the relative scarcity of labeled data packets in the QUIC transmission protocol, the training effect of the deep learning model on unlabeled data packets is limited. In addition, due to the lack of sufficient labeled data, the model may not be able to fully learn the characteristics of various traffic patterns, resulting in limited classification accuracy of QUIC data streams. Summary of the invention

[0005] In order to improve the accuracy of data processing and ensure the accuracy of classification of QUIC data streams, the present application provides a data processing method and system based on deep learning.

[0006] In the first aspect, the present application provides a data processing method based on deep learning, which adopts the following technical solution:

[0007] A data processing method based on deep learning comprises the following steps:

[0008] First modeling: Based on the deep learning algorithm, build the first network traffic classification model;

[0009] Historical data collection and processing: including the first collection, preprocessing and prediction steps;

[0010] First collection: collect unlabeled QUIC data packets in historical information, classify the unlabeled QUIC data packets, and obtain unlabeled QUIC data streams;

[0011] Preprocessing: preprocess the unlabeled QUIC data stream to obtain the first data;

[0012] Prediction: pre-train the first data using the first network traffic classification model, predict n bytes after the first data, and record the predicted n bytes as the second data;

[0013] Classification model training: including the second modeling, adding embedding layers and training steps;

[0014] Second modeling: Based on the deep learning algorithm, build the second network traffic classification model;

[0015] Adding an embedding layer: adding an embedding layer to the second network traffic classification model to obtain a third network traffic classification model;

[0016] Training: using the first data and the second data to train a third network traffic classification model;

[0017] Real-time data acquisition and processing: including the second acquisition and output steps;

[0018] Second collection: collect QUIC data stream in real time, pre-process the QUIC data stream, and obtain third data;

[0019] Output: Input the third data into the trained third network traffic classification model, and output the classification result of the QUIC data stream.

[0020] By adopting the above technical solution, the first network traffic classification model constructed by the deep learning algorithm of the present application can perform preliminary learning on the unlabeled QUIC data stream in the initial stage, and predict the last n bytes of the unlabeled QUIC data stream to obtain the first data and the second data, which provides a basis for subsequent fine training; the present application also predicts the n bytes after the first data as the second data through the first network traffic classification model, which helps the first network traffic classification model learn the ability to predict the last n bytes based on the first n bytes of the unlabeled QUIC data stream. The present application obtains the third network traffic classification model by adding an embedding layer to the second network traffic classification model, and trains the third network traffic classification model through the first data and the second data, so that the trained third network traffic classification model can fully learn the context information of the unlabeled QUIC data stream. This application collects QUIC data streams in real time (the QUIC data streams collected in real time include QUIC data streams with labels and QUIC data streams without labels), and preprocesses them to obtain third data, and inputs the third data into the trained third network traffic classification model. The third network traffic classification model can quickly and accurately output the classification results of the QUIC data stream. This application combines the characteristics of the deep learning algorithm and the QUIC data stream, predicts the last n bytes of the QUIC data stream through the first network traffic classification model, obtains the second data, and records the first n bytes of the QUIC data stream as the first data. The third network traffic classification model is trained through the first data and the second data, and the characteristics of the unlabeled QUIC data stream are learned, which facilitates the subsequent accurate classification of the unlabeled QUIC data stream and improves the accuracy of data processing.

[0021] Optionally, after performing the step of adding the embedding layer and before performing the training step, the method further includes:

[0022] Data normalization: Standardize the distribution of the first data and the second data by changing the variance and mean of the first data and the second data.

[0023] By adopting the above technical solution, the variance and mean of each data are on the same scale by standardizing the data. In this way, the network traffic classification model does not need to adapt to the scale of different data during training, thereby accelerating the training process. The standardized data can better reveal the inherent patterns between the data, making it easier for the third network traffic classification model to learn the true distribution of the data, thereby improving the classification accuracy of the model. Standardization helps to reduce overfitting because it reduces the impact of noise and outliers in the data on model training, making the model more generalizable to unseen data.

[0024] Optionally, after the historical data collection and processing step and before the classification model training step, the process further includes:

[0025] Reduce losses: including classification, first calculation and loss reduction steps;

[0026] Classification: input the second data into the log_softmax classifier of the first network traffic classification model, and output the probability distribution of the second data category label;

[0027] First calculation: using a negative log-likelihood function to calculate the loss between the probability distribution of the first data category label and the probability distribution of the second data category label, the calculation model of the negative log-likelihood function is as follows:

[0028] ;

[0029] Where L is the negative log-likelihood function; is the number of samples in the first data; is the number of categories in the first data; n is the number of bytes; is the Kronecker function; is the category label of the first data; is the i-th category in the first data; is a sample in the first data; is a logarithmic function; is the probability distribution of the second data category label, and the calculation model is as follows:

[0030] ;

[0031] in, is the weight matrix of the log_softmax classifier; F is the feature vector of the first data, and the calculation model is as follows:

[0032] ;

[0033] in, is the activation function; W is the connection weight of the fully connected layer of the first network traffic classification model; b is the bias term of the fully connected layer of the first network traffic classification model; p is the feature vector of the second data;

[0034] Reduce loss: Optimize the negative log-likelihood function through the Adam optimizer to obtain the minimum loss between the probability distribution of the first data category label and the probability distribution of the second data category label.

[0035] By adopting the above technical solution, the present application optimizes the loss function (negative log-likelihood function) so that the first network traffic classification model can gradually learn how to extract useful features from the input data (i.e., the first data) and make more accurate predictions based on these features. The Adam optimizer can adaptively adjust the learning rate so that the first network traffic classification model converges to the optimal solution faster during the training process. The appropriate loss function and optimization algorithm can help the model maintain a certain generalization ability while fitting the training data, reducing the overfitting phenomenon on unseen data.

[0036] Optionally, after executing the preprocessing step and before executing the prediction step, the following steps are further included:

[0037] Table creation: creating a byte vector query table, wherein the byte vector query table includes: each byte and the byte vector corresponding to the byte;

[0038] First extraction: extracting a byte sequence from the first data, recorded as a first byte sequence;

[0039] First table lookup: Look up the byte vector lookup table, and find the byte vector corresponding to the first byte sequence, which is recorded as the first byte vector;

[0040] First replacement: replacing the first byte sequence in the first data with the first byte vector to obtain new first data.

[0041] By adopting the above technical solution, the present application converts bytes into first byte vectors in the first data, so that the first network traffic classification model can capture the semantic relationship between bytes, which is invisible in the original byte representation, thereby increasing the number of features available to the first network traffic classification model and improving the accuracy of classification. The original byte sequence is discrete, which is not conducive to the deep learning model to perform operations in a continuous space. By replacing the first byte sequence with the first byte vector, the first network traffic classification model can process these features in a continuous space, thereby better utilizing the prediction ability of the deep learning model.

[0042] Optionally, after executing the prediction step and before executing the second modeling step, the method further includes:

[0043] Second extraction: extracting a byte sequence from the second data, recorded as a second byte sequence;

[0044] Second table lookup: Look up the byte vector lookup table for the byte vector corresponding to the second byte sequence, which is recorded as the second byte vector;

[0045] Second replacement: replacing the second byte sequence in the second data with the second byte vector to obtain new second data.

[0046] By adopting the above technical solution, through the second table lookup and the second replacement, and using the second byte vector to replace the second byte sequence, a shorter second byte sequence or a second byte sequence with a specific meaning can be converted into a second byte vector that may be longer, more complex or has a different representation form, thereby enriching the content of the original second data.

[0047] Optionally, in the step of adding an embedding layer, the new second data is used as a parameter of the embedding layer.

[0048] By adopting the above technical solution, the new second data (the second data replaced by the second byte vector) is used as a parameter of the embedding layer. When the new second data passes through the embedding layer, the output byte vector not only represents the original byte sequence, but also contains the contextual information and semantic information of these byte sequences in the data, which helps the third network traffic classification model to better understand the inherent laws and patterns of the data.

[0049] Optionally, after executing the first acquisition step and before executing the preprocessing step, the method further includes:

[0050] Assignment: Assign the connection ID in the QUIC data stream to 0.

[0051] By adopting the above technical solution, the present application assigns the connection ID in the QUIC data stream to 0, thereby avoiding the network traffic classification model treating the connection ID as a very important feature and giving it a large weight in the classification model training step. The present application anonymizes the connection ID by assigning it to 0, thereby improving the generalization ability and robustness of various network traffic classification models.

[0052] Optionally, after executing the assignment step and before executing the preprocessing step, the following steps are further included:

[0053] Prune: Delete QUIC data streams with less than 2 QUIC packets.

[0054] By adopting the above technical solution, the present application adopts the QUIC transmission protocol for dialogue during the connection establishment process between the client and the server, which requires at least a 1-RTT handshake. During the handshake process, the client needs to first send an initial data packet to the server. After receiving the initial data packet, the server replies with a data packet to the client, and then transmits the data. The QUIC data flow with a QUIC data packet less than 2 proves that the client and the server have not established a valid connection, so the present application deletes the QUIC data flow with a data packet less than 2, which can reduce processing time and improve data processing efficiency.

[0055] Optionally, the method further includes:

[0056] Evaluation: Determine whether the classification result of the QUIC data stream is correct. If so, output the category of the QUIC data stream; otherwise, execute the classification model training step.

[0057] By adopting the above technical solution, the present application judges the classification result of the output QUIC data stream. If the classification result is incorrect, the classification model training step is re-executed, and the wrong classification result is used to update the parameters and weights of the model. This continuous learning capability enables the network traffic classification model to continuously adapt to new data distributions and patterns, thereby improving classification performance.

[0058] In the second aspect, the present application provides a data processing system based on deep learning, which adopts the following technical solution:

[0059] A data processing system based on deep learning, comprising:

[0060] Modeling module, used to build network traffic classification model;

[0061] The historical data collection and processing module is used to collect and pre-process historical information to obtain the predicted n bytes;

[0062] The classification model training module is used to train the network traffic classification model using the preprocessed historical information and the predicted n bytes;

[0063] The real-time data collection and processing module is used to collect real-time QUIC data streams, input the real-time QUIC data streams into the trained network traffic classification model, and obtain the classification results of the QUIC data streams.

[0064] By adopting the above technical solution, the system first establishes a network traffic classification model through the modeling module, and then uses the historical data collection and processing module to preprocess the historical information and extract features that are useful for the classification task. Secondly, the network traffic classification model training module uses the preprocessed historical data and the predicted n bytes to train the network traffic classification model, and continuously optimizes the classification performance of the network traffic classification model. Finally, the real-time data collection and processing module collects QUIC data streams in real time and inputs them into the trained network traffic classification model. The network traffic classification model can quickly and accurately output the classification results of the QUIC data stream. This system improves the accuracy and efficiency of network traffic classification.

[0065] In summary, the present application includes at least one of the following beneficial technical effects:

[0066] 1. The first network traffic classification model constructed by the deep learning algorithm in the present application can perform preliminary learning on the unlabeled QUIC data stream in the initial stage, and predict the last n bytes of the unlabeled QUIC data stream to obtain the first data and the second data, which provides a basis for subsequent fine training; the present application also predicts the n bytes after the first data as the second data through the first network traffic classification model, which helps the first network traffic classification model learn the ability to predict the last n bytes of the unlabeled QUIC data stream from the first n bytes. The present application obtains the third network traffic classification model by adding an embedding layer to the second network traffic classification model, and trains the third network traffic classification model with the first data and the second data, so that the trained third network traffic classification model can fully learn the unlabeled context information. The present application takes the QUIC data stream in real time (the QUIC data stream taken in real time includes the QUIC data stream with labels and the QUIC data stream without labels), pre-processes it, obtains the third data, and inputs the third data into the trained third network traffic classification model, which can quickly and accurately output the classification result of the QUIC data stream. This application combines the characteristics of deep learning algorithms and QUIC data streams. It predicts the last n bytes of the QUIC data stream through a first network traffic classification model to obtain second data, and records the first n bytes of the QUIC data stream as first data. It trains a third network traffic classification model through the first data and the second data, learns the characteristics of the unlabeled QUIC data stream, facilitates the subsequent accurate classification of the unlabeled QUIC data stream, improves the accuracy of data processing, and provides strong support for network management and security monitoring.

[0067] 2. By standardizing the data, the variance and mean of each feature are on the same scale, so that the model does not have to adapt to the scale of different features during training, thereby speeding up the training process. Standardized data can better reveal the inherent patterns between data, making it easier for the third network traffic classification model to learn the true distribution of data, thereby improving the classification accuracy of the model. Standardization helps reduce overfitting because it reduces the impact of noise and outliers in the data on model training, making the model more generalizable to unseen data.

[0068] 3. By converting bytes into first byte vectors in the first data, the first network traffic classification model can capture semantic relationships between bytes that may not be visible in the original byte representation, thereby increasing the number of features available to the first network traffic classification model and improving classification accuracy. The original byte sequence is discrete, which is not conducive to the deep learning model to perform operations in a continuous space. By replacing the first byte sequence with the first byte vector, the first network traffic classification model can process these features in a continuous space, thereby better utilizing the prediction capabilities of the deep learning model.

[0069] 4. This system first establishes a network traffic classification model through the modeling module, and then uses the historical data collection and processing module to preprocess the historical information and extract features that are useful for the classification task. Secondly, the network traffic classification model training module uses the preprocessed historical data and the predicted n bytes to train the network traffic classification model, and continuously optimizes the classification performance of the network traffic classification model. Finally, the real-time data collection and processing module collects QUIC data streams in real time and inputs them into the trained network traffic classification model. The network traffic classification model can quickly and accurately output the classification results of the QUIC data stream. This system improves the accuracy and efficiency of network traffic classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 is a flow chart of the method of Example 1 of the present application;

[0071] Figure 2 This is a method flow chart of historical data collection and processing step S2 of Example 1 of the present application;

[0072] Figure 3 This is a method flow chart of the first byte replacement step S23 of Example 1 of the present application;

[0073] Figure 4 is a method flow chart of the second byte replacement step S25 of Embodiment 1 of the present application;

[0074] Figure 5 is a flow chart of the method for reducing loss step S3 in Example 1 of the present application;

[0075] Figure 6 This is a method flow chart of the classification model training step S4 of Example 1 of the present application;

[0076] Figure 7 is a method flow chart of the real-time data collection and processing step S5 of Example 1 of the present application;

[0077] Figure 8 This is a comparison chart of verification results when the byte vector has different dimensions in Example 1 of the present application;

[0078] Fig. 9 This is a comparison chart of the convergence of the loss function when the byte vector takes different dimensions in Example 1 of the present application. DETAILED DESCRIPTION

[0079] The following combination Figures 1 to 9 This application is described in further detail.

[0080] Embodiment 1: This embodiment discloses a data processing method based on deep learning, referring to Figure 1 The data processing method includes: a first modeling step S1, a historical data collection and processing step S2, a loss reduction step S3, a classification model training step S4, a real-time data collection and processing step S5, and an evaluation step S6. In this embodiment, the first n bytes of the unlabeled QUIC data stream are input into the first network traffic classification model to predict the next n bytes, and then a second network traffic classification model is established. In the second network traffic classification model, an embedding layer is added to obtain a third network traffic classification model, and then the third network traffic classification model is trained using the first data and the second data. Then, the real-time collected QUIC data stream is preprocessed, and the preprocessed QUIC data stream is input into the trained third network traffic classification model for classification, and then the classification result is evaluated. If the classification result is wrong, the classification model training step S4 is re-executed. The specific process is as follows:

[0081] The first modeling step S1 is: constructing a first network traffic classification model based on a deep learning algorithm.

[0082] The first network traffic classification model adopts a CNN-LSTM model. In the CNN layer, multiple convolutional layers are defined, and the convolutional layers are used to extract local features. A corresponding pooling layer is set after each convolutional layer, and the pooling layer is used to reduce the dimension of the features and reduce the amount of calculation. An LSTM layer is added after the CNN layer and the pooling layer, and the LSTM layer is used to process the long-term dependencies in the data and predict the subsequent n bytes based on the existing byte sequence data (i.e., the n bytes in the first data mentioned in the prediction step S24). A fully connected layer is added after the LSTM layer, and the fully connected layer is used to output the prediction result.

[0083] like Figure 2 As shown, the historical data collection and processing step S2 includes a first collection step S21, a data processing step S22, a first byte replacement step S23, a prediction step S24 and a second byte replacement step S25.

[0084] S21 First Collection: Use network capture tools (such as Wireshark, tcpdump, etc.) to capture untagged QUIC packets from the historical information of network traffic, perform preliminary analysis on the captured untagged QUIC packets, and classify the untagged QUIC packets according to their header information and application data in the QUIC frame to obtain different types of QUIC data streams (consisting of multiple consecutive QUIC data packets). Each QUIC data stream represents a time series of a group of QUIC data packets with similar communication characteristics and purposes.

[0085] The data processing step S22 includes an assignment step S221, a deletion step S222 and a preprocessing step S223.

[0086] S221 assignment: Assign the connection ID in the QUIC data stream to 0 to avoid the situation in which, in the classification model training step S4, the network traffic classification model considers that the connection ID appears more frequently and assigns it a larger weight, thereby reducing the generalization of the network traffic classification model.

[0087] S222 deletion: Delete QUIC data streams with less than 2 QUIC data packets. The QUIC transport protocol establishes a connection based on the TLS1.3 handshake process. The first connection uses a 1-RTT time, that is, when the first connection is made, the client sends an initial data packet containing encryption parameters to the server. After receiving the initial data packet, the server replies to the client with a data packet containing the server encryption parameters and the data requested by the client. Two data packets are transmitted during the 1-RTT process. When deleting QUIC data streams with less than 2 QUIC data packets, it ensures that the client and the server have established a valid connection, deletes redundant data in subsequent steps, and improves data processing efficiency.

[0088] S223 preprocessing: performing a series of preprocessing operations on the unlabeled QUIC data stream to obtain the first data.

[0089] The preprocessing operation includes: cleaning the QUIC data stream, removing unqualified QUIC data packets, and converting the QUIC data packets into a data format that can be processed by the CNN-LSTM model through a sliding window method or a Fourier algorithm.

[0090] like Figure 3 As shown, the first byte replacement step S23 includes a table building step S231, a first extraction step S232, a first table lookup step S233 and a first replacement step S234.

[0091] Before executing the table building step S231, a sequence of bytes is extracted from the first data, and an 8-bit binary string in the sequence is converted into decimal bytes.

[0092] S231 table building: building a byte vector query table, the byte vector query table including: each byte and the byte vector corresponding to the byte, the content of the byte vector query table is shown in Table 1.

[0093] Table 1 Byte vector query table

[0094]

[0095] A one-to-one correspondence between bytes and byte vectors is established by constructing a byte vector lookup table. In binary, the octet string 00000000 is converted to a decimal number of 0, and the octet string 11111111 is converted to a decimal number of 255. Therefore, the range of bytes in the byte vector lookup table is 0-255.

[0096] S232 First extraction: parsing the first data, identifying and extracting a byte sequence therein, recorded as a first byte sequence.

[0097] S233 first table lookup: In the byte vector lookup table created in the table creation step S231, the byte vector corresponding to the first byte sequence in the first extraction step S232 is searched and recorded as the first byte vector.

[0098] S234 First replacement: replace the first byte sequence in the first data with the first byte vector to obtain new first data.

[0099] S24 prediction: Use the CNN-LSTM model to pre-train the first data, and predict the n bytes after the first data, and record the predicted n bytes as the second data.

[0100] The pre-training of the first data includes:

[0101] Classify the first data: according to the classification of the first data, create folders of the corresponding number of categories. The folders are named after the types of QUIC data streams stored in the folders. All captured or received QUIC data packets are traversed. According to the classification criteria in the first acquisition step S21, each QUIC data packet is analyzed and classified into the corresponding type; for each classified QUIC data packet, the first data information (such as STREAM ID) to which it belongs is extracted. The pcap files in the entire first data are copied to the corresponding folders, and the pcap files are reorganized and sorted to ensure the integrity and order of the first data. Finally, verify whether the first data in each folder is correctly classified, and check whether there are omissions or errors.

[0102] Cut the first data: read the pcap file through the tshark function, and output it to different folders through shell script management, so as to perform a split operation on the pcap file in the first data and convert the pcap file into multiple sub-stream pcap files.

[0103] Extract the first data: perform an extraction operation on the first data of each category, extract the first n bytes of the first data, and use the LSTM layer of the CNN-LSTM model to predict the last n bytes of the first data, input the prediction result into the fully connected layer of the CNN-LSTM model, and output the second data.

[0104] like Figure 4 As shown, the second byte replacement step S25 includes a second extraction step S251, a second table lookup step S252 and a second replacement step S253.

[0105] S251 Second extraction: extracting a byte sequence from the second data, recorded as a second byte sequence.

[0106] S252 second table lookup: In the byte vector lookup table created in the table creation step S231, the byte vector corresponding to the second byte sequence in the second extraction step S251 is searched and recorded as the second byte vector.

[0107] S253 Second replacement: replace the second byte sequence in the second data with the second byte vector to obtain new second data.

[0108] At this point, the task of replacing all byte sequences in the first data and the second data with corresponding byte vectors has been completed, enriching the byte information in the QUIC data stream, realizing the semantic information between each byte in the QUIC data stream, and being able to better represent network traffic.

[0109] like Figure 5 As shown, the loss reducing step S3 includes a classification step S31, a first calculation step S32 and a loss reducing step S33.

[0110] S31 classification: In the first network traffic classification model, the new second data obtained in the second replacement step S253 is input into the log_softmax classifier, and the probability distribution of the second data category label is output.

[0111] In other embodiments, if the classification accuracy required for the QUIC data stream is not high, in the classification step S31, n bytes of the second data in the step S24 are directly input into the log_softmax classifier.

[0112] S32 First calculation: using the negative log-likelihood function, calculate the loss between the probability distribution of the first data category label and the probability distribution of the second data category label (using the negative log-likelihood function to measure the gap between the predicted probability distribution of the second data category label and the probability distribution of the true category label of the first data).

[0113] Assume that the first data has n bytes and the category label of the i-th byte of the first data , and the probability distribution of the class label of the second data (predicted by the first network traffic classification model) Since the first data is data extracted from the QUIC data stream, the probability distribution of the category label of the first data is real, and the second data is predicted by the first network traffic classification model, so there may be a certain error between the probability distribution of the category label of the second data and the probability distribution of the category label of the first data. This embodiment measures the gap between the probability distribution of the predicted second data category label and the probability distribution of the first data category label through a negative log-likelihood function.

[0114] The calculation model of the negative log-likelihood function is as follows:

[0115] ;

[0116] L is the negative log-likelihood function; is the number of samples in the first data. In this embodiment, there are 451 samples in the first data.

[0117] is the number of categories in the first data. In this embodiment, the first data includes 12 categories, namely: NFV_CHAT, NFV_EMAIL, NFV_FT, NFV_P2P, NFV_STREAMING, NFV_VOIP, SDN_CHAT, SDN_EMAIL, SDN_FT, SDN_P2P, SDN_STREAMING, SDN_VOIP.

[0118] In this embodiment, the calculation formula of the negative log-likelihood function is:

[0119] ;

[0120] Where n is the number of bytes; is the Kronecker function; is the category label corresponding to the i-th category in the first data; is the i-th category in the first data; is a sample in the first data; is a logarithmic function; is the probability distribution of the second data category label, and the calculation model is as follows:

[0121] ;

[0122] in, is the weight matrix of the log_softmax classifier; F is the feature vector of the first data, and the calculation model is as follows:

[0123] ;

[0124] in, is the activation function; W is the connection weight of the fully connected layer of the first network traffic classification model; b is the bias item of the fully connected layer of the first network traffic classification model, which is set according to the needs; p is the feature vector of the second data, which is extracted by machine learning algorithms such as neural networks.

[0125] S33 reduces the loss: optimizes the negative log-likelihood function through the Adam optimizer to obtain the minimum loss between the probability distribution of the first data category label and the probability distribution of the second data category label.

[0126] like Figure 6 As shown, the classification model training step S4 includes a second modeling step S41, an embedding layer adding step S42, a data normalization step S43 and a training step S44.

[0127] S41 Second modeling: Based on the deep learning algorithm, build the second network traffic classification model.

[0128] The second network traffic classification model adopts a CNN model to process the new first data and the new second data in the first replacement step S234 and the second replacement step S253.

[0129] S42 adds an embedding layer: adds an embedding layer to the second network traffic classification model, uses the new second data obtained in the second replacement step S252 as parameters of the embedding layer, and obtains a third network traffic classification model.

[0130] In the CNN model (i.e., the third network traffic classification model), an embedding layer is initially added, a CNN layer is set after the embedding layer, then a pooling layer is added, then a CNN layer is set, then a pooling layer is added, then a batch normalization BN layer is set, and then two fully connected layers are set. In the CNN model, the new first data is first input, and then the new second data is used as the parameter of the embedding layer, and then the local features of the byte vector are extracted through two CNN layers to find implicit features that are conducive to classification.

[0131] S43 Data Normalization: Through the batch normalization BN layer, the variance and mean of the first data and the corresponding second data are changed to standardize the distribution of the first data and the corresponding second data, and the global features are extracted through two fully connected layers.

[0132] Methods such as Min-Max Scaling or Z-score Standardization are used to standardize the variance or mean. These methods can scale the value range of the data to a uniform interval (such as 0 to 1 or with zero mean and unit variance), making the comparison between different features or data sets more fair and meaningful. By normalizing the data, the noise and bias introduced by data scale differences can be reduced, thereby improving the performance of the network traffic classification model.

[0133] S44 training: the third network traffic classification model is trained using the new first data (obtained in the first replacement step S234) and the new second data (obtained in the second replacement step S253), and the training process generally includes the steps of forward propagation, loss calculation, back propagation, and weight update. Through training, the third network traffic classification model learns the features of the new first data (obtained in the first replacement step S234) and the new second data (obtained in the second replacement step S253).

[0134] In other embodiments, if byte vectors are not used to replace bytes, this step uses a K-nearest neighbor algorithm based on a deep learning algorithm for operations in subsequent steps, and after executing the second modeling step S41, the training step S44 is directly executed.

[0135] like Figure 7 As shown, the real-time data collection and processing step S5 includes a second collection step S51 and an output step S52.

[0136] S51 Second acquisition: real-time acquisition of QUIC data stream, preprocessing of QUIC data stream, and obtaining third data. In this step, the preprocessing operation of the QUIC data stream is the same as the preprocessing step S223.

[0137] The preprocessing operation includes: cleaning the QUIC data stream collected in real time, removing unqualified data packets, and converting the QUIC data packets collected in real time into a data format that can be processed by the third network traffic classification model through a sliding window method or a Fourier algorithm.

[0138] S52 output: input the third data into the trained third network traffic classification model, and output the classification result of the QUIC data stream.

[0139] S6 evaluation: determine whether the classification result of the QUIC data stream is correct. If so, output the category of the QUIC data stream; otherwise, execute the classification model training step S4.

[0140] Among the 451 samples in this embodiment, the classification accuracy of the third network traffic classification model reached more than 99%. Figure 8 and Fig. 9 As shown, the present application has further upgraded the dimension of the byte vector. When the dimension of the byte vector is 8, 16, and 32, the classification accuracy of the third network traffic classification model is not less than 99.5%. The larger the dimension of the byte vector, the smaller the value of the negative log-likelihood function, and the faster the convergence speed.

[0141] Embodiment 2: This embodiment discloses a data processing system based on deep learning, and the data processing system includes:

[0142] Modeling module,This module builds various network traffic classification models based on deep learning algorithms.

[0143] Historical data collection and processing module,This module first collects unlabeled QUIC data packets and classifies them to form unlabeled QUIC data streams. This module pre-processes the unlabeled QUIC data stream to extract key features. And use the initially established network traffic classification model to pre-train historical data and predict the subsequent n bytes of the data stream to provide richer data for model training.

[0144] The classification model training module is used to train the network traffic classification model using the preprocessed historical information and the predicted n bytes.

[0145] The real-time data collection and processing module is used to collect real-time QUIC data streams, input the real-time QUIC data streams into the trained network traffic classification model, and obtain the classification results of the QUIC data streams.

[0146] The present application proposes a data processing method and system based on deep learning. Based on the deep learning algorithm, a network traffic classification model is established. By inputting unlabeled QUIC data packets into a pre-trained model for full training, the contextual semantic representation of the first n bytes is learned, and the subsequent n bytes are predicted. The bytes are replaced by byte vectors to enrich the content of the data. The first data and the second data after replacing the byte vectors are used to train a third network traffic classification model, thereby realizing the classification of real-time QUIC data streams. The classification accuracy of QUIC data streams, especially unlabeled QUIC data streams, is effectively improved.

[0147] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A data processing method based on deep learning, characterized in that: The following steps are involved: First modeling: constructing a first network traffic classification model based on a deep learning algorithm, wherein the first network traffic classification model is a CNN-LSTM model; Historical data collection and processing: including the first collection, preprocessing and prediction steps; First collection: collect unlabeled QUIC data packets in historical information, classify the unlabeled QUIC data packets, and obtain unlabeled QUIC data streams; Preprocessing: preprocess the unlabeled QUIC data stream to obtain the first data; Table creation: creating a byte vector query table, wherein the byte vector query table includes: each byte and the byte vector corresponding to the byte; First extraction: extracting a byte sequence from the first data, recorded as a first byte sequence; First table lookup: Look up the byte vector lookup table, and find the byte vector corresponding to the first byte sequence, which is recorded as the first byte vector; First replacement: replacing the first byte sequence in the first data with the first byte vector to obtain new first data; Prediction: pre-train the first data using the first network traffic classification model, predict n bytes after the first data, and record the predicted n bytes as the second data; Second extraction: extracting a byte sequence from the second data, recorded as a second byte sequence; Second table lookup: Look up the byte vector lookup table for the byte vector corresponding to the second byte sequence, which is recorded as the second byte vector; Second replacement: replacing the second byte sequence in the second data with the second byte vector to obtain new second data; Classification model training: including the second modeling, adding embedding layers and training steps; Second modeling: Based on the deep learning algorithm, a second network traffic classification model is constructed, and the second network traffic classification model is a CNN model; Adding an embedding layer: adding an embedding layer to the second network traffic classification model to obtain a third network traffic classification model; Training: using the first data and the second data to train a third network traffic classification model; Real-time data acquisition and processing: including the second acquisition and output steps; Second collection: collect QUIC data stream in real time, pre-process the QUIC data stream, and obtain third data; Output: Input the third data into the trained third network traffic classification model, and output the classification result of the QUIC data stream.

2. The data processing method based on deep learning according to claim 1, characterized in that: After the embedding layer is added and before the training step, the following steps are also performed: Data normalization: Standardize the distribution of the first data and the second data by changing the variance and mean of the first data and the second data.

3. The data processing method based on deep learning according to claim 2, characterized in that: After the historical data collection and processing steps and before the classification model training steps, the following steps are also included: Reduce losses: including classification, first calculation and loss reduction steps; Classification: input the second data into the log_softmax classifier of the first network traffic classification model, and output the probability distribution of the second data category label; First calculation: using a negative log-likelihood function to calculate the loss between the probability distribution of the first data category label and the probability distribution of the second data category label, the calculation model of the negative log-likelihood function is as follows: ); Where L is the negative log-likelihood function; is the number of samples in the first data; is the number of categories in the first data; n is the number of bytes; is the Kronecker function; is the category label of the first data; is the i-th category in the first data; is a sample in the first data; is a logarithmic function; is the probability distribution of the second data category label, and the calculation model is as follows: ; in, is the weight matrix of the log_softmax classifier; F is the feature vector of the first data, and the calculation model is as follows: ; in, is the activation function; W is the connection weight of the fully connected layer of the first network traffic classification model; b is the bias term of the fully connected layer of the first network traffic classification model; p is the feature vector of the second data; Reduce loss: Optimize the negative log-likelihood function through the Adam optimizer to obtain the minimum loss between the probability distribution of the first data category label and the probability distribution of the second data category label.

4. The data processing method based on deep learning according to claim 1, characterized in that: In the step of adding an embedding layer, the new second data is used as a parameter of the embedding layer.

5. The data processing method based on deep learning according to any one of claims 1 to 3, characterized in that: After executing the first acquisition step and before executing the preprocessing step, the method further includes: Assignment: Assign the connection ID in the QUIC data stream to 0.

6. The data processing method based on deep learning according to claim 5, characterized in that: After the assignment step and before the preprocessing step, it also includes: Prune: Delete QUIC data streams with less than 2 QUIC packets.

7. The data processing method based on deep learning according to any one of claims 1 to 3, characterized in that: The method further comprises: Evaluation: Determine whether the classification result of the QUIC data stream is correct. If so, output the category of the QUIC data stream; otherwise, execute the classification model training step.

8. A data processing system based on deep learning, wherein the data processing system adopts the data processing method according to any one of claims 1 to 7 when performing data processing, characterized in that: include: Modeling module, used to build network traffic classification model; The historical data collection and processing module is used to collect and pre-process historical information to obtain the predicted n bytes; The classification model training module is used to train the network traffic classification model using the preprocessed historical information and the predicted n bytes; The real-time data collection and processing module is used to collect real-time QUIC data streams, input the real-time QUIC data streams into the trained network traffic classification model, and obtain the classification results of the QUIC data streams.