Traffic classification method, device, storage medium and program product based on interpolation spectrum

By using interpolation spectrum as a feature of the traffic classification method on edge computing devices, the problem of low traffic classification accuracy of deep learning on edge computing devices is solved, achieving more efficient traffic classification and lower calculation errors, and improving classification Accuracy and efficiency.

CN118535988BActive Publication Date: 2024-10-29BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410991750.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-29
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

In the existing technology, the traffic classification method of deep learning on edge computing devices causes calculation result errors and low accuracy due to high-dimensional features, and the feature selection process may cause the loss of data features.

Method used

Using the traffic classification method based on interpolation spectrum, interpolation is inserted into the data points through the feature extraction layer, the interpolation spectrum is generated as a feature, and the classification is performed at the traffic classification layer, which avoids errors caused by distance calculation of high-dimensional data points and improves classification accuracy. .

Benefits of technology

It improves the accuracy and efficiency of traffic classification, reduces the cost of traffic classification and the difficulty of model training, and makes the feature extraction process interpretable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535988B_ABST
    Figure CN118535988B_ABST
Patent Text Reader

Abstract

The present invention provides a traffic classification method, device, storage medium and program product based on interpolation spectrum, which relate to the field of computer technology. The method comprises: obtaining traffic data to be classified; the traffic data to be classified comprises at least one type of traffic data received from an edge computing network, and each type of traffic data comprises at least one data point; obtaining a pre-trained traffic classification model, the traffic classification model comprises a feature extraction layer and a traffic classification layer; the feature extraction layer is used to insert a preset number of interpolations based on each data point, and integrate the interpolation spectrum as the extracted data feature; the traffic classification layer is used to classify the traffic data to be classified based on the data feature; the traffic data to be classified is input into the traffic classification model, and the traffic classification result corresponding to the traffic data to be classified is obtained; the problem of low traffic classification accuracy can be solved; the error caused by distance calculation based on high-dimensional data points can be avoided, and the accuracy of traffic classification can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a flow classification method, device, storage medium and program product based on interpolation spectrum. Background Art

[0002] Edge computing technology has brought innovation to the IoT architecture. However, the deployment of a large number of edge devices has also increased the risk of network attacks on the system, which has brought severe security challenges. Therefore, in order to improve the security of networks and systems, it is necessary to detect attacks and abnormal behaviors faced by the IoT. Traffic classification technology can help identify and block malicious traffic or attacks. Through classification analysis, potential threats and attack patterns can be discovered, further enhancing the security of networks and systems.

[0003] In order to achieve accurate and fast traffic data classification, traditional traffic classification methods have introduced deep learning technology, including: classifying traffic data through deep learning technologies such as convolutional neural network (CNN), recurrent neural network (RNN) or autoencoder.

[0004] However, when deep learning is directly applied to edge computing devices, since traffic data has high-dimensional characteristics, in order to avoid the curse of dimensionality, it is usually necessary to reduce the dimension of the high-dimensional data or perform feature selection processing, and then calculate the distance between the data. This approximation process may cause errors in the calculation results, which may lead to data feature loss and low traffic classification accuracy. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a traffic classification method, device, storage medium and program product based on interpolation spectrum to eliminate or improve one or more defects in the prior art.

[0006] One aspect of the present invention provides a traffic classification method based on interpolation spectrum, which is applied to edge devices in an edge computing network. The method includes the following steps:

[0007] Obtaining traffic data to be classified; the traffic data to be classified includes at least one type of traffic data received from the edge computing network, and each type of traffic data includes at least one data point;

[0008] A pre-trained traffic classification model is obtained, and the traffic classification model includes a feature extraction layer and a traffic classification layer; the feature extraction layer is used to insert a preset number of interpolations based on each data point, and integrate the interpolation spectrum as the extracted data feature; the traffic classification layer is used to classify the traffic data to be classified based on the data feature;

[0009] The traffic data to be classified is input into the traffic classification model to obtain the traffic classification result corresponding to the traffic data to be classified.

[0010] In some embodiments of the present invention, the feature extraction layer includes a first extraction sublayer, a second extraction sublayer, and a third extraction sublayer connected in sequence;

