Shake behavior authentication method and system based on user holding habit
By collecting sensor data from mobile smart devices to train a user behavior model and using an extreme gradient boosting algorithm to build a decision tree, the problem of false triggering of shake-to-shake behavior was solved. This enabled the recognition of legitimate shake-to-shake behavior without user awareness and the blocking of involuntary events, thus improving the user experience.
Patent Information
- Application Number
- CN202511841932.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-01-06
AI Technical Summary
In existing technologies for mobile smart devices, the shake action is often mistakenly triggered, resulting in a poor user experience and making it difficult to distinguish between shake events that are intentional and those that are not.
The shake-based authentication method, based on users' device-holding habits, collects sensor data, trains a user behavior model, identifies device-holding behavior and shake-based behavior, and uses an extreme gradient boosting algorithm to construct a decision tree to automatically distinguish between legitimate and illegitimate shake-based events.
Without requiring additional equipment or user cooperation, it accurately identifies legitimate shake-to-play behavior based on user physiological characteristics and usage habits, automatically blocking events triggered by involuntary actions and improving user experience.
Smart Images

Figure CN121278701A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence (AI), specifically relating to a method and system for authentication based on a user's hand-holding habits and the act of shaking the device. Background Technology
[0002] With the development of social informatization and intelligentization, the "shake" behavior has covered multiple fields such as mobile applications, e-commerce marketing, and multimedia. While enriching users' entertainment experience, it has also led to the problem of shake-to-advertisement redirecting users against their will. To protect personal information security and user experience, it is explicitly required that shake-to-advertisement must not mislead or force users to redirect when they are walking, riding in public transportation, picking up or putting down their mobile smart devices, or when such actions are not triggered by the user's voluntary will.
[0003] To address the issue of accidental triggering of the shake function on mobile smart devices and disrupting the user experience, the following three mainstream solutions currently exist: 1. Provide a sensor access control mechanism, allowing users to decide whether to allow applications to access sensor data. This approach implements a one-size-fits-all control over sensor data acquisition. While denying sensor access can effectively prevent shake-to-play functionality within applications, normal shake-to-play actions will also be unavailable. Furthermore, normal sensor-related functions within applications will be affected; for example, the inability to read the gyroscope sensor may impact accurate positioning and orientation, while the inability to read the accelerometer sensor may affect directional control operations, resulting in a poor user experience.
[0004] Second, provide a shake-to-trigger event management mechanism, allowing users to decide whether to allow shake-to-trigger events. This method typically uses shake-to-trigger conditions (such as device acceleration not less than 15m / s², bidirectional rotation angle not less than 35°, operation time not less than 3s, or considering acceleration value and direction, rotation angle simultaneously, or other parameters equivalent to the aforementioned single trigger conditions). When an event is identified as not a shake-to-trigger event, a pop-up requesting user authorization or direct blocking is displayed. This method is also prone to being one-size-fits-all. If non-shake-to-trigger events are directly blocked, then events that users expect will also be incorrectly blocked; while if a pop-up is displayed when a shake-to-trigger event is triggered, users need to frequently participate in the selection, which is not a user-friendly experience.
[0005] Third, a sensor access control mechanism is provided at application startup, requiring no additional user intervention. This typically reduces the application's sensor sensitivity within 3-10 seconds of startup. While this method minimizes impact on normal sensor-related functions within the application and requires no active user intervention, its applicability is limited. Furthermore, this short-term sensor sensitivity reduction cannot handle scenarios where shake-to-redirect ads remain for extended periods, and the expected redirect may still be incorrectly blocked. Summary of the Invention
[0006] This invention provides a shake-based authentication method based on user holding habits, aiming to at least solve one of the technical problems existing in the prior art.
[0007] The technical solution of this invention is a shake-based authentication method based on user's device holding habits. This method is applied to a shake-based authentication system based on user's device holding habits. The shake-based authentication system includes an application layer, a framework layer, a kernel layer, and a security layer (TEE) connected sequentially. The shake-based authentication method includes the following steps: S100. Collect training behavior data and determine the training behavior characteristics based on the training behavior data. S200. Train the user behavior model based on the behavioral characteristics to be trained; S300. If the behavior authentication function is enabled, the behavior authentication result of the current user is obtained by inputting the behavior features to be detected into the user behavior model.
[0008] Furthermore, in step S100, The training behavior data includes sensor data corresponding to at least one shaking action acquired by sensors, wherein the sensors include one or more combinations of magnetic sensors, gravity sensors, accelerometers and gyroscopes. The duration of the shake event is calculated using the sensor data. If the duration of the shake event is within a preset duration range, it is determined to be a valid shake action. The difference between the data during the initial period of the shake event and the peak data is calculated using the sensor data. If the difference is greater than a preset threshold, the shake action is considered valid.
[0009] Furthermore, in step S100, The behavioral features to be trained include a first type of preset value for the first type of data. The first type of data includes at least one of the following: accelerometer data, gyroscope data, distance from the origin to the accelerometer, angle from the origin to the accelerometer, velocity from the origin to the accelerometer, acceleration from the origin to the accelerometer, distance from adjacent points to the accelerometer, angle from adjacent points to the accelerometer, velocity from adjacent points to the accelerometer, acceleration from adjacent points to the accelerometer, distance from the accelerometer, displacement from the accelerometer, and duration of the accelerometer event. The first type of preset values includes at least one of the following: average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, 75% value, starting value, ending value, and start-end difference.
[0010] Furthermore, step S200 includes: S210. If the device is in an unlocked state, the application layer behavior data acquisition service continuously monitors the device's sensors to obtain horizontal acceleration data, gravity acceleration data, acceleration data, magnetometer data, and gyroscope data, and encrypts and stores the behavior data to be trained in the kernel layer. S220. Based on horizontal acceleration data, gravitational acceleration data, accelerometer data, magnetometer data, and gyroscope data, user behavior feature data is extracted and analyzed through the kernel layer behavior authentication HAL. The user behavior feature data includes holding behavior features and shaking behavior features. S230. Identify the characteristics of holding the device, eliminate non-holding device behavior data, and obtain valid holding device behavior; identify the characteristics of shaking behavior, eliminate non-shaking behavior data, and obtain valid shaking behavior. S240. If the screen is locked, stop the behavior data collection service and clear the cache.
[0011] Furthermore, in step S220, The device-holding behavior characteristics include at least the following: Gyroscope X / Y / Z axis data, as well as the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, and 75% value of the gyroscope X / Y / Z axis data; Accelerometer X / Y / Z axis data, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the accelerometer X / Y / Z axis data; Horizontal accelerometer X / Y / Z axis data, and the mean, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, and 75% value of the horizontal accelerometer X / Y / Z axis data; Gravity accelerometer X / Y / Z axis data, as well as the mean, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the gravity accelerometer X / Y / Z axis data; Magnetometer X / Y / Z axis data, including mean, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, and 75% value; holding angle X / Y / Z axis: mean, standard deviation, skewness, and kurtosis; The shaking behavior features include at least the following: The data on the distance from the origin to the shake point, as well as the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the distance from the origin to the shake point; The data on the angle of the shaker relative to the origin, as well as the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the angle of the shaker relative to the origin; Shake the relative velocity data to the origin, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the shake relative velocity data; Shaking acceleration data relative to the origin, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the shaking acceleration data relative to the origin; Shake to get the distance data between adjacent points, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value and 75% value of the distance data between adjacent points. Shake the angle data of adjacent points and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value and 75% value of the angle data of adjacent points; Shake the adjacent point speed data and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value and 75% value of the adjacent point speed data; Shake the acceleration data of adjacent points and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the acceleration data of adjacent points; It also includes shake duration data, shake distance data, and shake displacement data.
[0012] Furthermore, step S200 also includes: S250. Use the extreme gradient boosting (XGBoost) algorithm to train the user behavior model. The extreme gradient boosting algorithm selects behavioral feature sets with large behavioral differences based on the collected behavioral features and the pre-set illegal behavior features to construct multiple related decision subtrees. A single user behavior model may include multiple related decision trees, such as a user behavior model including a device holding behavior decision tree and a shake behavior decision tree. The attributes of the tree nodes of each decision tree include node depth, feature index, node value, left child node and right child node. S260. The user behavior model is incrementally learned according to the gradient boost decision tree (GBDT) algorithm. The maximum number of incremental learning times for the user behavior model is n. When the number of incremental learning times for the user behavior model exceeds n, the model corresponding to the earliest incremental learning is deleted from the user behavior model to solve the problem of time-varying behavior and the infinite growth of the model caused by behavior incremental learning.
[0013] Furthermore, step S300 includes: S310, the application layer behavior data collection service collects behavior data and extracts holding behavior features and shaking behavior features through the kernel layer behavior authentication HAL (hardware abstract layer, HAL); S320. Input the device holding behavior characteristics and the shaking behavior characteristics into the device holding behavior model and the shaking behavior model in the behavior authentication service of the security layer TEE, respectively, and output the device holding behavior matching score and the shaking behavior matching score. S330. Based on the comparison between the score fusion decision strategy and the preset threshold, the behavior authentication result is obtained, and it is determined whether the current shake behavior is triggered by the legitimate user's voluntary will.
[0014] Furthermore, in step S330, the behavior authentication result includes: If the behavioral feature to be detected matches the user behavior model, a behavior matching score is output. The behavior matching score is set according to the differences between users and specific business scenarios. A low behavior matching score is set in scenarios with high recognition rate, and a high behavior matching score is set in scenarios with low false alarm rate. Compare the behavior matching score with a preset threshold. If the behavior matching score is greater than or equal to the preset threshold, it is determined that the current shake behavior is triggered by the owner's own will; if the behavior matching score is less than the preset threshold, it is determined that the current shake behavior is not triggered by the owner or is not triggered by the owner's own will.
[0015] Furthermore, the present invention also discloses a shake-based authentication system based on user holding habits. The shake-based authentication system is used to implement the shake-based authentication method based on user holding habits. The shake-based authentication system includes an application layer, a framework layer, a kernel layer, and a security layer (TEE) connected in sequence. The application layer includes a behavior data acquisition service, which includes a sensor monitoring sub-service, a data cleaning sub-service, and a feature extraction sub-service connected in sequence. The framework layer includes a security management service and a storage management service connected in sequence. The framework layer is used to securely store the raw data of the shake-to-win behavior collected. The security management service is used to receive the raw feature output of the feature extraction sub-service and write data to the storage management service. The kernel layer includes a volume daemon (vold) and a hardware abstract layer (HAL) connected in sequence. The daemon receives the feature transformation output of the storage management service and writes behavioral data to the HAL. The security layer TEE includes a behavior authentication service, which includes a behavior authentication model sub-service and a behavior authentication policy sub-service.
[0016] Furthermore, the sensor monitoring sub-service includes at least a screen status monitoring service and a shake behavior data acquisition service. The screen status monitoring service is used to monitor the screen status, which includes unlocked state and locked state. The shake behavior data acquisition service calls the screen status monitoring service to monitor the system screen status. In the unlocked state, it monitors the sensor and related system resource consumption information and collects training data. In the locked state, it destroys the monitoring to avoid resource waste. Behavioral characteristics are written into the behavior authentication service in the security layer TEE. The behavior authentication service stores the user's holding behavior model and shake behavior model. After the user's behavioral characteristics are passed into the user's holding behavior model and shake behavior model, the behavior authentication policy determines whether the current shake behavior is triggered by the legitimate user's voluntary will.
[0017] The beneficial effects of this invention are as follows: The aforementioned shake-based authentication method distinguishes between holding and shaking behaviors by obtaining data from the mobile smart device's sensor output. It requires no additional equipment or user cooperation. The authentication of holding and shaking behaviors is based on the user's inherent physiological characteristics and usage habits, requiring no memory or carrying, making it difficult to imitate or forge. Based on the non-intrusive authentication during the user's shaking action, it automatically blocks shake events triggered by the user's involuntary actions.
[0018] Furthermore, additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0019] Figure 1 This is a general flowchart of the shake-based authentication method based on user holding habits according to an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of the overall process of the shake-based authentication method based on user holding habits according to an embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of the device holding behavior decision subtree in the shake-to-authenticate method based on user holding habits according to an embodiment of the present invention.
[0022] Figure 4 This is a schematic diagram of the shake behavior decision subtree in the shake behavior authentication method based on user holding habits according to an embodiment of the present invention.
[0023] Figure 5 This is a schematic diagram of the framework of a shake-to-authenticate system based on user holding habits according to an embodiment of the present invention. Detailed Implementation
[0024] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention.
[0025] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. The singular forms "a," "described," and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. Furthermore, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and not for limiting the invention. The term "and / or" as used herein includes any combination of one or more of the associated listed items.
[0026] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this disclosure, these elements should not be limited to these terms. These terms are used only to distinguish elements of the same type from one another. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. Any and all instances or exemplary language (“e.g.,” “such as,” etc.) provided herein are intended only to better illustrate embodiments of the invention and, unless otherwise required, do not impose a limitation on the scope of the invention.
[0027] Reference Figures 1 to 5In some embodiments, the shake-based authentication method based on user holding habits according to the present invention refers to... Figures 1 to 2 The shake-based authentication method based on user holding habits is applied to a shake-based authentication system based on user holding habits. This system comprises an application layer, a framework layer, a kernel layer, and a security layer (TEE) connected sequentially. The shake-based authentication method includes the following steps: S100. Collect training behavior data and determine the training behavior characteristics based on the training behavior data. S200. Train the user behavior model based on the behavioral characteristics to be trained; S300. If the behavior authentication function is enabled, the behavior authentication result of the current user is obtained by inputting the behavior features to be detected into the user behavior model.
[0028] The beneficial effects of this invention are as follows: The aforementioned shake-based authentication method distinguishes between holding and shaking behaviors by obtaining data from the mobile smart device's sensor output. It requires no additional equipment or user cooperation. The authentication of holding and shaking behaviors is based on the user's inherent physiological characteristics and usage habits, requiring no memory or carrying, making it difficult to imitate or forge. Based on the non-intrusive authentication during the user's shaking action, it automatically blocks shake events triggered by the user's involuntary actions.
[0029] This application provides a shake-based authentication method and apparatus, which can authenticate based on the user's shaking action while holding the device, identifying whether the shake event is triggered by the device owner's spontaneous action. Feature vectors are extracted based on the user's holding habits and the shaking behavior trajectory, and a reference feature vector is selected according to the minimum distance principle to calculate the optimal preset threshold.
[0030] This application provides a behavior authentication method applied to an electronic device, comprising: collecting behavior data to be trained; determining behavior features to be trained based on the behavior data to be trained; wherein the behavior data to be trained includes sensor data corresponding to at least one shake action, and the sensor types include magnetic sensors, accelerometer sensors, gravity sensors, and gyroscope sensors; training a user behavior model based on the behavior features to be trained; inputting the behavior features to be detected into the user behavior model to obtain the behavior authentication result of the current user.
[0031] The embodiments of the present invention can be applied to the following scenarios: Scenario 1: Shake-to-Advertisement Triggers Risk Control. Shake-to-advertisements are frequently encountered by users during device use. Some applications detect even slight shaking of the mobile device and immediately redirect to the advertisement, significantly impacting the user experience. Based on the shake-to-advertisement behavior authentication technology provided in this application, shake-to-advertisement behavior authentication can be performed seamlessly, preventing shake-to-advertisements from being triggered against the user's will.
[0032] Scenario 2: Liveness Detection. Current mainstream liveness detection methods, such as mouth opening, head shaking, and image recognition, require prolonged user interaction, severely impacting the user experience. The shake-to-authenticate technology solution provided in this application requires only a single shake, avoiding cumbersome user operations and improving the user experience.
[0033] Scenario 3: Assisted Identity Authentication. In some scenarios where the accuracy of identity authentication is not very high (such as lotteries, check-ins, and other activities that require the active participation of legitimate users), the shake-to-activate behavior can be used to enrich the user experience while also enhancing the authentication of the user's legitimacy.
[0034] The shake-to-authenticate method provided in this application can be applied to electronic devices. These electronic devices can be, for example, mobile phones, tablets, handheld computers, laptops, augmented reality (AR) / virtual reality (VR) devices, etc. This application does not impose any special limitations on the specific form of the electronic device.
[0035] Reference Figure 2 This is a schematic diagram of the overall process of a shake-to-authenticate method based on user holding habits. First, behavioral data (i.e., training behavioral data) is collected, and training behavioral features are extracted, including holding behavior features and shake-to-authenticate features. These are then trained to obtain user behavior models, which include a holding behavior model and a shake-to-authenticate model. Next, the behavioral features to be detected are detected, i.e., holding behavior matching and shake-to-authenticate matching are performed, resulting in a holding behavior matching score and a shake-to-authenticate matching score. Finally, a score fusion decision is made, comparing the behavior matching score with a preset threshold. If the behavior matching score is greater than or equal to the preset threshold, it is determined that the current shake-to-authenticate behavior was triggered voluntarily by the device owner. If the behavior matching score is less than the preset threshold, it is determined that the current shake-to-authenticate behavior was not triggered voluntarily by the device owner or was not voluntarily triggered by the device owner.
[0036] Furthermore, refer to Figures 1 to 2 In step S100, The training behavior data includes sensor data corresponding to at least one shaking action acquired by sensors, wherein the sensors include one or more combinations of magnetic sensors, gravity sensors, accelerometers and gyroscopes. The duration of the shake event is calculated using the sensor data. If the duration of the shake event is within a preset duration range, it is determined to be a valid shake action. The difference between the data during the initial period of the shake event and the peak data is calculated using the sensor data. If the difference is greater than a preset threshold, the shake action is considered valid.
[0037] Specifically, at least one shake event corresponds to a duration between [1s, 3s]. In this embodiment, considering that behavioral authentication technology is based on the analysis of users' unconscious behavioral habits, shake events that are too short or too long usually indicate user error or the execution of a specific action. Therefore, behavioral data generated when the duration is too short or too long can be considered abnormal behavioral data. Behavioral data with excessively short or long durations can be removed to effectively improve the accuracy of shake-based behavioral authentication without significantly impacting the user experience.
[0038] At least one shake event corresponds to accelerometer sensor data including the difference between the initial accelerometer data obtained during the user's shake operation and the peak accelerometer data, where the difference is greater than a preset threshold. This ensures the validity of the shake action and avoids collecting invalid data.
[0039] In one possible implementation, the gyroscope sensor data corresponding to at least one shake event includes the difference between the gyroscope data initially obtained during the user's shake operation and the gyroscope data at its peak, where the difference is greater than a preset threshold. This ensures the validity of the shake action and avoids collecting invalid data.
[0040] In one possible implementation, the sensor data also includes at least one of timestamps, horizontal acceleration data, gravitational acceleration data, accelerometer data, magnetometer data, and gyroscope data. Understandably, the more diverse the types of sensor data, the more accurate the user behavior model and the higher the reliability of user behavior authentication.
[0041] Furthermore, refer to Figures 1 to 2 In step S100, The behavioral features to be trained include a first type of preset value for the first type of data. The first type of data includes at least one of the following: accelerometer data, gyroscope data, distance from the origin to the accelerometer, angle from the origin to the accelerometer, velocity from the origin to the accelerometer, acceleration from the origin to the accelerometer, distance from adjacent points to the accelerometer, angle from adjacent points to the accelerometer, velocity from adjacent points to the accelerometer, acceleration from adjacent points to the accelerometer, distance from the accelerometer, displacement from the accelerometer, and duration of the accelerometer event. The first type of preset values includes at least one of the following: average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, 75% value, starting value, ending value, and start-end difference.
[0042] Furthermore, refer to Figures 1 to 2 Step S200 includes: S210. If the device is in an unlocked state, the application layer behavior data acquisition service continuously monitors the device's sensors to obtain horizontal acceleration data, gravity acceleration data, acceleration data, magnetometer data, and gyroscope data, and encrypts and stores the behavior data to be trained in the kernel layer. S220. Based on horizontal acceleration data, gravitational acceleration data, accelerometer data, magnetometer data, and gyroscope data, user behavior feature data is extracted and analyzed through the kernel layer behavior authentication HAL. The user behavior feature data includes holding behavior features and shaking behavior features. S230. Identify the characteristics of holding the device, eliminate non-holding device behavior data, and obtain valid holding device behavior; identify the characteristics of shaking behavior, eliminate non-shaking behavior data, and obtain valid shaking behavior. S240. If the screen is locked, stop the behavior data collection service and clear the cache.
[0043] Furthermore, refer to Figures 1 to 2 In step S220, The device-holding behavior characteristics include at least the following: Gyroscope X / Y / Z axis data, as well as the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, and 75% value of the gyroscope X / Y / Z axis data; Accelerometer X / Y / Z axis data, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the accelerometer X / Y / Z axis data; Horizontal accelerometer X / Y / Z axis data, and the mean, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, and 75% value of the horizontal accelerometer X / Y / Z axis data; Gravity accelerometer X / Y / Z axis data, as well as the mean, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the gravity accelerometer X / Y / Z axis data; Magnetometer X / Y / Z axis data, including mean, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value, and 75% value; holding angle X / Y / Z axis: mean, standard deviation, skewness, and kurtosis; The shaking behavior features include at least the following: The data on the distance from the origin to the shake point, as well as the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the distance from the origin to the shake point; The data on the angle of the shaker relative to the origin, as well as the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the angle of the shaker relative to the origin; Shake the relative velocity data to the origin, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the shake relative velocity data; Shaking acceleration data relative to the origin, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, and 75% values of the shaking acceleration data relative to the origin; Shake to get the distance data between adjacent points, and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value and 75% value of the distance data between adjacent points. Shake the angle data of adjacent points and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value and 75% value of the angle data of adjacent points; Shake the adjacent point speed data and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25% value, 50% value and 75% value of the adjacent point speed data; Shake the acceleration data of adjacent points and the average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the acceleration data of adjacent points; It also includes shake duration data, shake distance data, and shake displacement data.
[0044] Specifically, it is necessary to analyze sensor data to extract X / Y / Z axis holding angle data to identify valid holding behaviors; similarly, it is necessary to extract device acceleration data and rotation angle data to identify valid shaking behaviors. Data that is not held and does not involve shaking behaviors can be discarded, so that the training data can be clearly identified as shaking behavior data under holding conditions, effectively improving recognition accuracy.
[0045] In this embodiment, considering that behavioral authentication technology is based on the analysis of users' unconscious behavioral habits, a shake-to-win behavior that is too short or too long usually indicates a user's mistake or execution of a specific action. Therefore, behavioral data generated when the duration is too short or too long can be considered abnormal behavioral data. Behavioral data that is too short or too long can be removed to effectively improve recognition accuracy without significantly impacting the user experience of the behavioral authentication function.
[0046] The decision tree algorithm selects the best behavioral features based on individual differences to construct multiple model subtrees, and the multi-subtree fusion decision improves the accuracy of behavior recognition.
[0047] Furthermore, refer to Figures 3 to 4 Step S200 further includes: S250. Use the extreme gradient boosting (XGBoost) algorithm to train the user behavior model. The extreme gradient boosting algorithm selects behavioral feature sets with large behavioral differences based on the collected behavioral features and the pre-set illegal behavior features to construct multiple related decision subtrees. A single user behavior model may include multiple related decision trees, such as a user behavior model including a device holding behavior decision tree and a shake behavior decision tree. The attributes of the tree nodes of each decision tree include node depth, feature index, node value, left child node and right child node. S260. The user behavior model is incrementally learned according to the gradient boost decision tree (GBDT) algorithm. The maximum number of incremental learning times for the user behavior model is n. When the number of incremental learning times for the user behavior model exceeds n, the model corresponding to the earliest incremental learning is deleted from the user behavior model to solve the problem of time-varying behavior and the infinite growth of the model caused by behavior incremental learning.
[0048] In step S200, a user behavior model is trained based on the behavioral features to be trained. In some embodiments, after the mobile smart device acquires a preset number of behavioral features (e.g., behavioral features obtained from five shake events), user behavior model training can be triggered. In some embodiments, the user behavior model can be trained while acquiring behavioral features until it reaches a steady state (i.e., the behavior recognition accuracy of the user behavior model basically no longer improves with the increase of training times). In some embodiments, the user's mobile smart device can train the user behavior model. In other embodiments, after the user device collects the behavioral data to be trained, it can send it to a cloud server, where the cloud server trains the user behavior model, and the cloud server can then send the trained user behavior model back to the user device.
[0049] Specifically, refer to Figure 3 This is one of the decision subtrees in the device-holding behavior model. The root node of decision tree 1 is node 1, and the node value of node 1 is "value 1". The left and right child nodes of node 1 are node 2 and node 3, respectively. The depth of node 1 is 1, and the feature index selected by node 1 is the holding angle. The node values of nodes 2 and 3 can be "value 2" and "0" (illegal holding), respectively; the depth of nodes 2 and 3 is 2; the feature indices of nodes 2 and 3 are gyroscope bias and NULL, respectively; the left and right child nodes of node 2 are node 4 and node 5, respectively; node 3 is a leaf node with no left or right child nodes; the node values of nodes 4 and 5 are "1" (legal holding) and "0" (illegal holding), respectively; the depth of nodes 4 and 5 is 3; nodes 4 and 5 have no feature index and are both leaf nodes.
[0050] Specifically, refer to Figure 4 One of the decision subtrees of the shake behavior model, the root node of decision tree 2 is node 10, the node value of node 10 is "value 3", the left and right child nodes of node 10 are node 11 and node 12 respectively, the depth of node 10 is 1, and the feature index of node 10 is the shake displacement. Nodes 11 and 12 have values of "value 4" and "value 5" respectively; their depth is 2; their feature indices are the average acceleration and average angle of the shake, respectively; the left and right child nodes of node 11 are nodes 13 and 14, and the left and right child nodes of node 12 are nodes 15 and 16; their values are "0" (illegal shake) and "1" (legal shake), respectively; their depth is 3; they have no feature indices; and they are both leaf nodes. Nodes 15 and 16 have values of "1" (legal shake) and "0" (illegal shake), respectively; their depth is 3; they have no feature indices; and they are both leaf nodes.
[0051] Furthermore, refer to Figures 1 to 2 Step S300 includes: S310, the application layer behavior data collection service collects behavior data and extracts holding behavior features and shaking behavior features through the kernel layer behavior authentication HAL (hardware abstract layer, HAL); S320. Input the device holding behavior characteristics and the shaking behavior characteristics into the device holding behavior model and the shaking behavior model in the behavior authentication service of the security layer TEE, respectively, and output the device holding behavior matching score and the shaking behavior matching score. S330. Based on the comparison between the score fusion decision strategy and the preset threshold, the behavior authentication result is obtained, and it is determined whether the current shake behavior is triggered by the legitimate user's voluntary will.
[0052] Specifically, for step S300, a behavior authentication switch can be added to the settings application of the mobile smart device, allowing users to enable or disable the shake behavior authentication function.
[0053] Furthermore, refer to Figures 1 to 2 In step S330, the behavior authentication result includes: If the behavioral feature to be detected matches the user behavior model, a behavior matching score is output. The behavior matching score is set according to the differences between users and specific business scenarios. A low behavior matching score is set in scenarios with high recognition rate, and a high behavior matching score is set in scenarios with low false alarm rate. Compare the behavior matching score with a preset threshold. If the behavior matching score is greater than or equal to the preset threshold, it is determined that the current shake behavior is triggered by the owner's own will; if the behavior matching score is less than the preset threshold, it is determined that the current shake behavior is not triggered by the owner or is not triggered by the owner's own will.
[0054] Furthermore, refer to Figure 5 The present invention also discloses a shake-based authentication system based on user holding habits. The shake-based authentication system is used to implement the shake-based authentication method based on user holding habits. The shake-based authentication system includes an application layer, a framework layer, a kernel layer, and a security layer (TEE) connected in sequence. The application layer includes a behavior data acquisition service, which includes a sensor monitoring sub-service, a data cleaning sub-service, and a feature extraction sub-service connected in sequence. The framework layer includes a security management service and a storage management service connected in sequence. The framework layer is used to securely store the raw data of the shake-to-win behavior collected. The security management service is used to receive the raw feature output of the feature extraction sub-service and write data to the storage management service. The kernel layer includes a volume daemon (vold) and a hardware abstract layer (HAL) connected in sequence. The daemon receives the feature transformation output of the storage management service and writes behavioral data to the HAL. The security layer TEE includes a behavior authentication service, which includes a behavior authentication model sub-service and a behavior authentication policy sub-service.
[0055] Specifically, this embodiment of the invention uses the layered architecture of the Android system as an example to illustrate the software structure. Figure 1 As shown, the Android system may include an application layer (which may be simply referred to as the application layer), an application framework layer (which may be simply referred to as the framework layer), a kernel layer, and a TEE. Additionally, the Android system may also include the Android runtime and system libraries; this application does not limit this.
[0056] The application layer can include a series of applications and services. For example, the application layer can include a screen status monitoring service (keyguard) and a shake behavior data collection service.
[0057] The screen status monitoring service can be used to monitor screen status, which can include unlocked and locked states. The shake behavior data collection service can call Keyguard to monitor the system screen status. In the unlocked state, it can monitor motion sensor, orientation sensor, and related system resource consumption information to collect training data (specific data can be found in the relevant description below); in the locked state, the monitoring can be destroyed to avoid resource waste.
[0058] The framework layer can include a storage management service (StorageManagerService) and a security management service (SecManagerService). The security management service and storage management service are used to securely store the raw data collected from the shake-to-win behavior.
[0059] The kernel layer can include a volume daemon (vold) and a hardware abstract layer (HAL). The volume daemon is the control center for the external storage system in the Android platform, and it's a background process that manages and controls external storage devices on the Android platform. The hardware abstract layer (HAL) can be used to extract behavioral features from raw data (specific features can be found in the description below).
[0060] The TEE (Technical Equipment Environment) provides a secure zone within the electronic device, ensuring that sensitive data is stored, processed, and protected in an isolated and trusted environment, achieving end-to-end security. Behavioral characteristics can be written into the behavioral authentication service within the TEE, which can store user holding behavior models and shake-to-action behavior models. After user behavioral characteristics are passed to the user holding behavior model and shake-to-action behavior model, the behavioral authentication policy can determine whether the shake-to-action behavior was triggered by a legitimate user's voluntary intent.
[0061] Furthermore, the sensor monitoring sub-service includes at least a screen status monitoring service and a shake behavior data acquisition service. The screen status monitoring service is used to monitor the screen status, which includes unlocked state and locked state. The shake behavior data acquisition service calls the screen status monitoring service to monitor the system screen status. In the unlocked state, it monitors the sensor and related system resource consumption information and collects training data. In the locked state, it destroys the monitoring to avoid resource waste. Behavioral characteristics are written into the behavior authentication service in the security layer TEE. The behavior authentication service stores the user's holding behavior model and shake behavior model. After the user's behavioral characteristics are passed into the user's holding behavior model and shake behavior model, the behavior authentication policy determines whether the current shake behavior is triggered by the legitimate user's voluntary will.
[0062] Specifically, when a user needs to perform shake-to-authenticate behavior, the application can call the behavior authentication function. At this time, the behavior data collection service can collect behavior data and extract the holding behavior features and shake-to-authenticate behavior features through the behavior authentication module of the HAL layer. These features are then passed into the holding behavior model and shake-to-authenticate behavior model in the TEE behavior authentication service, respectively. The holding behavior matching score and shake-to-authenticate behavior matching score are output. Based on the score fusion decision strategy and the comparison with the preset threshold, it is determined whether the current shake-to-authenticate behavior is triggered by the legitimate user's voluntary will.
[0063] For example, the score fusion decision strategy can be to compare the score of holding the device with the preset threshold of holding the device, and the score of shaking the device with the preset threshold of shaking the device. If the scores are both greater than or equal to the preset threshold, it can be considered that the current shaking behavior is triggered by the legitimate user's voluntary will; otherwise, it can be considered that the current shaking behavior is not the user's voluntary will or is not a shaking behavior.
[0064] It should be understood that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).
[0065] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.
[0066] Furthermore, the method can be implemented operatively connected to any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or communicating with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described in the invention, the invention may also include the computer itself.
[0067] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.
[0068] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.
Claims
1. A method for shake behavior authentication based on user's holding habit, characterized in that, The shake behavior authentication method based on user holding habit is applied to a shake behavior authentication system based on user holding habit, which comprises an application layer, a framework layer, a kernel layer and a security layer TEE connected in sequence, and the shake behavior authentication method based on user holding habit comprises the following steps: S100, collecting training behavior data, and determining training behavior features according to the training behavior data; S200, training a user behavior model according to the training behavior features; S300, if the behavior authentication function is enabled, inputting the detection behavior features into the user behavior model to obtain the behavior authentication result of the current user. 2.The user's phone habit based shake behavior authentication method of claim 1, wherein, In step S100, The training behavior data comprises sensor data corresponding to at least one shake action obtained by a sensor, and the sensor comprises a combination of one or more of a magnetic force sensor, a gravity sensor, an acceleration sensor and a gyroscope sensor; The shake event duration is calculated through the sensor data, and if the shake event duration belongs to a preset duration range, it is judged as a valid shake action; The difference between the data during the start of the shake operation of the user and the highest peak data is calculated through the sensor data, and if the difference is greater than a preset threshold, it is judged as a valid shake action. 3.The user's phone habit based shake behavior authentication method of claim 1, wherein, In step S100, The training behavior features comprise first type preset values of first type data, The first type data comprises at least one of accelerometer data, gyroscope data, shake relative origin distance, shake relative origin angle, shake relative origin speed, shake relative origin acceleration, shake adjacent point distance, shake adjacent point angle, shake adjacent point speed, shake adjacent point acceleration, shake distance, shake displacement and shake event duration, The first type preset values comprise at least one of mean value, maximum value, minimum value, standard deviation, skewness, kurtosis, 25% value, 50% value, 75% value, start value, end value and start-end difference. 4.The user's habit based shake behavior authentication method of claim 1, wherein, Step S200 comprises: S210, if in the unlocked state, the behavior data collection service of the application layer continuously monitors the sensors of the device to obtain horizontal acceleration data, gravity acceleration data, acceleration data, magnetometer data and gyroscope data, and the training behavior data is encrypted and stored to the kernel layer; S220, based on the horizontal acceleration data, gravity acceleration data, accelerometer data, magnetometer data and gyroscope data, the user behavior feature data is extracted and analyzed by the behavior authentication HAL of the kernel layer, and the user behavior feature data comprises holding behavior features and shake behavior features; S230, the holding behavior features are identified, and non-holding behavior data is removed to obtain valid holding behavior, and the shake behavior features are identified, and non-shake behavior data is removed to obtain valid shake behavior; S240, if in the locked state, the behavior data collection service is stopped, and the cache is cleaned. 5.The user's phone habit based shake behavior authentication method of claim 4, wherein, In step S220, The holding behavior features at least comprise: Gyroscope X / Y / Z axis data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the gyroscope X / Y / Z axis data; Accelerometer X / Y / Z axis data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the accelerometer X / Y / Z axis data; Horizontal accelerometer X / Y / Z axis data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the horizontal accelerometer X / Y / Z axis data; Gravity accelerometer X / Y / Z axis data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the gravity accelerometer X / Y / Z axis data; Magnetometer X / Y / Z axis data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50%, 75% values of the magnetometer X / Y / Z axis data; holding angle X / Y / Z axis: average, standard deviation, skewness and kurtosis; The shaking behavior features at least include: Shaking relative origin distance data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking relative origin distance data; Shaking relative origin angle data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking relative origin angle data; Shaking relative origin speed data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking relative origin speed data; Shaking relative origin acceleration data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking relative origin acceleration data; Shaking adjacent point distance data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking adjacent point distance data; Shaking adjacent point angle data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking adjacent point angle data; Shaking adjacent point speed data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking adjacent point speed data; Shaking adjacent point acceleration data and average, maximum, minimum, standard deviation, skewness, kurtosis, 25%, 50% and 75% values of the shaking adjacent point acceleration data; Further including shaking duration data, shaking distance data and shaking displacement data. 6.The user's mobile device habit based shake behavior authentication method of claim 4, wherein, Step S200 further includes: S250, training the user behavior model using an extreme gradient boosting algorithm, the extreme gradient boosting algorithm being based on the collected behavior features and the preset illegal behavior features to filter out a behavior feature set combination with large behavior difference and construct multiple associated decision sub-trees; The single user behavior model can include a plurality of associated decision trees, such as a device holding behavior decision tree and a shaking behavior decision tree, and attributes of tree nodes of each decision tree include node depth, feature index, node value, left child node, and right child node. In S260, the user behavior model is incrementally learned according to the gradient descent tree algorithm, the maximum number of incremental learning of the user behavior model is n, and when the number of incremental learning of the user behavior model exceeds n, the model corresponding to the earliest incremental learning is deleted from the user behavior model, thereby solving the problem of model unlimited growth caused by behavior time variation and behavior incremental learning. 7.The user-habits-based shake behavior authentication method of claim 1, wherein, Step S300 includes: In S310, the behavior data collection service of the application layer collects behavior data, and extracts device holding behavior features and shaking behavior features through the behavior authentication HAL of the kernel layer; In S320, the device holding behavior features and the shaking behavior features are respectively input into a device holding behavior model and a shaking behavior model in the behavior authentication service of the secure layer TEE, and a device holding behavior matching score and a shaking behavior matching score are output; In S330, the behavior authentication result is obtained based on size comparison of the score fusion decision strategy and a preset threshold, and it is determined whether the current shaking behavior is a shaking behavior triggered by a legal user's autonomous will. 8.The user-habits-based shake behavior authentication method of claim 7, wherein, In S330, the behavior authentication result includes: If the to-be-detected behavior features match the user behavior model, a behavior matching score is output, the behavior matching score is set according to the difference of users and specific business scenarios, a low behavior matching score is set in a scenario with high recognition rate, and a high behavior matching score is set in a scenario with low false positive rate; The size of the behavior matching score and a preset threshold is compared; If the behavior matching score is greater than or equal to the preset threshold, it is determined that the current shaking behavior is triggered by the autonomous will of the device owner; if the behavior matching score is less than the preset threshold, it is determined that the current shaking behavior is not triggered by the autonomous will of the device owner. 9.A user-habits-based shake behavior authentication system for implementing the user-habits-based shake behavior authentication method according to any one of claims 1 to 8, characterized by The shaking behavior authentication system based on user device holding habits includes an application layer, a framework layer, a kernel layer, and a secure layer TEE connected in sequence; The application layer includes a behavior data collection service, and the behavior data collection service includes a sensor listening sub-service, a data cleaning sub-service, and a feature extraction sub-service connected in sequence; The framework layer includes a security management service and a storage management service connected in sequence, the framework layer is used for securely storing collected shaking behavior raw data, the security management service is used for receiving raw feature output of the feature extraction sub-service, and the security management service writes data to the storage management service; The kernel layer includes a daemon and a behavior authentication HAL connected in sequence, the daemon is used for receiving feature conversion output of the storage management service, and the daemon writes behavior data to the behavior authentication HAL; The secure layer TEE includes a behavior authentication service, and the behavior authentication service includes a behavior authentication model sub-service and a behavior authentication strategy sub-service.
10. The shaking behavior authentication system based on user device holding habits according to claim 9, wherein The sensor monitoring sub-service at least includes a screen state monitoring service and a shake behavior data collection service, the screen state monitoring service is used for monitoring the screen state, the screen state includes an unlocked state and a locked state, the shake behavior data collection service calls the screen state monitoring service to monitor the system screen state, in the unlocked state, the sensor and related system resource consumption information are monitored, the to-be-trained data is collected, in the locked state, the monitoring is destroyed, and resource waste is avoided; The behavior feature is written into a behavior authentication service in a security layer TEE, the behavior authentication service stores a user holding machine behavior model and a shake behavior model, after the user behavior feature is transmitted into the user holding machine behavior model and the shake behavior model, whether the current is a shake behavior triggered by a legal user's autonomous will is judged according to a behavior authentication strategy.
Citation Information
Patent Citations
Method and system for quickly removing message in notification bar of mobile terminal and mobile terminal
CN105468370A
Mistaken touch prevention method and device
CN105630352A
Detection method and device of shaking state in motion, intelligent terminal and storage medium
CN110270079A
Application management method and related device
CN116860115A