A one-way flow-based intelligent network connected vehicle encrypted network traffic classification method

By performing session-level and flow-level slicing on the encrypted network traffic of intelligent connected vehicles, extracting multi-dimensional features, and constructing a classification model, the problems of low accuracy and insufficient robustness in encrypted network traffic classification in existing technologies are solved, achieving more efficient encrypted network traffic identification and security assurance.

CN123145185APending Publication Date: 2026-11-20BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511056041.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-05-20
Filing Date
2025-07-30
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing encrypted network traffic classification methods have low accuracy in intelligent connected vehicles and are difficult to adapt to diverse and complex network behavior scenarios, lacking robustness.

Method used

By processing the encrypted network traffic data of intelligent connected vehicles into session-level and stream-level data, slicing it using quintuple information and transmission direction features, extracting multi-dimensional features, and constructing a classification model for supervised learning.

Benefits of technology

It improves the accuracy and robustness of encrypted network traffic classification, enabling more accurate identification of different types of encrypted network traffic and supporting traffic behavior analysis and security policy formulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123145185A_ABST
    Figure CN123145185A_ABST
Patent Text Reader

Abstract

The application discloses a kind of intelligent network connection car encrypted network flow classification method based on one-way flow, the method includes: step 1: using the five-element group information of network message, the intelligent network connection car encrypted network flow stored in pcap format is handled as session level encrypted network flow data, further using the interactive characteristics of session level encrypted network flow data, session level encrypted network flow data is handled as flow level encrypted network flow data;Step 2: the flow level encrypted network flow data obtained in step 1 is extracted multidimensional flow level features, which is used as the feature of classification model input data set, and the corresponding application type is used as label;Step 3: the data set obtained in step 2 is executed supervised classification using machine learning classification model multilayer perception.The method disclosed in the application can realize adaptive processing of encrypted network flow data, improve the classification accuracy and increase the robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network traffic analysis technology, and in particular to a method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow. Background Technology

[0002] The rapid development of intelligent connected vehicles has generated a massive amount of network traffic. However, due to the lack of a large-scale, mature network traffic analysis platform for intelligent connected vehicles, this traffic remains largely a "black box," posing a significant challenge to the security of these vehicles. Furthermore, encrypted network traffic constitutes a large proportion of the network traffic generated by intelligent connected vehicles. Because the payload of encrypted network traffic packets is invisible, traditional network traffic analysis methods that rely on extracting valuable information from plaintext payloads may fail. Therefore, classifying encrypted network traffic from intelligent connected vehicles has become a challenging task. While several organizations have researched the classification of encrypted network traffic from intelligent connected vehicles, these studies have all encountered problems such as low accuracy and high complexity. To date, no suitable encrypted network traffic classification method has been widely applied in production. Therefore, a classification method for encrypted network traffic from intelligent connected vehicles is of great significance for the safe and healthy development of intelligent connected vehicles.

[0003] Intelligent Connected Vehicles (ICVs) are vehicles that utilize onboard sensors, communication equipment, and cloud computing technology to enable them to perceive, make decisions, control, and interconnect with the external environment, thereby achieving functions such as autonomous driving, vehicle-to-everything (V2X) connectivity, and intelligent navigation. The core characteristics of ICVs include intelligence and connectivity. Intelligence is primarily reflected in the vehicle's ability to autonomously perceive road conditions, the environment, and driver needs, achieving automatic decision-making and driving through algorithms and data processing. For example, an autonomous driving system can automatically adjust speed, steering, and braking based on road conditions, improving driving safety and comfort. Connectivity refers to the vehicle's ability to exchange information in real time with external devices, traffic infrastructure, and other vehicles, forming an efficient transportation network. This not only improves traffic flow but also effectively reduces traffic accidents and congestion. Currently, ICVs have some applications in areas such as autonomous driving, intelligent navigation, remote monitoring, and V2X connectivity, but still face challenges in technology, regulations, and safety. With continuous technological advancements and policy support, ICVs are expected to become the mainstream of future travel, significantly changing transportation methods and improving road safety and travel efficiency.