[0011] The first extraction sublayer is used to determine the cluster center corresponding to each type of traffic data;

[0012] The second extraction sublayer is used to insert a preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data;

[0013] The third extraction sublayer is used to integrate the inserted interpolation values ​​to obtain an interpolation spectrum as a data feature.

[0014] In some embodiments of the present invention, determining the cluster center corresponding to each type of traffic data includes: determining the cluster center corresponding to each type of traffic data according to a preset cluster center algorithm.

[0015] In some embodiments of the present invention, determining the cluster center corresponding to each type of traffic data includes: respectively determining the average value of data points in each type of traffic data, and determining the cluster center corresponding to each type of traffic data.

[0016] In some embodiments of the present invention, a preset number of interpolation values ​​are respectively inserted between each data point and the cluster center corresponding to each type of traffic data, including: uniformly inserting the preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data.

[0017] In some embodiments of the present invention, a preset number of interpolants are inserted between each data point and the cluster center corresponding to each type of traffic data, including: according to the interpolation distribution indicated by a preset density function, a preset number of interpolants are inserted between each data point and the cluster center corresponding to each type of traffic data.

[0018] In some embodiments of the present invention, obtaining a pre-trained traffic classification model includes:

[0019] Obtain a sample interpolation spectrum data set, where the sample interpolation spectrum data set includes a sample training set, a sample classification label corresponding to the sample training set, and a sample test set;

[0020] Input the sample training set into the pre-created initial classifier to obtain the training result; the structure of the initial classifier is the same as that of the traffic classification layer;

[0021] Input the training results and sample classification labels into the preset loss function to obtain the loss function value;

[0022] Iteratively train the initial classifier using the loss function value;

[0023] Use the sample test set to test the trained classifier and obtain the test results;

[0024] Evaluate the test results according to preset evaluation indicators to obtain evaluation results;

[0025] When the evaluation results meet the preset evaluation expectations, the classifier training is completed;

[0026] The classifier is used as the traffic classification layer to build a traffic classification model.

[0027] Another aspect of the present invention provides a traffic classification device based on interpolation spectral representation, including a processor, a memory, and a computer program / instructions stored in the memory, the processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the above-mentioned traffic classification method based on interpolation spectral representation.

[0028] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the above-mentioned traffic classification method based on interpolation spectrum characterization.

[0029] Another aspect of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned traffic classification method based on interpolation spectrum representation.

[0030] The traffic classification method, device, storage medium and program product based on interpolation spectrum provided by the present invention obtain traffic data to be classified; the traffic data to be classified includes at least one type of traffic data received from an edge computing network, and each type of traffic data includes at least one data point; a pre-trained traffic classification model is obtained, and the traffic classification model includes a feature extraction layer and a traffic classification layer; the feature extraction layer is used to insert a preset number of interpolations based on each data point, and integrate the interpolation spectrum as the extracted data feature; the traffic classification layer is used to classify the traffic data to be classified based on the data feature; the traffic data to be classified is input into the traffic classification model to obtain the traffic classification result corresponding to the traffic data to be classified; the problem of low traffic classification accuracy can be solved; the interpolation spectrum is used as the traffic data to be classified The characteristics of traffic data, compared with distance and other representation methods, the interpolation spectrum has a higher dimension, and fewer high-dimensional features are lost when representing high-dimensional data. The interpolation spectrum can be regarded as a method of representing the similarity / distance between data. The interpolation spectrum does not need to change the dimension of the data, and can represent the similarity / distance between two data points in a more intuitive way in high-dimensional space. Therefore, it can avoid the errors caused by the distance calculation based on high-dimensional data points and improve the accuracy of traffic classification. At the same time, the feature extraction layer performs offline feature extraction on the data in an interpolation manner. After the data feature extraction is completed, the feature data is input into the traffic classification layer for online reasoning, separating the representation and classification, and can complete the classification prediction with a small amount of traffic data, reducing the cost of traffic classification and improving the efficiency of traffic classification.

[0031] In addition, by performing offline feature extraction on the traffic data in an interpolation manner through the feature extraction layer and then performing online inference through the traffic classification layer, a high-precision anomaly classification detection effect comparable to the end-to-end method using a large amount of data can be achieved with a small amount of sample data, thereby reducing the training difficulty of the traffic classification model and improving the training efficiency of the traffic classification model.

