A method for identifying highly coupled mobile applications based on service analysis
Through a service analysis method, machine learning algorithm is used to optimize attribute space and extract feature vectors of mobile applications, solving the problem of low recognition accuracy of high coupled mobile applications, realizing the provision of early recognition and differentiated services, and improving the recognition accuracy rate and resource utilization efficiency.
Patent Information
- Application Number
- CN202210623575.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-06-02
AI Technical Summary
The prior art has the problem of low recognition accuracy when identifying highly coupled mobile applications with similar traffic characteristics, especially when identifying applications in the early stage, it cannot meet the needs of Internet service providers to provide differentiated services.
Using a service analysis method, by capturing network traffic data after the mobile application is started, feature vectors are extracted and classification models are trained using supervised machine learning algorithms to optimize attribute space to achieve accurate recognition of highly coupled mobile applications.
It realizes accurate identification of highly coupled mobile applications, can complete identification within seconds of mobile applications launch, provides differentiated services, reduces resource consumption, and improves recognition accuracy.
Smart Images

Figure CN115065983B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a high-coupling mobile application identification method based on service analysis, and belongs to the technical field of network management. Background Art
[0002] With the rapid development of Internet technology, diversified mobile applications have greatly enriched people's lives. In order to improve the quality of service (QoS), Internet service providers pay more attention to the monitoring and management of the network. They hope to improve QoS by understanding users' use of mobile applications. In addition, early identification of applications is a prerequisite for Internet service providers to monitor and manage their networks. ISPs can provide differentiated services for different applications based on early identification.
[0003] In order to identify mobile applications as early as possible after the mobile application is launched, the previous method is to use the IP address and port of the service for identification. In the early stages of the development of the Internet, users can access services through DNS resolution or directly through IP addresses. At this time, the mapping relationship between applications and IP addresses is one-to-one. Therefore, applications can be identified by their IP addresses and port numbers. However, with the further increase in user access and the demand for low access latency, the above application architecture is no longer applicable. The emergence of content delivery network (CDN) acceleration and load balancing technology has solved the problems of user access and access latency, which also leads to different IP addresses being accessed by the same application in different regions. When multiple applications or services are deployed in a server cluster, IP addresses and applications will be a many-to-many mapping relationship. In addition, mobile applications can also use dynamically or randomly assigned ports. Therefore, it is no longer feasible to identify mobile applications by IP address and port, or DNS resolution and port. Experiments have shown that 55% of traffic can be distinguished by IP address and DNS, while IP address alone can distinguish 33%.
[0004] In recent years, most studies have adopted payload-based identification methods and statistical feature-based identification methods to accurately identify applications. Payload-based identification methods usually identify applications by selecting appropriate payload byte lengths and extracting key traffic features. Statistical feature-based identification methods usually identify mobile applications by analyzing packet-level traffic features.
[0005] However, the above two methods have the problem of low recognition accuracy when identifying family applications with similar traffic characteristics. Family applications are a series of applications released by some application providers (such as Google and Facebook). In order to facilitate application development, different applications will use some of the same public services, especially the products of the same company will use more public services released by the company. Therefore, there is service coupling between mobile applications that use the same service. The service coupling phenomenon is most common in family applications. However, since the traffic characteristics of the same service are often similar, service coupling is the root cause of the fuzzy classification of family applications. Therefore, it is a challenge to distinguish family applications by extracting effective traffic features.
[0006] In addition, early identification of applications is a prerequisite for ISPs to provide better QoS. In order to meet the service requirements of different mobile applications, ISPs need to identify mobile applications as soon as possible after they are launched and provide appropriate services for the applications. However, since both payload-based and statistical feature-based identification methods require a large number of data packets, they cannot meet the requirements of early identification of applications. Summary of the invention
[0007] In order to solve the above problems, the present invention discloses a method for identifying highly coupled mobile applications based on service analysis. In the model training stage, the method first captures the network traffic data of the mobile application running for tens of seconds from the start, and labels the network traffic data; then sets the time length t, extracts the service information accessed by the mobile application in the t-second network traffic data as an attribute, and forms an attribute space; then, generates a feature vector according to the attribute space, and forms a sample with the feature vector and the application label; finally, trains the classification model using a supervised machine learning algorithm, optimizes the attribute space in the process of training the model, and obtains the final recognition model. In the application recognition stage, the method first extracts the service information accessed by the mobile application in the newly incoming network traffic of t seconds; then generates a feature vector according to the attribute space optimized in the training stage; finally, uses the recognition model obtained in the training stage to identify the mobile application corresponding to the feature vector. The method provided by the present invention is based on a unidirectional data flow arriving in the network. The present invention can realize the accurate identification of each specific highly coupled mobile application from multiple highly coupled mobile applications, and can provide a premise for Internet providers to provide differentiated services for different applications.
[0008] In order to achieve the purpose of the present invention, the specific technical steps of this solution are as follows: A method for identifying highly coupled mobile applications based on service analysis, the method comprising the following steps:
[0009] Step (1) obtaining network traffic data of a highly coupled mobile application from the time it is started to the time it runs for tens of seconds, and marking the network traffic data with an application tag;
[0010] Step (2) sets the time length t and divides each flow sample into samples of the same time length;
[0011] Step (3) extracts the service information accessed by the mobile application in each traffic sample as attributes based on the result of step (2) to form an attribute space;
[0012] Step (4) generates a feature vector based on the result of step (3) according to the attribute space, and combines the feature vector and the label of the sample to form a sample;
[0013] Step (5) using a supervised machine learning model to perform model training on the samples obtained in step (4);
[0014] Step (6) sorting the attributes based on the feature_importance generated by the model in step (5), optimizing the attribute space using a wrapper method, and obtaining a new attribute space;
[0015] Step (7) generates a feature vector based on the new attribute space obtained in step (6), and further generates samples;
[0016] Step (8) performs model training on the samples obtained in step (7) based on step (5);
[0017] Repeat steps (5)-(8) until the recognition accuracy of the model begins to decrease, then stop the repetitive process to obtain the optimized attribute space and the final recognition model.
[0018] Step (9) extracting the service information accessed by the mobile application from the newly incoming network traffic in t seconds;
[0019] Step (10) generates a feature vector based on the result of step (9) and the optimized attribute space obtained in the repeated process of step (6);
[0020] Step (11) uses the recognition model finally obtained in step (8) to identify the mobile application corresponding to the feature vector in step (10).
[0021] Furthermore, in step (1), the method for obtaining the original traffic data of the highly coupled mobile application is as follows:
[0022] A highly coupled mobile application to be identified is selected and the network traffic data of the highly coupled mobile application from the start to the operation period is captured, and the network traffic data is tagged with an application label, thereby obtaining a labeled highly coupled mobile application data set.
[0023] Furthermore, in step (2), the method for obtaining traffic samples of the same time length is as follows:
[0024] Set the time length to t, and each traffic sample is the network traffic data of the highly coupled mobile application from the start to the running time, totaling t seconds.
[0025] Furthermore, in step (3), the steps of extracting the service information accessed by the mobile application and forming the attribute space are as follows:
[0026] According to the time length t set in step (2), the information of the services accessed by the mobile application within t seconds of the traffic sample is extracted, and the services are used as attributes of the attribute space, where the formats of the attributes are (IP:Port) and (DomainName:Port).
[0027] Furthermore, in step (4), the steps of constructing the feature vector and forming the sample are as follows:
[0028] (4.1) Generate the feature vector of each traffic sample based on the above attribute space. The format is shown in (1)
[0029] x i =(x i1 ;x i2 ;…;x id ) (1)
[0030] Among them, x ij is the sample x i The value of the jth attribute, d is the dimension of the attribute space. If the sample x i The jth attribute (i.e. service) is accessed, x ij The value is 1, otherwise the value is 0;
[0031] (4.2) Combine the feature vector and the label of the mobile application to form a sample (x i ,y i ), y i is the flow sample x i The corresponding application tag.
[0032] Furthermore, in step (5), the machine learning model is used to train the labeled samples obtained in step (4.2) to obtain the recognition model as follows:
[0033] (5.1) Divide the labeled samples obtained in step (4.2) into a training set and a test set with a ratio of 7:3 for model training;
[0034] (5.2) Use multiple machine learning models to train the model on the training set.
[0035] Furthermore, in step (6), the method for optimizing the attribute space is as follows:
[0036] During the model training process, the attribute space generated in step (3) is iteratively optimized using a wrapper method to reduce the dimension of the attribute space. The attributes are sorted in descending order according to the feature_importance values generated by the model in step (5). The last 50 attributes after sorting are removed to generate a new attribute space.
[0037] Furthermore, in step (7), the method of generating feature vectors and samples according to the new attribute space is the same as the method in step (4).
[0038] Furthermore, in step (8), the method for model training is the same as that in step (5), and the training samples are the samples obtained in step (7).
[0039] Further, in step (9), the method for extracting the service information accessed by the mobile application in the newly incoming network traffic in t seconds is as follows:
[0040] Set the time length t to the same time length t as in step (2), and extract the information of the services accessed by the mobile application within t seconds of network traffic.
[0041] Furthermore, in step (10), the method for generating the feature vector is as follows:
[0042] Based on the optimized attribute space obtained in the repeated process of step (6), the feature vector corresponding to the flow data in step (9) is generated, and the format of the feature vector is the same as that of the feature vector in step (4).
[0043] Furthermore, in step (11), the method for identifying the mobile application corresponding to the feature vector is as follows:
[0044] The recognition model finally obtained in step (8) is used to identify the mobile application corresponding to the feature vector in step (10).
[0045] Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects: (1) The present invention is aimed at mobile applications with high service coupling, and proposes a high-coupling mobile application identification method based on service analysis. The method is suitable for identifying mobile applications developed by the same developer and has good application prospects; (2) The present invention uses the unidirectional flow in the network traffic as the analysis object and only extracts the service information. The traffic characteristics are relatively simple and do not require statistical calculations, thereby reducing resource consumption in the feature extraction process; (3) The present invention only needs to analyze the traffic starting from the startup of the mobile application to achieve a high recognition accuracy, which is of great significance for the study of early recognition of mobile applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Identify the overall framework diagram for highly coupled mobile applications based on service analysis;
[0047] Figure 2 Collect topology diagrams for network traffic;
[0048] Figure 3 This is a diagram of the confusion matrix of the random forest model at 25 seconds;
[0049] Figure 4 This is a schematic diagram of the confusion matrix of the support vector machine model at 25s;
[0050] Figure 5 This is a diagram of the confusion matrix under the k nearest neighbor model for 25 seconds;
[0051] Figure 6 This is a schematic diagram of the recognition performance under 15 seconds;
[0052] Figure 7 This is a schematic diagram of recognition performance under 20 seconds;
[0053] Figure 8 It is a schematic diagram of recognition performance under 25s;
[0054] Fig. 9 Schematic diagram of recognition performance under 30s. DETAILED DESCRIPTION
[0055] The technical solution provided by the present invention will be described in detail below in conjunction with specific embodiments. It should be understood that the following specific implementation methods are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0056] Example: See Figure 1-Figure 9 , a method for identifying highly coupled mobile applications based on service analysis, the method comprising the following steps:
[0057] Step (1) obtaining network traffic data of a highly coupled mobile application from the time it is started to the time it runs for tens of seconds, and marking the network traffic data with an application tag;
[0058] Step (2) sets the time length t and divides each flow sample into samples of the same time length;
[0059] Step (3) extracts the service information accessed by the mobile application in each traffic sample as attributes based on the result of step (2) to form an attribute space;
[0060] Step (4) generates a feature vector based on the result of step (3) according to the attribute space, and combines the feature vector and the label of the sample to form a sample;
[0061] Step (5) using a supervised machine learning model to perform model training on the samples obtained in step (4);
[0062] Step (6) sorting the attributes based on the feature_importance generated by the model in step (5), optimizing the attribute space using a wrapper method, and obtaining a new attribute space;
[0063] Step (7) generates a feature vector based on the new attribute space obtained in step (6), and further generates samples;
[0064] Step (8) performs model training on the samples obtained in step (7) based on step (5);
[0065] Repeat steps (5)-(8) until the recognition accuracy of the model begins to decrease, then stop the repetitive process to obtain the optimized attribute space and the final recognition model.
[0066] Step (9) extracting the service information accessed by the mobile application from the newly incoming network traffic in t seconds;
[0067] Step (10) generates a feature vector based on the result of step (9) and the optimized attribute space obtained in the repeated process of step (6);
[0068] Step (11) uses the recognition model finally obtained in step (8) to identify the mobile application corresponding to the feature vector in step (10).
[0069] In one embodiment of the present invention, in step (1), network traffic data of 32 mobile applications from four application families, namely Google, Facebook, Baidu, and Tencent, is collected. The network traffic topology diagram is shown in FIG. Figure 2 As shown in the figure. Since the IP address of the service is affected by factors such as address and time, different cities were selected when collecting network traffic data, and it took 5 months. During this period, different versions of mobile applications were also covered. In addition, considering that the mobile device model may have an impact on the experiment, mobile phones of different brands and system models were used to collect network traffic data. The 32 mobile applications in this example and the number of samples of each application are shown in Table 1.
[0070] Table 1: 32 family applications and sample numbers
[0071]
[0072]
[0073] In one embodiment of the present invention, in step (2), the time length is set to t, and each traffic sample is network traffic data of the highly coupled mobile application from the start to the operation for a total of t seconds.
[0074] In one embodiment of the present invention, in step (3), the steps of extracting the service information accessed by the mobile application and forming the attribute space are as follows:
[0075] According to the time length t set in step (2), the information of the services accessed by the mobile application within t seconds of the traffic sample is extracted, and the services are used as attributes of the attribute space, where the formats of the attributes are (IP:Port) and (DomainName:Port).
[0076] In one embodiment of the present invention, in step (4), the method of constructing a feature vector and forming a sample is as follows:
[0077] (4.1) Generate the feature vector of each traffic sample based on the above attribute space. The format is shown in (1)
[0078] x i =(x i1 ;x i2 ;…;x id ) (1)
[0079] Among them, x ij is the sample x i The value of the jth attribute, d is the dimension of the attribute space. If the sample x i The jth attribute (i.e. service) is accessed, x ij The value is 1, otherwise the value is 0;
[0080] (4.2) Combine the feature vector and the label of the mobile application to form a sample (x i ,y i ), y i is the sample x i The corresponding application tag.
[0081] In one embodiment of the present invention, in step (5), a machine learning model is used to perform model training on the labeled samples obtained in step (4.2), and a method for obtaining a classification model is as follows:
[0082] (5.1) Divide the labeled samples obtained in step (4.2) into a training set and a test set with a ratio of 7:3 for model training;
[0083] (5.2) Use multiple machine learning models to train the model on the training set.
[0084] (5.3) The impact of different models and different time lengths on recognition results. This case experiments and analyzes different machine learning models and time lengths. This case uses three machine learning models: random forest (RF), support vector machine (SVM) and K nearest neighbor (KNN). At the same time, experiments were conducted with t set to 15s, 20s, 25s, and 30s. Figure 3-Figure 5 The confusion matrix shows that the different machine learning models used can almost completely identify highly coupled mobile applications.
[0085] Attached Figure 6-Figure 9 The recognition performances of the three models at time lengths of 15s, 20s, 25s and 30s are shown respectively. Table 2 lists the time performances of different models at different time lengths. Under the same time length, although the training time of the RF model is not optimal, the test time is the shortest. The requirements for mobile application recognition are fast and accurate. Therefore, short test time is a prerequisite for realizing fast recognition applications. Therefore, after comprehensive consideration of recognition performance and time performance, better recognition performance can be obtained when the random forest model is used and the time length t is set to 25s. Table 3 lists the recognition performance of the random forest model with a time length of 25s.
[0086] Table 2 Time performance of different models at different time lengths
[0087]
[0088] Table 3 Recognition performance of random forest model at 25s
[0089]
[0090]
[0091] Table 3 shows that the accuracy of almost all categories can reach more than 98%. Generally speaking, traffic from the same service or application is more easily confused, but the results in the table show that the present invention overcomes this difficulty.
[0092] In one embodiment of the present invention, in step (6), the method for optimizing the attribute space is as follows:
[0093] During the model training process, the attribute space generated in step (3) is iteratively optimized using a wrapper method to reduce the dimension of the attribute space. The attributes are sorted in descending order according to the feature_importance values generated by the model in step (5). The last 50 attributes after sorting are removed to generate a new attribute space.
[0094] In one embodiment of the present invention, in step (7), the method for generating feature vectors and samples according to the new attribute space is the same as the method in step (4).
[0095] In one embodiment of the present invention, in step (8), the method for model training is the same as the method in step (5), and the training samples are the samples obtained in step (7).
[0096] In one embodiment of the present invention, in step (9), the method for extracting the service information accessed by the mobile application in the newly incoming network traffic is as follows:
[0097] Set the time length t to the same time length t as in step (2), and extract the information of the services accessed by the mobile application within t seconds of network traffic.
[0098] In one embodiment of the present invention, in step (10), the method for generating a feature vector is as follows:
[0099] Based on the optimized attribute space obtained in the repeated process of step (6), the feature vector corresponding to the flow data in step (9) is generated, and the format of the feature vector is the same as that of the feature vector in step (4).
[0100] In one embodiment of the present invention, in step (11), the method for identifying the mobile application corresponding to the feature vector is as follows:
[0101] The recognition model finally obtained in step (8) is used to identify the mobile application corresponding to the feature vector in step (10).
[0102] The technical means disclosed in the scheme of the present invention are not limited to the technical means disclosed in the above-mentioned implementation mode, but also include technical schemes composed of any combination of the above-mentioned technical features. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also regarded as the protection scope of the present invention.
Claims
1. A highly coupled mobile application identification method based on service analysis, characterized in that: The method comprises the following steps: Step (1) obtaining network traffic data of a highly coupled mobile application from the time it is started to the time it runs for tens of seconds, and marking the network traffic data with an application tag; Step (2) sets the time length t and divides each flow sample into samples of the same time length; Step (3) extracts the service information accessed by the mobile application in each traffic sample as attributes based on the result of step (2) to form an attribute space; Step (4) generates a feature vector based on the result of step (3) according to the attribute space, and combines the feature vector and the sample label into a sample; Step (5) using a supervised machine learning model to perform model training on the samples obtained in step (4); Step (6) sorting the attributes based on the feature_importance generated by the model in step (5), optimizing the attribute space using a wrapper method, and obtaining a new attribute space; Step (7) generates a feature vector based on the new attribute space obtained in step (6), and further generates samples; Step (8) performs model training on the samples obtained in step (7) based on step (5); Repeat steps (5)-(8) until the recognition accuracy of the model begins to decrease, then stop the repetitive process to obtain the optimized attribute space and the final recognition model; Step (9) extracting the service information accessed by the mobile application from the newly incoming network traffic in t seconds; Step (10) generates a feature vector based on the result of step (9) and the optimized attribute space obtained in the repeated process of step (6); Step (11) uses the recognition model finally obtained in step (8) to identify the mobile application corresponding to the feature vector in step (10); In step (3), the method for extracting the service information accessed by the mobile application and forming the attribute space is as follows: According to the time length t set in step (2), extract the information of the services accessed by the mobile application within the t-second traffic sample, and use the services as attributes of the attribute space, where the format of the attributes is (IP:Port) and (DomainName:Port). Among them, in step (4), the steps of constructing feature vectors and forming samples are as follows: (4.1) Generate the feature vector of each traffic sample based on the above attribute space. The format is shown in (1) x i =(x i1 ;x i2 ;…;x id ) (1) Among them, x ij is the sample x i The value of the jth attribute, d is the dimension of the attribute space, if the sample x i The jth attribute service, x, is accessed ij The value is 1, otherwise the value is 0; (4.2) Combine the feature vector and the label of the mobile application to form a sample (x i ,y i ), y i is the flow sample x i The corresponding application tag, In step (6), the method for optimizing the attribute space is as follows: During the model training process, the attribute space generated in step (3) is iteratively optimized using a wrapper method to reduce the dimension of the attribute space. The attributes are sorted in descending order according to the feature_importance values generated by the model in step (5). The last 50 attributes after sorting are removed to generate a new attribute space.
2. According to claim 1, a method for identifying highly coupled mobile applications based on service analysis is characterized in that: In step (1), the method for obtaining the original traffic data is as follows: A highly coupled mobile application to be identified is selected and the network traffic data of the highly coupled mobile application from the start to the operation period is captured, and the network traffic data is tagged with an application label, thereby obtaining a labeled highly coupled mobile application data set.
3. According to the method for identifying highly coupled mobile applications based on service analysis in claim 1, it is characterized in that: In step (2), the method for obtaining traffic samples of the same time length is as follows: Set the time length to t, and each traffic sample is the network traffic data of the highly coupled mobile application from the start to the running time, totaling t seconds.
4. The method for identifying highly coupled mobile applications based on service analysis according to claim 1, characterized in that: In step (5), the machine learning model is used to train the labeled samples obtained in step (4.2) to obtain the recognition model as follows: (5.1) Divide the labeled samples obtained in step (4.2) into a training set and a test set with a ratio of 7:3 for model training; (5.2) Use multiple machine learning models to train the model on the training set.
5. The method for identifying highly coupled mobile applications based on service analysis according to claim 1, characterized in that: In step (9), the method for extracting the service information accessed by the mobile application in the newly incoming network traffic in t seconds is as follows: Set the time length t to the same time length t as in step (2), and extract the information of the services accessed by the mobile application within t seconds of network traffic.
6. The method for identifying highly coupled mobile applications based on service analysis according to claim 1, characterized in that: In step (10), the method for generating a feature vector is as follows: based on the optimized attribute space obtained in the repeated process of step (6), a feature vector corresponding to the flow data in step (9) is generated, and the format of the feature vector is the same as that of the feature vector in step (4).
7. The method for identifying highly coupled mobile applications based on service analysis according to claim 1, characterized in that: In step (11), the method for identifying the mobile application corresponding to the feature vector is as follows: using the recognition model finally obtained in step (8) to identify the mobile application corresponding to the feature vector in step (10).