[0004] Network Traffic Analysis (NTA) is a series of techniques used to monitor, capture, and analyze data transmission information on a network to assess network performance, optimize traffic management, detect security threats, and resolve faults. With the widespread use of the internet and the increasing complexity of cyberattacks, NTA has become an important tool in areas such as network security, performance management, and compliance monitoring. NTA techniques mainly include traffic monitoring and capture, traffic classification and feature extraction, protocol analysis and decoding, pattern analysis and anomaly detection, and performance monitoring and fault diagnosis. As NTA technology continues to develop, artificial intelligence and big data technologies are being applied more extensively, enabling more efficient processing of massive amounts of data, identification of unknown threats, and real-time responses. However, with the widespread adoption of encryption technology, analyzing encrypted traffic has become a new challenge for current NTA.

[0005] Encrypted Traffic Analysis (ETA) is a technology that monitors and analyzes encrypted communication traffic to extract valuable information and identify potential security threats, abnormal behaviors, or attack activities. With the widespread adoption of encrypted communication protocols (such as TLS / SSL), more and more network traffic is encrypted, rendering traditional plaintext traffic-based monitoring techniques ineffective. Therefore, encrypted traffic analysis technology has emerged. The challenge of encrypted traffic analysis lies in the fact that its analytical capabilities are constrained by the complexity of encryption algorithms, limitations in encryption key management, and privacy regulations. However, with technological advancements and the application of artificial intelligence, more and more security systems are integrating encrypted traffic analysis to ensure network security and data privacy.

[0006] Encrypted Traffic Classification (ETC) refers to the technology of analyzing and classifying encrypted communication traffic. It distinguishes different types of applications and communication behaviors by identifying the external characteristics of encrypted traffic (such as traffic patterns, protocol behavior, and timing characteristics). With the widespread application of encrypted communication technologies (such as TLS / SSL), more and more network traffic is encrypted, rendering traditional plaintext analysis methods ineffective. Therefore, encrypted traffic classification has become a key technology in network security, traffic management, and application identification. ETC mainly relies on the following technical means: metadata-based classification, traffic fingerprinting, timing and behavioral pattern analysis, deep learning, and artificial intelligence. The challenge of encrypted traffic classification lies in the fact that with the continuous development of encryption algorithms and communication protocols, new encryption methods and attack techniques are constantly emerging, requiring classification technologies to have stronger adaptability and real-time performance. Furthermore, due to the privacy-preserving nature of encrypted traffic, how to balance security and privacy protection remains a significant issue for encrypted traffic classification. Summary of the Invention

[0007] This invention provides a method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow. The purpose is to overcome the shortcomings of existing encrypted network traffic classification methods, such as low classification accuracy and difficulty in adapting to diverse and complex network behavior scenarios based on the optimal window selection method, and to improve the classification accuracy and robustness of the classification method.

[0008] A method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow is provided, the method comprising:

[0009] Step 1: Utilizing the five-tuple information of network packets—source IP, destination IP, source port, destination port, and protocol—the encrypted network traffic of intelligent connected vehicles stored in pcap format is first processed into session-level encrypted network traffic data. Further leveraging the interactive characteristics of session-level encrypted network traffic data, it is then processed into stream-level encrypted network traffic data.

[0010] Specifically, for each session-level encrypted network traffic data obtained, all network packets contained therein have the same 5-tuple. For each stream-level encrypted network traffic data obtained in the end, all network packets contained therein not only have the same 5-tuple, but also have the same transmission direction.

[0011] Step 1 specifically includes the following sub-steps:

[0012] Step 1.1: Read the pcap files of encrypted network traffic data of intelligent connected vehicles for different application categories. For each application category of encrypted network traffic data pcap file, extract a complete encrypted network traffic data into multiple session-level encrypted network traffic data according to the five-tuple information of the network packet, namely source IP, destination IP, source port, destination port and protocol.

[0013] Among them, session-level encrypted network traffic data is characterized by (1):

[0014] S = {P1, P2, ..., P} S} (1)

[0015] Among them, P s This represents a network packet, and all network packets share the same 5-tuple. Session-level encrypted network traffic data is more likely to reveal patterns in communication patterns compared to fully encrypted network traffic data containing multiple sessions.