[0032] In addition, offline feature extraction of traffic data by interpolation can display the characteristics of traffic data in a visual form, making the data characteristics more interpretable.

[0033] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0034] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0036] Figure 1 A flow chart of a traffic classification method based on interpolation spectrum provided by an embodiment of the present invention.

[0037] Figure 2 A schematic diagram of the structure of a traffic classification model provided by an embodiment of the present invention.

[0038] Figure 3 A schematic diagram of interpolation visualization provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0040] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0041] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0042] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0043] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0044] The executor of the traffic classification method based on interpolation spectrum characterization provided in the present application is an edge device in an edge computing network. The edge device can be a terminal such as a computer, a mobile phone, a tablet computer, a camera, or a server. This embodiment does not limit the implementation method of the edge device.

[0045] This embodiment provides a traffic classification method based on interpolation spectrum representation, such as Figure 1 As shown, the method at least includes steps S101 to S103:

[0046] Step S101, obtaining traffic data to be classified.

[0047] The traffic data to be classified includes at least one type of traffic data received from the edge computing network, and each type of traffic data includes at least one data point.

[0048] In some embodiments of the present invention, the traffic data to be classified may be data from communications between edge devices in an edge computing network, or data captured during transmission from edge devices to the cloud or other network nodes.

[0049] Specifically, the traffic data to be classified may include but is not limited to the following:

[0050] The first type is sensor data. Sensor data can be real-time data from various sensors (such as temperature sensors, humidity sensors, light sensors, etc.). For example, the temperature sensor in other edge devices sends temperature readings to the edge device at regular intervals.

[0051] The second type is video stream data. Video stream data refers to data sent from surveillance cameras or other video devices to edge devices, such as real-time video surveillance images.

[0052] The third type is transmission data. Transmission data refers to network communication data from one edge device to another edge device. For example, data transmission between edge devices, such as file transfer, database synchronization, etc.

[0053] The fourth type is control commands. Control commands include control commands or configuration information sent from the control system or other edge devices in the edge computing network to the edge device.

[0054] The fifth type is attack and abnormal behavior data. Attack and abnormal behavior data refers to the data stream of malicious attacks or abnormal behaviors detected in the edge computing network. For example, intrusion detection data captured by edge devices or network security devices (such as port scanning, denial of service attacks, etc.); abnormal data traffic caused by device failure, network problems or other abnormal reasons (such as sensor data suddenly showing abnormal values ​​or abnormal frequency transmission data); abnormal behavior data caused by malware or virus infection; unusual patterns or frequency changes detected in the data stream transmitted from the network to the edge device (such as edge devices suddenly transmitting large amounts of data or high-frequency data).

[0055] Step S102, obtaining a pre-trained traffic classification model. The traffic classification model includes a feature extraction layer and a traffic classification layer. The feature extraction layer is used to insert a preset number of interpolations based on each data point, and integrate the interpolation spectrum as the extracted data feature; the traffic classification layer is used to classify the traffic data to be classified based on the data feature.

[0056] Among them, the traffic classification model refers to a machine learning model or a deep learning model used to extract the features of the traffic data to be classified and classify the traffic data to be classified; the interpolation spectrum is the theoretical core of the traffic classification model.

[0057] Interpolation is a mathematical method that uses the functional relationship between known data points to find the value of unknown data points. According to the above characteristics, the generated unknown data points can be used to represent the relationship characteristics between known data points.

[0058] In traditional classification models, in order to represent the characteristics of data, the model usually uses similarity metrics to quantify the similarity or distance between different data. Among them, similarity metrics use a variety of functions to calculate similarity / distance, including Euclidean distance, Manhattan distance, etc. However, since traffic data has high-dimensional characteristics, in order to avoid the dimensionality disaster, it is usually necessary to reduce the dimension of high-dimensional data or perform feature selection before calculating the distance between data. This approximate process may cause errors in the calculation results, which may lead to data feature loss.

