An in-pocket detection method, terminal device, chip system, and storage medium
By combining proximity light sensors, ambient light sensors, angular velocity sensors, and ultrasonic sensors, the problem of low detection accuracy of proximity light sensors in dark-colored plush or thin, light-transmitting pockets has been solved, improving detection accuracy and saving power.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2026-03-19
AI Technical Summary
In existing technologies, proximity sensors have low accuracy in detecting whether a mobile phone is in a pocket made of dark velvet or thin, light-transmitting material, which can easily lead to false positives and false negatives.
By combining proximity sensors, ambient light sensors, angular velocity sensors, and ultrasonic sensors, the system acquires sensory information and ultrasonic data from the terminal device to comprehensively determine whether the terminal device is in a pocket. The ultrasonic sensor is used to measure the distance between the device and obstacles, avoiding reliance solely on proximity sensors.
It improves the accuracy of determining whether a terminal device is in a pocket, avoids misjudgments and missed judgments caused by material effects, saves system power consumption, and ensures user experience.
Smart Images

Figure CN2025106320_19032026_PF_FP_ABST
Abstract
Description
Pocket detection method, terminal device, chip system and storage medium
[0001] The present application claims priority from the Chinese patent application No. 202411278867.3 filed on September 11, 2024, and entitled "Pocket detection method, terminal device, chip system and storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of terminal, and in particular to a pocket detection method, a terminal device, a chip system and a storage medium. BACKGROUND
[0003] With the rapid development of science and technology, intelligent devices (such as mobile phones) have been integrated into people's daily life and have become the core tool for communication, entertainment, work, etc. Users can put mobile phones in pockets for easy access. However, this behavior also has the problem of pocket mis-triggering, such as mis-dialing a phone, mis-sending a message, etc., which reduces the user's experience.
[0004] Currently, in order to solve the problem of pocket mis-triggering, the proximity light sensor on the mobile phone is usually used to detect whether the mobile phone is in the pocket, and in the case that the mobile phone is in the pocket, the mobile phone display is controlled to display a mis-trigger prevention interface to avoid mis-triggering. However, when the pocket material is dark and fluffy or light and transparent, the proximity light sensor will be affected by light and it will be difficult to capture effective light signals, increasing the risk of misjudgment and omission, and reducing the accuracy of detection. SUMMARY
[0005] The present application provides a pocket detection method, a terminal device, a chip system and a storage medium, which can reduce the risk of misjudgment and omission and improve the accuracy of determining whether the terminal device is in the pocket.
[0006] In a first aspect, a pocket detection method is provided, which comprises: in the case that the proximity light sensor of the terminal device reports proximity data, acquiring perception information of the terminal device and determining whether the terminal device is in the pocket based on the perception information, the perception information comprising the first ambient light intensity of the terminal device and / or the posture information of the terminal device, the proximity data being used to indicate that the distance between the proximity light sensor and the obstacle is less than or equal to the target distance threshold; in the case that the proximity light sensor of the terminal device does not report proximity data, or the terminal device does not have a proximity light sensor, acquiring ultrasonic wave data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic wave data. The first ambient light intensity can be acquired through the ambient light sensor of the terminal device; the ultrasonic wave data can be acquired through the ultrasonic wave sensor.
[0007] The method can be executed by a terminal device including a touch screen, can be executed by a module (for example, a processor, a chip, or a chip system, etc.) applied in the terminal device, and can also be implemented by a logic module or software capable of implementing all or part of the terminal device functions. The pocket detection refers to detecting whether the terminal device is in a pocket by using a series of methods.
[0008] The above scheme no longer relies on a single proximity light sensor to determine whether the terminal device is in a pocket, but comprehensively considers whether the terminal device has a proximity sensor, whether the proximity sensor reports proximity data, and uses a corresponding detection method to detect whether the terminal device is in a pocket, thereby improving the accuracy of determining whether the terminal device is in a pocket. The problem of misjudgment or failure in determining whether the terminal device is in a pocket by using a proximity light sensor in the related art is solved.
[0009] In a possible implementation, the posture information includes orientation information of the terminal device, or the posture information includes orientation information and stability information of the terminal device. The orientation information indicates whether the terminal device is in a vertical posture, and the vertical posture is a posture in which a screen of the terminal device is perpendicular or close to perpendicular to the ground. The stability information is used to indicate whether the terminal device is in a stable state. The posture information can be obtained by using an angular velocity sensor (i.e., a gyroscope sensor) of the terminal device. The first ambient light intensity can be obtained by using an ambient light sensor of the terminal device.
[0010] The above scheme, in the case that the proximity light sensor of the terminal device reports proximity data, the terminal device can be in a pocket, and the terminal device can be detected whether it is in the pocket by using the ambient light sensor and / or the angular velocity sensor of the terminal device, thereby avoiding the misjudgment problem when the material of the pocket is a light and thin light-transmitting material, and improving the accuracy of determining whether the terminal device is in a pocket.
[0011] In a possible implementation, in the case that the proximity light sensor of the terminal device does not report proximity data, or the terminal device does not have a proximity light sensor, ultrasonic data of the terminal device is obtained, and whether the terminal device is in a pocket is determined based on the ultrasonic data.
[0012] The above scheme, when the proximity light sensor of the terminal device does not report proximity data, the proximity light sensor may fail or the proximity light sensor may fail, both of which may cause the occurrence of the missed detection problem. In order to avoid the occurrence of the missed detection problem, and solve the problem that the terminal device cannot perform the bag detection due to not being equipped with the proximity light sensor in the related technology, considering the similarity of the proximity light sensor and the ultrasonic sensor in function, that is, the distance between the terminal device and the obstacle can be measured by the ultrasonic sensor to determine whether the terminal device is in the pocket, and the accuracy of determining whether the terminal device is in the pocket is improved.
[0013] Among them, in this paper, the time difference from emission to reception of ultrasonic waves, ultrasonic waveforms (such as reflected waveforms), amplitudes or frequencies can be referred to as ultrasonic data. In order to distinguish, the time difference from emission to reception of ultrasonic waves can be represented as first ultrasonic data, and at least one of the ultrasonic waveforms (such as reflected waveforms), amplitudes or frequencies can be represented as second ultrasonic data. The bag detection by the ultrasonic sensor can be realized only based on the first ultrasonic data; of course, it can also be realized based on the first ultrasonic data and the second ultrasonic data; for example, in the case of determining that the distance between the terminal device and the obstacle is less than or equal to the target distance threshold based on the first ultrasonic data, the second ultrasonic data is analyzed and judged to determine whether the terminal device is in the pocket.
[0014] In a possible implementation, the bag detection method further includes: detecting whether the terminal device performs a bag drop action; and in the case that the terminal device performs the bag drop action, detecting whether the terminal device has a proximity light sensor.
[0015] It should be understood that the bag drop action can be the process that the terminal device is consciously moved towards the pocket direction from the original position and at least reaches the pocket entrance or the nearby area. The bag drop action emphasizes the action of the terminal device moving towards the pocket, rather than whether the terminal device is finally successfully put into the pocket.
[0016] Among them, the position where the proximity light sensor is arranged can be represented as the head or the top. The terminal device performing the bag drop action can specifically include performing an inverted bag drop action or a non-inverted bag drop action. The inverted bag drop action can be understood as a bag drop action with the head (i.e. the top) downward. Among them, the non-inverted bag drop action can be a bag drop action with the head (top) upward. The non-inverted bag drop action can also be an action other than the inverted bag drop action and the bag drop action with the head (top) upward.
[0017] Optionally, the head (top) of the terminal device is also provided with an ambient light sensor.
[0018] Exemplarily, the upside-down bag-out motion is a process that the mobile phone is moved at least to the pocket entrance or a region near the pocket entrance in a posture that the top is away from the pocket entrance. The non-upside-down bag-out motion is a process that the mobile phone is moved at least to the pocket entrance or a region near the pocket entrance in a posture that the top is not away from the pocket entrance, for example, a process that the mobile phone is moved at least to the pocket entrance or a region near the pocket entrance in a posture that the top is close to the pocket entrance.
[0019] The above scheme can not start the process of detecting whether the terminal device is in the pocket when the terminal device does not perform the bag-out motion. The process of detecting whether the terminal device is in the pocket can be started (i.e., the bag-out detection process is started) only when the terminal device performs the bag-out motion, thereby avoiding high power consumption caused by frequent detection and saving system power consumption.
[0020] In a possible implementation, detecting whether the terminal device performs the bag-out motion includes: obtaining acceleration data of the terminal device; and determining, based on the acceleration data, whether the terminal device performs the bag-out motion.
[0021] In a possible implementation, when the proximity light sensor of the terminal device reports the proximity data, obtaining the perception information of the terminal device and determining, based on the perception information, whether the terminal device is in the pocket includes: when the terminal device performs the upside-down bag-out motion and the proximity light sensor reports the proximity data, obtaining the perception information of the terminal device and determining, based on the perception information, whether the terminal device is in the pocket, the bag-out motion including the upside-down bag-out motion. The perception information at least includes the first ambient light intensity.
[0022] The above scheme indicates that the terminal device performs the upside-down bag-out motion and the proximity light sensor reports the proximity data, which can indicate that the terminal device is possibly in the pocket and the proximity light sensor and the ambient light sensor are not exposed outside the pocket. At this time, the perception information of the terminal device can be obtained, and whether the terminal device is in the pocket is further determined based on the perception information. In this way, the reliability and accuracy of detecting whether the terminal device is in the pocket by using the ambient light sensor can be improved. The perception information at least includes the first ambient light intensity.
[0023] In a possible implementation, determining, based on the perception information, whether the terminal device is in the pocket includes: when the perception information satisfies a perception condition, determining that the terminal device is in the pocket; or when the perception information satisfies the perception condition, acquiring a first image by using an image acquisition component of the terminal device, and when a target object does not exist in the first image, determining that the terminal device is in the pocket, the target object being an object with a face; and when the perception information does not satisfy the perception condition, obtaining ultrasonic data of the terminal device and determining, based on the ultrasonic data, whether the terminal device is in the pocket.
[0024] The above scheme can further collect the first image in the case that the perception information meets the perception condition, and determine whether the target object exists in the first image through face recognition on the first image, as a basis for whether the terminal device is used. In the case that the target object does not exist in the first image, it indicates that the terminal device is not used by the user, and it can be determined that the terminal device is in the pocket. In the case that the target object exists in the first image, it indicates that the terminal device is used by the user, and it can be determined that the terminal device is not in the pocket. In this way, the face recognition is used as a bottom mechanism of the pocket detection, and in the case that the target object exists in the first image, the pocket detection process is exited immediately to ensure the smooth and interference-free experience of the user in the process of using the terminal device. Moreover, the accuracy of determining whether the terminal device is in the pocket can be improved.
[0025] The ultrasonic data can be at least one of an ultrasonic waveform, an amplitude, and a frequency.
[0026] In a possible implementation, the ultrasonic data can be an ultrasonic waveform, an amplitude, and a frequency. In the case that a change trend of the ultrasonic waveform meets a target change trend, a change trend of the amplitude meets a preset amplitude change trend, and a change trend of the frequency meets a preset frequency change trend, it is determined that the terminal device is in the pocket. The ultrasonic waveform is a reflected wave waveform. The target change trend is a change trend of the reflected wave waveform when the terminal device is placed in the pocket.
[0027] In a possible implementation, the ultrasonic data is an ultrasonic waveform. In the case that a change trend of the ultrasonic waveform meets a target change trend, it is determined that the terminal device is in the pocket.
[0028] In a possible implementation, the ultrasonic data is a reflected wave waveform. Feature extraction is performed on the reflected wave waveform to obtain waveform feature information, which is amplitude change information and waveform distortion information. The waveform distortion information indicates a morphological change of the reflected wave waveform compared with a transmitted wave waveform. The waveform feature information can be input into a pre-trained classifier, and the classifier is used to process the waveform feature information to determine whether the terminal device is in the pocket.
[0029] In a possible implementation, in the case that the proximity light sensor of the terminal device does not report proximity data, or the terminal device does not have a proximity light sensor, the ultrasonic data of the terminal device is obtained, and whether the terminal device is in the pocket is determined based on the ultrasonic data, by the following method:
[0030] In a first mode, the position where the proximity light sensor is arranged is represented as a head or a top. In a case where the terminal device performs a non-inverted bag-falling action and the proximity light sensor does not report proximity data, ultrasonic data of the terminal device is acquired, and whether the terminal device is in a pocket is determined based on the ultrasonic data.
[0031] In the above solution, the top of the terminal device can also be provided with an ambient light sensor. In a case where the terminal device performs a non-inverted bag-falling action and the proximity light sensor does not report proximity data, it is considered that the proximity light sensor can be faulty or exposed outside the pocket, and the ambient light sensor can also be exposed outside the pocket. Based on this, an ultrasonic sensor similar in function to the proximity light sensor can be used to measure the distance between the terminal device and an obstacle, so as to determine whether the terminal device is in the pocket. In this way, the problem of missed detection caused by the proximity light sensor being faulty or exposed outside the pocket is avoided, and the accuracy of determining whether the terminal device is in the pocket is improved.
[0032] In a second mode, in a case where the terminal device performs a non-inverted bag-falling action and the terminal device does not have a proximity light sensor, ultrasonic data of the terminal device is acquired, and whether the terminal device is in a pocket is determined based on the ultrasonic data.
[0033] In the above solution, in a case where the terminal device does not have a proximity light sensor, an ultrasonic sensor similar in function to the proximity light sensor is considered to be used to measure the distance between the terminal device and an obstacle, so as to determine whether the terminal device is in the pocket. In this way, it is avoided to excessively rely on the proximity light sensor to detect whether the terminal device is in the pocket, and the limitation in the related art that the proximity light sensor is excessively relied on to detect whether the terminal device is in the pocket is overcome.
[0034] In a third mode, the position where the proximity light sensor is arranged is represented as a head or a top. In a case where the terminal device performs an inverted bag-falling action and the proximity light sensor does not report proximity data, ultrasonic data of the terminal device is acquired, and whether the terminal device is in a pocket is determined based on the ultrasonic data.
[0035] In the above solution, in a case where the terminal device performs an inverted bag-falling action and the proximity light sensor does not report proximity data, it is considered that the proximity light sensor can be faulty or invalid. Therefore, an ultrasonic sensor similar in function to the proximity light sensor can be used to measure the distance between the terminal device and an obstacle, so as to determine whether the terminal device is in the pocket. In this way, the problem of missed detection caused by the proximity light sensor being invalid or faulty is avoided, and the accuracy of determining whether the terminal device is in the pocket is improved.
[0036] In a possible implementation, the determining whether the terminal device is in the pocket based on the ultrasonic data comprises: in a case where a change trend of the ultrasonic waveform meets a target change trend, determining that the terminal device is in the pocket, the ultrasonic data comprising the ultrasonic waveform; or in a case where the change trend of the ultrasonic waveform meets the target change trend, acquiring a first image by using an image acquisition component of the terminal device, and in a case where a target object does not exist in the first image, determining that the terminal device is in the pocket, the target object being an object having a face.
[0037] The above scheme acquires the first image in a case where the change trend of the ultrasonic waveform meets the target change trend, and determines whether the target object exists in the first image by performing face recognition on the first image, as a basis for determining whether the terminal device is used. In a case where the target object does not exist in the first image, it indicates that the terminal device is not used by the user, and it can be determined that the terminal device is in the pocket. In a case where the target object exists in the first image, it indicates that the terminal device is used by the user, and it can be determined that the terminal device is not in the pocket. In this way, the face recognition is used as a bottom mechanism of the pocket detection, and the pocket detection process can be exited in a case where the target object exists in the first image, to ensure a smooth and interference-free experience of the user in the process of using the terminal device. Moreover, the accuracy of determining whether the terminal device is in the pocket can be improved.
[0038] In a possible implementation, the pocket detection method further comprises: in a case where the terminal device performs a non-inverted pocket action and a proximity light sensor reports proximity data, acquiring a first image by using an image acquisition component of the terminal device, and in a case where a target object does not exist in the first image, determining that the terminal device is in the pocket, the target object being an object having a face.
[0039] The above scheme is that the top of the terminal device can also be provided with an ambient light sensor. In a case where the terminal device performs a non-inverted pocket action and the proximity light sensor reports proximity data, it is considered that the proximity light sensor can be outside the pocket and the proximity light sensor can be blocked (for example, blocked by the hand of the user), and the ambient light sensor can also be outside the pocket. Based on this consideration, the first image can be acquired, and whether the target object exists in the first image is determined by performing face recognition on the first image, as a basis for determining whether the terminal device is used. In a case where the target object does not exist in the first image, it indicates that the terminal device is not used by the user, and it can be determined that the terminal device is in the pocket. In a case where the target object exists in the first image, it indicates that the terminal device is used by the user, and it can be determined that the terminal device is not in the pocket. In this way, the accuracy of determining whether the terminal device is in the pocket is improved.
[0040] In a possible implementation, the pocket detection method further includes: in a case where the terminal device is in the pocket, determining whether to control the terminal device to display the anti-mistouch interface based on a scenario in which the terminal device is located.
[0041] In a possible implementation, the determining whether to control the terminal device to display the anti-mistouch interface based on the scenario in which the terminal device is located includes: in a case where the scenario in which the terminal device is located is a first scenario, determining not to control the terminal device to display the anti-mistouch interface; and in a case where the scenario in which the terminal device is located is a second scenario, determining to control the terminal device to display the anti-mistouch interface.
[0042] The first scenario and the second scenario are different, and the first scenario and the second scenario can be divided in consideration of operation continuity of a user. The operation continuity of the first scenario is higher than that of the second scenario. The higher the operation continuity of a scenario, the more sensitive the perception of the user will be, and once the operation is interrupted, the overall thinking of the user is broken, which affects the user experience.
[0043] The above scheme, in the first scenario, the operation continuity of the user is high, and the user can continue to use the terminal device in a very short time. In order to ensure that the user can use the terminal device seamlessly subsequently, even if the terminal device is currently in the pocket, the anti-mistouch interface can not be displayed, thereby avoiding interference with the touch / touch input operation. In this way, when the user takes the terminal device out of the pocket, the previous operation can be continued, and the operation continuity and overall user experience are improved.
[0044] The terminal device is in the second scenario, and the operation continuity of the user is relatively low. Even if the operation is interrupted for a short time, the perception of the user will not be too strong. In order to avoid the problem of pocket mistouch, the anti-mistouch interface can be displayed to avoid the trouble caused by pocket mistouch.
[0045] In a possible implementation, the first scenario is an operation continuity scenario, the second scenario is a video playing scenario or a target scenario, and the target scenario is a scenario other than the operation continuity scenario and the video playing scenario.
[0046] In a possible implementation, the operation continuity scenario is a payment scenario or a game scenario, and the target scenario is a scenario of conducting a conversation through a conversation window, such as a social chat scenario.
[0047] In a possible implementation, in a case where the terminal device is in the pocket, the scenario in which the terminal device is located is the target scenario, and a duration for displaying the anti-mistouch interface is greater than a target duration, the terminal device is controlled to be in a locked state.
[0048] The operation continuity of the video playing scenario is higher than that of the target scenario.
[0049] For the target scenario with low operation continuity, the user's perception of the operation interruption is weak, and the terminal device can be controlled to be in the lock screen state when the display of the anti-mistouch interface lasts longer than the target time. This can prevent pocket mistouch while protecting the user's privacy and data security. Moreover, when the terminal device is in the lock screen state, the terminal device screen will be turned off, which can reduce power consumption and thus prolong the standby time of the terminal device and improve the user experience.
[0050] It should be noted that, in the case where the terminal device is in the pocket, it is determined whether the terminal device displays the anti-mistouch interface based on the scenario in which the terminal device is located, which avoids the inconvenience to the user caused by the blind start of the anti-mistouch interface in the related art when the terminal device is in the pocket, and further improves the user experience.
[0051] In a possible implementation, the pocket detection method further includes: after the terminal device is in the pocket and the anti-mistouch interface is displayed, the anti-mistouch interface is exited when one or more of the following conditions are met: the terminal device's proximity light sensor reports away data, the away data indicating that the distance between the proximity light sensor and the obstacle is greater than a target distance threshold; the second image collected by the image collection component of the terminal device contains a target object, the target object being an object with a face; the second ambient light intensity of the terminal device is greater than a target intensity threshold, and the terminal device has a lifting action; or, an exit operation of the anti-mistouch interface by the user is detected.
[0052] The above scheme can determine that the user may need to use the terminal device or is using the terminal device when one or more conditions are met, and then exit the anti-mistouch interface to restore the response capability to the user's operation, thereby improving the user experience and allowing the user to more conveniently operate the terminal device.
[0053] In a second aspect, another pocket detection method is provided, which includes: obtaining touch information of a touch screen of a terminal device, wherein the touch information includes at least one of a touch position, a touch area, and a touch duration; collecting a first image by an image collection component of the terminal device based on the touch information meeting a pocket touch condition; and determining that the terminal device is in a pocket when a target object is not present in the first image, the target object being an object with a face.
[0054] The above scheme first identifies whether the touch behavior is a pocket touch or a non-pocket touch through the touch information, collects a first image through the image collection component of the terminal device when it is identified that the touch behavior is a pocket touch, and determines that the terminal device is in the pocket when it is identified that the first image has a face, thereby improving the accuracy of determining whether the terminal device is in the pocket.
[0055] In a possible implementation, the obtaining the touch information of the touch screen of the terminal device comprises: detecting whether a pocket-throwing action of the terminal device occurs; and obtaining the touch information of the touch screen of the terminal device in a case where the pocket-throwing action of the terminal device occurs.
[0056] In a possible implementation, the detecting whether the pocket-throwing action of the terminal device occurs comprises: obtaining acceleration data of the terminal device; and determining, based on the acceleration data, whether the pocket-throwing action of the terminal device occurs.
[0057] In a possible implementation, the pocket-throwing detection method further comprises: in a case where the terminal device is in the pocket, determining, based on a scenario in which the terminal device is located, whether to control the terminal device to display the anti-mistouch interface.
[0058] In a possible implementation, the determining, based on the scenario in which the terminal device is located, whether to control the terminal device to display the anti-mistouch interface comprises: in a case where the scenario in which the terminal device is located is a first scenario, determining not to control the terminal device to display the anti-mistouch interface; and in a case where the scenario in which the terminal device is located is a second scenario, determining to control the terminal device to display the anti-mistouch interface.
[0059] In a possible implementation, the first scenario is an operation continuity scenario, the second scenario is a video playing scenario or a target scenario, and the target scenario is a scenario other than the operation continuity scenario and the video playing scenario.
[0060] In a possible implementation, in a case where the scenario in which the terminal device is located is the target scenario and a duration for which the anti-mistouch interface is displayed is greater than a target duration, the terminal device is controlled to be in a locked screen state.
[0061] In a possible implementation, the operation continuity scenario is a game scenario or a payment scenario, and the target scenario is a scenario in which a conversation is conducted through a conversation window.
[0062] In a possible implementation, the pocket-throwing detection method further comprises: in a case where the terminal device is in the pocket and the anti-mistouch interface is displayed, the anti-mistouch interface is exited in a case where one or more of the following conditions are met: a proximity light sensor of the terminal device reports away data, the away data being used to indicate that a distance between the proximity light sensor and an obstacle is greater than a target distance threshold; a second image collected by an image collection component of the terminal device contains a target object, the target object being an object with a face; a second ambient light intensity of the terminal device is greater than a target intensity threshold, and the terminal device has a lifting action; and an exit operation of the anti-mistouch interface by a user is detected.
[0063] In a third aspect, another pocket detection method is provided, which includes: determining a scenario in which a terminal device is located when the terminal device is in a pocket; and determining whether to control the terminal device to display an anti-mistouch interface based on the scenario in which the terminal device is located.
[0064] The above scheme determines whether to control the terminal device to display the anti-mistouch interface based on the scenario in which the terminal device is located when the terminal device is in the pocket, thereby avoiding starting the anti-mistouch interface blindly only because the terminal device is in the pocket, which may cause inconvenience to a user, and greatly improving user experience.
[0065] In a possible implementation, the determining whether to control the terminal device to display the anti-mistouch interface based on the scenario in which the terminal device is located includes:
[0066] In a case where the scenario in which the terminal device is located is a first scenario, it is determined that the terminal device is not controlled to display the anti-mistouch interface.
[0067] In a case where the scenario in which the terminal device is located is a second scenario, it is determined that the terminal device is controlled to display the anti-mistouch interface.
[0068] In a possible implementation, the first scenario is an operation continuity scenario, the second scenario is a video playing scenario or a target scenario, and the target scenario is a scenario other than the operation continuity scenario and the video playing scenario.
[0069] In a possible implementation, the method further includes: in a case where the scenario in which the terminal device is located is the target scenario and a duration for which the anti-mistouch interface is displayed is greater than a target duration, controlling the terminal device to be in a locked state.
[0070] In a possible implementation, the operation continuity scenario is a game scenario or a payment scenario, and the target scenario is a scenario in which a conversation is performed through a conversation window.
[0071] In a fourth aspect, an embodiment of the present application provides a terminal device, which includes a processor and a memory. The memory is configured to store a computer program, and the processor is configured to call and run the computer program from the memory, so that the terminal device performs the method in any one of the first aspect.
[0072] In a fifth aspect, an embodiment of the present application provides a terminal device, which includes a processor and a memory. The memory is configured to store a computer program, and the processor is configured to call and run the computer program from the memory, so that the terminal device performs the method in any one of the second aspect.
[0073] In a sixth aspect, an embodiment of the present application provides a terminal device, the terminal device comprising a processor and a memory, the memory being configured to store a computer program, and the processor being configured to invoke and run the computer program from the memory, so that the terminal device executes the method of any one of the third aspect.
[0074] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is executed by a processor, the processor executes the method of any one of the first aspect.
[0075] In an eighth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is executed by a processor, the processor executes the method of any one of the second aspect.
[0076] In a ninth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is executed by a processor, the processor executes the method of any one of the third aspect.
[0077] In a tenth aspect, an embodiment of the present application provides a computer program product, the computer program product comprising: computer program code, when the computer program code is executed by a terminal device, the terminal device executes the method of any one of the first aspect.
[0078] In an eleventh aspect, an embodiment of the present application provides a computer program product, the computer program product comprising: computer program code, when the computer program code is executed by a terminal device, the terminal device executes the method of any one of the second aspect.
[0079] In a twelfth aspect, an embodiment of the present application provides a computer program product, the computer program product comprising: computer program code, when the computer program code is executed by a terminal device, the terminal device executes the method of any one of the third aspect.
[0080] In a thirteenth aspect, an embodiment of the present application provides a chip system, the chip system comprising a processing circuit and a storage medium, the storage medium storing computer program instructions; the computer program instructions are executed by the processing circuit to implement the method of any one of the first aspect.
[0081] Optionally, the processing circuit in the above chip system can be replaced by a processor, and the storage medium can be replaced by a memory. Optionally, the chip system can further comprise a communication interface, the communication interface being configured to realize communication between the chip system and an external device.
[0082] In a fourteenth aspect, an embodiment of the present application provides a chip system, which comprises processing circuitry and a storage medium, and the storage medium stores computer program instructions; the computer program instructions are executed by the processing circuitry to implement any of the methods in the second aspect.
[0083] Optionally, the processing circuitry in the chip system can be replaced by a processor, and the storage medium can be replaced by a memory. Optionally, the chip system can further comprise a communication interface, which is configured to realize communication between the chip system and an external device.
[0084] In a fifteenth aspect, an embodiment of the present application provides a chip system, which comprises processing circuitry and a storage medium, and the storage medium stores computer program instructions; the computer program instructions are executed by the processing circuitry to implement any of the methods in the third aspect.
[0085] Optionally, the processing circuitry in the chip system can be replaced by a processor, and the storage medium can be replaced by a memory. Optionally, the chip system can further comprise a communication interface, which is configured to realize communication between the chip system and an external device.
[0086] The beneficial effects of the technical solutions in the fourth aspect to the fifteenth aspect of the present application can refer to the beneficial effects of the technical solutions in the first aspect, the second aspect, or the third aspect, which will not be described here. BRIEF DESCRIPTION OF DRAWINGS
[0087] FIG. 1 is a structural schematic diagram of a terminal device according to an embodiment of the present application;
[0088] FIG. 2 is a software structure schematic diagram of a terminal device 100 according to an embodiment of the present application;
[0089] FIG. 3 is a flowchart of a pocket detection method 300 according to an embodiment of the present application;
[0090] FIG. 4 is a flowchart of another pocket detection method 400 according to an embodiment of the present application;
[0091] FIG. 5 is a flowchart of yet another pocket detection method 500 according to an embodiment of the present application;
[0092] FIG. 6 is a flowchart of a pocket detection method 600 according to another embodiment of the present application;
[0093] FIG. 7 is a flowchart of another pocket detection method 700 according to another embodiment of the present application;
[0094] FIG. 8 is a flowchart of yet another pocket detection method 800 according to another embodiment of the present application;
[0095] FIG. 9 is a display interface diagram of a terminal device applying a pocket detection method according to an embodiment of the present application;
[0096] FIG. 10 is a display interface diagram of a terminal device applying another pocket detection method according to an embodiment of the present application;
[0097] FIG. 11 is a display interface diagram of a terminal device applying yet another pocket detection method according to an embodiment of the present application;
[0098] FIG. 12 is a display interface diagram of a terminal device applying a pocket detection method according to another embodiment of the present application;
[0099] FIG. 13 is a display interface diagram of a terminal device applying another pocket detection method according to another embodiment of the present application;
[0100] FIG. 14 is a structural diagram of a terminal device according to an embodiment of the present application. DETAILED DESCRIPTION
[0101] FIG. 1 shows a structural diagram of a terminal device 100.
[0102] The terminal device 100 can include a mobile phone, a smart watch, a smart player, a foldable mobile phone, a tablet computer, etc. The specific type of the terminal device 100 is not specially limited in the embodiments of the present application.
[0103] The terminal device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) joint 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor 180, a key 190, an indicator 191, a subscriber identification module (SIM) card interface 192, and a display screen 193, etc.
[0104] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 can include more or fewer components than FIG. 1, or combine certain components, or split certain components, or different component arrangements. The components in FIG. 1 can be implemented in hardware, software, or a combination of software and hardware.
[0105] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0106] The processor 110 can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions.
[0107] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 can be a cache memory. The memory can save instructions or data that the processor 110 has used or used frequently. If the processor 110 needs to use the instructions or data, it can be directly called from the memory. Avoid repeated access and reduce the waiting time of the processor 110, thus improving the efficiency of the system.
[0108] In some embodiments, the processor 110 can include one or more interfaces. The interface can include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a pulse code modulation (PCM) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 can connect modules such as touch sensors, audio modules, wireless communication modules, displays, cameras, etc. through at least one of the above interfaces.
[0109] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the terminal device 100. In some other embodiments of the present application, the terminal device 100 can also use different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0110] The USB connector 130 is a USB standard compliant interface that can be used to connect the terminal device 100 with peripheral devices. The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. The power management module 141 is configured to connect with a battery 142 and the charging management module 140. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display screen 193, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can be integrated into one device.
[0111] The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
[0112] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the terminal device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be integrated into the same device as at least part of the modules of the processor 110.
[0113] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to the loudspeaker 170A and the microphone 170B) or displays images or videos through the display screen 193. In some embodiments, the modem processor can be an independent device. In other embodiments, the modem processor can be integrated into the same device as the mobile communication module 150 or other functional modules independently of the processor 110.
[0114] The wireless communication module 160 can provide solutions for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), near field communication (NFC), and the like, which are applied on the terminal device 100. In some embodiments, the antenna 1 of the terminal device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the terminal device 100 can communicate with the network and other terminal devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), and the like.
[0115] The terminal device 100 can realize the display function through the GPU, the display screen 193, and the application processor, and the like. The GPU is a microprocessor for image processing, which is connected with the display screen 193 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0116] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to realize the expansion of the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, the music, video, and the like are saved in the external memory card. Or the music, video, and the like are transmitted from the terminal device to the external memory card.
[0117] The internal memory 121 can be used to store computer executable program codes including instructions. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function, and the like. The data storage area can store data created during use of the terminal device 100, and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one of a magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 110 executes various function methods or data processing of the terminal device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory disposed in the processor.
[0118] The terminal device 100 can implement an audio function through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. For example, music playing, and the like.
[0119] The sensor 180 can include a pressure sensor, a gyroscope sensor, an acceleration sensor, a proximity light sensor, an ambient light sensor, a touch sensor, an ultrasonic sensor, and the like, for converting various signals from the outside world into electrical signals or other desired forms of information output.
[0120] The gyroscope sensor can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x-axis, y-axis, and z-axis) can be determined by the gyroscope sensor.
[0121] The acceleration sensor can detect the magnitude of acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected.
[0122] The touch sensor, also known as a "touch panel". The touch sensor can be disposed on the display screen 193, and the touch sensor and the display screen 193 together form a touch screen, also known as a "touch screen". The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation can be provided through the display screen 193. In other embodiments, the touch sensor can also be disposed on the surface of the terminal device 100, which is different from the position where the display screen 193 is located.
[0123] The keys 190 can include a power key, a volume key, and the like. The keys 190 can be mechanical keys. They can also be touch keys. The terminal device 100 can receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 100.
[0124] The indicator 191 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate information, a missed call, a notification, and the like.
[0125] Optionally, the terminal device can also include a SIM card interface 192 for connecting a SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 192 to achieve contact and separation with the terminal device 100. The terminal device 100 can support one or more SIM card interfaces 192. The SIM card interface 192 can support a Nano SIM card, a Micro SIM card, a SIM card, and the like. The same SIM card interface 192 can simultaneously insert multiple cards. The types of the multiple cards can be the same or different. The SIM card interface 192 can also be compatible with different types of SIM cards. The SIM card interface 192 can also be compatible with external storage cards.
[0126] The display screen 193 is used to display video interfaces, user setting interfaces, and the like. For example, the display screen 193 can be used to display video content and the like. The display screen 193 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode, and the like. In some embodiments, the display screen can be a foldable or scrollable display screen.
[0127] The software system of the terminal device 100 can adopt a layered architecture. The embodiments of the present application take the Harmony system as an example to exemplarily illustrate the software architecture of the terminal device 100. It should be understood that the scheme provided by the present application can also be applied to Android operating systems, Apple operating systems, Windows operating systems, and the like.
[0128] FIG. 2 is a software structure diagram of the terminal device 100 according to an embodiment of the present application.
[0129] In some embodiments, the Harmony system includes four layers, from bottom to top, a kernel layer, a system basic service layer, a framework layer, and an application layer.
[0130] The Harmony system adopts a multi-kernel design, which optionally includes a Linux kernel, a HongMeng microkernel, and a lightweight Internet of Things operating system (LiteOS) kernel. With this design, devices with different device capabilities can select a suitable system kernel. The kernel layer also includes a kernal abstract layer that provides basic kernel capabilities to other Harmony layers, such as process management, thread management, memory management, file system management, network management, and peripheral management.
[0131] The system foundation service layer is a core capability set of the Harmony system, which supports the Harmony system to provide services to application services through the framework layer in a multi-device deployment scenario. This layer optionally includes the following parts:
[0132] System basic capability subsystem set: provides basic capabilities for distributed applications running, scheduling, migration, and other operations on multiple devices of the Harmony system, and is composed of a distributed software bus, distributed data management and file management, distributed task scheduling, Ark runtime, distributed security and privacy protection, and the like. Among them, the Ark runtime provides a C / C++ / JavaScript multi-language runtime and basic system library, and also provides a runtime for Java programs (i.e., application programs or parts developed using Java language in the framework layer) that are statically compiled using the Ark compiler.
[0133] Basic software service subsystem set: provides common and universal software services for the Harmony system, and is composed of a graphical image, distributed media, distributed AI, multi-modal input, mobile sensing development platform (MSDP) & device virtualization technology (DV), event notification, telephone service, design for X (DFX), and the like. The basic software service subsystem set can be trimmed according to the deployment environment of different device forms, and each subsystem can be trimmed according to the functional granularity.
[0134] Enhanced software service subsystem set (see the enhanced software part in the dashed box in FIG. 2): provides differentiated capability-enhanced software services for different devices for the Harmony system, and is composed of a tablet business software, a smart TV business software, a car machine business software, an Internet of Things (IoT) business software, and the like. The enhanced software service subsystem set can be trimmed according to the deployment environment of different device forms, and each subsystem can be trimmed according to the functional granularity.
[0135] Harmony driver foundation (HDF) and hardware abstraction layer (HAL): is the basis of the hardware ecological opening of the Harmony system, which provides hardware capability abstraction to hardware upwards, and provides various peripheral driver development frameworks and runtime environments downwards.
[0136] Hardware service subsystem set: provides common and adaptive hardware services for the Harmony system, which consists of hardware service subsystems such as generic Sensor, location, power, USB, and biometric identification. The hardware service subsystem set can be tailored according to the deployment environment of different device forms, and each subsystem can be tailored according to the functional granularity.
[0137] Special hardware service subsystem (see the special hardware part in the dashed box in FIG. 2): provides differentiated hardware services for different devices for the Harmony system, which can optionally include tablet-specific hardware services, car-specific hardware services, wearable-specific hardware services, and IoT-specific hardware services. The special hardware service subsystem can be tailored according to the subsystem granularity, and each subsystem can be tailored according to the functional granularity.
[0138] The framework layer provides Java / C / C++ / JavaScript and other multi-language user program frameworks and meta-ability frameworks for the applications of the Harmony system, as well as multi-language framework application programming interfaces (APIs) exposed by various software and hardware services.
[0139] The application layer includes system applications and third-party applications (or extended applications), which can include camera, gallery, calendar, call, drawing application, navigation, WLAN, music, video, short message, and other applications. The applications in the Harmony system are constructed based on atomic ability (AA) and feature ability (FA).
[0140] The following takes a terminal device with the structure shown in FIGS. 1 and 2 as an example to explain the method for detecting a drop in the embodiment of the present application in detail.
[0141] Currently, in order to solve the problem of pocket mis-triggering, the proximity light sensor on the mobile phone is usually used to detect whether the mobile phone is in the pocket, and in the case that the mobile phone is in the pocket, the mobile phone is controlled to display an anti-mis-trigger interface to avoid mis-triggering. However, when the pocket material is dark and fluffy material, the dark and fluffy material may cause the proximity light sensor to "fail"; when the pocket material is light and thin and transparent material, light can easily penetrate the pocket, so that the proximity light sensor cannot accurately identify whether the mobile phone is in the pocket.
[0142] Exemplarily, for the dark and fluffy material, due to their strong absorption of light and the scattering effect of the fluffy, the proximity light sensor is difficult to capture enough light signals from these materials. When the mobile phone is put into the pocket of such material, the light signal received by the proximity light sensor is relatively weak, and even can be lower than the detection threshold of the proximity light sensor. Therefore, the proximity light sensor can not be able to determine whether the mobile phone is in the pocket, resulting in "failure" and easy to appear the problem of missed judgment.
[0143] And for the light and thin and transparent material, such as thin silk, silk, etc., external light can easily penetrate the pocket and shine on the proximity light sensor. When the mobile phone is put into the pocket of such material, the light signal received by the proximity light sensor not only contains the light signal inside the pocket, but also can contain the light signal outside the pocket. Due to the interference of the light signal outside the pocket, it is difficult to distinguish whether the received light signal is from inside or outside the pocket through the proximity light sensor, so it is difficult to accurately determine whether the mobile phone is in the pocket, and it is easy to appear the problem of misjudgment.
[0144] Therefore, the embodiment of the present application provides a pocket detection method applied to a terminal device. The method no longer only relies on a single proximity light sensor to determine whether the terminal device is in the pocket, but comprehensively considers whether the terminal device has a proximity sensor and whether the proximity sensor reports proximity data (the proximity data is used to indicate that the distance between the proximity light sensor and the obstacle is less than or equal to a target distance threshold), and adopts a corresponding detection method to detect whether the terminal device is in the pocket. Wherein, in the case that the proximity light sensor of the terminal device reports the proximity data, the perception information (the perception information includes the first ambient light intensity of the terminal device and / or the posture information of the terminal device) of the terminal device is acquired, and whether the terminal device is in the pocket is determined based on the perception information, to avoid misjudgment and improve the accuracy of determining whether the terminal device is in the pocket. In the case that the proximity light sensor of the terminal device does not report the proximity data, or the terminal device does not have the proximity light sensor, the ultrasonic data of the terminal device is acquired, and whether the terminal device is in the pocket is determined based on the ultrasonic data, to avoid the missed judgment caused by the failure of the proximity light sensor to identify and improve the accuracy of determining whether the terminal device is in the pocket.
[0145] The following through multiple embodiments, the pocket detection method provided by the present application is explained in detail.
[0146] FIG. 3 is a flow diagram of a pocket detection method 300 provided by an embodiment of the present application. The method 300 is applied to a terminal device, which is not limited to the specific order of FIG. 3, and it should be understood that in other embodiments, the order of some steps in the method 300 can be exchanged according to actual needs, or some steps can be omitted or deleted. The method 300 can include S301-S303. Each step is explained in detail below.
[0147] S301, detecting whether the terminal device has a proximity light sensor.
[0148] In one possible implementation, the terminal device can obtain its own sensor list. If the sensor list has identification information of the proximity light sensor, it is determined that the terminal device has the proximity light sensor. If the sensor list does not have the identification information of the proximity light sensor, it is determined that the terminal device does not have the proximity light sensor. The identification information of the proximity light sensor uniquely refers to the proximity light sensor, and the identification information of the proximity light sensor is, for example, the name of the proximity light sensor.
[0149] Wherein, S302 or S303 can be performed after S301.
[0150] S302, in the case that the terminal device has the proximity light sensor and the proximity light sensor reports proximity data, obtaining perception information of the terminal device and determining whether the terminal device is in a pocket based on the perception information.
[0151] Wherein, the perception information includes a first ambient light intensity of the terminal device and / or posture information of the terminal device, and the proximity data is used to indicate that the distance between the proximity light sensor and the obstacle is less than or equal to a target distance threshold. The posture information includes orientation information of the terminal device; or, the posture information includes orientation information and stability information of the terminal device. The orientation information indicates whether the terminal device is in a vertical posture, which is a posture in which the screen of the terminal device is perpendicular or close to perpendicular to the ground. The stability information indicates whether the terminal device is in a stable state. The proximity light sensor of the terminal device reports the proximity data, which indicates that the terminal device has the proximity light sensor (i.e., the terminal device supports under-screen proximity light detection) and the proximity light sensor is not failed.
[0152] In a possible implementation, the proximity light sensor includes one or more light sensing elements (such as a photodiode, a photoresistor, or the like), which are capable of receiving a light signal from an external environment. When the light sensing element receives the light signal, it converts the light signal into an electrical signal by using a photoelectric effect. The intensity of the electrical signal is proportional to the intensity of the received light signal. The change of the electrical signal reflects the change of the distance between the obstacle and the proximity light sensor. Subsequently, corresponding data, such as proximity data or away data, can be generated based on the electrical signal. The away data is used to indicate that the distance between the proximity light sensor and the obstacle is greater than a target distance threshold.
[0153] Exemplarily, the light signal can be converted into a voltage signal, and then the voltage signal can be sequentially amplified and denoised to obtain a processed voltage signal. The voltage represented by the processed voltage signal is compared with a voltage threshold to obtain a comparison result. If the comparison result represents that the voltage is greater than the voltage threshold, it is determined that the obstacle is approaching, and the proximity data is generated. If the comparison result represents that the voltage is less than or equal to the voltage threshold, it is determined that the obstacle is away, and the away data is generated.
[0154] In the embodiments of the present application, in the case that the proximity light sensor of the terminal device reports the proximity data, the perception information of the terminal device can be acquired, wherein the perception information includes a first ambient light intensity and / or posture information of the terminal device. The first ambient light intensity is a value of the light intensity of the environment in which the terminal device is currently located. The perception information of the terminal device can be collected by the terminal device through its own sensor.
[0155] There are two possible cases in which the proximity light sensor of the terminal device reports the proximity data. One case is that the terminal device is in a pocket. The other case is that the terminal device is not in the pocket, and the proximity light sensor is blocked; for example, when the user holds the terminal device, the hand blocks the proximity light sensor, resulting in the reporting of the proximity data, but in fact the terminal device is not put into the pocket. Based on this consideration, the perception information of the terminal device can be acquired, and whether the terminal device is in the pocket is further detected based on the perception information, thereby improving the accuracy of determining whether the terminal device is in the pocket.
[0156] The first ambient light intensity of the terminal device is described in detail below.
[0157] In a possible implementation, the value of the light intensity of the environment in which the terminal device is located, i.e., the first ambient light intensity, can be acquired through the ambient light sensor of the terminal device.
[0158] The internal part of the ambient light sensor can include one or more photosensitive elements (such as a photoresistor, a photosensitive diode, or a photosensitive crystal, etc.), which can convert the received light (photons) into an electrical signal (such as a voltage signal or a current signal) by using a photoelectric effect. The electrical signal can then be amplified, filtered, and the like, and the processed electrical signal is converted into a digital signal. Finally, the digital signal is converted into a specific numerical value representing the intensity of the light, i.e., the first ambient light intensity.
[0159] The following describes in detail the acquisition of the attitude information of the terminal device.
[0160] In a possible implementation, the rotation angular velocity of the terminal device can be acquired by an angular velocity sensor (such as a gyroscope sensor) of the terminal device, and the orientation information and the stability information of the terminal device are determined based on the rotation angular velocity. The attitude information of the terminal device includes the orientation information of the terminal device and the stability information of the terminal device.
[0161] For example, the terminal device is a mobile phone, and the angular velocity data of the mobile phone around its X, Y, and Z axes can be measured by an angular velocity sensor on the mobile phone. The attitude angle of the mobile phone can be obtained by integrating the angular velocity data. The attitude angle includes a pitch angle, a roll angle, and a yaw angle. Subsequently, the orientation information of the mobile phone in space can be determined based on the attitude angle. The orientation information can indicate whether the terminal device is in a vertical attitude, which is an attitude in which the screen of the mobile phone is perpendicular or close to perpendicular to the ground.
[0162] The stability information of the mobile phone can be determined by judging the change of the angular velocity data within a preset time length. The stability information can indicate whether the mobile phone is in a stable state. If the change indicates that the angular velocity data of the mobile phone within the preset time length does not change, or the change amplitude is within a preset amplitude threshold range, it is determined that the stability information is information indicating that the mobile phone is in a stable state. If the change indicates that the angular velocity data of the mobile phone within the preset time length changes, and the change amplitude is greater than the amplitude threshold, it is determined that the stability information is information indicating that the mobile phone is in an unstable state. The amplitude threshold is the maximum amplitude threshold in the preset amplitude threshold range.
[0163] The following describes in detail the determination of whether the terminal device is in a pocket based on the perception information.
[0164] In the embodiments of the present application, it can be determined whether the perception information satisfies the perception condition to obtain a determination result, and whether the terminal device is in a pocket is determined based on the determination result. Wherein:
[0165] In a possible implementation, the perception information is a first ambient light intensity, and the perception condition is that the ambient light intensity is less than or equal to an ambient light intensity threshold. In a case where the first ambient light intensity is less than or equal to the ambient light intensity threshold, it is determined that the perception information satisfies the perception condition, and it is determined that the terminal device is in the pocket. In a case where the first ambient light intensity is greater than the ambient light intensity threshold, it is determined that the perception information does not satisfy the perception condition. In a case where the perception information does not satisfy the perception condition, it is further needed to detect whether the terminal device is in the pocket.
[0166] In another possible implementation, the perception information is posture information, the posture information is orientation information and stability information of the terminal device, and the perception condition is that the posture of the terminal device is a vertical and stable posture. In a case where the posture information of the terminal device indicates that the terminal device is in the vertical and stable posture, it is determined that the perception information satisfies the perception condition, and it is determined that the terminal device is in the pocket. In a case where the posture information of the terminal device indicates that the terminal device is not in the vertical and stable posture, it is determined that the perception information does not satisfy the perception condition. In a case where the perception information does not satisfy the perception condition, it is further needed to detect whether the terminal device is in the pocket.
[0167] In another possible implementation, the perception information is the first ambient light intensity and the posture information, the posture information is orientation information and stability information of the terminal device, the perception condition is that the ambient light intensity is less than or equal to an ambient light intensity threshold, and the posture of the terminal device is a vertical and stable posture. In a case where the first ambient light intensity is less than or equal to the ambient light intensity threshold, and the posture information of the terminal device indicates that the terminal device is in the vertical and stable posture, it is determined that the perception information satisfies the perception condition, and it is determined that the terminal device is in the pocket. In a case where the first ambient light intensity is greater than the ambient light intensity threshold, and the posture information of the terminal device indicates that the terminal device is not in the vertical and stable posture, or in a case where the first ambient light intensity is less than or equal to the ambient light intensity threshold, and the posture information of the terminal device indicates that the terminal device is not in the vertical and stable posture, or in a case where the first ambient light intensity is greater than the ambient light intensity threshold, and the terminal device is in the vertical and stable posture, it is determined that the perception information does not satisfy the perception condition. In a case where the perception information does not satisfy the perception condition, it is further needed to detect whether the terminal device is in the pocket.
[0168] In the above implementations, the terminal device can be determined to be in the pocket when the perception information satisfies the perception condition. Of course, when the perception information satisfies the perception condition, further detection can be performed to determine whether the terminal device is in the pocket. Specifically, when the perception information satisfies the perception condition, a first image is captured by the image capturing component of the terminal device, and when the first image does not contain a target object, the terminal device is determined to be in the pocket, where the target object is an object with a human face.
[0169] For example, the terminal device can be a mobile phone, and the image capturing component can be a camera on the mobile phone, such as a front camera and / or a rear camera. When the perception information satisfies the perception condition, the mobile phone can capture a first image by the image capturing component. Then, face recognition is performed on the first image to determine whether the first image contains a target object. When the first image does not contain a target object, the mobile phone is determined to be in the pocket. When the first image contains a target object, the mobile phone is determined not to be in the pocket. The first image can be, for example, an image within the range of view captured by the image capturing component.
[0170] Optionally, the target object can be an object with a specific human face, such as a target face pre-recorded by the user.
[0171] The above scheme can perform face recognition on the first image to determine whether the first image contains a target object, which can be used as a basis for determining whether the terminal device is being used. When the first image contains a target object, it is determined that the terminal device is being used, and it can be determined that the terminal device is not in the pocket (i.e., the terminal device is not in the pocket state), and the entire pocket detection process can be exited immediately to ensure a smooth and uninterrupted experience for the user when using the terminal device. When the first image does not contain a target object, it is determined that the terminal device is not being used, and it can be determined that the terminal device is in the pocket (i.e., the terminal device is in the pocket state). In this way, the accuracy of determining whether the terminal device is in the pocket is improved.
[0172] The following explains in detail the further detection of whether the terminal device is in the pocket when the perception information does not satisfy the perception condition.
[0173] When the perception information does not satisfy the perception condition, the proximity light sensor can be blocked (non-pocket blocking), and based on this, an ultrasonic sensor similar in function to the proximity light sensor can be used to measure the distance between the terminal device and an obstacle to detect whether the terminal device is in the pocket.
[0174] In the embodiments of the present application, the distance between the terminal device and the obstacle can be detected by the ultrasonic sensor, and it is determined that the terminal device is in the pocket when the distance is less than or equal to the target distance threshold. Of course, the ultrasonic data of the terminal device can also be obtained when the distance is less than or equal to the target distance threshold, and whether the terminal device is in the pocket is determined based on the ultrasonic data, so as to improve the accuracy of determining whether the terminal device is in the pocket. The ultrasonic data can be collected by the ultrasonic sensor of the terminal device, and the ultrasonic data includes at least one of the ultrasonic waveform (such as the reflected wave waveform), the amplitude, the frequency and the like. The distance between the terminal device and the obstacle is calculated by measuring the time difference from the emission to the reception of the ultrasonic wave and combining the sound speed.
[0175] In this paper, the time difference from the emission to the reception of the ultrasonic wave, the ultrasonic waveform (such as the reflected wave waveform), the amplitude or the frequency can be referred to as the ultrasonic data.
[0176] The ultrasonic sensor is composed of an ultrasonic transmitter and an ultrasonic receiver. The ultrasonic transmitter inside the ultrasonic sensor can emit ultrasonic signals of a certain frequency and waveform, which propagate in space and are reflected when encountering the pocket wall or other obstacles to generate reflected waves. The reflected waves can be captured by the ultrasonic receiver of the terminal device. The following describes in detail whether the terminal device is in the pocket based on the ultrasonic data.
[0177] In one possible implementation, the ultrasonic data is the ultrasonic waveform, the amplitude and the frequency, and it is determined that the terminal device is in the pocket when the variation trend of the ultrasonic waveform meets the target variation trend, the variation trend of the amplitude meets the preset amplitude variation trend, and the variation trend of the frequency meets the preset frequency variation trend. Otherwise, it is determined that the terminal device is not in the pocket. The ultrasonic waveform is the reflected wave waveform.
[0178] In one possible implementation, the ultrasonic data is the ultrasonic waveform, and it is determined that the terminal device is in the pocket when the variation trend of the ultrasonic waveform meets the target variation trend. Otherwise, it is determined that the terminal device is not in the pocket. The ultrasonic waveform is the reflected wave waveform.
[0179] The target variation trend is the variation trend of the reflected wave waveform when the terminal device is placed in the pocket. It is determined that the variation trend of the ultrasonic waveform meets the target variation trend when the variation trend of the ultrasonic waveform is consistent with the target variation trend, or when the similarity between the variation trend of the ultrasonic waveform and the target variation trend is greater than or equal to the similarity threshold.
[0180] In another possible implementation, the ultrasonic wave data is a reflected wave waveform, and feature extraction can be performed on the reflected wave waveform to obtain waveform feature information, which is amplitude variation information and waveform distortion information; wherein the waveform distortion information indicates the morphological changes of the reflected wave waveform compared with the transmitted wave waveform. The waveform feature information can be input into a pre-trained classifier, and the classifier can process the waveform feature information to determine whether the terminal device is in the pocket. Wherein, the classifier matches the input waveform feature information with at least one target waveform feature of the terminal device in the pocket, and in the case that the waveform feature information matches the target waveform feature, the classifier can output a judgment result indicating that the terminal device is in the pocket, that is, it can be determined that the terminal device is in the pocket. In the case that the waveform feature does not match the target waveform feature, the classifier can output a judgment result indicating that the terminal device is not in the pocket, that is, it can be determined that the terminal device is not in the pocket.
[0181] Wherein, the classifier is pre-trained by using sample waveform feature information of the terminal device in different states, which includes but is not limited to the terminal device in the pocket and the terminal device not in the pocket (such as on the hand, on the desktop).
[0182] In a possible implementation, the ultrasonic wave waveform is, for example, a reflected wave waveform, and the reflected wave waveform can be directly matched with at least one pocket waveform template (reflected wave waveform template) of the terminal device in the pocket. If there is a template matched with the reflected wave waveform in the at least one pocket waveform template, it is determined that the terminal device is in the pocket. If there is no template matched with the reflected wave waveform in the at least one pocket waveform template, it is determined that the terminal device is not in the pocket.
[0183] In the embodiments of the present application, the determination result of whether the terminal device is in the pocket determined by the ultrasonic sensor can also be used as a preliminary determination result, and then based on the initial determination result, the terminal device is further detected to determine whether it is in the pocket, so as to improve the accuracy of determining whether the terminal device is in the pocket.
[0184] Specifically, in the case that the initial determination result indicates that the terminal device is not in the pocket, no subsequent detection is performed, and the initial determination result is used as the final determination result, that is, it is determined that the terminal device is not in the pocket. In the case that the initial determination result indicates that the terminal device is in the pocket, a first image is acquired by the image acquisition component of the terminal device, and in the case that there is no target object in the first image, it is determined that the terminal device is in the pocket, and the target object is an object with a face. In the case that there is a target object in the first image, it is determined that the terminal device is not in the pocket.
[0185] Exemplarily, the terminal device can be a mobile phone, and the image acquisition component can be a camera on the mobile phone, such as a front camera and / or a rear camera. The mobile phone can acquire an image in a range of view through the image acquisition component, that is, a first image. Then, face recognition is performed on the first image to determine whether the target object exists in the first image. In a case where the target object does not exist in the first image, it is determined that the mobile phone is in the pocket. In a case where the target object exists in the first image, it is determined that the mobile phone is not in the pocket.
[0186] The above solution takes face recognition as a bottom mechanism of pocket detection, can exit the pocket detection process as soon as the target object exists in the first image, to ensure the smooth and interference-free experience of the user in the process of using the terminal device. Moreover, the accuracy of determining whether the terminal device is in the pocket can be improved.
[0187] In a case where the terminal device has a proximity light sensor and the proximity light sensor does not report proximity data, or the terminal device does not have a proximity light sensor, ultrasonic data of the terminal device is acquired, and whether the terminal device is in the pocket is determined based on the ultrasonic data.
[0188] When the terminal device has a proximity light sensor and the proximity light sensor does not report proximity data, the following situations can exist: the distance between the proximity light sensor and the obstacle is greater than the target distance threshold, or the proximity light sensor is invalid, or the proximity light sensor is faulty. The invalidity or the fault of the proximity light sensor can both cause the occurrence of the missing detection problem. In order to avoid the occurrence of the missing detection problem and solve the problem that the terminal device cannot perform pocket detection due to not being equipped with a proximity light sensor in the related art, considering the similarity in function between the proximity light sensor and the ultrasonic sensor, that is, the distance between the terminal device and the obstacle can be measured through the ultrasonic sensor to determine whether the terminal device is in the pocket, and the accuracy of determining whether the terminal device is in the pocket is improved.
[0189] The distance between the terminal device and the obstacle is measured by the ultrasonic sensor to determine whether the terminal device is in the pocket, specifically, the distance between the terminal device and the obstacle is detected by the ultrasonic sensor, and it is determined that the terminal device is in the pocket when the distance is less than or equal to a target distance threshold. Of course, the ultrasonic data of the terminal device can also be obtained when the distance is less than or equal to the target distance threshold, and whether the terminal device is in the pocket is determined based on the ultrasonic data to improve the accuracy of determining whether the terminal device is in the pocket. The ultrasonic data can be collected by the ultrasonic sensor of the terminal device. The ultrasonic data includes at least one of ultrasonic waveform (such as reflected wave waveform), amplitude, frequency, and the like. The distance between the terminal device and the obstacle is calculated by measuring the time difference from the transmission to the reception of the ultrasonic wave and combining the sound speed.
[0190] In the embodiments of the present application, the implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" in S303 is the same as the implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302. For details, please refer to the specific implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302. The embodiments of the present application will not be described here.
[0191] The embodiments of the present application provide a pocket detection method. In the case that the proximity data of the proximity light sensor of the terminal device is reported, the perception information of the terminal device is obtained, and whether the terminal device is in the pocket is determined based on the perception information. The perception information includes the first ambient light intensity of the terminal device and / or the posture information of the terminal device. The proximity data is used to indicate that the distance between the proximity light sensor and the obstacle is less than or equal to a target distance threshold. In the case that the proximity data of the proximity light sensor of the terminal device is not reported, or the terminal device does not have a proximity light sensor, the ultrasonic data of the terminal device is obtained, and whether the terminal device is in the pocket is determined based on the ultrasonic data. In this way, it is no longer determined whether the terminal device is in the pocket only by relying on a single proximity light sensor, but the detection method corresponding to whether the terminal device has a proximity sensor and whether the proximity sensor reports proximity data is considered to detect whether the terminal device is in the pocket, thereby improving the accuracy of determining whether the terminal device is in the pocket. The problem of misjudgment or failure in determining whether the terminal device is in the pocket by the proximity light sensor in the related art is solved.
[0192] It should be understood that the power consumption of each sensor involved in the present application from high to low is in turn: ultrasonic sensor, image acquisition component, ambient light sensor, proximity light sensor, acceleration sensor, angular velocity sensor.
[0193] Exemplarily, the terminal device can have an ultrasonic sensor, an image acquisition component, an ambient light sensor, an acceleration sensor, and an angular velocity sensor. In actual applications, a corresponding sensor can be selected to detect whether the terminal device is in the pocket according to actual conditions. The acceleration sensor or the combination of the acceleration sensor and the angular velocity sensor can determine whether the terminal device performs a pocket-landing action and whether the specific pocket-landing action is an upside-down pocket-landing action or a non-upside-down pocket-landing action.
[0194] In this document, the working principles of the ultrasonic sensor and the proximity light sensor are different, but both can actually perform pocket-landing detection through distance measurement. The power consumption of the ultrasonic sensor is much higher than that of the proximity light sensor. Considering the power consumption, the proximity light sensor is preferentially used for detection when the terminal device has the proximity light sensor; and the ultrasonic sensor is used for detection when the terminal device does not have the proximity light sensor. In any of the following cases, the ultrasonic sensor can be used for re-detection to avoid the problems of false detection or missed detection caused by the failure, malfunction, or possible exposure outside the pocket of the proximity light sensor: the proximity light sensor fails, malfunctions, or is possibly exposed outside the pocket.
[0195] FIG. 4 is a flow diagram of another pocket-landing detection method 400 provided by an embodiment of the present application. The method 400 is a refinement of the method 300 shown in FIG. 3. The method 400 is not limited to the specific order of FIG. 4, and it should be understood that in other embodiments, the order of some steps in the method 400 can be exchanged according to actual needs, or some steps in the method 400 can be omitted or deleted. The method 400 can include 401-407. Each step is explained and described in detail below.
[0196] In the foregoing embodiments, S301 can be implemented by S401-S402.
[0197] S401, detecting whether the terminal device performs a pocket-landing action.
[0198] In the embodiments of the present application, the acceleration sensor of the terminal device can be used to collect acceleration data of the terminal device in a three-dimensional space (X, Y, and Z axes) in real time or periodically. The acceleration data is analyzed to determine whether the terminal device performs a pocket-landing action.
[0199] In a possible implementation, the acceleration data can be analyzed to extract acceleration characteristic information, such as at least one of a peak value of acceleration (that is, an amplitude of maximum or minimum acceleration), a rate of change of direction (indicating a rate at which the direction of the acceleration vector changes), a duration of acceleration, and the like. The acceleration characteristic information can be matched with a plurality of sets of preconfigured pocketing acceleration characteristic information, and if there is characteristic information in the plurality of sets of pocketing acceleration characteristic information that matches the acceleration characteristic information, it is determined that the terminal device performs a pocketing action.
[0200] Of course, the acceleration data can also be compared with reference pocketing acceleration data to obtain a comparison result, and in a case where the comparison result indicates that a difference between the acceleration data and the reference pocketing acceleration data is less than or equal to a preset difference, it is determined that the terminal device performs a pocketing action; otherwise, it is determined that the terminal device does not perform a pocketing action. Alternatively, in a case where the comparison result indicates that a similarity between the acceleration data and the reference pocketing acceleration data is greater than a similarity threshold, it is determined that the terminal device performs a pocketing action; otherwise, it is determined that the terminal device does not perform a pocketing action.
[0201] In another possible implementation, whether the terminal device performs a pocketing action can be determined based on an acceleration waveform, an angular velocity waveform collected by an angular velocity sensor, and a pressure waveform collected by a pressure sensor.
[0202] Specifically, acceleration data of the terminal device in a three-dimensional space (X, Y, and Z axes) is collected by an acceleration sensor of the terminal device to form an acceleration waveform, and each point on the acceleration waveform represents an acceleration value of the terminal device in the three directions at a certain time. Rotational speed data of the terminal device is collected by an angular velocity sensor of the terminal device to form an angular velocity waveform, and external pressure data received by the terminal device is collected by a pressure sensor to form a pressure waveform. Acceleration characteristic information is extracted from the acceleration waveform, such as a peak value of acceleration, a rate of change of direction, and a duration of acceleration. Angular velocity characteristic information is extracted from the angular velocity waveform, and includes at least one of a change in rotational speed, a change in rotational direction, and a duration of rotation. Pressure characteristic information is extracted from the pressure waveform, and includes at least one of a change in pressure and a duration of pressure. The extracted acceleration characteristic information, angular velocity characteristic information, and pressure characteristic information can be input into a pocketing action recognition model, and the input characteristic information is analyzed by the pocketing action recognition model to determine whether the terminal device performs a pocketing action. The pocketing action recognition model is trained by using a neural network algorithm on sample acceleration characteristic information, sample angular velocity characteristic information, and sample pressure characteristic information corresponding to a pocketing action and a non-pocketing action.
[0203] It should be understood that the pocketing action can be a process in which the terminal device is consciously moved from an original position towards a pocket direction and reaches at least a pocket entrance or a nearby area. The pocketing action emphasizes the action of the terminal device moving towards the pocket direction, rather than whether the terminal device is finally successfully pocketed.
[0204] S402, in a case where the terminal device performs a pocketing action, detecting whether the terminal device has a proximity light sensor thereon.
[0205] The pocketing action includes an upside-down pocketing action and a non-upside-down pocketing action. The upside-down pocketing action can be understood as a pocketing action with the head (i.e., the top) facing downwards. The non-upside-down pocketing action can be a pocketing action with the head (i.e., the top) facing upwards. The non-upside-down pocketing action can also be a pocketing action other than the upside-down pocketing action and the pocketing action with the head (i.e., the top) facing upwards.
[0206] In the embodiments of the present application, in a case where the terminal device does not perform a pocketing action, a process of detecting whether the terminal device is in a pocket can not be started. In a case where the terminal device performs a pocketing action, the process of detecting whether the terminal device is in a pocket is started, which can reduce system power consumption and improve user experience. The detection of whether the terminal device has a proximity light sensor thereon is a primary step in the process of detecting whether the terminal device is in a pocket.
[0207] Optionally, the position where the proximity light sensor is arranged is the head or the top, and the top can also be provided with an ambient light sensor.
[0208] Exemplarily, the upside-down pocketing action is a process in which a mobile phone is moved at least to a pocket entrance or a nearby area in a posture with the top away from the pocket entrance. The non-upside-down pocketing action is a process in which a mobile phone is moved at least to a pocket entrance or a nearby area in a posture with the top not away from the pocket entrance, for example, a process in which a mobile phone is moved at least to a pocket entrance or a nearby area in a posture with the top close to the pocket entrance.
[0209] It should be noted that the implementation process of S402, i.e., detecting whether the terminal device has a proximity light sensor thereon, is the same as that of S301, i.e., detecting whether the terminal device has a proximity light sensor thereon. For details, refer to the implementation process of S301, which will not be described herein again.
[0210] S302 in the foregoing embodiments can be implemented by S403, and S303 in the foregoing embodiments can be implemented by S405, S406 and S407. Any one of S403, S404, S405, S406 and S407 can be executed after S402.
[0211] S403, in the case that the terminal device performs an upside-down bag-falling action and the proximity light sensor reports proximity data, obtaining perception information of the terminal device and determining whether the terminal device is in a pocket based on the perception information. The bag-falling action includes the upside-down bag-falling action.
[0212] In the embodiments of the present application, the position where the proximity light sensor is arranged is represented as a head or a top, and the head (i.e. the top) can also be provided with an ambient light sensor. In the case that the terminal device performs an upside-down bag-falling action (a bag-falling action with the top down) and the proximity light sensor reports proximity data, it can be indicated that the terminal device can be in a pocket, and the proximity light sensor and the ambient light sensor are not exposed outside the pocket. At this time, the perception information of the terminal device can be obtained, and whether the terminal device is in a pocket can be further determined based on the perception information. In this way, the reliability and accuracy of obtaining the perception information by the ambient light sensor and detecting whether the terminal device is in a pocket based on the perception information can be improved. The perception information at least includes the first ambient light intensity.
[0213] Moreover, in the case that the terminal device performs an upside-down bag-falling action and the proximity light sensor reports proximity data, the perception information is obtained and whether the terminal device is in a pocket is determined based on the perception information, which avoids frequent collection of perception information for bag-falling detection, reduces system power consumption, and improves user experience.
[0214] The determination of whether the terminal device is in a pocket based on the perception information can be implemented in the following ways:
[0215] In the case that the perception information satisfies a perception condition, it is determined that the terminal device is in a pocket; or
[0216] In the case that the perception information satisfies a perception condition, a first image collected by an image collection component of the terminal device is obtained, and in the case that a target object does not exist in the first image, it is determined that the terminal device is in a pocket, the target object being an object with a face;
[0217] In the case that the perception information does not satisfy a perception condition, ultrasonic data of the terminal device is obtained, and whether the terminal device is in a pocket is determined based on the ultrasonic data.
[0218] It should be noted that the implementation process of these ways is the same as the implementation process of the aforementioned "determination of whether the terminal device is in a pocket based on the perception information" in S302 in the foregoing embodiments. For details, refer to the specific implementation process of "determination of whether the terminal device is in a pocket based on the perception information" in S302, which will not be described herein again.
[0219] In the above-mentioned ways, in the case that the perception information satisfies a perception condition, it can be determined that the terminal device is in a pocket.
[0220] Of course, the first image can also be collected when the perception information meets the perception condition, and face recognition is performed on the first image to determine whether the target object exists in the first image, as a basis for determining whether the terminal device is used. If there is no target object in the first image, it indicates that the terminal device is not used by the user, and it can be determined that the terminal device is in the pocket. If there is a target object in the first image, it indicates that the terminal device is used by the user, and it can be determined that the terminal device is not in the pocket. In this way, face recognition is used as a bottom mechanism for pocket detection. If there is a target object in the first image, the pocket detection process is exited immediately to ensure a smooth and interference-free experience for the user during use of the terminal device. Moreover, the accuracy of determining whether the terminal device is in the pocket can be improved.
[0221] In the embodiments of the present application, the perception information at least includes the first ambient light intensity. If the perception information does not meet the perception condition, the following situations can exist:
[0222] The first situation: the terminal device is not in the pocket, and the proximity sensor reports proximity data due to some reasons (such as dust, dirt obstruction, etc.). The ambient light sensor detects the light intensity outside the pocket, and thus determines that the perception information does not meet the perception condition.
[0223] The first situation: the terminal device is in the pocket, and the proximity sensor reports proximity data in the pocket. However, the ambient light sensor can be disturbed by the light outside the pocket, resulting in failure to correctly detect the low-light environment inside the pocket, and thus determining that the perception information does not meet the perception condition.
[0224] Based on this, considering the possibility that the proximity light sensor is blocked by non-pocket, an ultrasonic sensor similar to the proximity light sensor can be considered to re-detect the distance between the terminal device and the obstacle to determine whether the terminal device is in the pocket, thereby improving the accuracy of determining whether the terminal device is in the pocket.
[0225] The distance between the terminal device and the obstacle is measured by the ultrasonic sensor to determine whether the terminal device is in the pocket, specifically: the distance between the terminal device and the obstacle is detected by the ultrasonic sensor, and in a case where the distance is less than or equal to a target distance threshold, it is determined that the terminal device is in the pocket. Of course, in the case where the distance is less than or equal to the target distance threshold, the ultrasonic data of the terminal device can also be obtained, and whether the terminal device is in the pocket is determined based on the ultrasonic data, to improve the accuracy of determining whether the terminal device is in the pocket. The ultrasonic data can be collected by the ultrasonic sensor of the terminal device; the ultrasonic data includes at least one of ultrasonic waveform (such as reflected wave waveform), amplitude, frequency, etc. The distance between the terminal device and the obstacle is calculated by measuring the time difference from the transmission to the reception of the ultrasonic wave, and combining the sound velocity.
[0226] In the embodiments of the present application, the implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" in S403 is the same as the implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302, and the specific implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302 can be referred to, and the embodiments of the present application will not be repeated here.
[0227] S404, in a case where the terminal device performs a non-inverted bag-falling action and the proximity light sensor reports proximity data, a first image is collected by the image collection component of the terminal device, and in a case where there is no target object in the first image, it is determined that the terminal device is in the pocket, and the target object is an object with a face.
[0228] The position of the proximity light sensor is indicated as the head or the top.
[0229] In the embodiments of the present application, in a case where the terminal device performs a non-inverted bag-falling action and the proximity light sensor reports proximity data, the following situations can exist:
[0230] The first situation can be: the terminal device is in the pocket, and the proximity light sensor reports the proximity data because of the pocket shielding;
[0231] The second case can be: the terminal device is not in the pocket and the proximity light sensor of the terminal device is blocked, which means non-pocket blocking. Wherein, the terminal device is, for example, a mobile phone, and the user is putting the mobile phone into the pocket, just when the mobile phone is put into the entrance of the pocket, someone talks to the user, and the user pauses the putting action and holds the mobile phone; Wherein, the user's hand blocks the proximity light sensor when holding the mobile phone. In this process, the mobile phone detects that the non-inverted bag falling action occurs and the proximity data is reported by the proximity light sensor, but in fact the mobile phone is not in the pocket. Wherein, the non-inverted bag falling action can be that the mobile phone is moved to the entrance of the pocket with the top close to the entrance of the pocket.
[0232] Wherein, the top can also be provided with an ambient light sensor, and in the non-inverted bag falling action, if the terminal device is in the pocket, the ambient light sensor also has the risk of being exposed outside the pocket.
[0233] The above scheme, the proximity light sensor reports the proximity data, which means that the proximity light sensor is not failed, and the ambient light sensor may be exposed outside the pocket. Moreover, since the ultrasonic sensor has high power consumption, in the case that the proximity light sensor is not failed, the ultrasonic sensor can not be used for detection. Based on these considerations, in order to determine whether the terminal device is in the pocket, a first image can be acquired by the image acquisition component, and face recognition is performed on the first image to determine whether there is a target object in the first image as a basis for whether the terminal device is used. If there is no target object in the first image, it indicates that the terminal device is not used by the user, and it can be determined that the terminal device is in the pocket. If there is a target object in the first image, it indicates that the terminal device is used by the user, and it can be determined that the terminal device is not in the pocket. In this way, the accuracy of determining whether the terminal device is in the pocket is improved.
[0234] Moreover, the first image is acquired and the face recognition is performed on the first image only in the case that the terminal device has a non-inverted bag falling action and the proximity light sensor reports the proximity data. In this way, the problem of high power consumption of the terminal device caused by frequent acquisition of the first image and face recognition on the first image can be avoided.
[0235] Wherein, the first image is acquired by the image acquisition component in a low-power mode. Wherein, acquiring an image in a low-power mode can be understood as acquiring an image in low-light conditions, or acquiring an image by passively receiving light brightness through a camera. In this way, the overall power consumption of the bag falling detection is reduced, and the user experience is improved.
[0236] S405, in the case that the terminal device has a non-inverted bag falling action and the proximity light sensor does not report the proximity data, ultrasonic data of the terminal device is acquired and whether the terminal device is in the pocket is determined based on the ultrasonic data.
[0237] The position where the proximity light sensor is arranged is referred to as a head or a top.
[0238] In the embodiments of the present application, the terminal device performs a non-inverted bag-falling action, and the proximity light sensor does not report proximity data. This may be due to the following situations:
[0239] The first situation: the terminal device may be in the pocket, and the proximity light sensor may be faulty or exposed outside the pocket.
[0240] The second situation: the terminal device is not in the pocket. For example, the user is putting the mobile phone into the pocket, and the mobile phone is just put into the pocket entrance when the user is interrupted by an emergency. If the proximity light sensor is not blocked by the user's hand, the proximity light sensor will not report proximity data. The non-inverted bag-falling action can be the process of moving the mobile phone to the pocket entrance with the top close to the pocket entrance.
[0241] Based on the above situations, considering that the proximity light sensor may be faulty or exposed outside the pocket, and the ambient light sensor may also be exposed outside the pocket, an ultrasonic sensor similar in function to the proximity light sensor can be used to measure the distance between the terminal device and the obstacle to determine whether the terminal device is in the pocket. In this way, the problem of missed detection due to the proximity light sensor being faulty or exposed outside the pocket is avoided, and the accuracy of determining whether the terminal device is in the pocket is improved.
[0242] The distance between the terminal device and the obstacle is measured by the ultrasonic sensor to determine whether the terminal device is in the pocket. Specifically, the distance between the terminal device and the obstacle is detected by the ultrasonic sensor, and if the distance is less than or equal to a target distance threshold, it is determined that the terminal device is in the pocket. Of course, the ultrasonic data of the terminal device can also be obtained if the distance is less than or equal to the target distance threshold, and whether the terminal device is in the pocket is determined based on the ultrasonic data to improve the accuracy of determining whether the terminal device is in the pocket. The ultrasonic data can be collected by the ultrasonic sensor of the terminal device. The ultrasonic data includes at least one of the ultrasonic waveform (such as the reflected wave waveform), the amplitude, the frequency, and the like. The distance between the terminal device and the obstacle is calculated by measuring the time difference between the emission and reception of the ultrasonic wave, and combining the sound speed.
[0243] In the embodiments of the present application, the implementation process of "obtaining ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data" in S405 is the same as the implementation process of "obtaining ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302. For details, refer to the specific implementation process of "obtaining ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302. The embodiments of the present application will not be described here.
[0244] S406, in the case that the terminal device has a non-inverted bag-falling action and the terminal device does not have a proximity light sensor, obtaining ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data.
[0245] In the embodiments of the present application, in the case that the terminal device has a non-inverted bag-falling action, the case that the terminal device does not have a proximity light sensor is considered. In this case, an ultrasonic sensor similar in function to the proximity light sensor is used to measure the distance between the terminal device and the obstacle to determine whether the terminal device is in the pocket. This can avoid relying too much on the proximity light sensor to detect whether the terminal device is in the pocket, and overcome the limitation in the related art that the proximity light sensor is relied on too much to detect whether the terminal device is in the pocket. (For example, the terminal device cannot be detected whether it is in the pocket when it does not have a proximity light sensor), and improve the versatility and accuracy of detecting whether the terminal device is in the pocket.
[0246] In the embodiments of the present application, in the case that the terminal device has a non-inverted bag-falling action, the case that the terminal device does not have a proximity light sensor is considered. In this case, an ultrasonic sensor similar in function to the proximity light sensor is used to measure the distance between the terminal device and the obstacle to determine whether the terminal device is in the pocket. This can avoid relying too much on the proximity light sensor to detect whether the terminal device is in the pocket, and overcome the limitation in the related art that the proximity light sensor is relied on too much to detect whether the terminal device is in the pocket. (For example, the terminal device cannot be detected whether it is in the pocket when it does not have a proximity light sensor), and improve the versatility and accuracy of detecting whether the terminal device is in the pocket.
[0247] In the embodiments of the present application, the implementation process of "obtaining the ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data" in S406 is the same as the implementation process of "obtaining the ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302. For details, refer to the specific implementation process of "obtaining the ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302. The embodiments of the present application will not be described here.
[0248] S407, in the case that the terminal device performs the upside-down bag-falling action, and the proximity light sensor does not report the proximity data, obtaining the ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data.
[0249] In the embodiments of the present application, in the case that the terminal device performs the upside-down bag-falling action (the top-down bag-falling action), and the proximity light sensor does not report the proximity data, the following situations may exist:
[0250] The first situation: the terminal device may be in the pocket, and the proximity light sensor may be faulty or the proximity light sensor may be invalid.
[0251] The second situation: the terminal device is outside the pocket, that is, the terminal device is not in the pocket. For example, in the process of putting the mobile phone into the pocket, the user is interrupted by an emergency event just after putting the mobile phone into the pocket, and the proximity light sensor is not blocked by the user's hand. Therefore, the proximity light sensor does not report the proximity data.
[0252] Based on the above situations, considering the risk that the proximity light sensor may be faulty or invalid, it is not accurate to determine whether the terminal device is in the pocket by only using the proximity light sensor to detect the terminal device in the case that the terminal device performs the non-upside-down bag-falling action. Therefore, an ultrasonic sensor similar in function to the proximity light sensor can be used to measure the distance between the terminal device and the obstacle, so as to determine whether the terminal device is in the pocket. In this way, the problem of missed detection caused by the invalidity or failure of the proximity light sensor is avoided, and the accuracy of determining whether the terminal device is in the pocket is improved.
[0253] The distance between the terminal device and the obstacle is measured by the ultrasonic sensor to determine whether the terminal device is in the pocket, specifically: the distance between the terminal device and the obstacle is detected by the ultrasonic sensor, and in a case where the distance is less than or equal to a target distance threshold, it is determined that the terminal device is in the pocket. Of course, in the case where the distance is less than or equal to the target distance threshold, the ultrasonic data of the terminal device can also be obtained, and whether the terminal device is in the pocket is determined based on the ultrasonic data, to improve the accuracy of determining whether the terminal device is in the pocket. The ultrasonic data can be collected by the ultrasonic sensor of the terminal device; the ultrasonic data includes at least one of ultrasonic waveform (such as reflected wave waveform), amplitude, frequency, etc. The distance between the terminal device and the obstacle is calculated by measuring the time difference from the transmission to the reception of the ultrasonic wave, and combining the sound speed.
[0254] In the embodiments of the present application, the implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" in S407 is the same as the implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302, and the specific implementation process of "obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data" involved in S302 can be referred to, and the present application embodiment will not be described here.
[0255] It should be noted that the description of the same steps and the same content in the embodiments of the present application and other embodiments can refer to the description in other embodiments, and will not be described here.
[0256] The embodiments of the present application provide a pocket detection method for detecting whether the terminal device has a pocket action, and starting the process of "detecting whether the terminal device is in the pocket" when the terminal device has a pocket action. After the terminal device has a pocket action, it is determined which pocket action the terminal device has (inverted pocket action or non-inverted pocket action), whether there is a proximity sensor, and whether the proximity sensor reports proximity data, to determine the possible risks of the proximity sensor (such as failure, malfunction, and exposure outside the pocket (referring to the risk of the proximity sensor being exposed outside the pocket when the terminal device is in the pocket)), and the possible risks of the ambient light sensor (such as the risk of the ambient light sensor being exposed outside the pocket when the terminal device is in the pocket and the pocket is small). Based on the determined factors, the corresponding sensor is used to further detect whether the terminal device is in the pocket, which improves the accuracy of pocket detection and solves the problem of misjudgment or missed detection in related technologies when determining whether the terminal device is in the pocket by the proximity light sensor.
[0257] FIG. 5 is a flow diagram of another pocket detection method 500 provided by the embodiments of the present application. The method 500 is not limited to the specific order of FIG. 5, and it should be understood that in other embodiments, the order of some steps of the method 500 can be exchanged with each other according to actual needs, or some steps of the method 500 can be omitted or deleted. The method 500 can include 501-503. Each step is explained in detail below.
[0258] S501, obtaining touch information of a touch screen of the terminal device.
[0259] The touch information includes at least one of a touch position, a touch area, and a touch duration.
[0260] In the embodiments of the present application, the touch position refers to the specific position of the touch on the touch screen. The touch area refers to the size of the area in contact with the screen when the screen is touched. The touch duration refers to the duration of touching the touch screen.
[0261] In a possible implementation, the touch screen can be a capacitive touch screen. The touch information of the touch screen of the terminal device can be determined by detecting the change of the capacitance on the touch screen of the terminal device. For example, the area of the touch screen can be divided into multiple sub-areas, and the change of the capacitance of which sub-area is detected to determine the touch position. The touch area is determined by measuring the range and intensity of the change of the capacitance. The touch duration is determined by monitoring the duration of the change of the capacitance.
[0262] In the embodiments of the present application, it can be determined whether the touch information meets the pocket touch condition, and whether the terminal device is in the pocket based on the determination result.
[0263] For example, the pocket touch condition is that the touch area is less than or equal to a touch area threshold or the touch position is within a target touch area and the touch duration is less than a preset duration.
[0264] For example, when the touch information does not meet the pocket touch condition, it is determined that the terminal device is not in the pocket. When the touch information meets the pocket touch condition, it is possible that the pocket touch, and the terminal device can be further detected to be in the pocket to improve the accuracy of determining whether the terminal device is in the pocket.
[0265] For example, the touch information of the touch screen of the terminal device obtained is the touch area. When the touch area is greater than the touch area threshold, it is determined that the touch information does not meet the pocket touch condition, and it is determined that the terminal device is not in the pocket.
[0266] S502, in the case where the touch information meets the pocket touch condition, a first image is collected by an image collection component of the terminal device.
[0267] In the embodiment of the present application, if the touch information meets the pocket touch condition, it is determined that the touch information is likely to be generated by pocket touch, and a first image can be acquired by the image acquisition component of the terminal device, and face recognition is performed on the first image to further determine whether the terminal device is in the pocket. If there is a target object in the first image, it indicates that the terminal device is being used or is about to be used by the user, and it is determined that the terminal device is not in the pocket.
[0268] S503, if there is no target object in the first image, it is determined that the terminal device is in the pocket, and the target object is an object with a face.
[0269] It should be noted that the same steps and the same content in the embodiments of the present application can refer to the description in other embodiments, and will not be repeated here.
[0270] The embodiment of the present application provides a pocket detection method, acquires touch information of a touch screen of a terminal device; in the case that the touch information meets the pocket touch condition, a first image is acquired by an image acquisition component of the terminal device; in the case that there is no target object in the first image, it is determined that the terminal device is in the pocket, and the target object is an object with a face. In this way, the touch behavior is first identified as pocket touch or non-pocket touch through touch information, in the case that the touch behavior is identified as pocket touch, a first image is acquired by the image acquisition component of the terminal device, and in the case that there is no target object in the first image, it is determined that the terminal device is in the pocket, thereby improving the accuracy of determining whether the terminal device is in the pocket.
[0271] FIG. 6 is a flowchart of a pocket detection method 600 provided by another embodiment of the present application. The method 600 is a refinement of the method 500 shown in FIG. 5, and the method 600 is not limited to the specific order of FIG. 6. It should be understood that in other embodiments, the order of some steps in the method 600 can be exchanged according to actual needs, or some steps in the method 600 can be omitted or deleted. The method 600 can include 601-604. Each step will be explained and described in detail below.
[0272] S601, detecting whether a pocket action of a terminal device occurs.
[0273] It should be noted that the implementation process of S601 and the implementation process of S401 can refer to the specific implementation process of S401, and the embodiments of the present application will not be repeated here.
[0274] S602, in the case that the pocket action of the terminal device occurs, acquiring touch information of a touch screen of the terminal device.
[0275] The touch information includes at least one of a touch position, a touch area, and a touch duration.
[0276] It should be noted that the process of obtaining the touch information of the touch screen of the terminal device in S602 is the same as that of S501, and the specific implementation process can be referred to the specific implementation process of S501, and the embodiments of the present application will not be repeated here.
[0277] S603, in the case that the touch information meets the pocket touch condition, collecting a first image by the image collection component of the terminal device.
[0278] S604, in the case that the target object does not exist in the first image, determining that the terminal device is in the pocket, and the target object is an object with a face.
[0279] It should be noted that the same steps and the same content in the embodiments of the present application and other embodiments can be referred to the description in other embodiments, and will not be repeated here.
[0280] The embodiments of the present application provide a pocket detection method, which detects whether the terminal device has a pocket action, and starts the process of detecting whether the terminal device is in the pocket in the case that the terminal device has the pocket action. The process includes identifying whether the touch behavior is a pocket touch or a non-pocket touch by the touch information, collecting a first image by the image collection component of the terminal device in the case that the touch behavior is identified as the pocket touch, and determining that the terminal device is in the pocket in the case that the first image has a face, which improves the accuracy of determining whether the terminal device is in the pocket.
[0281] FIG. 7 is a flowchart of another pocket detection method 700 provided by another embodiment of the present application. The method 700 is applied to a terminal device, and the terminal device is taken as a mobile phone as an example. The method 700 is not limited to the specific order of FIG. 7, and it should be understood that in other embodiments, the order of some steps in the method 700 can be exchanged according to actual needs, or some steps in the method 700 can be omitted or deleted. The method 700 can include 701-708. The steps will be explained in detail below.
[0282] S701, detecting whether the mobile phone has a pocket action.
[0283] In the embodiments of the present application, the subsequent detection process is not started in the case that the mobile phone does not have the pocket action.
[0284] S702, in the case that the mobile phone has the pocket action, determining whether the mobile phone has a proximity light sensor.
[0285] Wherein, either one of S703 and S704b is executed in the case that the mobile phone does not have the proximity light sensor. S704a is executed in the case that the mobile phone has the proximity light sensor.
[0286] S703, obtaining touch information, and determining whether the touch information meets a pocket touch condition.
[0287] In the case that the touch information meets the pocket touch condition, S708 is executed. In the case that the touch information does not meet the pocket touch condition, it can be determined that the mobile phone is not in the pocket.
[0288] It should be noted that the implementation process of S703 is the same as that of "obtaining touch information, and determining whether the touch information meets a pocket touch condition" in the embodiment corresponding to FIG. 5, and details can be referred to the specific implementation process of "obtaining touch information, and determining whether the touch information meets a pocket touch condition" in the embodiment corresponding to FIG. 5, which will not be repeated here.
[0289] S704a, whether the mobile phone has a head-down pocket-putting-in action.
[0290] In the embodiment of the present application, the head-down pocket-putting-in action can be understood as a top-down pocket-putting-in action, or an upside-down pocket-putting-in action. Wherein, the head (top) is the position of the proximity light sensor on the mobile phone. Wherein, the head-down pocket-putting-in action can be specifically that the mobile phone is at least moved to the pocket entrance or the nearby area with the head (top) close to the pocket entrance.
[0291] Wherein, S705a is executed in the case that the mobile phone has the head-down pocket-putting-in action. S705b is executed in the case that the mobile phone does not have the head-down pocket-putting-in action.
[0292] It should be noted that the implementation process of S704a is the same as that of "whether the terminal device has an upside-down pocket-putting-in action" in the embodiment corresponding to FIG. 4, and details can be referred to the specific implementation process of "whether the terminal device has an upside-down pocket-putting-in action" in the embodiment corresponding to FIG. 4, which will not be repeated here.
[0293] S704b, determining whether the mobile phone has a head-down pocket-putting-in action.
[0294] Wherein, S707b is executed in the case that it is determined that the mobile phone has the head-down pocket-putting-in action.
[0295] It should be noted that the implementation process of S704b is the same as that of "whether the terminal device has an upside-down pocket-putting-in action" in the embodiment corresponding to FIG. 4, and details can be referred to the specific implementation process of "whether the terminal device has an upside-down pocket-putting-in action" in the embodiment corresponding to FIG. 4, which will not be repeated here.
[0296] In S704a and S704b, although the steps are the same, the steps executed after S705a and the steps executed after S705b are different.
[0297] S705a, determine whether the proximity light sensor on the mobile phone reports proximity data.
[0298] In the case where it is determined that the proximity light sensor on the mobile phone reports proximity data, S706 is executed. In the case where it is determined that the proximity light sensor on the mobile phone does not report proximity data, S707a is executed.
[0299] S705b, determine whether the proximity light sensor on the mobile phone reports proximity data.
[0300] In the case where it is determined that the proximity light sensor on the mobile phone reports proximity data, S708 is executed. In the case where it is determined that the proximity light sensor on the mobile phone does not report proximity data, S707a is executed.
[0301] It should be noted that, although S704a and S704b have the same steps, the steps executed after S705a and the steps executed after S705b are different.
[0302] S706, determine whether the ambient light and the posture of the mobile phone meet the pocket feature.
[0303] In the case where it is determined that the ambient light and the posture of the mobile phone meet the pocket feature, S708 is executed. In the case where the ambient light and the posture of the mobile phone do not meet the pocket feature, S707a is executed.
[0304] In the case where it is determined that the ambient light and the posture of the mobile phone meet the pocket feature, S708 is executed. In the case where the ambient light and the posture of the mobile phone do not meet the pocket feature, S707a is executed.
[0305] Exemplarily, the pocket feature can be the perception condition in the foregoing embodiments, which can be, for example, that the ambient light intensity is less than or equal to the ambient light intensity threshold value, and the posture of the mobile phone is a vertical and stable posture.
[0306] S707a, detect the distance between the mobile phone and the obstacle through the ultrasonic sensor, and determine whether the distance is less than or equal to a target distance threshold value.
[0307] In the case where the distance is less than or equal to the target distance threshold value, S708 is executed. In the case where the distance is greater than the target distance threshold value, it is determined that the mobile phone is not in the pocket.
[0308] S707b, detect the distance between the mobile phone and the obstacle through the ultrasonic sensor, and determine whether the distance is less than or equal to a target distance threshold value.
[0309] If the distance is less than or equal to the target distance threshold, S708 is performed. If the distance is greater than the target distance threshold, it is determined that the mobile phone is not in the pocket.
[0310] S708, an image (i.e., a first image) is captured by the camera of the mobile phone, and it is determined whether the image has a face. If the image has a face, it is determined that the mobile phone is not in the pocket. If the image does not have a face, it is determined that the mobile phone is in the pocket.
[0311] The above method can use the falling-into-pocket action as a trigger condition for starting the detection of whether the mobile phone is in the pocket, thereby ensuring the timeliness and pertinence of the detection process. In the detection process, if there is no proximity light sensor or the proximity light sensor is invalid, fails, or is possibly exposed outside the pocket or is blocked by a non-pocket, considering the similarity in function between the proximity light sensor and the ultrasonic sensor, the ultrasonic sensor can be used for detection, thereby improving the reliability and accuracy of the falling-into-pocket detection. Moreover, in the case where the mobile phone is detected to be in the pocket by other sensors, face recognition is introduced as a bottom mechanism for the falling-into-pocket detection, so that if it is determined by face recognition that the user is using the mobile phone, the falling-into-pocket detection process is exited immediately, thereby ensuring the smooth and interference-free experience of the user in the process of using the mobile phone. If it is determined by face recognition that the user is not using the mobile phone, it is determined that the mobile phone is in the pocket. In this way, the accuracy and robustness of the falling-into-pocket detection are enhanced.
[0312] It should be noted that the descriptions of the same steps and the same contents in the embodiments of the present application and in other embodiments can refer to the descriptions in other embodiments, which will not be described here again.
[0313] The embodiment of the present application provides a falling-into-pocket detection method for detecting whether the mobile phone has a falling-into-pocket action. If the mobile phone has a falling-into-pocket action, the process of detecting whether the mobile phone is in the pocket is started. In the case where the mobile phone has a falling-into-pocket action, considering the specific falling-into-pocket action of the mobile phone, whether there is a proximity sensor, and whether the sensor reports proximity data when there is a sensor, the corresponding detection method is used to detect whether the mobile phone is in the pocket, thereby improving the accuracy of determining whether the mobile phone is in the pocket.
[0314] FIG. 8 is a flow diagram of another falling-into-pocket detection method 800 provided by another embodiment of the present application. The method 800 can be performed after it is determined that the terminal device is in the pocket, for example, the method 800 can be performed after it is determined by the above method 300, method 400, method 500, method 600, or method 700 that the terminal device is in the pocket; of course, it can also be applied to be performed after it is determined by other methods that the terminal device is in the pocket. The method 800 includes S801-S802. The steps will be explained in detail below.
[0315] S801, determine a scene in which the terminal device is located in a case where the terminal device is in a pocket.
[0316] The terminal device in S801 being in the pocket can be detected by the terminal device.
[0317] In the embodiments of the present application, the scene in which the terminal device is located can be determined based on the current interface of the terminal device. The scene in which the terminal device is located can be divided into two, which are a first scene and a second scene. The first scene can be an operation continuity scene, and the second scene is a video playing scene and a target scene. The target scene can be a scene other than the operation continuity scene and the video playing scene. In terms of operation continuity, the operation continuity scene is stronger than the video playing scene, and the video playing scene is stronger than the target scene.
[0318] The operation continuity scene refers to an interactive environment and situation between the user and the current interface that can be real-time, bidirectional, and highly involved. This kind of scene has very high requirements for operation continuity and timeliness, and interruption (i.e. being interrupted) has a greater impact on user experience. The operation continuity scene can be, for example, a payment scene, a game scene, etc.
[0319] The video playing scene refers to a specific environment and situation in which the user receives and enjoys multimedia entertainment resources through the terminal device. This kind of scene integrates various media elements such as images, audio, subtitles, etc.
[0320] The target scene includes but is not limited to reading an electronic book, browsing a webpage, online learning, remote office work, or a social chat scene, etc.
[0321] The following explains in detail the determination of the scene in which the terminal device is located based on the current interface of the terminal device.
[0322] In one possible implementation, in a case where the current interface of the terminal device has at least one of a two-dimensional code for payment or collection, a bar code for payment or collection, a payment control (such as a button for submitting an order), etc., it is determined that the terminal device is located in a payment scene.
[0323] In another possible implementation, in a case where the current interface of the terminal device has game-specific visual elements and / or game-specific interaction methods, it is determined that the terminal device is located in a game scene. Or, in a case where the current interface of the terminal device is a game APP interface, it is determined that the terminal device is located in a game scene.
[0324] Exemplarily, an image recognition technology is adopted to detect the content of the current interface of the terminal device, to determine whether there is a visual element specific to a game on the current interface, such as information including a character, a game user interface (UI) element, a scene background, and the like. Subsequently, the manner in which the user interacts with the current interface is analyzed, to observe whether there is a game-specific operation feedback, such as character movement, attack effect, sound effect, and the like. If all of them exist, it is determined that the scenario in which the terminal device is located is a game scenario.
[0325] In another possible implementation, in a case where the current interface of the terminal device is an interface of an APP of a video playing type, it is determined that the scenario in which the terminal device is located is a video scenario.
[0326] S802, based on the scenario in which the terminal device is located, determining whether to control the terminal device to display the anti-mistouch interface.
[0327] In an embodiment of the present application, at least one scenario identifier corresponding to the anti-mistouch interface is pre-stored in the terminal device, and the identifier of the scenario in which the terminal device is located can be matched with the at least one scenario identifier corresponding to the anti-mistouch interface. In a case where there is a scenario identifier in the at least one scenario identifier that matches the identifier of the scenario in which the terminal device is located, it is determined to control the terminal device to display the anti-mistouch interface. In a case where there is no scenario identifier in the at least one scenario identifier that matches the identifier of the scenario in which the terminal device is located, it is determined not to control the terminal device to display the anti-mistouch interface.
[0328] S802 can be implemented in the following manner:
[0329] In a case where the scenario is a first scenario, it is determined not to control the terminal device to display the anti-mistouch interface. In a case where the scenario is a second scenario, it is determined to control the terminal device to display the anti-mistouch interface. The first scenario and the second scenario are different. In terms of operation continuity, the first scenario is higher than the second scenario.
[0330] In an embodiment of the present application, in a case where the scenario in which the terminal device is located is a first scenario, the terminal device can not be controlled to display the anti-mistouch interface. That is, the original interface of the terminal device is maintained, and neither the screen is locked nor the anti-mistouch interface is displayed, so that the terminal device can respond to a touch / touch input operation in real time, and this response capability is not affected by the fact that the terminal device is in a pocket state.
[0331] In a case where the scenario in which the terminal device is located is a second scenario, the terminal device is controlled to display the anti-mistouch interface. The second scenario is a video playing scenario or a scenario in which a conversation is conducted through a conversation window, such as a social chat scenario.
[0332] Optionally, the anti-mis-touch interface is located on the top of all interface layers of the terminal device to block the mis-touch report point of the touch screen in the pocket.
[0333] S802 can be specifically implemented by the following solutions.
[0334] Solution one: in the case that the terminal device is in an operation continuity scenario, the terminal device does not display the anti-mis-touch interface. The first scenario is the operation continuity scenario, such as a payment scenario or a game scenario.
[0335] For example, taking the payment scenario as an example, the user has shown the payment code in the payment link as shown in FIG. 9. If the user realizes that there are other items to be purchased at this time, the user will put the mobile phone into the pocket to get the required items. In this process, the mobile phone can detect that it is put into the pocket, and determine that it is in the payment scenario based on the current interface. The mobile phone does not display the anti-mis-touch interface, but keeps the original interface. That is, the display interface of the mobile phone still displays the payment interface shown in FIG. 9, which is convenient for the user to continue to use later, avoids the inconvenience that the user may be brought by automatically entering the anti-mis-touch interface only because the mobile phone is in the pocket, and improves the user experience.
[0336] In another example, taking the game scenario as an example, the user is playing a game, and the interface of the mobile phone is a game interface as shown in FIG. 10. If the user needs to wash his hands at this time, he may put the mobile phone into the pocket. In this process, the mobile phone can detect that it is put into the pocket, and determine that it is in the game scenario based on the current interface. The mobile phone does not display the anti-mis-touch interface, but keeps the original interface. In this way, even if the mobile phone is in the pocket, the display interface still remains the game interface shown in FIG. 10, ensuring that the user can continue to use the mobile phone for gaming seamlessly later. In this way, the inconvenience that the user may be brought by blindly displaying the anti-mis-touch interface only because the mobile phone is put into the pocket is avoided, and the user experience is improved.
[0337] Solution two: in the case that the terminal device is in a video playing scenario, it is determined to control the terminal device to display the anti-mis-touch interface. Correspondingly, the terminal device displays the anti-mis-touch interface. The second scenario is the video playing scenario.
[0338] For example, as shown in (a) of FIG. 11, a user watches a video (such as a variety show) at home, and the interface of the mobile phone is a video playing interface in landscape mode. If someone knocks on the door at this time, the user may put the mobile phone into a pocket to open the door. During this process, the mobile phone can detect that it is put into a pocket, and determine that it is in a video playing scenario based on the current interface. The mobile phone displays an anti-mistouch interface, i.e., switches the display interface from the video playing interface shown in (a) of FIG. 11 to the anti-mistouch interface shown in (b) of FIG. 11. Of course, as shown in (c) of FIG. 11, when the user watches a video at home, the interface of the mobile phone can also be a video playing interface in portrait mode. When the mobile phone detects that it is put into a pocket, and determines that it is in a video playing scenario based on the current interface, it switches the display interface from the video playing interface shown in (a) of FIG. 11 to the anti-mistouch interface shown in (d) of FIG. 11.
[0339] In the video playing scenario, since the user has relatively less interaction with the interface, after the anti-mistouch interface is displayed, the mobile phone can be effectively prevented from being mistouched, thereby improving the user experience.
[0340] In a third aspect, the terminal device displays an anti-mistouch interface in a target scenario. The terminal device is controlled to be in a locked state when the duration for displaying the anti-mistouch interface is greater than a target duration. The second scenario is the target scenario.
[0341] The target duration is, for example, 10 seconds, and can be flexibly set according to actual application. The present application does not limit the target duration.
[0342] For example, during a break after class, a user chats with others through a conversation window of an application A of the mobile phone, as shown in (a) of FIG. 12. The window supports text or voice input. When the class bell rings, the user puts the mobile phone into a pocket. At this time, the mobile phone can detect that it is put into a pocket, and determine that the user is in a social chatting scenario according to the current interface. The mobile phone automatically displays an anti-mistouch interface. For example, the mobile phone switches the display interface from the chatting interface shown in (a) of FIG. 12 to the anti-mistouch interface shown in (b) of FIG. 12. When the duration for displaying the anti-mistouch interface is greater than a target duration, the mobile phone automatically enters a locked state, such as the state shown in (c) of FIG. 12. In this way, considering that the user has relatively weak operation continuity with the interface of the mobile phone in the target scenario, after the anti-mistouch interface is displayed, the mobile phone can be effectively prevented from being mistouched. Moreover, the terminal device is controlled to be in a locked state when the duration for displaying the anti-mistouch interface is greater than a target duration. In this way, the user's privacy and data security can be protected, power consumption can be reduced, the standby time of the mobile phone can be prolonged, power consumption can be reduced, and the user experience can be improved.
[0343] In the related art, the anti-mis-touch interface is usually displayed when it is detected that the mobile phone is in the pocket. This processing manner is relatively general and does not fully consider the specific needs in different use scenarios. However, the embodiments of the present application can consider the operation continuity in different scenarios to determine whether to display the anti-mis-touch interface when the terminal device is in the pocket. Moreover, for scenarios with weak operation continuity, the terminal device is controlled to be in the lock screen state when the duration of displaying the anti-mis-touch interface is greater than the target duration, thereby prolonging the standby time of the mobile phone, reducing power consumption, and improving the user experience.
[0344] It should be noted that after the terminal device is in the pocket and the anti-mis-touch interface is displayed, the anti-mis-touch interface is exited when one or more of the following conditions are met. Among them:
[0345] The first item: the terminal device reports away data on the proximity light sensor, and the away data is used to indicate that the distance between the proximity light sensor and the obstacle is greater than the target distance threshold.
[0346] The second item: the target object exists in the second image collected by the image collection component of the terminal device, and the target object is an object with a face. The second image is an image of the range of view collected by the image collection component of the terminal device after the terminal device is in the pocket and the anti-mis-touch interface is displayed.
[0347] The third item: the second ambient light intensity of the terminal device is greater than the target intensity threshold, and the terminal device has a lifting action.
[0348] Among them, the second ambient light intensity is the value of the light intensity of the environment in which the terminal device is located after the terminal device is in the pocket and the anti-mis-touch interface is displayed. The lifting action refers to the process of the user picking up or holding the terminal device from the stationary or placed state.
[0349] Exemplarily, the acceleration data of different axes (X, Y, and Z axes) can be detected by the acceleration sensor of the terminal device, and the rotational motion of the mobile phone around different axes (X, Y, and Z axes) can be detected by the gyroscope sensor. Based on these acceleration data and angular velocity data, it is determined whether the terminal device has a lifting action.
[0350] The fourth item: the user's exit operation for the anti-mis-touch interface is detected.
[0351] In a possible implementation, after the terminal device is in the pocket and the anti-mis-touch interface is displayed, if the terminal device reports away data on the proximity light sensor, the anti-mis-touch interface is automatically exited.
[0352] Wherein, the away data is used to represent that the distance between the proximity light sensor and the obstacle is greater than a target distance threshold.
[0353] In the embodiments of the present application, when the proximity light sensor reports the away data, it is determined that the terminal device has left the pocket or has been taken out of the pocket. Based on this determination, the terminal device automatically exits the anti-mistouch interface to restore the response capability to the user operation, thereby improving the user experience and enabling the user to more conveniently operate the terminal device.
[0354] In a possible implementation, after the terminal device is in the pocket and the anti-mistouch interface is displayed, an image, i.e., a second image, is captured by the image capturing component of the terminal device; and face recognition is performed on the second image to determine whether the target object exists in the second image. In the case where the target object exists in the second image, it indicates that the terminal device needs to be used by the user or is being used by the user, and the anti-mistouch interface can be automatically exited.
[0355] In a possible implementation, after the terminal device is in the pocket and the anti-mistouch interface is displayed, the second ambient light intensity of the terminal device is greater than a target intensity threshold, and the terminal device has a lifting action.
[0356] In the case where the second ambient light intensity of the terminal device is greater than the target intensity threshold and the terminal device has the lifting action, it can be determined that the terminal device has left the pocket, and the anti-mistouch interface can be automatically exited.
[0357] In a possible implementation, after the terminal device is in the pocket and the anti-mistouch interface is displayed, in the case where an exit operation of the anti-mistouch interface by the user is detected, the anti-mistouch interface can be exited.
[0358] For example, as shown in FIG. 13, the user can slide the control for canceling the anti-mistouch interface shown in FIG. 13 to the right twice, and the terminal device can exit the anti-mistouch interface in response to the operation to display the interface as shown in (a) of FIG. 12. Wherein, the exit operation is the operation of sliding the control for canceling the anti-mistouch interface to the right twice.
[0359] It should be noted that the pocket in the present application can be a pocket of trousers, a pocket of a coat, a pocket on the outside of a backpack, etc. The method of pocket detection is described by taking the pocket of trousers as an example, and should not be understood as a limitation on the range of pockets to which the present application is applicable.
[0360] The embodiments of the present application provide a pocket detection method, which can identify the scene in which the terminal device is located, and determine whether to control the terminal device to display the anti-mistouch interface based on the scene, thereby avoiding the inconvenience that the anti-mistouch interface is automatically displayed only because the terminal device is in the pocket, and improving the user experience.
[0361] It should be noted that the information collection process (such as collecting the first image, the second image, the touch information of the touch screen of the terminal device) and the feature extraction process involved in the present application are executed with the user's knowledge and permission, that is, the information collection process / feature extraction process is in compliance with the requirements and does not belong to the act of interfering with the public interest.
[0362] Based on the above embodiment, in other embodiments of the present application, the terminal device takes a mobile phone as an example, and multiple modules can be deployed on the mobile phone to implement the above-mentioned bag detection method.
[0363] Exemplarily, the multiple modules include a multimodal fusion mobile phone bag module, a mobile phone motion state recognition module, a proximity light / environment light recognition module, an ultrasonic recognition module, a Swing recognition module, and a scene recognition module.
[0364] The multimodal fusion mobile phone bag module: can cooperate with other modules, and fuse at least two of acceleration detection, face recognition, proximity light detection, ambient light detection, and ultrasonic detection to detect whether the mobile phone is in the pocket, thereby improving the accuracy of determining whether the mobile phone is in the pocket.
[0365] The mobile phone motion state recognition module: determines whether the mobile phone has fallen into the pocket by comprehensively judging the vertical, horizontal, and longitudinal direction motion through acceleration data.
[0366] The proximity light / environment light recognition module: can detect the distance between the mobile phone and obstacles (i.e., surrounding objects) through a proximity light sensor and an ambient light sensor to detect whether the mobile phone is in the pocket.
[0367] The ultrasonic recognition module: identifies the distance of the objects around the user of the mobile phone by emitting ultrasonic waves and receiving signals through the microphone to determine whether the mobile phone is in the pocket.
[0368] The Swing recognition module: determines whether there is a face looking at the mobile phone through the camera Swing capability, as a basis for determining that someone is using the mobile phone, to determine whether the mobile phone is in the pocket. The Swing capability refers to the low-power face recognition capability of the camera.
[0369] It should be understood that the camera involved herein can be a camera with swing capability, that is, a camera capable of collecting images (such as the first image and the second image mentioned above) and performing face recognition on the images in a low-power mode.
[0370] Exemplarily, acquiring the image in the low-power mode can be understood as acquiring the image in a low-light condition, or acquiring the image by the light brightness passively received by the camera. Subsequently, the acquired image can be subjected to face recognition to determine whether the mobile phone is in the pocket. This process reduces power consumption compared to the related art that requires actively shooting a high-resolution color image by the camera and performing face recognition based on the high-resolution color image, thereby realizing optimization of the overall power consumption of the system.
[0371] The scene recognition module can recognize the scene in which the mobile phone is located, perform whitelist processing when the mobile phone is used in daily use such as a game or a payment scene, and control the mobile phone to not display the anti-mistouch interface. This avoids the anti-mistouch interface being displayed blindly only because the mobile phone is placed in the pocket, thereby possibly causing inconvenience to the user and greatly improving the user experience. After the anti-mistouch interface is displayed, the anti-mistouch interface can be timely revoked based on detection of multiple sensors or user operations to restore the response capability to the user operations, thereby improving the user experience and enabling the user to operate the mobile phone more conveniently.
[0372] The foregoing describes examples of the pocket detection method provided in the present application. It can be understood that, in order to implement the above functions, the terminal device comprises hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application of the technical solution and the design constraints. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application. The present application can divide the functions of the method for detecting the pocket according to the above method examples, for example, each function can be divided into a functional unit, or two or more functions can be integrated into one unit. The integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the present application is illustrative, and is only a logical functional division. Actual implementation can have another division manner.
[0373] FIG. 14 shows a structural schematic diagram of a terminal device provided in the present application. The dashed line in FIG. 14 indicates that the unit or the module is optional. The terminal device 14 can be used to implement the method described in the above method embodiments. The terminal device 14 can be a terminal device or a chip (system).
[0374] The terminal device 14 includes one or more processors 1401, which can support the terminal device 14 to implement the methods in the method embodiments corresponding to FIG. 3, FIG. 4, FIG. 5, FIG. 6, FIG. 7 and FIG. 8. The processor 1401 can be a general-purpose processor or a special-purpose processor. For example, the processor 1401 can be a central processing unit (CPU). The CPU can be used to control the terminal device 14, execute software programs, and process data of the software programs. The terminal device 14 can also include a communication unit 1405 to implement input (reception) and output (transmission) of signals.
[0375] The terminal device 14 described above can be a chip (system) including a memory and a processor, wherein the processor is configured to execute a computer program stored in the memory to implement the methods shown in the various embodiments.
[0376] The communication unit 1405 can be an input and / or output circuit of the chip (system), or the communication unit 1405 can be a communication interface of the chip (system), which can be a component of the terminal device 14.
[0377] For another example, the communication unit 1405 can be a transceiver of the terminal device 14, or the communication unit 1405 can be a transceiver circuit of the terminal device 14. The terminal device 14 can include one or more memories 1402 having programs 1404 stored thereon, which can be run by the processor 1401 to generate instructions 1403, so that the processor 1401 executes the methods described in the above method embodiments according to the instructions 1403. Optionally, the memory 1402 can also store data. Optionally, the processor 1401 can also read the data stored in the memory 1402, which can be stored in the same storage address as the program 1404, or can be stored in a different storage address from the program 1404.
[0378] The processor 1401 and the memory 1402 can be separately arranged or integrated together, for example, integrated on a system on chip (SOC) of the terminal device. The specific manner in which the processor 1401 executes the method of the drop detection can be referred to the related description in the method embodiments.
[0379] It should be appreciated that each step of the above method embodiments can be implemented by logic circuits in the form of hardware in the processor 1401 or instructions in the form of software. The processor 1401 can be a CPU, a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or other programmable logic device, for example, a discrete gate, transistor logic, or discrete hardware components.
[0380] The present application also provides a computer program product, which, when executed by the processor 1401, implements the method of any method embodiment of the present application. The computer program product can be stored in the memory 1402, for example, as the program 1404, which is finally converted into an executable object file capable of being executed by the processor 1401 through preprocessing, compiling, assembling, and linking, etc.
[0381] The present application also provides a computer readable storage medium, which stores a computer program, which, when executed by a computer, implements the method of any method embodiment of the present application. The computer program can be a high-level language program or an executable object program.
[0382] The computer readable storage medium is, for example, the memory 1402. The memory 1402 can be a volatile memory or a nonvolatile memory, or the memory 1402 can include both volatile and nonvolatile memory. The nonvolatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), which is used as the external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), SynchBurst DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).
[0383] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and apparatuses and the generated technical effects can refer to the corresponding processes and technical effects in the foregoing method embodiments, and will not be described here.
[0384] In several embodiments provided in the present application, the disclosed system, device and method can be implemented in other ways. For example, some features of the above-described method embodiments can be omitted or not executed. The above-described device embodiments are merely illustrative, and the splitting of units is only a logical function splitting, and actual implementation can have another splitting manner, and multiple units or components can be combined or integrated into another system. In addition, the coupling between units or the coupling between components can be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.
[0385] The above examples are only used to illustrate the technical solutions of the present application, but not to limit the same. Although the present application has been described in detail with reference to the foregoing examples, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing examples can be modified, or some technical features can be replaced by equivalent ones, and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
[0386] Finally, the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of detecting a pot, characterized by, The method is applied to a terminal device, and comprises the following steps: In a case where a proximity light sensor of the terminal device reports proximity data, obtaining sensing information of the terminal device and determining whether the terminal device is in a pocket based on the sensing information, the sensing information comprising a first ambient light intensity of the terminal device and / or posture information of the terminal device, the proximity data being used to indicate that a distance between the proximity light sensor and an obstacle is less than or equal to a target distance threshold; In a case where the proximity light sensor of the terminal device does not report the proximity data, or the terminal device does not have the proximity light sensor, obtaining ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data.
2. The method of claim 1, wherein, The method further comprises the following steps: Detecting whether a pocket-removing action occurs to the terminal device; In a case where the pocket-removing action occurs to the terminal device, detecting whether the proximity light sensor is present on the terminal device.
3. The method of claim 2, wherein, The detection of whether the pocket-removing action occurs to the terminal device comprises the following steps: Obtaining acceleration data of the terminal device; Based on the acceleration data, determining whether the pocket-removing action occurs to the terminal device.
4. The method according to any one of claims 1 to 3, characterized in that, The obtaining of the sensing information of the terminal device and the determination of whether the terminal device is in the pocket based on the sensing information in a case where the proximity light sensor of the terminal device reports the proximity data comprises the following steps: In a case where an upside-down pocket-removing action occurs to the terminal device and the proximity light sensor reports the proximity data, obtaining the sensing information of the terminal device and determining whether the terminal device is in the pocket based on the sensing information, the pocket-removing action comprising the upside-down pocket-removing action.
5. The method according to any one of claims 1 to 4, characterized in that, The determination of whether the terminal device is in the pocket based on the sensing information comprises the following steps: In a case where the sensing information satisfies a sensing condition, determining that the terminal device is in the pocket; or In a case where the sensing information satisfies the sensing condition, acquiring a first image by using an image acquisition component of the terminal device, and in a case where a target object is not present in the first image, determining that the terminal device is in the pocket, the target object being an object having a face; In a case where the sensing information does not satisfy the sensing condition, obtaining ultrasonic data of the terminal device, and determining whether the terminal device is in the pocket based on the ultrasonic data.
6. The method according to any one of claims 1 to 3, characterized in that, The obtaining of the ultrasonic data of the terminal device and the determination of whether the terminal device is in the pocket based on the ultrasonic data in a case where the proximity light sensor of the terminal device does not report the proximity data, or the terminal device does not have the proximity light sensor, comprises the following steps: In a case where a non-upside-down pocket-removing action occurs to the terminal device and the proximity light sensor does not report the proximity data, obtaining the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data; or, In a case where the terminal device performs the non-inverted bag-falling action and the terminal device does not have the proximity light sensor, obtaining ultrasonic wave data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic wave data; or, In a case where the terminal device performs the inverted bag-falling action and the proximity light sensor of the terminal device does not report the proximity data, obtaining ultrasonic wave data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic wave data.
7. The method according to any one of claims 1 to 6, characterized in that, The determining whether the terminal device is in the pocket based on the ultrasonic wave data comprises: In a case where a change trend of an ultrasonic wave waveform meets a target change trend, determining that the terminal device is in the pocket, the ultrasonic wave data comprising the ultrasonic wave waveform; or, In a case where the change trend of the ultrasonic wave waveform meets the target change trend, acquiring a first image by an image acquisition component of the terminal device, and in a case where a target object does not exist in the first image, determining that the terminal device is in the pocket, the target object being an object having a face.
8. The method of claim 4, wherein, The method further comprises: In a case where the terminal device performs the non-inverted bag-falling action and the proximity light sensor reports the proximity data, acquiring a first image by an image acquisition component of the terminal device, and in a case where a target object does not exist in the first image, determining that the terminal device is in the pocket, the target object being an object having a face.
9. The method according to any one of claims 1 to 8, characterized in that, The method further comprises: In a case where the terminal device is in the pocket, determining whether to control the terminal device to display an anti-mistouch interface based on a scenario in which the terminal device is located.
10. The method of claim 9, wherein, The determining whether to control the terminal device to display the anti-mistouch interface based on the scenario in which the terminal device is located comprises: In a case where the scenario in which the terminal device is located is a first scenario, determining not to control the terminal device to display the anti-mistouch interface; In a case where the scenario in which the terminal device is located is a second scenario, determining to control the terminal device to display the anti-mistouch interface.
11. The method of claim 10, wherein, The first scenario is an operation continuity scenario, and the second scenario is a video playing scenario or a target scenario, the target scenario being a scenario other than the operation continuity scenario and the video playing scenario.
12. The method of claim 11, wherein, The method further comprises: In a case where the scenario in which the terminal device is located is the target scenario and a time length for which the anti-mistouch interface is displayed is greater than a target time length, controlling the terminal device to be in a locked screen state.
13. The method according to claim 11 or 12, characterized in that, The operation continuity scenario is a game scenario or a payment scenario, and the target scenario is a scenario in which a conversation is performed through a conversation window.
14. The method according to any one of claims 1 to 12, characterized in that, The method further comprises: In a case where the terminal device is in the pocket and the anti-mistouch interface is displayed, the anti-mistouch interface being exited in a case where one or more of the following conditions are met: The proximity light sensor of the terminal device reports away data, the away data being used to indicate that a distance between the proximity light sensor and the obstacle is greater than the target distance threshold; A second image acquired by the image acquisition component of the terminal device has a target object, the target object being an object having a face; The second ambient light intensity of the terminal device is greater than a target intensity threshold, and the terminal device has a lifting action; or A user's exit operation on the anti-mis-touch interface is detected.
15. A method of detecting a pot, characterized by, The method is applied to a terminal device, and the method comprises: Obtaining touch information of a touch screen of the terminal device, wherein the touch information comprises at least one of a touch position, a touch area, and a touch duration; When the touch information meets a pocket touch condition, acquiring a first image by an image acquisition component of the terminal device; When there is no target object in the first image, determining that the terminal device is in the pocket, and the target object is an object with a face.
16. The method of claim 15, wherein, The method further comprises: Detecting whether the terminal device has a bag-falling action; When the terminal device has the bag-falling action, obtaining touch information of a touch screen of the terminal device.
17. The method of claim 16, wherein, The method further comprises: Obtaining acceleration data of the terminal device; Based on the acceleration data, determining whether the terminal device has a bag-falling action.
18. The method of any of claims 15-16, wherein, The method further comprises: When the terminal device is in the pocket, based on a scene in which the terminal device is located, determining whether to control the terminal device to display an anti-mis-touch interface.
19. The method of claim 18, wherein, The method further comprises: When the scene in which the terminal device is located is a first scene, determining not to control the terminal device to display the anti-mis-touch interface; When the scene in which the terminal device is located is a second scene, determining to control the terminal device to display the anti-mis-touch interface.
20. The method of claim 19, wherein, The first scene is an operation continuity scene, the second scene is a video playing scene or a target scene, and the target scene is a scene other than the operation continuity scene and the video playing scene.
21. The method of claim 20, wherein, The method further comprises: When the scene in which the terminal device is located is the target scene, and a time length for displaying the anti-mis-touch interface is greater than a target time length, controlling the terminal device to be in a locked screen state.
22. The method of claim 20 or 21, wherein, The operation continuity scene is a game scene or a payment scene, and the target scene is a scene for chatting through a chat window.
23. The method of any one of claims 15-22, wherein, The method further comprises: When the terminal device is in the pocket and displays the anti-mis-touch interface, the anti-mis-touch interface is exited when one or more of the following conditions are met: A proximity light sensor of the terminal device reports away data, and the away data is used to indicate that a distance between the proximity light sensor and an obstacle is greater than a target distance threshold; A second image acquired by an image acquisition component of the terminal device has a target object, and the target object is an object with a face; A second ambient light intensity of the terminal device is greater than a target intensity threshold, and the terminal device has a lifting action; A user's exit operation on the anti-mis-touch interface is detected.
24. A method of detecting a pot, the method comprising: detecting a pot by a method according to any one of claims 1 to 23. The method is applied to a terminal device, and the method comprises: When the terminal device is in the pocket, determining a scene in which the terminal device is located; Determine whether to control the terminal device to display an anti-mistouch interface based on a scenario in which the terminal device is located.
25. The method of claim 24, wherein, The determining whether to control the terminal device to display the anti-mistouch interface based on the scenario in which the terminal device is located includes: In a case where the scenario in which the terminal device is located is a first scenario, determine not to control the terminal device to display the anti-mistouch interface. In a case where the scenario in which the terminal device is located is a second scenario, determine to control the terminal device to display the anti-mistouch interface.
26. The method of claim 25, wherein, The first scenario is an operation continuity scenario, the second scenario is a video playing scenario or a target scenario, and the target scenario is a scenario other than the operation continuity scenario and the video playing scenario.
27. The method of claim 26, wherein, The method further includes: In a case where the scenario in which the terminal device is located is the target scenario and a duration for which the anti-mistouch interface is displayed is greater than a target duration, control the terminal device to be in a locked screen state.
28. The method of claim 26 or 27, wherein, The operation continuity scenario is a game scenario or a payment scenario, and the target scenario is a scenario in which a conversation is conducted through a conversation window.
29. A terminal device, comprising: The terminal device includes: a processor coupled with a memory, the memory being configured to store a program or instructions which, when executed by the processor, cause the terminal device to perform the method of any one of claims 1-14, 15-23, or 24-28.
30. A chip system, characterized by The chip system includes a memory and a processor configured to execute a computer program stored in the memory to implement the method of any one of claims 1-14, 15-23, or 24-28.
31. A computer readable storage medium having stored thereon computer programs or instructions, characterized in that, The computer program or instructions, when executed, cause a computer to perform the method of any one of claims 1-14, 15-23, or 24-28.
32. A computer program product, characterised in that, The computer program or instructions, when executed, cause a computer to perform the method of any one of claims 1-14, 15-23, or 24-28.
Citation Information
Patent Citations
Electronic equipment and display screen control method thereof
CN110989860A
Electronic equipment and display screen control method thereof
CN113986034A
Method for preventing mistaken touch and electronic equipment
CN114070928A
Data transmission method and device, electronic equipment and intelligent terminal
CN116261124A
Touch control processing method and related equipment
CN117850614A