A method for identifying smart device applications based on side channel analysis of magnetic field data
Through the side channel analysis method based on magnetic field data, combined with deep autoencoders and finite state automata, it solves the problem of identifying smart device applications without obtaining system permissions, achieves high-accuracy application identification, and fills the gap between existing technologies. identification limitations.
Patent Information
- Application Number
- CN202110800743.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-07-15
AI Technical Summary
It is difficult for existing technology to accurately identify the smart device application being used by a user without obtaining system permissions, especially on mobile smart devices. Traditional methods such as obtaining Android root permissions or jailbreaking IOS have limitations.
The side channel analysis method based on magnetic field data is used to collect, preprocess and extract magnetic field data features through the offline training phase. Deep autoencoders and finite state automata are used for application identification, and linear discriminant classifier models are trained to achieve user application recognition. Identify.
It achieves more than 95% window recognition accuracy and 73.5% application recognition accuracy. The Top 5 accuracy reaches 90%. It can detect the applications used by users without obtaining system permissions, which significantly improves the accuracy and efficiency of application recognition.
Smart Images

Figure CN113569930B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of side channel analysis, and in particular relates to a method for identifying applications of smart devices. Background Art
[0002] As of 2019, there are about 5.7 billion mobile smart device users in the world. Mobile smart devices have become an indispensable part of people's daily lives. In 2019, the global shipment of mobile smart devices was 1.486 billion units. In comparison, the shipment of PCs was only 261 million units, and it showed a decreasing trend year by year. It can be seen that mobile smart devices will replace traditional PC devices and become the main body of the Internet. The convenience of mobile smart devices makes them an indispensable part of people's lives and work. The rich applications on the mobile smart platform greatly facilitate life, work and business activities. The use of tablets makes it easier for people to handle documents, read books, watch online videos and other work and entertainment activities; the convenient electronic banking, quick payment and online finance on smartphones are driving the financial reform of the entire society and changing people's payment methods and living habits.
[0003] The popularity of smart devices has led to the development of mobile applications. It has become a demand to perceive the applications that users are using: network regulators want to know whether the applications that users are using are compliant, and advertising operators need to perceive the application usage of users to make decisions on the placement of advertising resources. However, the permission management of smart device systems is relatively strict, and non-system applications are not allowed to perceive the applications that users are using. Therefore, identifying user applications has become a hot topic in research. At present, the main methods of application identification from the perspective of engineering applications are to obtain system permissions (Android root permissions, IOS system jailbreak), obtain Android accessibility permissions, and use ADB to connect to smart devices. In the academic field, the main focus is on the use of side channel information to analyze the applications that users are using. Side channel analysis is divided into traffic analysis and statistical data-based side channel analysis according to different data sources. Since the former needs to obtain the interactive traffic between users and the Internet, it has great limitations in practical applications. Side channel analysis based on statistical data is currently a hot topic in research. Summary of the invention
[0004] In order to solve the technical problems mentioned in the above background technology, the present invention proposes a smart device application identification method based on magnetic field data side channel analysis.
[0005] In order to achieve the above technical objectives, the technical solution of the present invention is:
[0006] A method for identifying applications of smart devices based on side channel analysis of magnetic field data comprises an offline training phase and an online identification phase. The offline training phase sequentially comprises four steps of collecting magnetic field data, data preprocessing, extracting data features and training a classification model; the online identification phase sequentially comprises four steps of collecting magnetic field data, data preprocessing, extracting data features and identifying applications, wherein the steps of collecting magnetic field data and extracting data features are the same as those of collecting magnetic field data and extracting data features in the offline training phase, the step of data preprocessing adds identification of an application startup window compared to the step of data preprocessing in the offline training phase, and the step of application identification is to input the data features extracted in the previous step into the classification model trained in the offline training phase to obtain a classification result.
[0007] Further, the method of collecting magnetic field data is as follows:
[0008] An external magnetic field sensor is used to collect magnetic field data around the smart terminal, with a sampling frequency of 200 Hz.
[0009] Furthermore, in the offline training stage, data preprocessing includes outlier processing, elimination of environmental magnetic fields, data denoising and data normalization.
[0010] Furthermore, the method of extracting data features is as follows:
[0011] A deep autoencoder is used to extract deep features of reduced dimensionality from magnetic field data, and the dimension of the deep features is 200 dimensions. During the training and feature extraction process, the deep autoencoder inputs the magnetic field data of the 3D time series into the network in sequence according to the dimensions, once for each dimension, and a total of three times for each data. When extracting features, the deep features obtained in each dimension are spliced to obtain the deep features of the magnetic field data of the 3D time series.
[0012] Furthermore, in the offline training stage, the method of training the classification model is as follows:
[0013] The data features extracted in the previous step are used as training sets to train the linear discriminant classifier provided by the machine learning library sklearn in Python to obtain a classification model.
[0014] Furthermore, the identification method of the application startup window is as follows:
[0015] A finite state automaton is used to search for the application startup window. The finite state automaton is divided into four states: calibration state, waiting state, screening state and detection state. In the calibration state, the calibration operation of the magnetic field sensor data is performed to reduce the overall offset effect of the thermal effect of the long-term operation of the magnetic field sensor on the magnetic field data. In the waiting state, the changes of the magnetic field data are monitored in real time, and the state is transferred to the screening state or the magnetic field data is recalibrated when the set conditions are met. The screening state filters the interactive operations of the smart terminal to avoid misjudgment of the search for the startup window due to the magnetic field disturbance caused by transient events. In the detection state, the application startup is detected, the corresponding magnetic field data is saved for subsequent processing, and the application is waited for to end and then transferred to the waiting state.
[0016] The beneficial effects brought by adopting the above technical solution are:
[0017] Experiments have shown that the accuracy of window recognition of the present invention is as high as 95%, the accuracy of application recognition is as high as 73.5%, and the accuracy of Top 5 is as high as 90%. It can effectively perceive the application being used by the user without obtaining system permissions. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of the method of the present invention;
[0019] Figure 2 It is a schematic diagram of the structure of the deep autoencoder in the present invention;
[0020] Figure 3 It is a schematic diagram of the finite state automaton in the present invention. DETAILED DESCRIPTION
[0021] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.
[0022] With the rapid development of mobile Internet, it has become a demand to monitor the applications that are being run by smart terminal users. The previous technology requires obtaining the system permissions of the smart terminal, which has limitations in practical applications. The present invention provides an application identification method based on magnetic field data side channel analysis, which can sense the user's running applications without system permissions. Figure 1 As shown, the technical solution is divided into two parts, namely the offline training stage and the online recognition stage.
[0023] 1. Offline training phase
[0024] In the offline training stage, the main purpose is to extract the features of the magnetic field data, model the change pattern of the magnetic field data, and train the classification model. This section introduces the offline training stage of mobile smart terminal application recognition, which mainly includes: data acquisition, data preprocessing, feature extraction and training classification models.
[0025] 1.1 Data Acquisition
[0026] The present invention uses an external magnetic field sensor to collect magnetic field data around the smart terminal. The external magnetic field sensor is placed next to the smart terminal for data collection. The external magnetic field sensor has a better collection effect than the magnetic field sensor deployed inside the mobile smart terminal, which is mainly reflected in the smaller noise of the magnetic field data. At the same time, the external magnetic field sensor has a higher sampling rate. Compared with the sampling rate of the sensor of the mobile smart device generally not exceeding 100hz, the sampling rate of the external magnetic field sensor can generally reach more than 200hz. For data types with a higher frequency of change, such as magnetic field data, a higher sampling rate means that more details of the magnetic field changes can be collected, which can effectively improve the effect of application recognition.
[0027] 1.2 Data Preprocessing
[0028] The collected magnetic field data needs to be preprocessed before further feature extraction. The outliers of the sensor will affect the results, and the possible outliers need to be processed. When collecting data on the magnetic field around the smart terminal, the earth's magnetic field and the magnetic field of the magnetic material in the surrounding environment will affect the collected data, so that it will affect the subsequent application recognition based on the magnetic field change pattern. Therefore, it is necessary to eliminate the earth's magnetic field and the environmental magnetic field. And because there is high-frequency noise in the magnetic field data, in order to improve the recognition effect, a low-pass filter is used to filter the high-frequency noise of the magnetic field data. Finally, due to the different distances between the magnetic field sensor and the mobile smart device, the magnetic field data will change at different amplitudes. In order to alleviate this problem and facilitate the training of the autoencoder, all data are normalized. The preprocessing of the data is divided into multiple steps: outlier processing, elimination of environmental magnetic fields, data denoising, and data normalization.
[0029] (1) Outlier processing
[0030] Magnetic field data will produce outliers, which are usually hundreds or even thousands higher than the magnetic field data on the left and right. Setting a threshold of 500 for the difference between adjacent magnetic field data can detect the existence of outliers, and using interpolation to smooth out outliers.
[0031] (2) Eliminate the environmental magnetic field
[0032] When the smart terminal runs the application, the data collected by the magnetic field sensor is the superposition of the environmental magnetic field and the magnetic field of the smart terminal. When the smart terminal runs the application, the data collected by the magnetic field sensor is the superposition of the environmental magnetic field and the magnetic field of the smart terminal. S As the data collected by the sensor, there is B S =B M +B E , where B M is the impact of mobile smart devices running applications on the surrounding magnetic field, B E It is the superposition of the magnetic field of the surrounding environment including the geomagnetic field. Since the geomagnetic field does not change much within a certain spatial range, and the change of the surrounding magnetic field during the startup of an application is not large, therefore, during the startup of an application, B E As a constant. So we can get B M =B S -B E , B E is the initial value of the magnetic field sensor data.
[0033] (3) Data denoising
[0034] The sensor data contains a lot of high-frequency noise, which can be filtered out using a low-pass filter. Use a first-order low-pass filter to smooth the magnetic field data:
[0035] B M '(i)=αB M (i)+(1-α)B M '(i-1) (1)
[0036] Among them, α is the filter coefficient, B M (i) is the sampling value before filtering, B M '(i) is the output value after filtering, B M '(i-1) is the output value after the last filtering. Low-pass filtering performs weighted average of the new sample value and the previous filter output value. The value of α is 0.7, which can better filter out high-frequency noise and retain the details of the waveform to a certain extent.
[0037] (4) Data normalization
[0038] Finally, the filtered data is normalized. N
[0039]
[0040] Among them, max(B M '), min(B M ') are BM 'The maximum and minimum values in three dimensions. The normalization operation scales all data to between 0 and 1 without changing the data change trend, which can effectively alleviate the problem of different magnetic field change amplitudes caused by different distances between the sensor and the mobile smart device.
[0041] 1.3 Feature Extraction
[0042] After segmenting and preprocessing the magnetic field data, it is necessary to extract deep feature data from the magnetic field data that can effectively reflect the application operation characteristics. Unlike traditional feature engineering, which requires manual feature extraction based on the characteristics of the data, using autoencoders through unsupervised learning as a feature extraction method can extract effective deep features from high-dimensional time series data.
[0043] The autoencoder consists of an encoder and a decoder. The encoder can encode the input data, and its dimension is generally much smaller than the input data, so that the autoencoder can be used for data dimensionality reduction and deep feature extraction. At the same time, the decoder can decode the encoded data and restore it to data that is almost the same as the original data.
[0044] The L2 norm is used as the loss function to measure the gap between input and output. During the network training phase, a certain amount of magnetic field data needs to be collected in advance for the training of the autoencoder. After a certain number of rounds of training, when the network loss converges, the autoencoder has the ability to extract deep features of time series.
[0045] During the human-computer interaction, the user's interactive operations, such as clicking and sliding, will also disturb the surrounding magnetic field. However, during the application startup, the user's interactive behavior is relatively small, and when the same application is started, the modules loaded by the application and the instructions executed by the central processor of the smart device are relatively consistent. Therefore, when the sensor sampling rate is 200hz, for the xyz three-axis magnetic field data in the input data, the first 576 data of each axis are intercepted and input into the neural network to extract deep features respectively.
[0046] In the process of training and extracting features, the autoencoder inputs the 3D time series data into the network in order according to the dimensions, once for each dimension, and a total of three times for each piece of data; when extracting features, the deep features obtained in each dimension are concatenated to obtain the deep features of the 3D time series data. The encoder part of the fully trained autoencoder network is used to train the input data B N Encode to obtain low-dimensional deep features, such as Figure 2 shown.
[0047] 1.4 Training the Classification Model
[0048] For each application, multiple sets of startup data are collected, and deep features are extracted to form a training data set. The training set is used to train the linear discriminant classifier provided by the machine learning library sklearn in Python.
[0049] 2. Online identification stage
[0050] The online recognition stage is divided into four steps: data acquisition, data preprocessing, feature extraction, and application identification. The data acquisition step and feature extraction step are consistent with the above 1.1 and 1.3, respectively. The application identification step uses the classification model trained in 1.4 for identification. In the data preprocessing step of the online recognition stage, since the timestamp of application startup cannot be directly obtained, it is necessary to use the data cutting operation based on the finite state automaton to process the acquired magnetic field data to identify the window where the application is started.
[0051] In the online recognition stage, data preprocessing is divided into five steps, namely, outlier processing, startup window identification, elimination of environmental magnetic field, data denoising and data normalization. Among them, outlier processing, elimination of environmental magnetic field, data denoising and data normalization are consistent with the operations in 1.2 above. The identification of the application startup window is described in detail below.
[0052] In the data collection step, magnetic field data including when the application is started is obtained. In the offline training stage, the magnetic field data can be sliced by the timestamp recorded by the adb tool. In the online recognition stage, the magnetic field sensor collects the magnetic field data around the mobile smart terminal in real time. At this time, it is necessary to search the startup data window of the application and find the magnetic field data window including when the application is started. The present invention proposes to use a finite state automaton to search the application startup window.
[0053] like Figure 3 As shown, the finite state automaton used to search for the application startup window is divided into four states: in the calibration state, the sensor data calibration operation is performed to reduce the overall offset of the magnetic field data caused by the thermal effect of the long-term operation of the magnetic field sensor; in the waiting state, the changes in the magnetic field data are monitored in real time, and the state is transferred to the screening state or the magnetic field data is recalibrated when certain conditions are met; the screening state filters out the interactive operations of the mobile smart terminal to avoid misjudgment of the search for the startup window due to magnetic field disturbances caused by transient events; in the detection state, the application startup is detected, the corresponding magnetic field data is saved for subsequent processing, and the application is waited for to end and transferred to the waiting state. The finite state automaton is described in detail below:
[0054] 1) Calibration state: When the system starts running, it first enters the calibration state to perform calibration operations on the magnetic field data. Obtain the reference value of the ambient magnetic field and perform calibration. When the surrounding magnetic field is stable, collect the x-axis, y-axis, and z-axis data M of the magnetic field x (i), M y (i), M z (i). First, collect data for t seconds and calculate the mean and variance of the magnetic field data. According to multiple experimental observations, when t > 0.5, relatively accurate mean and variance can be obtained. Then, calculate F(i) for the collected magnetic field data:
[0055]
[0056] where μ x , μ y , μ z , σ x , σ y , σ z correspond to the mean and variance of M x (i), M y (i), M z (i), and F(i) follows a chi-square distribution. When F(i) < TH f1 , the calibration of the magnetic field data is completed, and the node enters the waiting state, where TH f1 = α, and α is the quantile of the chi-square distribution with 3 degrees of freedom. After experiments and observations, select the parameter that satisfies , that is is 12.84.
[0057] 2) Waiting state: Wait for possible user interaction behaviors and application startup behaviors. When F(i) > TH f2 , the node enters the screening state. To solve the phenomenon of overall drift of magnetic field data caused by temperature, vibration, etc. during long-term data collection, if TH f1 < F(i) < TH f2 and ΔT > TH t1 in the waiting state, then recalibrate the magnetic field data, where ΔT is the duration of the former, and TH t1 can be set to 2000 ms.
[0058] 3) Screening state: Filter transient magnetic field data changes caused by user interaction actions and external magnetic field interference, etc. When the state machine is in the screening state, if TH f3 < F(i) and ΔT > TH t2 , it means the application starts running, and the node enters the detection state. If F(i) < TH f2 and ΔT < TH t2, then return to the waiting state, TH f2 Set to 1600, TH t2 Set to 500ms.
[0059] 4) Detection state: In the detection state, F(i) is greater than TH during the application startup process. f2 Magnetic field data M x (i) M y (i) M z (i) Record a total of t s The data is then further processed to identify the application category. f2 And ΔT>TH t2 , then returns to the waiting state.
[0060] In the specific experimental process, the hwt-905 external magnetic field sensor is used to collect magnetic field data from the mobile smart terminal. The smart device used in the experiment is the Google pixel2 smartphone. In the process of the experiment, the magnetic field data set is collected according to the above collection method, and the data set is stratified and sampled according to the type of application in a ratio of 4:1 to produce training sets and test sets; after preprocessing the magnetic field data, a deep feature with a length of 50 is extracted from each dimension of the magnetic field data, and spliced into a deep feature with a length of 150. Finally, the linear discriminant analysis classification algorithm is used to identify the application. The recognition accuracy of the linear discriminant analysis can reach 0.735, the F1-score is 0.73, and the top5 accuracy reaches 0.9; after a large number of experiments, the linear discriminant analysis algorithm is significantly better than other classification algorithms in the problem of application identification.
[0061] The embodiments are only for illustrating the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for identifying smart device applications based on magnetic field data side channel analysis, Features: The method comprises an offline training stage and an online identification stage, wherein the offline training stage comprises four steps of collecting magnetic field data, data preprocessing, extracting data features and training a classification model in sequence; the online identification stage comprises four steps of collecting magnetic field data, data preprocessing, extracting data features and application identification in sequence, wherein the steps of collecting magnetic field data and extracting data features are the same as those of collecting magnetic field data and extracting data features in the offline training stage, the step of data preprocessing adds identification of an application startup window compared to the step of data preprocessing in the offline training stage, and the step of application identification is to input the data features extracted in the previous step into the classification model trained in the offline training stage to obtain a classification result; The method for identifying the application launch window is as follows: A finite state automaton is used to search for the application startup window. The finite state automaton is divided into four states: calibration state, waiting state, screening state and detection state. In the calibration state, the calibration operation of the magnetic field sensor data is performed to reduce the overall offset effect of the thermal effect of the long-term operation of the magnetic field sensor on the magnetic field data. In the waiting state, the changes of magnetic field data are monitored in real time, and when the set conditions are met, the state is transferred to the screening state or the magnetic field data is recalibrated; The screening state filters out the interactive operations of the smart terminal to avoid misjudgment of the search for the start window due to magnetic field disturbances caused by transient events; In the detection state, the application startup is detected, the corresponding magnetic field data is saved for subsequent processing, and the application is waited for to finish running before transferring to the waiting state.
2. According to the method for identifying smart device applications based on magnetic field data side channel analysis according to claim 1, Features: The method for collecting magnetic field data is as follows: An external magnetic field sensor is used to collect magnetic field data around the smart terminal, with a sampling frequency of 200 Hz.
3. According to the method for identifying smart device applications based on magnetic field data side channel analysis according to claim 1, Features: During the offline training phase, data preprocessing includes outlier processing, elimination of environmental magnetic fields, data denoising, and data normalization.
4. According to the method for identifying smart device applications based on magnetic field data side channel analysis according to claim 1, Features: The method of extracting data features is as follows: A deep autoencoder is used to extract deep features of reduced dimensionality from magnetic field data, and the dimension of the deep features is 200 dimensions. During the training and feature extraction process, the deep autoencoder inputs the magnetic field data of the 3D time series into the network in sequence according to the dimensions, once for each dimension, and a total of three times for each data. When extracting features, the deep features obtained in each dimension are spliced to obtain the deep features of the magnetic field data of the 3D time series.
5. According to the method for identifying smart device applications based on magnetic field data side channel analysis according to claim 1, Features: In the offline training stage, the method of training the classification model is as follows: The data features extracted in the previous step are used as training sets to train the linear discriminant classifier provided by the machine learning library sklearn in Python to obtain a classification model.