[0059] In order to solve the above technical problems, in some embodiments of the present invention, an interpolation spectrum is used as a feature of the traffic data to be classified. Compared with representations such as distance, the interpolation spectrum has a higher dimension and loses fewer high-dimensional features when characterizing high-dimensional data. The interpolation spectrum can be regarded as a method for representing the similarity / distance between data. Compared with the above method, the interpolation spectrum does not need to change the dimension of the data, and can represent the similarity / distance between two data points in a more intuitive way in a high-dimensional space. Therefore, it can avoid errors caused by distance calculation based on high-dimensional data points.

[0060] In some embodiments of the present invention, reference Figure 2 In the traffic classification model shown in the figure, the feature extraction layer includes three steps: determining the cluster center, generating interpolation, and integrating the interpolation spectrum. Offline feature extraction is performed on the data in an interpolation manner. The traffic classification layer is used for online reasoning, and the integrated interpolation spectrum is used as feature data to classify the traffic data to be classified.

[0061] Specifically, the feature extraction layer includes a first extraction sublayer, a second extraction sublayer and a third extraction sublayer which are connected in sequence; the first extraction sublayer is used to determine the cluster center corresponding to each type of traffic data; the second extraction sublayer is used to insert a preset number of interpolations between each data point and the cluster center corresponding to each type of traffic data; the third extraction sublayer is used to integrate the inserted interpolations to obtain an interpolation spectrum as a data feature.

[0062] For the traffic data to be classified including at least one type of traffic data, the cluster centers of each type of traffic data are first determined. The interpolation data in the interpolation spectrum are distributed between the original data points and each cluster center.

[0063] In some embodiments of the present invention, the average value of all data points of the same category can be obtained by an average method to obtain the cluster center, so as to save the computing resources of the edge device. Specifically, the average method can be expressed by the following formula:

[0064]

[0065] In the formula, C represents the cluster center; Represents data points in the same type of traffic data; Indicates the number of data points in the same type of traffic data.

[0066] Specifically, determining the cluster center corresponding to each type of traffic data includes: respectively determining the average value of data points in each type of traffic data, and determining the cluster center corresponding to each type of traffic data.

[0067] In addition, cluster centers can also be obtained by other clustering methods. Specifically, determining the cluster center corresponding to each type of traffic data includes: determining the cluster center corresponding to each type of traffic data according to a preset cluster center algorithm. The preset cluster center algorithm includes but is not limited to the K-means algorithm (K-means), Gaussian Mixture Model (GMM) algorithm, hierarchical clustering algorithm, etc. This embodiment does not limit the implementation method of obtaining the cluster center.

[0068] By inserting a preset number of interpolation values ​​between data points and cluster centers, data features of all data points in the traffic data to be classified can be generated. For example, the cluster centers include cluster centers , the data points include the data points ; At data point With cluster center Insert m interpolation values ​​between to get data points The corresponding data features.

[0069] Specifically, inserting a preset number of interpolation values ​​between the data point and the cluster center can be expressed by the following formula:

[0070]

[0071] In the formula, Indicates interpolation sets; Indicates The jth interpolation in the interpolation set; m represents the preset number of interpolations; j represents a constant ranging from 0 to m; the interpolation function is a linear function, and the boundary condition of the interpolation function is , ; represents a data point; C represents a cluster center; .

[0072] Among them, the interpolation function It can be expressed by the following formula:

[0073]

[0074] In the formula, represents a data point; C represents a cluster center; .

[0075] refer to Figure 3 The interpolation spectrum of the traffic data to be classified is visualized in two-dimensional space. Given a traffic data to be classified with three categories of traffic data. In the initial space, points of different shapes represent data points of different categories, and the ellipses at the center of each category represent their cluster centers. A data point is selected from the traffic data represented by the circle, and several data points are inserted between the data point and all the cluster centers, i.e., interpolation, which is represented by dotted points in the figure. The set of these interpolations constitutes the interpolation spectrum corresponding to the data point.

[0076] For example, if the number of categories of traffic data in the traffic data to be classified is n, then the number of cluster centers is n; Interpolate between n cluster centers respectively, and the interpolation set between the first cluster center is , and the interpolation set between the second cluster center is , and the interpolation set between the nth cluster center is ; The set of all interpolated values ​​constitutes the data point The interpolation spectrum of , as a data point The extracted features.