[0016] Step 1.2: Perform a slicing operation on each session-level encrypted network traffic data obtained in Step 1.1 using its interactive characteristics. First, find the slice location. If the transmission direction of network packets in the session-level encrypted network traffic data changes, that is, the source IP address and destination IP address are swapped, then it is defined as the slice location.

[0017] The transmission direction of network messages is represented by (2):

[0018] D(P i ) = (src_ip i dst_ip i (2)

[0019] The change in the transmission direction of network messages is characterized by (3) and (4):

[0020] D(P i )≠D(P i+1 (3)

[0021] (src_ip i dst_ip i )=(dst_ip i+1 src_ip i+1 (4)

[0022] Performing a slicing operation at the slice location yields a large amount of stream-level encrypted network traffic data.

[0023] Among them, the stream-level encrypted network traffic data is characterized by (5):

[0024]

[0025] Where P f This indicates a network packet. All network packets contained in a stream-level encrypted network traffic data have the same 5-tuple and the same transmission direction.

[0026] Each stream-level encrypted network traffic data can contain one or more network packets, and a stream-level encrypted network traffic data can be regarded as a one-way transmission action of encrypted network traffic.

[0027] Step 2: Extract features from each stream-level encrypted network traffic data obtained in Step 1, taking into full account multiple feature dimensions, such as time features, direction features, basic statistical features, distribution features, etc.

[0028] For each stream-level encrypted network traffic data obtained in Step 1, feature extraction is performed across different dimensions. Temporal features include the start time, end time, and duration of the stream-level encrypted network traffic data; directional features are defined as positive or negative 1; basic statistical features include the number of network packets in the stream-level encrypted network traffic data, and the average, maximum, and minimum lengths of all network packets in the stream-level encrypted network traffic data; distribution features include the skewness and kurtosis of the lengths of all network packets in the stream-level encrypted network traffic data. A total of 25 non-correlated stream-level features are provided.

[0029] Step 3: The extracted multidimensional features are used as features of the input dataset for the classification model, and the corresponding application type is used as the label of the input dataset for the classification model. Finally, the features and labels of the input dataset for the classification model are obtained.

[0030] The input dataset for the classification model has 25 dimensions of features, while the labels of the input dataset for the classification model are 1 dimension.

[0031] Construct a classification model with input dataset (X, y), which consists of features X and labels y corresponding to stream-level encrypted network traffic data for all different application types.

[0032] Where X represents the 25-dimensional feature of the stream-level encrypted network traffic data in step 2, and y represents the application category label of the stream-level encrypted network traffic data in step 1. Both feature X and label y are converted into PyTorch tensors for easy input into the classification model.

[0033] Step 4: Divide the features X and labels y of all different types of stream-level encrypted network traffic data into training set (X_train, y_train), validation set (X_val, y_val), and test set (X_test, y_test) using the function train_test_split. Then, perform supervised classification using the multilayer perceptron machine learning classification model to obtain classification results, including confusion matrix, accuracy, precision, recall, and F1 score.

[0034] Thus far, from step 1 to step 4, the classification of encrypted network traffic data for different application categories of intelligent connected vehicles has been achieved.

[0035] Beneficial effects

[0036] A method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow has the following advantages compared with existing encrypted network traffic classification methods:

[0037] 1. Existing encrypted network traffic classification methods are based on fixed window selection, which segments a complete flow according to a fixed time or the number of network packets, ignoring the interactive information of network traffic and resulting in low classification accuracy. This invention can greatly improve the accuracy of encrypted network traffic classification.

[0038] 2. Existing methods for classifying encrypted network traffic by selecting window parameters for different labels no longer directly apply to new encrypted network traffic data once the label type is changed. This invention can greatly improve the robustness of encrypted network traffic classification. Attached Figure Description

[0039] Figure 1 This invention provides a method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow, and the topology diagram of intelligent connected vehicle network nodes in Embodiment 1.

[0040] Figure 2 This is a schematic diagram of the input and output of the intelligent connected vehicle encrypted network traffic classification method based on unidirectional flow in this invention and the intelligent connected vehicle encrypted network traffic classification method in embodiment 1.

[0041] Figure 3 This is a flowchart of the intelligent connected vehicle encrypted network traffic classification method based on unidirectional flow and the intelligent connected vehicle encrypted network traffic classification method in embodiment 2 of the present invention;

[0042] Figure 4This is a schematic diagram illustrating the principle of the intelligent connected vehicle encrypted network traffic classification method based on unidirectional flow and the session-level encrypted network traffic data slicing method in Embodiment 2 of the present invention.

[0043] Figure 5 is a diagram showing the classification performance results of the intelligent connected vehicle scenario in the present invention, which is based on a unidirectional flow encrypted network traffic classification method for intelligent connected vehicles and in Example 3.

[0044] Figure 5(a) shows the result of the multi-class confusion matrix in the intelligent connected vehicle scenario, and (b) shows the result of the three classification indicators for each application category in the intelligent connected vehicle scenario.

[0045] Figure 6 is a classification performance diagram of the intelligent connected vehicle encrypted network traffic classification method based on unidirectional flow and in the Internet of Things scenario in Embodiment 3 of the present invention;

[0046] Figure 6(a) shows the result of the multi-class confusion matrix in the Internet of Things (IoT) scenario, and (b) shows the result of the three classification indicators for each application category in the IoT scenario. Detailed Implementation

[0047] Example 1

[0048] Embodiment 1 of this invention elaborates on the application scenarios and input / output of the intelligent connected vehicle encrypted network traffic classification method based on unidirectional flow.

[0049] Figure 1This is a topology diagram of the network nodes for intelligent connected vehicles in Example 1. The number of intelligent connected vehicles is experiencing explosive growth, generating a large amount of network traffic due to their network connectivity. Intelligent connected vehicles access base stations via telematics boxes (T-Boxes) and further connect to the core network and telematics service providers (TSPs) to enable a wide variety of network applications, such as watching tutorial videos, remotely controlling vehicles via smart terminals, and performing OTA upgrades. Using a network splitter device, encrypted network traffic from intelligent connected vehicles for different network applications can be captured. The network splitter device collects all IoT traffic and sends it to a network monitor, which uses Wireshark to store the network traffic in pcap file format. A network splitter is a hardware device that monitors and analyzes network traffic by connecting to a network cable and providing copies of the traffic to other monitoring and security tools. The connection method of the network splitter does not affect normal operation and provides full-duplex, non-intrusive, and passive network traffic access without introducing any latency or affecting network performance. When intelligent connected vehicles implement network applications, the resulting network traffic is highly mixed. Furthermore, encrypted network traffic constitutes a significant portion of this traffic, further posing challenges to network traffic monitoring platforms for intelligent connected vehicles. Existing methods for classifying encrypted network traffic suffer from low accuracy and high complexity; to date, no suitable method for classifying encrypted network traffic has been widely adopted in production.

[0050] Figure 2 This diagram illustrates the input and output of the encrypted network traffic classification method for intelligent connected vehicles in Embodiment 1. The encrypted network traffic data is first loaded in pcap format, including various specific types of traffic data, such as tutorial videos, remote vehicle control, and OTA upgrades. This data is then processed into different categories of features and labels using a classification method. Subsequently, the classification model is trained and validated using supervised learning on this traffic data. During training, the model learns the feature distribution and category relationships of the encrypted network traffic data from the training set. In the validation set, the model's performance is optimized by evaluating metrics such as precision, recall, and F1 score to avoid overfitting or underfitting. Finally, the test set is used to verify the model's actual classification performance, ensuring it can accurately identify different types of traffic data. Through this process, the classification model can efficiently analyze the complex characteristics of stream-level encrypted network traffic in intelligent connected vehicles, providing crucial support for traffic behavior analysis, anomaly detection, and security strategy formulation, thus contributing to the security and reliability of vehicle-to-everything (V2X) communication.

[0051] Example 2

[0052] To make the purpose, technical solution, and advantages of the present invention's method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow clearer, the technical solution in the present invention will be clearly and completely described below with reference to the accompanying drawings of Embodiment 2:

[0053] Figure 3 This is a flowchart of the encrypted network traffic classification method for intelligent connected vehicles in Embodiment 2. The method 300 includes: an encrypted network traffic data preprocessing unit 301, a session-level encrypted network traffic data slicing unit 302, a stream-level encrypted network traffic data feature extraction unit 303, a classification model input construction unit 304, and a classification model execution unit 305.

[0054] In the encrypted network traffic data preprocessing unit 301, sessions of encrypted network traffic from intelligent connected vehicles are extracted. Intelligent connected vehicles can implement a wide variety of network applications, such as watching tutorial videos, remotely controlling the vehicle via a smart terminal, and performing OTA (Over-the-Air) upgrades. When implementing network applications, intelligent connected vehicles generate a large amount of encrypted network traffic data of different application categories. The pcap files of encrypted network traffic data for different application categories are read. For each application category's pcap file, a complete encrypted network traffic data set is extracted into multiple session-level encrypted network traffic data sets according to a five-tuple. Each session-level encrypted network traffic data set has the same source IP, destination IP, source port, destination port, and protocol number. Session-level encrypted network traffic data sets are more likely to reveal patterns in communication patterns compared to complete encrypted network traffic data sets containing multiple mixed sessions.

[0055] In the session-level encrypted network traffic data slicing unit 302, the session-level encrypted network traffic data extracted by the encrypted network traffic data preprocessing unit 301 is sliced. Based on the interaction characteristics of the communicating parties, the data of each session is divided into multiple stream-level encrypted network traffic data. By analyzing the changes in the transmission direction of network packets in the data, the slice position is determined, forming multiple stream-level data units. This method can effectively capture the unidirectional transmission characteristics of traffic, thereby providing more granular data for subsequent traffic analysis and classification models, improving classification accuracy, and enhancing the robustness of the method.

[0056] In this embodiment 2 Figure 3 The session-level encrypted network traffic data slicing unit 302 specifically includes the following steps:

[0057] Step 1: Determine the IP addresses of the two communicating parties in the session, namely IP-1 and IP-2;

[0058] Step 2: Locate the point where the network packet direction changes;

[0059] Step 3: Perform a slicing operation to divide the encrypted network traffic unidirectional transmission actions and set them as subsequent classification objects;

[0060] Step 4: Perform steps 1-3 for all sessions under all tags.

[0061] in, Figure 4 This is a schematic diagram of the principle of the session-level encrypted network traffic data slicing method in Embodiment 2, that is, a schematic diagram of the principle of the session-level encrypted network traffic data slicing unit 302 in Embodiment 2.

[0062] In this embodiment 2, the encrypted network traffic data extracted by the encrypted network traffic data preprocessing unit 301 is sliced ​​using its interactive characteristics. Taking a portion of a session-level encrypted network traffic as an example, this session involves communication between IP-1 and IP-2. Network packets are sometimes transmitted from IP-1 to IP-2 and sometimes from IP-2 to IP-1. If the transmission direction of network packets in the encrypted network traffic data changes, i.e., the source IP address and destination IP address are swapped, as indicated by the arrow, then a slicing operation is performed at the position where the transmission direction changes. In this session, two network packets are first transmitted from IP-2 to IP-1, and then the transmission direction of the network packets changes, with three network packets being transmitted from IP-1 to IP-2. Therefore, a slicing operation is performed after the second network packet. According to this session-level encrypted network traffic data slicing method, the portion of the session-level encrypted network traffic data shown in the figure is sliced ​​into five stream-level encrypted network traffic data. Each stream-level encrypted network traffic data can contain one or more network packets with the same 5-tuple and the same transmission direction, which can be regarded as a unidirectional transmission action of encrypted network traffic.

[0063] Performing the same operation on each session-level encrypted network traffic data for all application categories will ultimately yield a large amount of stream-level encrypted network traffic data. The stream-level encrypted network traffic data corresponding to the same session-level encrypted network traffic data has inherent fine-grained session-wide characteristics. Similarly, the stream-level encrypted network traffic data corresponding to the same application category has inherent coarse-grained application-category-wide characteristics.

[0064] The stream-level encrypted network traffic data feature extraction unit 303 performs multi-dimensional feature extraction on the stream-level encrypted network traffic data obtained from the session-level encrypted network traffic data slicing unit 302. By extracting time features, direction features, and basic statistical features, it comprehensively describes the behavior and distribution characteristics of the stream-level encrypted network traffic data. This includes the start time, end time, and duration of the stream-level encrypted network traffic; the number of network packets; the average, maximum, and minimum lengths of all network packets; and statistical measures such as skewness and kurtosis of the lengths of all network packets. These features provide rich data support for subsequent traffic classification and analysis, ensuring that there is no strong correlation between the features.

[0065] The multi-dimensional features obtained from the stream-level encrypted network traffic data feature extraction unit 303 in the classification model input building unit 304 correspond to their category labels. During the transformation process, the features and labels are standardized into PyTorch tensors to facilitate efficient computation and optimization in the subsequent deep learning model. This process is fundamental to the training of the classification model, ensuring that the input data format is uniform and has good operability, thus laying the foundation for achieving high-precision network traffic classification.

[0066] In the classification model execution unit 305, the input data of the classification model obtained from the classification model input construction unit 304 is fed into the machine learning classifier for training and evaluation of the classification model. The feature data (X) and label data (y) are divided into training, validation, and test sets using the function `train_test_split`, ensuring separation of training and testing and avoiding performance overestimation due to data leakage. The training set is used to train the classification model, the validation set is used to adjust model parameters to optimize performance, and the test set is used to evaluate the model's generalization ability and final classification effect. Through this process, the classification model can learn the mapping relationship between encrypted traffic features and corresponding categories, providing technical support for encrypted network traffic classification in intelligent connected vehicles.

[0067] Example 3

[0068] This embodiment 3 verifies the high accuracy classification performance of the present invention on encrypted network traffic data of intelligent connected vehicles. The specific implementation method is as follows: Encrypted network traffic data of intelligent connected vehicles with multiple tags, including remote control, OTA upgrades, and video viewing, is collected. The present invention is used to perform a multi-classification task to obtain classification results, including a classification confusion matrix and classification indicators for each tag.

[0069] Figure 5(a) shows the results of the multi-class confusion matrix in the intelligent connected vehicle scenario of this embodiment 3. In Figure 5(a), the horizontal axis represents the predicted label, and the vertical axis represents the true label. For the 397 stream-level encrypted network traffic with the true label of remote control, 396 stream-level encrypted network traffic were predicted as the correct label, and 1 stream-level encrypted network traffic was predicted as the incorrect label; for the 433 stream-level encrypted network traffic with the true label of OTA upgrade, all stream-level encrypted network traffic were predicted as the correct label; for the 81 stream-level encrypted network traffic with the true label of watching video, 73 stream-level encrypted network traffic were predicted as the correct label, and 8 stream-level encrypted network traffic were predicted as the incorrect label.

[0070] Figure 5(b) shows the results of the three classification indicators for each application category in the intelligent connected vehicle scenario of this embodiment 3. The legend in Figure 5(b) represents the classification indicators, including precision, recall, and F1 score, which are represented by left-hand diagonal lines, horizontal lines, and right-hand diagonal lines, respectively. The horizontal axis represents the tags, including remote control, OTA upgrades, and video viewing, while the vertical axis represents the specific values ​​of the classification indicators. For example, the precision of the remote control tag is 98%, the recall is 99.8%, and the F1 score is 98.9%. The overall classification accuracy for the three tags is 98.9%.

[0071] Figures 5(a) and 5(b) together demonstrate that the present invention has high accuracy in classifying encrypted network traffic data of intelligent connected vehicles.

[0072] Example 4

[0073] Example 4 verifies the robust classification performance of the present invention on new IoT encrypted network traffic data. Specifically, based on the public dataset CIC-IOT-2022, a new IoT encrypted network traffic dataset is constructed, with labels including microphone_start, camera 1_start, camera 2_attack, camera 3_attack, and camera 3_interaction. A multi-classification task is performed using the present invention to obtain classification results, which also include the classification confusion matrix and classification metrics for each label.

[0074] Figure 6(a) shows the results of the multi-class confusion matrix in the IoT scenario of Example 4. In Figure 6(a), the horizontal axis represents the predicted label, and the vertical axis represents the true label. For example, for the 1595 stream-level encrypted network traffic with the true label "microphone_start", 1588 stream-level encrypted network traffic are predicted as correct labels, and 7 stream-level encrypted network traffic are predicted as incorrect labels; for the 298 stream-level encrypted network traffic with the true label "camera1_start", 296 stream-level encrypted network traffic are predicted as correct labels, and 2 stream-level encrypted network traffic are predicted as incorrect labels; for the 4281 stream-level encrypted network traffic with the true label "camera3_attack", all stream-level encrypted network traffic are predicted as correct labels.

[0075] Figure 6(b) shows the results of the three classification metrics for each application category in the IoT scenario of this embodiment 4. The legend in Figure 6(b) represents the classification metrics, including precision, recall, and F1 score, which are represented by left-hand diagonal lines, horizontal lines, and right-hand diagonal lines, respectively. The horizontal axis represents the tags, including Microphone_Activation, Camera 1_Activation, Camera 2_Attack, Camera 3_Attack, and Camera 3_Interaction. The vertical axis represents the specific values ​​of the classification metrics. For example, the precision of the tag Microphone_Activation is 100%, the recall is 99.6%, and the F1 score is 99.8%. The overall classification accuracy for the three tags is 99.4%.

[0076] Figures 6(a) and 6(b) together demonstrate the excellent classification performance of the present invention in the new Internet of Things scenario, and together verify the robustness of the present invention in classifying encrypted network traffic data.

[0077] The above description is merely a preferred embodiment of the present invention, and the present invention should not be limited to the content disclosed in this embodiment and the accompanying drawings. Any equivalent or modified embodiments made without departing from the spirit of the present invention fall within the scope of protection of the present invention.

Claims

1. A method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow, characterized in that, The method includes: Step 1: Utilizing the five-tuple information of network packets—source IP, destination IP, source port, destination port, and protocol—the encrypted network traffic of intelligent connected vehicles stored in pcap format is first processed into session-level encrypted network traffic data. Further leveraging the interactive characteristics of session-level encrypted network traffic data, it is then processed into stream-level encrypted network traffic data. Specifically, for each session-level encrypted network traffic data obtained, all network packets contained therein have the same 5-tuple. For each stream-level encrypted network traffic data obtained in the end, all network packets contained therein not only have the same 5-tuple, but also have the same transmission direction. Step 1 specifically includes the following sub-steps: Step 1.1: Read the pcap files of encrypted network traffic data of intelligent connected vehicles for different application categories. For each application category of encrypted network traffic data pcap file, extract a complete encrypted network traffic data into multiple session-level encrypted network traffic data according to the five-tuple information of the network packet, namely source IP, destination IP, source port, destination port and protocol. Among them, session-level encrypted network traffic data is characterized by (1): S={P1,P2,…,P S } (1) Among them, P s This represents a network packet, and all network packets share the same 5-tuple. Session-level encrypted network traffic data is more likely to reveal patterns in communication patterns compared to fully encrypted network traffic data containing multiple sessions. Step 1.2: Perform a slicing operation on each session-level encrypted network traffic data obtained in Step 1.1 using its interactive characteristics. First, find the slice location. If the transmission direction of network packets in the session-level encrypted network traffic data changes, that is, the source IP address and destination IP address are swapped, then it is defined as the slice location. The transmission direction of network messages is represented by (2): D(P i )=(src_ip i ,dst_ip i ) (2) The change in the transmission direction of network messages is characterized by (3) and (4): D(P i )≠D(P i+1 ) (3) (src_ip i ,dst_ip i )=(dst_ip i+1 ,src_ip i+1 ) (4) Performing a slicing operation at the slice location yields a large amount of stream-level encrypted network traffic data. Among them, the stream-level encrypted network traffic data is characterized by (5): Where P f This indicates a network packet. All network packets contained in a stream-level encrypted network traffic data have the same 5-tuple and the same transmission direction. Each stream-level encrypted network traffic data can contain one or more network packets, and a stream-level encrypted network traffic data can be regarded as a one-way transmission action of encrypted network traffic. Step 2: Extract features from each stream-level encrypted network traffic data obtained in Step 1, taking into full account multiple feature dimensions, such as time features, direction features, basic statistical features, distribution features, etc. For each stream-level encrypted network traffic data obtained in Step 1, feature extraction is performed across different dimensions. Temporal features include the start time, end time, and duration of the stream-level encrypted network traffic data; directional features are defined as positive or negative 1; basic statistical features include the number of network packets in the stream-level encrypted network traffic data, and the average, maximum, and minimum lengths of all network packets in the stream-level encrypted network traffic data; distribution features include the skewness and kurtosis of the lengths of all network packets in the stream-level encrypted network traffic data. A total of 25 non-correlated stream-level features are provided. Step 3: The extracted multidimensional features are used as features of the input dataset for the classification model, and the corresponding application type is used as the label of the input dataset for the classification model. Finally, the features and labels of the input dataset for the classification model are obtained. The input dataset for the classification model has 25 dimensions of features, while the labels of the input dataset for the classification model are 1 dimension. Construct a classification model with input dataset (X, y), which consists of features X and labels y corresponding to stream-level encrypted network traffic data for all different application types. Where X represents the 25-dimensional feature of the stream-level encrypted network traffic data in step 2, and y represents the application category label of the stream-level encrypted network traffic data in step 1. Both feature X and label y are converted into PyTorch tensors for easy input into the classification model. Step 4: Divide the features X and labels y of all different types of stream-level encrypted network traffic data into training set (X_train, y_train), validation set (X_val, y_val), and test set (X_test, y_test) using the function train_test_split. Then, perform supervised classification using the machine learning classification model multilayer perceptron to obtain classification results, including confusion matrix, accuracy, precision, recall, and F1 score. Thus far, from step 1 to step 4, the classification of encrypted network traffic data for different application categories of intelligent connected vehicles has been achieved.

2. The method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow according to claim 1, characterized in that: In step 1, when dividing session-level encrypted network traffic data into stream-level encrypted network traffic data, the criterion for determining whether the transmission direction of network packets has changed is whether the source IP address and destination IP address of the network packets have been swapped. If they have been swapped, the transmission direction is considered to have changed, and this is taken as a slice point. Furthermore, each stream-level encrypted network traffic data only contains continuous network packets with the same transmission direction, avoiding interference from bidirectional interleaved communication on feature extraction, thereby improving the expressive power of subsequent features and the recognition accuracy of the classification model.

3. The method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow according to claim 1, characterized in that: In step 2, the extracted flow-level encrypted network traffic features include, but are not limited to: (1) time features: such as start time, end time, and duration; (2) Directional features: defined as +1 or -1, used to indicate the transmission direction of network packets; (3) Basic statistical features: such as the number of packets, average length, maximum length, minimum length, etc.; (4) Distribution features: such as the skewness and kurtosis of packet length, etc.; The 25-dimensional features have low correlation with each other, which helps to enhance the generalization ability of the classification model and improve the distinguishability of encrypted traffic in different application scenarios.

4. The method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow according to claim 1, characterized in that: In step 3, the input dataset (X, y) for the classification model is constructed, which consists of the features X and labels y corresponding to the stream-level encrypted network traffic data of all different application types. Both features X and labels y are converted into PyTorch tensors for easy input into the classification model.

5. The method for classifying encrypted network traffic of intelligent connected vehicles based on unidirectional flow according to claim 1, characterized in that: In step 4, the training set, validation set, and test set are divided in a 6:2:2 ratio to ensure sufficient training while retaining enough samples for validation and testing. The classification model adopts a multilayer perceptron structure, with its input being a 25-dimensional feature vector of the stream-level encrypted network traffic and its output being the application category label to which the encrypted traffic belongs. The classification results are comprehensively evaluated by calculating the confusion matrix, accuracy, precision, recall, and F1 score to ensure the reliability and practicality of the model in actual vehicle network encrypted traffic identification.