[0077] For all data points in the traffic data to be classified, the corresponding interpolation spectra are generated by the above interpolation method, and all the interpolation spectra are integrated to finally obtain an interpolation spectrum set for characterizing the traffic data to be classified.

[0078] In the process of interpolating between data points and cluster centers, The boundary conditions have been determined. . In the case where the preset number of interpolants inserted is m, , However, when the preset number m is fixed, the boundary The value still needs to be determined.

[0079] In one example, Uniformly distributed on [0,1], that is .

[0080] Specifically, a preset number of interpolation values ​​are respectively inserted between each data point and the cluster center corresponding to each type of traffic data, including: uniformly inserting the preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data.

[0081] In another example, given The possible influence of different distributions on the characterization effect of the interpolation spectrum needs to be determined by changing Based on this, in some embodiments of the present invention, by giving a preset density function To determine the distribution of interpolation, according to the following method sampling:

[0082]

[0083] The above function represents The probability value distributed on the interval [p,q], where p and q are constants.

[0084] For example: with p=0, q=1, In the case of Uniformly distributed on [0,1]; at p=0, q=1, If the sampling is performed under the condition of More, close to 1 Less, resulting in more interpolation near the data points and less interpolation near the cluster centers.

[0085] In some embodiments of the present invention, the preset density function Including but not limited to (1-x)^2, Φ(x+.5), Φ(x+.3), x^4+(1-x)^4, √(1-x), x^2+(1-x)^2, (1-x)^2+0.5, 1-x, 1.5-x, 1 or x, etc.; in actual implementation, the preset density function can be adjusted according to actual needs In this embodiment, the density function is not preset. The implementation method is limited.

[0086] Specifically, a preset number of interpolants are inserted between each data point and the cluster center corresponding to each type of traffic data, including: according to the interpolation distribution indicated by a preset density function, a preset number of interpolants are inserted between each data point and the cluster center corresponding to each type of traffic data.

[0087] Step S103: input the traffic data to be classified into the traffic classification model to obtain the traffic classification result corresponding to the traffic data to be classified.

[0088] Specifically, after the traffic data to be classified is input into the traffic classification model, the feature extraction layer in the traffic classification model inserts a preset number of interpolations based on each data point in the traffic data to be classified, and integrates the interpolation spectrum as the extracted data features. The extracted data features are input into the traffic classification layer, and the traffic classification layer classifies the traffic data to be classified based on the extracted data features, and outputs the traffic classification results corresponding to the traffic data to be classified.

[0089] In some embodiments of the present invention, a method for training a traffic classification model is provided, comprising:

[0090] Step S1041, obtaining a sample interpolation spectrum data set, where the sample interpolation spectrum data set includes a sample training set, sample classification labels corresponding to the sample training set, and a sample test set.

[0091] The ratio of the sample training set to the sample test set is 7:3. In actual implementation, the ratio of the sample training set to the sample test set can also be adjusted according to actual conditions. This embodiment does not limit the implementation method of the ratio of the sample training set to the sample test set.

[0092] In some embodiments of the present invention, the sample interpolation spectrum data set includes an interpolation spectrum obtained by interpolating traffic data generated according to a simulated message queuing telemetry transport (MQTT) network architecture to reflect the traffic in an Internet of Things environment; and / or, an interpolation spectrum obtained by interpolating traffic data generated by a real large-scale edge computing network; and / or, an interpolation spectrum obtained by interpolating traffic data collected by professional simulation equipment that simulates traffic of multiple network applications to reflect the Internet network environment.

[0093] In some implementations of the present invention, the sample interpolation spectrum data set includes interpolation spectrum data corresponding to at least one type of sample traffic data, and each type of traffic data does not exceed 100, so as to reflect the data flow of small and medium-sized edge devices in the simulated Internet of Things. All data are processed by a natural language processing tool set (such as USTC-TK2016, etc.), and the original pcap file is split by stream and saved in json format.

[0094] Step S1042, input the sample training set into the pre-created initial classifier to obtain the training result; the structure of the initial classifier is the same as the structure of the traffic classification layer.

[0095] In one example, the initial classifier is a traditional machine learning classification model, such as a support vector machine (SVM) model, a decision tree model, or a random forest model.

[0096] In another example, the initial classifier is a deep learning classification model, such as a Long Short-Term Memory (LSTM) model, a Convolutional Neural Network (CNN) model, a DeepDefense model, etc.

[0097] Step S1043, input the training results and sample classification labels into a preset loss function to obtain a loss function value.

[0098] The preset loss function includes a cross-entropy loss function or a hinge loss function, etc. In actual implementation, the preset loss function used can be adjusted according to the classifier actually selected, and this embodiment does not limit the selection of the preset loss function.

[0099] Step S1044, iteratively train the initial classifier using the loss function value.

[0100] Specifically, the initial classifier is trained based on the loss value to reduce the difference between the training result and the sample classification label until the initial classifier converges to obtain a trained classifier.

[0101] Step S1045, using the sample test set to test the trained classifier to obtain a test result.

[0102] Step S1046, evaluating the test results according to preset evaluation indicators to obtain evaluation results; when the evaluation results meet the preset evaluation expectations, the classifier training is completed.

[0103] In some embodiments of the present invention, the preset evaluation indicators include classification accuracy, precision, recall and F1 score. The accuracy can be expressed by the following formula:

[0104]

[0105] In the formula, TP represents the number of normal samples classified as normal by the model; TN represents the number of abnormal samples classified as abnormal by the model; FP represents the number of abnormal samples classified as normal by the model; FN represents the number of normal samples classified as abnormal by the model.

[0106] The accuracy can be expressed as follows:

[0107]

[0108] In the formula, TP represents the number of normal samples classified as normal by the model; FP represents the number of abnormal samples classified as normal by the model.

[0109] The recall rate can be expressed as follows:

[0110]

[0111] In the formula, TP represents the number of normal samples classified as normal by the model; FN represents the number of normal samples classified as abnormal by the model.

[0112] The F1 score can be expressed as follows:

[0113]

[0114] In the formula, Indicates the accuracy of classification; Represents the recall rate of the classification.

[0115] In some embodiments of the present invention, when the classification accuracy, precision, recall rate and F1 score of the trained classifier meet the preset evaluation expectations, the classifier training can be considered completed, for example, the classification accuracy is greater than the preset accuracy, and / or the precision is greater than the preset precision, and / or the recall rate is greater than the preset recall rate, and / or the F1 score is greater than the preset F1 score. Among them, the preset accuracy, preset precision, preset recall rate and preset F1 score are preset evaluation expectations, and the value of the budget evaluation expectation can be adjusted according to actual needs. This embodiment does not limit the value of the preset evaluation expectation.

[0116] In some embodiments of the present invention, six initial classifiers are used to classify the sample test set, and the test results are shown in Table 1:

[0117]

[0118] Table 1

[0119] Six initial classifiers are used to classify the original data corresponding to the sample test set. The test results are shown in Table 2:

[0120]

[0121] Table 2

[0122] According to the comparison between Table 1 and Table 2, the classification effect of the model with interpolated spectrum as input is basically stronger than that of the classifier with original data as input. Among them, the classification results of traditional machine learning models are similar, and the classification results of deep learning models are significantly improved. Therefore, interpolated spectrum can effectively represent original data, can effectively assist deep learning methods, and improve detection effects.

[0123] In addition, in some embodiments of the present invention, five traditional classification models, including event-related neural network (ERNN), point cloud data processing network (PointNet), dynamic graph convolutional neural network (DGCNN), deep pyramid convolutional neural network (DPCNN) and ensemble random forest (EnsembleRF) model, are used to classify the sample test set, and compared with the decision tree as a classifier (NLIS) to evaluate the overall performance of the model. The results are shown in Table 3. The accuracy of the five traditional classification models does not exceed 90%. The performance of the classifier (NLIS) trained by the present invention is better than the five traditional classification models.

[0124]

[0125] Table 3

[0126] In addition, in order to verify the generalization performance of the model, the traffic classification layer is constructed with the Random Forest model as the classifier. The first sample test set obtained by interpolating the traffic data generated by the MQTT network architecture, the second sample test set obtained by interpolating the traffic data generated by the real large-scale edge computing network, and the third sample test set obtained by interpolating the traffic data collected by professional simulation equipment that simulates a variety of network application traffic are tested. The results are shown in Table 4:

[0127]

[0128] Table 4

[0129] As shown in Table 4, the classification result of the first sample test set is the worst, the classification result of the third sample test set is the best, and the classification result of the second sample test set is between the two. On the one hand, there are obvious differences in the classification results of the three sample test sets, which may be due to the different classification effects of the initial classifiers used on the three sample test sets, indicating that the representation effect of the interpolation spectrum is restricted by the data set itself; on the other hand, the classification results of the three sample test sets are good, and the accuracy rate is higher than 70%, indicating that the model has good generalization performance.

[0130] Step S1047, using the classifier as a traffic classification layer to construct a traffic classification model.

[0131] In some embodiments of the present invention, the traffic classification model includes a feature extraction layer and a traffic classification layer. The feature extraction layer is used to insert a preset number of interpolations based on each data point, and integrate the interpolation spectrum as the extracted data feature; the traffic classification layer is used to classify the traffic data to be classified based on the data feature. After the classifier is trained, the classifier is used as the traffic classification layer to construct the traffic classification model.

[0132] In addition, in some embodiments of the present invention, the feature extraction layer includes three steps: determining the cluster center, generating interpolation, and integrating the interpolation spectrum. Among them, the method for determining the cluster center includes but is not limited to the averaging method, K-means algorithm, Gaussian mixture model (GMM) algorithm, hierarchical (Agglomerative) clustering algorithm, etc. The support vector machine model (SVM) is used as the classifier used in the traffic classification layer, and the method for determining the cluster center is evaluated by preset evaluation indicators. The results are shown in Table 5:

[0133]

[0134] Table 5

[0135] As shown in Table 5, n represents the number of samples, k represents the number of iterations, and m represents the additional space occupied by the operation. The results show that the classification results of the three cluster center algorithms, K-means, GMM, and Agglomerative, are the same, but they are all lower than the average method and have higher complexity. The possible reason for this result is that the amount of data is small, so the three cluster center algorithms generate the same cluster center, which may be conducive to clustering, but the representation effect of the generated interpolation spectrum is weaker than the average method.

[0136] In addition, in some embodiments of the present invention, by giving a preset density function To determine the distribution of interpolation. Among them, the preset density function Including but not limited to (1-x)^2, Φ(x+.5), Φ(x+.3), x^4+(1-x)^4, √(1-x), x^2+(1-x)^2, (1-x)^2+0.5, 1-x, 1.5-x, 1 or x, etc. The support vector machine model (SVM) is used as the classifier used in the traffic classification layer, and each preset density function is evaluated by the preset evaluation index. The evaluation results are shown in Table 6:

[0137]

[0138] Table 6

[0139] As shown in Table 6, under the influence of different density functions, the classification effect of the model is similar. This result shows that the distribution of interpolation points has limited influence on classification. Considering the comprehensive classification effect and the amount of calculation, uniform distribution of interpolation points is the best distribution strategy.

[0140] In summary, the traffic classification method based on interpolation spectrum provided in this embodiment obtains traffic data to be classified; the traffic data to be classified includes at least one type of traffic data received from the edge computing network, and each type of traffic data includes at least one data point; a pre-trained traffic classification model is obtained, and the traffic classification model includes a feature extraction layer and a traffic classification layer; the feature extraction layer is used to insert a preset number of interpolations based on each data point, and integrate the interpolation spectrum as the extracted data feature; the traffic classification layer is used to classify the traffic data to be classified based on the data feature; the traffic data to be classified is input into the traffic classification model to obtain the traffic classification result corresponding to the traffic data to be classified; the problem of low traffic classification accuracy can be solved; the interpolation spectrum is used as the traffic data to be classified. Compared with the distance and other representations, the interpolation spectrum has a higher dimension and loses fewer high-dimensional features when representing high-dimensional data. The interpolation spectrum can be regarded as a method of representing the similarity / distance between data. The interpolation spectrum does not need to change the dimension of the data and can represent the similarity / distance between two data points in a more intuitive way in the high-dimensional space. Therefore, it can avoid the errors caused by the distance calculation based on high-dimensional data points and improve the accuracy of traffic classification. At the same time, the feature extraction layer performs offline feature extraction on the data in an interpolation manner. After the data feature extraction is completed, the feature data is input into the traffic classification layer for online reasoning, separating the representation and classification, and can complete the classification prediction with a small amount of traffic data, reducing the cost of traffic classification and improving the efficiency of traffic classification.

[0141] In addition, by performing offline feature extraction on the traffic data in an interpolation manner through the feature extraction layer and then performing online inference through the traffic classification layer, a high-precision anomaly classification detection effect comparable to the end-to-end method using a large amount of data can be achieved with a small amount of sample data, thereby reducing the training difficulty of the traffic classification model and improving the training efficiency of the traffic classification model.

[0142] In addition, offline feature extraction of traffic data by interpolation can display the characteristics of traffic data in a visual form, making the data characteristics more interpretable.

[0143] Corresponding to the above method, the present invention also provides a traffic classification device based on interpolation spectrum representation, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the above-mentioned traffic classification method based on interpolation spectrum representation.

[0144] An embodiment of the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the above-mentioned traffic classification method based on interpolation spectrum representation are implemented.

[0145] Another aspect of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned traffic classification method based on interpolation spectrum representation.

[0146] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0147] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0148] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A traffic classification method based on interpolation spectrum characterization, characterized in that: Applied to an edge device in an edge computing network, the method comprises the following steps: Acquire traffic data to be classified; the traffic data to be classified includes at least one type of traffic data received from the edge computing network, and each type of traffic data includes at least one data point; A pre-trained traffic classification model is obtained, wherein the traffic classification model includes a feature extraction layer and a traffic classification layer; the feature extraction layer is used to insert a preset number of interpolations based on each data point, and integrate the interpolation spectrum as the extracted data feature; the traffic classification layer is used to classify the traffic data to be classified based on the data feature; Inputting the traffic data to be classified into the traffic classification model to obtain a traffic classification result corresponding to the traffic data to be classified; The feature extraction layer includes a first extraction sublayer, a second extraction sublayer and a third extraction sublayer connected in sequence; The first extraction sublayer is used to determine the cluster center corresponding to each type of traffic data; The second extraction sublayer is used to insert a preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data; The third extraction sublayer is used to integrate the inserted interpolation values ​​to obtain the interpolation spectrum as the data feature.

2. The method according to claim 1, characterized in that The determining the cluster center corresponding to each type of traffic data includes: determining the cluster center corresponding to each type of traffic data according to a preset cluster center algorithm.

3. The method according to claim 1, characterized in that Determining the cluster center corresponding to each type of traffic data includes: respectively determining the average value of data points in each type of traffic data, and determining the cluster center corresponding to each type of traffic data.

4. The method according to claim 1, characterized in that: Inserting a preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data includes: uniformly inserting the preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data.

5. The method according to claim 1, characterized in that The method of inserting a preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data comprises: inserting the preset number of interpolation values ​​between each data point and the cluster center corresponding to each type of traffic data according to the interpolation distribution indicated by a preset density function.

6. The method according to claim 1, characterized in that The obtaining of a pre-trained traffic classification model includes: Acquire a sample interpolation spectrum data set, wherein the sample interpolation spectrum data set includes a sample training set, a sample classification label corresponding to the sample training set, and a sample test set; Inputting the sample training set into a pre-created initial classifier to obtain a training result; the structure of the initial classifier is the same as the structure of the traffic classification layer; Input the training result and the sample classification label into a preset loss function to obtain a loss function value; Iteratively train the initial classifier using the loss function value; Using the sample test set to test the trained classifier to obtain a test result; Evaluate the test results according to preset evaluation indicators to obtain evaluation results; When the evaluation result meets the preset evaluation expectation, the classifier training is completed; The classifier is used as the traffic classification layer to construct the traffic classification model.

7. A flow classification device based on interpolation spectrum characterization, comprising a processor, a memory, and a computer program / instruction stored in the memory, characterized in that: The processor is used to execute the computer program / instructions. When the computer program / instructions are executed, the device implements the steps of the method according to any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Categorizing method oriented to Internet unbalanced application flow

    CN104102700A

  • Malicious traffic detection method based on SMOTE algorithm and ensemble learning

    CN110572382A