Bag falling detection method, terminal equipment, chip system and storage medium

By comprehensively utilizing proximity light, ambient light, angular velocity, and ultrasonic sensors, combined with image recognition technology, the problem of false or missed detections by proximity light sensors in dark or translucent pockets has been solved, improving the accuracy of mobile phone detection in pockets and enhancing the user experience.

CN121657152APending Publication Date: 2026-03-13HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, proximity sensors have a high risk of misjudging and missing detection when detecting mobile phones in pockets made of dark velvet or thin, light-transmitting materials, leading to frequent false triggering issues and reducing user experience.

Method used

By combining proximity sensors, ambient light sensors, angular velocity sensors, and ultrasonic sensors, the system comprehensively determines whether a mobile phone is in a pocket by integrating data from multiple sensors. It uses ultrasonic sensors for distance measurement and combines image recognition technology to improve detection accuracy.

Benefits of technology

It effectively reduces the risk of false positives and false negatives, improves the accuracy of determining whether a phone is in a pocket, ensures that the user experience is not disturbed, and saves system power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121657152A_ABST
    Figure CN121657152A_ABST
Patent Text Reader

Abstract

The invention provides a falling bag detection method, terminal equipment, a chip system and a storage medium, and the method comprises the steps: obtaining the sensing information of the terminal equipment under the condition that a proximity light sensor of the terminal equipment reports proximity data, and determining whether the terminal equipment is in a pocket or not based on the sensing information, the sensing information comprises first ambient light intensity of the terminal equipment and / or attitude information of the terminal equipment, and the proximity data is used for representing that the distance between the proximity light sensor and an obstacle is smaller than or equal to a target distance threshold value; and under the condition that the proximity light sensor of the terminal equipment does not report the proximity data, or the terminal equipment is not provided with the proximity light sensor, acquiring ultrasonic data of the terminal equipment, and determining whether the terminal equipment is in the pocket based on the ultrasonic data. Therefore, the misjudgment and missed judgment risks can be reduced, and the accuracy of determining whether the terminal equipment is in the pocket or not is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a method for detecting dropped bags, a terminal device, a chip system, and a storage medium. Background Technology

[0002] With the rapid development of technology, smart devices (such as mobile phones) have become integrated into people's daily lives, serving as core tools for communication, entertainment, work, and many other aspects. Users can keep their phones in their pockets for easy access. However, this also presents the problem of accidental activation, such as making accidental calls or sending accidental text messages, thus reducing the user experience.

[0003] Currently, to address the issue of accidental triggering in pockets, a proximity sensor on the phone is typically used to detect whether the phone is in a pocket. If the phone is in a pocket, an anti-accidental touch interface is displayed to prevent accidental triggering. However, when the pocket material is dark fleece or thin, translucent material, the proximity sensor becomes susceptible to light interference and struggles to capture a valid light signal, increasing the risk of false positives and false negatives and reducing detection accuracy. Summary of the Invention

[0004] This application provides a method for detecting a lost bag, a terminal device, a chip system, and a storage medium, which can reduce the risk of false positives and false negatives and improve the accuracy of determining whether the terminal device is in a pocket.

[0005] Firstly, a method for detecting a bag falling into a pocket is provided. This method includes: when a proximity sensor of a terminal device reports proximity data, acquiring perception information of the terminal device and determining whether the terminal device is in a pocket based on the perception information. The perception information includes a first ambient light intensity of the terminal device and / or the attitude information of the terminal device. The proximity data indicates that the distance between the proximity sensor and an obstacle is less than or equal to a target distance threshold. When the proximity sensor of the terminal device does not report proximity data, or the terminal device does not have a proximity sensor, acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data. The first ambient light intensity can be acquired through the ambient light sensor of the terminal device; the ultrasonic data can be acquired through an ultrasonic sensor.

[0006] This method can be executed by a terminal device including a touchscreen, by a module applied in the terminal device (such as a processor, chip, or chip system), or by a logic module or software that can implement all or part of the functions of the terminal device. Specifically, pocket detection refers to using a series of methods to detect whether the terminal device is in a pocket.

[0007] The above solution no longer relies solely on a single proximity sensor to determine whether a terminal device is in a pocket. Instead, it comprehensively considers whether the terminal device has a proximity sensor and whether the proximity sensor reports proximity data, employing corresponding detection methods to determine whether the terminal device is in a pocket. This improves the accuracy of determining whether a terminal device is in a pocket. It also solves the problems of misjudgment or failure in related technologies that rely on proximity sensors to determine whether a terminal device is in a pocket.

[0008] In one possible implementation, the attitude information includes the orientation information of the terminal device; or, the attitude information includes both the orientation information and stability information of the terminal device. The orientation information indicates whether the terminal device is in a vertical orientation, meaning the screen of the terminal device is perpendicular or nearly perpendicular to the ground. The stability information indicates whether the terminal device is in a stable state. The attitude information can be obtained through the terminal device's angular velocity sensor (i.e., gyroscope sensor). The first ambient light intensity can be obtained through the terminal device's ambient light sensor.

[0009] The above solution, when the proximity sensor of the terminal device reports proximity data, indicates that the terminal device may be in a pocket. The ambient light sensor and / or angular velocity sensor of the terminal device can be used to detect whether the terminal device is in a pocket. This avoids the misjudgment problem that occurs when the pocket is made of a thin, light-transmitting material, and improves the accuracy of determining whether the terminal device is in a pocket.

[0010] In one possible implementation, if the proximity sensor of the terminal device does not report proximity data, or if the terminal device does not have a proximity sensor, ultrasonic data of the terminal device is acquired, and the terminal device is determined to be in a pocket based on the ultrasonic data.

[0011] In the above-described solution, if the proximity sensor of the terminal device fails to report proximity data, the proximity sensor may be malfunctioning or ineffective, both of which could lead to missed detections. To avoid missed detections and address the issue of the terminal device being unable to perform bag-drop detection due to the lack of a proximity sensor in related technologies, considering the functional similarity between proximity sensors and ultrasonic sensors, an ultrasonic sensor can be used to measure the distance between the terminal device and the obstacle to determine whether the terminal device is in a pocket, thus improving the accuracy of determining whether the terminal device is in a pocket.

[0012] In this paper, the time difference between ultrasonic wave transmission and reception, ultrasonic wave waveform (e.g., reflected wave waveform), amplitude, or frequency can all be referred to as ultrasonic data. For ease of distinction, the time difference between ultrasonic wave transmission and reception can be represented as first ultrasonic data, and at least one of the ultrasonic wave waveform (e.g., reflected wave waveform), amplitude, or frequency can be represented as second ultrasonic data. Bag detection using an ultrasonic sensor can be implemented based solely on the first ultrasonic data; alternatively, it can be implemented based on both the first and second ultrasonic data. For example, if the distance between the terminal device and the obstacle is determined to be less than or equal to a target distance threshold based on the first ultrasonic data, the second ultrasonic data can be used for analysis and judgment to determine whether the terminal device is in the pocket.

[0013] In one possible implementation, the bag-dropping detection method further includes: detecting whether the terminal device has performed a bag-dropping action; and, if the terminal device has performed a bag-dropping action, detecting whether the terminal device has a proximity light sensor.

[0014] It should be understood that the pocketing action can be the process by which a terminal device is intentionally moved towards the pocket from its original position, and at least reaches the pocket entrance or nearby area. The pocketing action emphasizes the action of the terminal device moving towards the pocket itself, rather than whether the terminal device ultimately successfully pockets the pocket.

[0015] The location where the proximity sensor is set can be represented as the head or top. The bag-dropping action of the terminal device can specifically include either an inverted bag-dropping action or a non-inverted bag-dropping action. An inverted bag-dropping action can be understood as a bag-dropping action with the head (top) facing down. A non-inverted bag-dropping action can be a bag-dropping action with the head (top) facing up. A non-inverted bag-dropping action can also be any bag-dropping action other than an inverted bag-dropping action or a bag-dropping action with the head (top) facing up.

[0016] Optionally, an ambient light sensor may also be provided on the head (top) of the terminal device.

[0017] For example, the inverted pocket drop action is the process of moving the phone to at least the pocket entrance or nearby area with the top of the phone away from the pocket entrance. The non-inverted pocket drop action is the process of moving the phone to at least the pocket entrance or nearby area with the top of the phone not away from the pocket entrance, for example, specifically, moving the phone to at least the pocket entrance or nearby area with the top of the phone close to the pocket entrance.

[0018] The above solution eliminates the need to initiate the process of detecting whether the terminal device is in a pocket when the terminal device does not perform a pocket-dropping action. Instead, the process is initiated only when the terminal device performs a pocket-dropping action (i.e., the pocket-dropping detection process is activated), avoiding excessive power consumption caused by frequent detection and saving system power.

[0019] In one possible implementation, detecting whether the terminal device has performed a bag-dropping action includes: acquiring acceleration data of the terminal device; and determining whether the terminal device has performed a bag-dropping action based on the acceleration data.

[0020] In one possible implementation, when the proximity sensor of the terminal device reports proximity data, acquiring the terminal device's sensing information and determining whether the terminal device is in a pocket based on the sensing information includes: when the terminal device performs an inverted pocket-dropping action and the proximity sensor reports proximity data, acquiring the terminal device's sensing information and determining whether the terminal device is in a pocket based on the sensing information, wherein the pocket-dropping action includes an inverted pocket-dropping action. The sensing information includes at least a first ambient light intensity.

[0021] In the above scheme, the proximity sensor is positioned at the head or top. When the terminal device inverts and falls into the pocket, and the proximity sensor reports proximity data, it indicates that the terminal device may be in the pocket. Since neither the proximity sensor nor the ambient light sensor is exposed outside the pocket, the sensor's sensing information can be acquired, and based on this information, it can be further determined whether the terminal device is in the pocket. This improves the reliability and accuracy of detecting whether a terminal device is in a pocket using an ambient light sensor. The sensing information includes at least the first ambient light intensity.

[0022] In one possible implementation, determining whether a terminal device is in a pocket based on sensing information includes: determining that the terminal device is in a pocket if the sensing information meets the sensing conditions; or: if the sensing information meets the sensing conditions, acquiring a first image through the image acquisition component of the terminal device, and determining that the terminal device is in a pocket if no target object is found in the first image, wherein the target object is an object with a face; or if the sensing information does not meet the sensing conditions, acquiring ultrasonic data of the terminal device, and determining whether the terminal device is in a pocket based on the ultrasonic data.

[0023] The above scheme, when the perceived information meets the perception conditions, can also acquire a first image. Facial recognition is then performed on the first image to determine if a target object exists, serving as a basis for determining whether the terminal device is being used. If no target object is present in the first image, it indicates the terminal device is not being used by the user, confirming it is in a pocket. If a target object is present in the first image, it indicates the terminal device is being used by the user, confirming it is not in a pocket. Thus, facial recognition serves as a fallback mechanism for pocket detection. If a target object is present in the first image, the pocket detection process immediately exits, ensuring a smooth and uninterrupted user experience while using the terminal device. Furthermore, it improves the accuracy of determining whether the terminal device is in a pocket.

[0024] The ultrasonic data can be at least one of the following: ultrasonic waveform, amplitude, and frequency.

[0025] In one possible implementation, the ultrasonic data can be ultrasonic waveform, amplitude, and frequency. The terminal device is determined to be in the pocket if the changing trend of the ultrasonic waveform satisfies a target changing trend, the changing trend of the amplitude satisfies a preset amplitude changing trend, and the changing trend of the frequency satisfies a preset frequency changing trend. Here, the ultrasonic waveform is a reflected wave waveform. The target changing trend is a pre-defined changing trend of the reflected wave waveform when the terminal device is placed in the pocket.

[0026] In one possible implementation, the ultrasonic data is an ultrasonic waveform, and the terminal device is determined to be in the pocket if the trend of change of the ultrasonic waveform meets the trend of change of the target.

[0027] In one 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 includes amplitude variation information and waveform distortion information. The waveform distortion information represents the morphological changes that occur in the reflected wave waveform compared to the emitted wave waveform. This waveform feature information can be input into a pre-trained classifier, which processes the waveform feature information to determine whether the terminal device is in a pocket.

[0028] In one possible implementation, when the proximity sensor of the terminal device does not report proximity data, or the terminal device does not have a proximity sensor, ultrasonic data of the terminal device is acquired, and the determination of whether the terminal device is in a pocket is based on the ultrasonic data is achieved in the following way:

[0029] Method 1: The location of the proximity sensor is represented as the head or top. If the terminal device performs a non-inverted pocket-dropping action and the proximity sensor does not report proximity data, ultrasonic data from the terminal device is acquired, and the presence of the terminal device in the pocket is determined based on the ultrasonic data.

[0030] In the aforementioned scheme, the top of the terminal device may also be equipped with an ambient light sensor. If the terminal device experiences a non-inverted drop into the pocket action, and the proximity sensor does not report proximity data, considering that the proximity sensor may malfunction or be exposed outside the pocket, the ambient light sensor may also be exposed. Therefore, an ultrasonic sensor, functionally similar to the proximity 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. This avoids missed detections due to proximity sensor malfunction or exposure outside the pocket, improving the accuracy of determining whether the terminal device is in the pocket.

[0031] Method 2: When the terminal device performs a non-inverted bag-dropping action and does not have a proximity sensor, acquire ultrasonic data of the terminal device and determine whether the terminal device is in the pocket based on the ultrasonic data.

[0032] The above solution, in the case that the terminal device does not have a proximity sensor, considers using an ultrasonic sensor that is functionally similar to a proximity sensor to measure the distance between the terminal device and the obstacle in order to determine whether the terminal device is in the pocket. This can avoid relying too much on the proximity sensor to detect whether the terminal device is in the pocket and overcome the limitation of related technologies that rely too much on the proximity sensor to detect whether the terminal device is in the pocket.

[0033] Method 3: The location of the proximity sensor is represented as the head or top. If the terminal device inverts and falls into the pocket, and the proximity sensor does not report proximity data, ultrasonic data from the terminal device is acquired, and the presence of the terminal device in the pocket is determined based on the ultrasonic data.

[0034] In the above solution, when the terminal device inverts and falls into the pocket, the proximity sensor does not report proximity data. Considering that the proximity sensor may malfunction or fail, an ultrasonic sensor, which is functionally similar to the proximity 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. This avoids missed detections due to proximity sensor failure or malfunction, and improves the accuracy of determining whether the terminal device is in the pocket.

[0035] In one possible implementation, determining whether a terminal device is in a pocket based on ultrasonic data includes: determining that the terminal device is in a pocket if the trend of change of the ultrasonic waveform meets the target trend of change, wherein the ultrasonic data includes the ultrasonic waveform; or, if the trend of change of the ultrasonic waveform meets the target trend of change, acquiring a first image through the image acquisition component of the terminal device, and determining that the terminal device is in a pocket if no target object is found in the first image, wherein the target object is an object with a human face.

[0036] The above scheme, when the changing trend of the ultrasonic waveform meets the target changing trend, acquires a first image. Facial recognition is then performed on the first image to determine if a target object exists, serving as the basis for determining whether the terminal device is being used. If the target object is not present in the first image, it indicates the terminal device is not being used by the user, thus confirming it is in a pocket. If the target object is present in the first image, it indicates the terminal device is being used by the user, thus confirming it is not in a pocket. In this way, using facial recognition as a fallback mechanism for pocket detection allows the process to immediately exit if a target object is present in the first image, ensuring a smooth and uninterrupted user experience while using the terminal device. Furthermore, it improves the accuracy of determining whether the terminal device is in a pocket.

[0037] In one possible implementation, the bag-dropping detection method further includes: when the terminal device performs a non-inverted bag-dropping action and the proximity sensor reports proximity data, acquiring a first image through the image acquisition component of the terminal device, and determining that the terminal device is in a pocket and the target object is an object with a human face if no target object is found in the first image.

[0038] In the aforementioned scheme, the top of the terminal device may also be equipped with an ambient light sensor. When the terminal device performs a non-inverted pocket-dropping action and the proximity sensor reports proximity data, considering that the proximity sensor might be outside the pocket, or obstructed (e.g., by the user's hand), the ambient light sensor might also be outside the pocket. Based on this consideration, a first image can be captured, and facial recognition can be performed on the first image to determine if a target object exists, serving as a basis for determining whether the terminal device is being used. If no target object is present in the first image, it indicates that the terminal device is not being used by the user, thus confirming that the terminal device is in the pocket. If a target object is present in the first image, it indicates that the terminal device is being used by the user, thus confirming that the terminal device is not in the pocket. This improves the accuracy of determining whether the terminal device is in the pocket.

[0039] In one possible implementation, the pocket detection method further includes: when the terminal device is in a pocket, determining whether to control the terminal device to display an anti-accidental touch interface based on the scenario in which the terminal device is located.

[0040] In one possible implementation, 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: if 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 if 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.

[0041] The first and second scenarios differ in that they are divided considering the continuity of user operations. The first scenario has a higher degree of operational continuity than the second. Users are more sensitive to scenarios with higher operational continuity; once the operation is interrupted, the user's overall train of thought is disrupted, negatively impacting the user experience.

[0042] In the first scenario described above, the user's operation continuity is very high, and the user may continue using the terminal device for a short period of time. To ensure seamless subsequent use of the terminal device, even if the terminal device is currently in a pocket, the anti-mistouch interface can be hidden, thus avoiding interference with touch / touch input operations. This way, when the user takes the terminal device out of their pocket, they can continue their previous operation, improving operational continuity and the overall user experience.

[0043] In the second scenario, considering that the user's operation continuity is relatively low, even if the operation is briefly interrupted, the user's perception will not be too strong. To avoid the problem of accidental touch in the pocket, an anti-accidental touch interface can be displayed to avoid the trouble caused by accidental touch in the pocket.

[0044] In one possible implementation, the first scenario is an operation continuity scenario, the second scenario is a video playback scenario or a target scenario, and the target scenario is a scenario other than the operation continuity scenario and the video playback scenario.

[0045] In one possible implementation, the operation continuity scenario is a payment scenario or a game scenario; the target scenario is a scenario where a conversation is conducted through a session window, such as a social chat scenario.

[0046] In one possible implementation, when the terminal device is in a pocket, the scene in which the terminal device is located is the target scene, and the duration of displaying the anti-mistouch interface is longer than the target duration, the terminal device is controlled to be in a locked screen state.

[0047] Among them, the operational continuity of the video playback scenario is higher than that of the target scenario.

[0048] For scenarios with low operational continuity, where user perception of interruption is minimal, the above solution can lock the device even when the duration of the anti-mistouch display exceeds the target duration. This prevents accidental touches from pockets while protecting user privacy and data security. Furthermore, the screen turns off when the device is locked, reducing power consumption and extending standby time, thus improving the user experience.

[0049] It should be noted that when the terminal device is in a pocket, the system determines whether to control the terminal device to display the anti-mistouch interface based on the scenario in which the terminal device is located. This avoids the inconvenience that may be caused to users by blindly activating the anti-mistouch interface simply because the terminal device is in a pocket, as is the case with other related technologies, and further improves the user experience.

[0050] In one possible implementation, the pocket detection method further includes: after the terminal device is in the pocket and the anti-mistouch interface is displayed, exiting the anti-mistouch interface if one or more of the following conditions are met: the proximity sensor of the terminal device reports distance data, which indicates that the distance between the proximity sensor and the obstacle is greater than a target distance threshold; a target object exists in the second image acquired by the image acquisition component of the terminal device, and the target object is 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 undergoes a lifting action; or, the user's exit operation on the anti-mistouch interface is detected.

[0051] The above solution can determine if a user may need to use or is using a terminal device when one or more conditions are met, and then exit the anti-mistouch interface to restore responsiveness to user operations, thereby improving the user experience and making it easier for users to operate the terminal device.

[0052] Secondly, another method for detecting a lost pocket is provided. This method includes: acquiring touch information of the touch screen of a terminal device, wherein the touch information includes at least one of touch position, touch area, and touch duration; acquiring a first image through the image acquisition component of the terminal device when the touch information meets the pocket touch condition; and determining that the terminal device is in a pocket and the target object is an object with a face when there is no target object in the first image.

[0053] The above solution first identifies whether the touch behavior is a pocket touch or a non-pocket touch through touch information. If the touch behavior is identified as a pocket touch, the terminal device's image acquisition component acquires a first image. If a face is identified in the first image, it is determined that the terminal device is in a pocket, thus improving the accuracy of determining whether the terminal device is in a pocket.

[0054] In one possible implementation, obtaining touch information for the touchscreen of the terminal device includes: detecting whether the terminal device has performed a bag-dropping action; and if the terminal device has performed a bag-dropping action, obtaining touch information for the touchscreen of the terminal device.

[0055] In one possible implementation, detecting whether the terminal device has performed a bag-dropping action includes: acquiring acceleration data of the terminal device; and determining whether the terminal device has performed a bag-dropping action based on the acceleration data.

[0056] In one possible implementation, the pocket detection method further includes: when the terminal device is in a pocket, determining whether to control the terminal device to display an anti-accidental touch interface based on the scenario in which the terminal device is located.

[0057] In one possible implementation, 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: if 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 if 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.

[0058] In one possible implementation, the first scenario is an operation continuity scenario, the second scenario is a video playback scenario or a target scenario, and the target scenario is a scenario other than the operation continuity scenario and the video playback scenario.

[0059] In one possible implementation, if the scenario in which the terminal device is located is the target scenario and the duration of displaying the anti-accidental touch interface is longer than the target duration, the terminal device is controlled to be in a locked screen state.

[0060] In one possible implementation, the operation continuity scenario is a game scenario or a payment scenario; the target scenario is a scenario where a session is conducted through a session window.

[0061] In one possible implementation, the pocket detection method further includes: after the terminal device is in the pocket and the anti-mistouch interface is displayed, exiting the anti-mistouch interface if one or more of the following conditions are met: the proximity sensor of the terminal device reports distance data, which indicates that the distance between the proximity sensor and the obstacle is greater than a target distance threshold; a target object exists in the second image acquired by the image acquisition component of the terminal device, and the target object is 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 undergoes a lifting action; and the user's exit operation on the anti-mistouch interface is detected.

[0062] Thirdly, another method for detecting a device falling into a pocket is provided, which includes: determining the scene in which the terminal device is located when the terminal device is in a pocket; and determining whether to control the terminal device to display an anti-accidental touch interface based on the scene in which the terminal device is located.

[0063] The above solution determines whether to control the display of the anti-mistouch interface based on the scenario in which the terminal device is in a pocket. This avoids the inconvenience that may be caused to users by blindly activating the anti-mistouch interface simply because the terminal device is in a pocket, and greatly improves the user experience.

[0064] In one possible implementation, based on the scenario in which the terminal device is located, it is determined whether to control the terminal device to display an anti-mistouch interface, including:

[0065] In the scenario where the terminal device is located, the first scenario is defined, and it is determined that the terminal device will not be controlled to display the anti-accidental touch interface;

[0066] When the terminal device is in the second scenario, determine that the terminal device should display the anti-accidental touch interface.

[0067] In one possible implementation, the first scenario is an operation continuity scenario, the second scenario is a video playback scenario or a target scenario, and the target scenario is a scenario other than the operation continuity scenario and the video playback scenario.

[0068] In one possible implementation, the method further includes: when the scenario in which the terminal device is located is the target scenario and the duration of displaying the anti-mistouch interface is longer than the target duration, controlling the terminal device to be in a locked screen state.

[0069] In one possible implementation, the operation continuity scenario is a game scenario or a payment scenario; the target scenario is a scenario where a session is conducted through a session window.

[0070] Fourthly, embodiments of this application provide a terminal device, which includes a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the terminal device performs the method of any one of the first aspects.

[0071] Fifthly, embodiments of this application provide a terminal device, which includes a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the terminal device performs the method of any one of the second aspects.

[0072] In a sixth aspect, embodiments of this application provide a terminal device, which includes a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, causing the terminal device to perform the method of any of the third aspects.

[0073] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method of any one of the first aspects.

[0074] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method of any one of the second aspects.

[0075] Ninthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method of any of the third aspects.

[0076] In a tenth aspect, embodiments of this application provide a computer program product, which includes computer program code that, when executed by a terminal device, causes the terminal device to perform any of the methods in the first aspect.

[0077] In one aspect, embodiments of this application provide a computer program product, which includes computer program code, such that when the computer program code is run by a terminal device, the terminal device performs any of the methods in the second aspect.

[0078] In a twelfth aspect, embodiments of this application provide a computer program product comprising: computer program code, which, when executed by a terminal device, causes the terminal device to perform any of the methods in the third aspect.

[0079] In a thirteenth aspect, embodiments of this application provide a chip system including a processing circuit and a storage medium storing computer program instructions; when the computer program instructions are executed by the processing circuit, they implement any of the methods in the first aspect.

[0080] Optionally, the processing circuitry in the above-mentioned chip system can be replaced by a processor, and the storage medium can be replaced by a memory. Optionally, the chip system may also include a communication interface for enabling communication between the chip system and external devices.

[0081] In a fourteenth aspect, embodiments of this application provide a chip system including a processing circuit and a storage medium storing computer program instructions; when the computer program instructions are executed by the processing circuit, they implement any of the methods in the second aspect.

[0082] Optionally, the processing circuitry in the above-mentioned chip system can be replaced by a processor, and the storage medium can be replaced by a memory. Optionally, the chip system may also include a communication interface for enabling communication between the chip system and external devices.

[0083] In a fifteenth aspect, embodiments of this application provide a chip system including a processing circuit and a storage medium storing computer program instructions; when the computer program instructions are executed by the processing circuit, they implement any of the methods in the third aspect.

[0084] Optionally, the processing circuitry in the above-mentioned chip system can be replaced by a processor, and the storage medium can be replaced by a memory. Optionally, the chip system may also include a communication interface for enabling communication between the chip system and external devices.

[0085] The beneficial effects of the technical solutions in aspects four to fifteen of this application can be referred to the beneficial effects of the technical solutions in aspects one, two or three, which will not be repeated here. Attached Figure Description

[0086] Figure 1 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0087] Figure 2 A schematic diagram of the software structure of a terminal device 100 provided in an embodiment of this application;

[0088] Figure 3 A schematic flowchart of a bag detection method 300 provided in an embodiment of this application;

[0089] Figure 4 A schematic flowchart of another bag detection method 400 provided in an embodiment of this application;

[0090] Figure 5 A flowchart illustrating another bag detection method 500 provided in this application embodiment;

[0091] Figure 6 A schematic flowchart of a bag detection method 600 provided for another embodiment of this application;

[0092] Figure 7 A flowchart illustrating another bag detection method 700 provided in another embodiment of this application;

[0093] Figure 8 A flowchart illustrating another bag detection method 800 provided in another embodiment of this application;

[0094] Figure 9 A schematic diagram of the display interface for a terminal device applying a bag detection method, provided in an embodiment of this application;

[0095] Figure 10 A schematic diagram of the display interface for another terminal device applying the bag detection method provided in an embodiment of this application;

[0096] Figure 11 A schematic diagram of the display interface for another terminal device application of the bag detection method provided in this application embodiment;

[0097] Figure 12 A schematic diagram of a display interface for a terminal device applying a bag detection method, provided for another embodiment of this application;

[0098] Figure 13 A schematic diagram of the display interface for another terminal device applying the bag detection method according to another embodiment of this application;

[0099] Figure 14 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0100] Figure 1 A schematic diagram of the structure of a terminal device 100 is shown.

[0101] Terminal device 100 may include mobile phones, smartwatches, smart media players, foldable phones, tablets, etc. This application embodiment does not impose any special restrictions on the specific type of terminal device 100.

[0102] Terminal device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) connector 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor 180, button 190, indicator 191, subscriber identification module (SIM) card interface 192, and display screen 193, etc.

[0103] It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more than Figure 1 More or fewer components, or combining some components, or splitting some components, or different component arrangements. Figure 1 The components can be implemented in hardware, software, or a combination of both.

[0104] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), and a controller. These different processing units may be independent devices or integrated into one or more processors.

[0105] The processor 110 can generate operation control signals based on the instruction opcode and timing signals to control the instruction fetching and execution.

[0106] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 may be a cache memory. This memory can store instructions or data that the processor 110 has used or that are used frequently. If the processor 110 needs to use the instruction or data, it can directly retrieve it from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0107] In some embodiments, the processor 110 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (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 to modules such as touch sensors, audio modules, wireless communication modules, displays, and cameras through at least one of these interfaces.

[0108] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.

[0109] USB connector 130 is a USB standard-compliant interface used to connect terminal device 100 and peripheral devices. Charging management module 140 receives charging input from a charger, which can be either a wireless or wired charger. Power management module 141 connects to battery 142, and charging management module 140 connects to processor 110. Power management module 141 receives input from battery 142 and / or charging management module 140 to power processor 110, internal memory 121, display screen 193, and wireless communication module 160, etc. In some embodiments, power management module 141 and charging management module 140 may also be housed in the same device.

[0110] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0111] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the same device as at least some modules of the processor 110.

[0112] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the 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. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 193. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0113] The wireless communication module 160 can provide wireless communication solutions for use on the terminal device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), and near field communication (NFC) technologies. In some embodiments, antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and antenna 2 is coupled to the wireless communication module 160, enabling the terminal device 100 to communicate with networks and other terminal devices via wireless communication technologies. These wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), and Code Division Multiple Access (CDMA).

[0114] Terminal device 100 can implement display functions through a GPU, display screen 193, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 193 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0115] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card, or music, video, and other files can be transferred from the terminal device to the external storage card.

[0116] Internal memory 121 can be used to store computer executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc. The data storage area may store data created during the use of terminal device 100, etc. In addition, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional methods or data processing of terminal device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.

[0117] Terminal device 100 can implement audio functions, such as music playback, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0118] Sensor 180 may include pressure sensors, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, touch sensors, ultrasonic sensors, etc., and is used to convert various signals from the outside world into electrical signals or other required forms of information output.

[0119] A gyroscope sensor can be used to determine the motion attitude of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 about three axes (i.e., the x-axis, y-axis, and z-axis) can be determined by the gyroscope sensor.

[0120] The accelerometer can detect the magnitude of the 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.

[0121] A touch sensor, also known as a "touch panel," can be located on the display screen 193. The touch sensor and display screen 193 together form a touchscreen, also called a "touch display." The touch sensor detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 193. In some embodiments, the touch sensor may also be located on the surface of the terminal device 100, in a different position than the display screen 193.

[0122] Button 190 may include a power button, volume buttons, etc. Button 190 may be a mechanical button or a touch button. Terminal device 100 may receive button input and generate key signal inputs related to user settings and function control of terminal device 100.

[0123] Indicator 191 can be an indicator light, used to indicate charging status, power changes, or to indicate information such as missed calls and notifications.

[0124] Optionally, the terminal device may also include a SIM card interface 192 for connecting a SIM card. The SIM card can be inserted into or removed from the SIM card interface 192 to achieve contact and separation with the terminal device 100. The terminal device 100 may support one or more SIM card interfaces 192. The SIM card interface 192 may support Nano SIM cards, Micro SIM cards, and other SIM cards. Multiple cards can be inserted into the same SIM card interface 192 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 192 is also compatible with different types of SIM cards. The SIM card interface 192 is also compatible with external memory cards.

[0125] The display screen 193 is used to display data such as video interfaces and user settings interfaces. For example, the display screen 193 can be used to display information such as video content. 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, etc. In some embodiments, the display screen can be a foldable or rollable display screen.

[0126] The software system of terminal device 100 can adopt a layered architecture. This application uses the Harmony operating system as an example to illustrate the software architecture of terminal device 100. It should be understood that the solution provided in this application can also be applied to other types of operating systems such as Android, Apple, and Windows.

[0127] Figure 2 This is a schematic diagram of the software structure of the terminal device 100 according to an embodiment of this application.

[0128] In some implementations, the Harmony system comprises four layers, from bottom to top: the kernel layer, the system basic services layer, the framework layer, and the application layer.

[0129] The Harmony system employs a multi-kernel design, optionally including the Linux kernel, the Harmony microkernel, and the lightweight IoT operating system kernel (LiteOS). This design allows devices with varying capabilities to choose the appropriate system kernel. The kernel layer also includes a kernel abstraction layer, providing foundational kernel capabilities to other Harmony layers, such as process management, thread management, memory management, file system management, network management, and peripheral device management.

[0130] The system's basic service layer is the core capability set of the Harmony system, enabling it to provide application services through a framework layer in multi-device deployment scenarios. This layer may optionally include the following components:

[0131] The system's basic capability subsystems provide fundamental capabilities for the operation, scheduling, and migration of distributed applications across multiple devices within the Harmony system. These subsystems comprise a distributed soft bus, distributed data management and file management, distributed task scheduling, the Ark runtime, and distributed security and privacy protection. The Ark runtime provides runtime environments for multiple languages ​​(C / C++ / JavaScript) and basic system libraries. It also provides a runtime environment for Java programs statically generated using the Ark compiler (i.e., the parts of the application or framework layer developed using the Java language).

[0132] The basic software service subsystem suite provides common and general software services for the Harmony system. It comprises subsystems such as graphics and image processing, distributed media, distributed AI, multimodal input, mobile sensing development platform (MSDP) & device virtualization (DV), event notification, telephony services, and design for X (DFX) for non-functional product attributes. Each subsystem can be tailored to the functional granularity required for deployment in different device configurations.

[0133] Enhanced software service subsystem set (see) Figure 2 The enhanced software portion (highlighted by the dashed line) provides differentiated capability enhancement software services for the Harmony system across various devices. It comprises subsystems such as tablet business software, smart screen business software, in-vehicle system business software, and Internet of Things (IoT) business software. This set of enhanced software service subsystems can be tailored to the deployment environment of different device types, with each subsystem further tailored to its functional granularity.

[0134] Harmony Driver Foundation (HDF) and Hardware Abstraction Layer (HAL) form the foundation for the open hardware ecosystem of the Harmony system. HDF provides hardware capability abstraction to the hardware and provides a development framework and runtime environment for various peripheral drivers to the hardware.

[0135] Hardware Service Subsystem Set: Provides common and adaptable hardware services for the Harmony system, consisting of hardware service subsystems such as general sensor, location, power, USB, and biometrics. The Hardware Service Subsystem Set can be tailored to the deployment environment of different device types, with each subsystem allowing for functional customization.

[0136] Proprietary hardware service subsystem (see) Figure 2 The proprietary hardware component (highlighted by the dashed line) provides differentiated hardware services for different devices within the Harmony system. Optional subsystems include proprietary hardware services for tablets, in-vehicle systems, wearables, and IoT devices. These proprietary hardware service subsystems can be tailored at the subsystem level, and each subsystem can be tailored at the functional level.

[0137] The framework layer provides Harmony system applications with multi-language user program frameworks and meta-capability frameworks in languages ​​such as Java, C, C++, and JavaScript, as well as multi-language framework application programming interfaces (APIs) for various software and hardware services.

[0138] The application layer includes system applications and third-party applications (or extended applications), which can include applications such as camera, gallery, calendar, calling, drawing applications, navigation, WLAN, music, video, and SMS. Applications in the Harmony system are built upon atomic capabilities (AA) and feature capabilities (FA).

[0139] The following has Figure 1 and Figure 2 Taking the terminal device with the structure shown as an example, the bag detection method provided in this application embodiment will be explained in detail.

[0140] Currently, to address the issue of accidental activation in pockets, a proximity sensor on the phone is typically used to detect whether the phone is in a pocket. If the phone is in a pocket, an anti-accidental touch interface is displayed to prevent accidental activation. However, when the pocket material is dark fleece, the dark fabric may cause the proximity sensor to malfunction; when the pocket material is thin and translucent, light can easily penetrate the pocket, making it impossible for the proximity sensor to accurately identify whether the phone is in the pocket.

[0141] For example, with dark-colored plush fabrics, the proximity sensor struggles to capture sufficient light signals due to their strong light absorption and the scattering effect of the fibers. When a phone is placed in a pocket made of this material, the light signal received by the proximity sensor is weak, potentially even below its detection threshold. Therefore, the proximity sensor may fail to determine if the phone is in the pocket, resulting in a "failure" and a tendency to miss detections.

[0142] For thin, translucent fabrics, such as gauze or silk, external light can easily penetrate the pocket and reach the proximity sensor. When a phone is placed in such a pocket, the proximity sensor receives light signals that may include both light from inside and outside the pocket. Due to interference from external light signals, the proximity sensor struggles to distinguish whether the received light signal originates from inside or outside the pocket, making it difficult to accurately determine if the phone is in the pocket and leading to false positives.

[0143] Based on this, this application provides a pocket-in-pocket detection method applied to a terminal device. This method no longer relies solely on a single proximity sensor to determine whether the terminal device is in a pocket. Instead, it comprehensively considers whether the terminal device has a proximity sensor and whether the proximity sensor reports proximity data (proximity data indicates that the distance between the proximity sensor and the obstacle is less than or equal to a target distance threshold), and employs a corresponding detection method to detect whether the terminal device is in a pocket. Specifically, when the terminal device's proximity sensor reports proximity data, the method acquires the terminal device's perception information (including the terminal device's first ambient light intensity and / or the terminal device's posture information) and determines whether the terminal device is in a pocket based on this perception information, avoiding false positives and improving the accuracy of determining whether the terminal device is in a pocket. When the terminal device's proximity sensor does not report proximity data, or the terminal device does not have a proximity sensor, the method acquires the terminal device's ultrasonic data and determines whether the terminal device is in a pocket based on this ultrasonic data, avoiding missed detections due to proximity sensor failure and improving the accuracy of determining whether the terminal device is in a pocket.

[0144] The following examples provide a detailed explanation of the bag detection method provided in this application.

[0145] Figure 3 This is a flowchart illustrating a bag detection method 300 provided in an embodiment of this application. This method 300 is applied to a terminal device and does not rely on… Figure 3 The specific order is a limitation. It should be understood that in other embodiments, the order of some steps in method 300 can be interchanged according to actual needs, or some steps can be omitted or deleted. Method 300 may include S301 to S303. The following is a detailed explanation of each step.

[0146] S301. Detect whether the terminal device has a proximity light sensor.

[0147] In one possible implementation, the terminal device can obtain its own sensor list. If the sensor list contains the identification information for a proximity light sensor, it determines that the terminal device has a proximity light sensor. If the sensor list does not contain the identification information for a proximity light sensor, it determines that the terminal device does not have a proximity light sensor. The identification information for the proximity light sensor uniquely identifies the sensor; for example, the identification information for the proximity light sensor may be its name.

[0148] S302 or S303 can be executed after S301.

[0149] S302. When the terminal device has a proximity light sensor and the proximity light sensor reports proximity data, acquire the sensing information of the terminal device and determine whether the terminal device is in a pocket based on the sensing information.

[0150] The perception information includes the first ambient light intensity of the terminal device and / or the attitude information of the terminal device. Proximity data is used to indicate that the distance between the proximity sensor and the obstacle is less than or equal to a target distance threshold. Attitude information includes the orientation information of the terminal device; or, the attitude information includes the orientation information and stability information of the terminal device. Orientation information indicates whether the terminal device is in a vertical orientation, which is the orientation of the terminal device's screen being perpendicular or nearly perpendicular to the ground. Stability information indicates whether the terminal device is in a stable state. The proximity data reported by the terminal device's proximity sensor indicates that the terminal device has a proximity sensor (i.e., the terminal device supports under-display proximity light detection) and that the proximity sensor is not malfunctioning.

[0151] In one possible implementation, the proximity sensor includes one or more photosensitive elements (such as photodiodes, photoresistors, etc.) that can receive light signals from the external environment. When the photosensitive element receives a light signal, it converts the light signal into an electrical signal using the photoelectric effect. The intensity of this electrical signal is proportional to the intensity of the received light signal. The change in the electrical signal reflects the change in distance between the obstacle and the proximity sensor. Subsequently, corresponding data, such as proximity data or distance-away data, can be generated based on the electrical signal. Distance-away data indicates that the distance between the proximity sensor and the obstacle is greater than a target distance threshold.

[0152] For example, the optical signal can be converted into a voltage signal, which can then be 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 indicates that the voltage is greater than the voltage threshold, it is determined that an obstacle is approaching, and approach data is generated. If the comparison result indicates that the voltage is less than or equal to the voltage threshold, it is determined that the obstacle is moving away, and moving away data is generated.

[0153] In this embodiment, when the proximity sensor of the terminal device reports proximity data, the terminal device's perception information can be acquired; wherein, the perception information includes a first ambient light intensity and / or the terminal device's attitude information. The first ambient light intensity is the numerical value of the light intensity of the environment in which the terminal device is currently located. The terminal device's perception information can be collected by the terminal device itself through its sensors.

[0154] There are two possible scenarios for the proximity sensor on a terminal device to report proximity data. One is that the terminal device is in a pocket. The other is that the terminal device is not in a pocket, and the proximity sensor is obstructed; for example, if the user holds the terminal device and their hand blocks the proximity sensor, it may report proximity data even though the terminal device is not actually in a pocket. Based on this consideration, the device's sensing information can be acquired, and this information can be used to further detect whether the terminal device is in a pocket, thus improving the accuracy of determining whether the terminal device is in a pocket.

[0155] The following section will first provide a detailed explanation of how to obtain the first ambient light intensity of the terminal device.

[0156] In one possible implementation, the ambient light sensor of the terminal device can be used to obtain the value of the light intensity of the environment in which the terminal device is located, i.e., the first ambient light intensity.

[0157] The ambient light sensor may contain one or more photosensitive elements (such as photoresistors, photodiodes, or photocrystals). These photosensitive elements can convert received light (photons) into electrical signals (such as voltage or current signals) using the photoelectric effect. These electrical signals can then be amplified, filtered, and converted into digital signals. Finally, the digital signal is converted into a specific numerical value representing the light intensity, i.e., the first ambient light intensity.

[0158] The following provides a detailed explanation of how to obtain the attitude information of the terminal device.

[0159] In one possible implementation, the rotational angular velocity of the terminal device can be collected using an angular velocity sensor (such as a gyroscope sensor), and the orientation and stability information of the terminal device can be determined based on the rotational angular velocity. The attitude information of the terminal device includes both its orientation and stability information.

[0160] For example, a terminal device such as a mobile phone can measure the angular velocity data of the phone around its X, Y, and Z axes using an angular velocity sensor on the phone. Integrating this angular velocity data yields the phone's attitude angles. These attitude angles include pitch, roll, and yaw. Subsequently, the phone's orientation information in space can be determined based on these attitude angles. The orientation information can indicate whether the terminal device is in a vertical orientation, meaning the phone's screen is perpendicular or nearly perpendicular to the ground.

[0161] The stability information of a mobile phone can be determined by analyzing changes in angular velocity data over a preset time period. This stability information indicates whether the phone is in a stable state. If the changes indicate that the angular velocity data remains unchanged within the preset time period, or the change is within a preset amplitude threshold, then the stability information indicates that the phone is in a stable state. If the changes indicate that the angular velocity data changes within the preset time period, and the change exceeds the amplitude threshold, then the stability information indicates that the phone is in an unstable state. This amplitude threshold is the maximum amplitude threshold within the preset amplitude threshold range.

[0162] The following is a detailed explanation of how to determine whether a terminal device is in a pocket based on sensory information.

[0163] In this embodiment of the application, it can be determined whether the sensing information meets the sensing conditions, obtain a determination result, and determine whether the terminal device is in a pocket based on the determination result. Wherein:

[0164] In one possible implementation, the sensing information is a first ambient light intensity, and the sensing condition is that the ambient light intensity is less than or equal to an ambient light intensity threshold. If the first ambient light intensity is less than or equal to the ambient light intensity threshold, the sensing information is determined to meet the sensing condition, and the terminal device is determined to be in a pocket. If the first ambient light intensity is greater than the ambient light intensity threshold, the sensing information is determined not to meet the sensing condition. If the sensing information does not meet the sensing condition, further detection is needed to determine whether the terminal device is in a pocket.

[0165] In another possible implementation, the perceived information is posture information, which includes the orientation and stability information of the terminal device. The perception condition is that the terminal device's posture is vertical and stable. If the terminal device's posture information indicates that the terminal device is in a vertical and stable posture, the perception condition is satisfied, and the terminal device is determined to be in the pocket. If the terminal device's posture information indicates that the terminal device is not in a vertical and stable posture, the perception condition is not satisfied. If the perception condition is not satisfied, further detection is needed to determine whether the terminal device is in the pocket.

[0166] In another possible implementation, the sensing information consists of a first ambient light intensity and attitude information. The attitude information includes the terminal device's orientation and stability information. The sensing condition is that the ambient light intensity is less than or equal to an ambient light intensity threshold, and the terminal device's attitude is vertical and stable. If the first ambient light intensity is less than or equal to the ambient light intensity threshold, and the terminal device's attitude information indicates that the terminal device is in a vertical and stable posture, then the sensing information satisfies the sensing condition, and it can be determined that the terminal device is in a pocket. If the first ambient light intensity is greater than the ambient light intensity threshold, and the terminal device's attitude information indicates that the terminal device is not in a vertical and stable posture, then the sensing information does not satisfy the sensing condition; or, if the first ambient light intensity is less than or equal to the ambient light intensity threshold, and the terminal device's attitude information indicates that the terminal device is not in a vertical and stable posture, then the sensing information does not satisfy the sensing condition; or, if the first ambient light intensity is greater than the ambient light intensity threshold, and the terminal device is in a vertical and stable posture, then the sensing information does not satisfy the sensing condition. If the sensing information does not satisfy the sensing condition, further detection is needed to determine whether the terminal device is in a pocket.

[0167] Among the above implementation methods, if the perceived information meets the perception conditions, it can be determined that the terminal device is in a pocket. Of course, if the perceived information meets the perception conditions, further detection can also be used to determine whether the terminal device is in a pocket. Specifically, if the perceived information meets the perception conditions, the terminal device's image acquisition component acquires a first image. If the target object is not present in the first image, it is determined that the terminal device is in a pocket, and the target object is an object with a face.

[0168] For example, 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-facing camera and / or a rear-facing camera. When the perceived information meets the perception conditions, the mobile phone can acquire a first image through the image acquisition component. Subsequently, facial recognition is performed on the first image to determine whether a target object exists in the first image. If no target object is found in the first image, it is determined that the mobile phone is in a pocket. If a target object is found in the first image, it is determined that the mobile phone is not in a pocket. The first image can be, for example, an image within the field of view acquired by the image acquisition component.

[0169] Optionally, the target object can be an object with a specific face, such as a target face pre-recorded by the user.

[0170] The above scheme performs facial recognition on the first image to determine whether a target object exists in the image, serving as a basis for determining whether the terminal device is being used. If a target object is present in the first image, it indicates the terminal device is being used, meaning it is not in a pocket (i.e., not in a pocket), and the entire pocket detection process can be immediately terminated to ensure a smooth and uninterrupted user experience. If no target object is present in the first image, it indicates the terminal device is not being used, meaning it is in a pocket (i.e., in a pocket). This improves the accuracy of determining whether the terminal device is in a pocket.

[0171] The following section provides a detailed explanation of how to further detect whether the terminal device is in a pocket when the perceived information does not meet the perception conditions.

[0172] If the sensing information does not meet the sensing conditions, the proximity sensor may be blocked (not by the pocket). Based on this, an ultrasonic sensor, which is functionally similar to the proximity sensor, can be used to measure the distance between the terminal device and the obstacle in order to detect whether the terminal device is in the pocket.

[0173] In this embodiment, the distance between the terminal device and an obstacle can be detected using an ultrasonic sensor. If the distance is less than or equal to a target distance threshold, it can be determined that the terminal device is in a pocket. Alternatively, if the distance is less than or equal to the target distance threshold, ultrasonic data from the terminal device can be acquired, and the accuracy of determining whether the terminal device is in a pocket can be improved based on the ultrasonic data. Ultrasonic data can be collected using the ultrasonic sensor of the terminal device; the ultrasonic data includes at least one of the following: ultrasonic waveform (e.g., reflected wave waveform), amplitude, frequency, etc. The distance between the terminal device and the obstacle is calculated by measuring the time difference between the ultrasonic wave transmission and reception, combined with the speed of sound.

[0174] In this paper, the time difference between the emission and reception of ultrasound, the ultrasound waveform (such as the reflected wave waveform), amplitude, or frequency can all be referred to as ultrasound data.

[0175] The ultrasonic sensor consists of an ultrasonic transmitter and an ultrasonic receiver. The ultrasonic transmitter inside the sensor emits ultrasonic signals of a specific frequency and waveform. These signals propagate through space and are reflected when they encounter a pocket wall or other obstacles, generating reflected waves. These reflected waves are then captured by the ultrasonic receiver of the terminal device. The following section provides a detailed explanation of how to determine whether a terminal device is in a pocket based on ultrasonic data.

[0176] In one possible implementation, the ultrasonic data includes ultrasonic waveform, amplitude, and frequency. The terminal device is determined to be in the pocket if the changing trend of the ultrasonic waveform meets the target changing trend, the changing trend of the amplitude meets the preset amplitude changing trend, and the changing trend of the frequency meets the preset frequency changing trend. Here, the ultrasonic waveform is a reflected wave waveform. Conversely, if the changing trends do not meet the target trend, the terminal device is determined not to be in the pocket.

[0177] In one possible implementation, the ultrasonic data is an ultrasonic waveform. If the trend of the ultrasonic waveform's change matches the target trend, it is determined that the terminal device is in the pocket. If the trend of the ultrasonic waveform's change does not match the target trend, it is determined that the terminal device is in the pocket; otherwise, it is determined that the terminal device is not in the pocket. The ultrasonic waveform is a reflected wave waveform.

[0178] The target trend is defined as the pre-set trend of the reflected wave waveform when the terminal device is placed in a pocket. If the trend of the ultrasonic waveform matches the target trend, the ultrasonic waveform is determined to satisfy the target trend; or, if the similarity between the ultrasonic waveform and the target trend is greater than or equal to a similarity threshold, the ultrasonic waveform is determined to satisfy the target trend.

[0179] In another possible implementation, the ultrasonic data is a reflected wave waveform. Feature extraction can be performed on this reflected wave waveform to obtain waveform feature information, which includes amplitude variation information and waveform distortion information. The waveform distortion information represents the morphological changes that occur in the reflected wave waveform compared to the emitted wave waveform. This waveform feature information can be input into a pre-trained classifier. The classifier processes the waveform feature information to determine whether the terminal device is in a pocket. Specifically, the classifier matches the input waveform feature information with at least one preset target waveform feature indicating that the terminal device is in a pocket. If the waveform feature information matches the target waveform feature, the classifier outputs a judgment indicating that the terminal device is in a pocket, thus confirming that the terminal device is in a pocket. If the waveform feature information does not match the target waveform feature, the classifier outputs a judgment indicating that the terminal device is not in a pocket, thus confirming that the terminal device is not in a pocket.

[0180] The classifier is pre-trained using sample waveform feature information of the terminal device in different states, including but not limited to the terminal device being in a pocket and the terminal device not being in a pocket (e.g., in hand or on a table).

[0181] In one possible implementation, the ultrasonic waveform is, for example, a reflected wave waveform. The reflected wave waveform can be directly matched with at least one preset pocket waveform template (reflected wave waveform template) for when the terminal device is in a pocket. If a template matching the reflected wave waveform exists in at least one pocket waveform template, it is determined that the terminal device is in a pocket. If no template matching the reflected wave waveform exists in at least one pocket waveform template, it is determined that the terminal device is not in a pocket.

[0182] In this embodiment of the application, the determination result of whether the terminal device is in the pocket by the ultrasonic sensor can also be used as a preliminary determination result. Then, based on the initial determination result, the terminal device can be further detected to improve the accuracy of determining whether the terminal device is in the pocket.

[0183] Specifically, if the initial determination indicates that the terminal device is not in a pocket, subsequent detection can be omitted, and the initial determination can be taken as the final determination, i.e., the terminal device is determined not to be in a pocket. If the initial determination indicates that the terminal device is in a pocket, a first image is acquired by the image acquisition component of the terminal device. If the target object is not present in the first image, it is determined that the terminal device is in a pocket, and the target object is an object with a human face. If the target object is present in the first image, it is determined that the terminal device is not in a pocket.

[0184] For example, 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-facing camera and / or a rear-facing camera. The mobile phone can acquire an image within its field of view, i.e., a first image, through the image acquisition component. Subsequently, facial recognition is performed on the first image to determine whether a target object exists in the first image. If no target object is found in the first image, it is determined that the mobile phone is in a pocket. If a target object is found in the first image, it is determined that the mobile phone is not in a pocket.

[0185] The above solution uses facial recognition as a fallback mechanism for pocket detection. If the target object is present in the first image, the pocket detection process is immediately terminated, ensuring a smooth and uninterrupted user experience while using the terminal device. Furthermore, it improves the accuracy of determining whether the terminal device is in a pocket.

[0186] S303. When the terminal device has a proximity light sensor but the proximity light sensor does not report proximity data, or when the terminal device does not have a proximity light sensor, acquire ultrasonic data of the terminal device and determine whether the terminal device is in a pocket based on the ultrasonic data.

[0187] In this case, the terminal device is equipped with a proximity sensor. If the proximity sensor fails to report proximity data, the following situations may occur: the distance between the proximity sensor and the obstacle exceeds the target distance threshold, the proximity sensor is malfunctioning, or the proximity sensor is faulty. Both proximity sensor malfunction and failure can lead to missed detections. To avoid missed detections and address the issue of the terminal device being unable to perform bag-drop detection due to the lack of a proximity sensor in related technologies, considering the functional similarity between proximity sensors and ultrasonic sensors, an ultrasonic sensor can be used to measure the distance between the terminal device and the obstacle to determine whether the terminal device is in a pocket, thus improving the accuracy of determining whether the terminal device is in a pocket.

[0188] Specifically, determining whether a terminal device is in a pocket involves measuring the distance between the terminal device and an obstacle using an ultrasonic sensor. If the distance is less than or equal to a target distance threshold, the device is considered to be in the pocket. Alternatively, if the distance is less than or equal to the target distance threshold, ultrasonic data from the terminal device can be acquired, and the device's pocket status can be determined based on this data, thus improving the accuracy of this determination. Ultrasonic data can be collected using the terminal device's ultrasonic sensor; this data includes at least one of the following: ultrasonic waveform (e.g., reflected wave waveform), amplitude, and frequency. The distance between the terminal device and the obstacle is calculated by measuring the time difference between the ultrasonic wave's transmission and reception, combined with the speed of sound.

[0189] In this embodiment, the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S303 is the same as the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. For details, please refer to the specific implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. This embodiment will not be elaborated here.

[0190] This application provides a method for detecting whether a device is in a pocket. When the proximity sensor of a terminal device reports proximity data, the method acquires the terminal device's sensing information and determines whether the terminal device is in a pocket based on this information. The sensing information includes the terminal device's first ambient light intensity and / or its posture information. The proximity data indicates that the distance between the proximity sensor and an obstacle is less than or equal to a target distance threshold. When the terminal device's proximity sensor does not report proximity data, or the terminal device does not have a proximity sensor, the method acquires ultrasonic data from the terminal device and determines whether the terminal device is in a pocket based on this data. This method no longer relies solely on a single proximity sensor to determine whether the terminal device is in a pocket. Instead, it comprehensively considers whether the terminal device has a proximity sensor and whether the proximity sensor reports proximity data, employing corresponding detection methods to detect whether the terminal device is in a pocket, thereby improving the accuracy of determining whether the terminal device is in a pocket. This solves the problem of misjudgment or failure in related technologies that rely on proximity sensors to determine whether a terminal device is in a pocket.

[0191] It should be understood that the power consumption of the various sensors mentioned in this article, from highest to lowest, is as follows: ultrasonic sensor, image acquisition unit, ambient light sensor, proximity sensor, accelerometer, and angular velocity sensor.

[0192] For example, the terminal device may have an ultrasonic sensor, an image acquisition component, an ambient light sensor, an accelerometer, and an angular velocity sensor. In practical applications, the appropriate sensor can be selected to detect whether the terminal device is in a pocket, depending on the actual situation. Specifically, by using an accelerometer, or a combination of an accelerometer and an angular velocity sensor, it is possible to determine whether the terminal device has initiated a pocket-dropping action, and whether the action is an inverted or non-inverted pocket-dropping action.

[0193] In this article, ultrasonic sensors and proximity sensors operate on different principles, but both can be used for bag detection through distance measurement. Ultrasonic sensors consume significantly more power than proximity sensors. Considering power consumption, proximity sensors are preferred when the terminal device has one; otherwise, ultrasonic sensors are used. In cases where the proximity sensor is faulty, malfunctioning, or potentially exposed outside the pocket, an ultrasonic sensor can be used for re-detection to avoid false or missed detections caused by these issues.

[0194] Figure 4 This is a flowchart illustrating another bag detection method 400 provided in an embodiment of this application. Method 400 is... Figure 3 The method 300 shown is a refinement, and method 400 does not... Figure 4 The specific order is a limitation. It should be understood that in other embodiments, the order of some steps in method 400 can be interchanged according to actual needs, or some steps can be omitted or deleted. Method 400 may include steps 401 to 407. The steps are explained in detail below.

[0195] In the aforementioned embodiments, S301 can be implemented through S401 to S402:

[0196] S401. Detect whether the terminal device has performed a bag dropping action.

[0197] In this embodiment of the application, the acceleration data of the terminal device in three-dimensional space (X, Y, Z axes) can be collected in real time or periodically by the acceleration sensor of the terminal device. By analyzing the acceleration data, it can be determined whether the terminal device has dropped the bag.

[0198] In one possible implementation, acceleration data can be analyzed to extract acceleration feature information, such as at least one of the following: peak acceleration (i.e., the magnitude of the maximum or minimum acceleration), rate of change of direction (representing the rate at which the acceleration vector changes direction), and duration of acceleration. This acceleration feature information can be matched against multiple pre-set sets of bag-dropping acceleration feature information. If a feature matching the specified acceleration feature information is found among the multiple sets, it is determined that the terminal device has performed a bag-dropping action.

[0199] Alternatively, the acceleration data can be compared with baseline bag-dropping acceleration data. If the comparison result indicates that the difference between the acceleration data and the baseline bag-dropping acceleration data is less than or equal to a preset difference, it is determined that the terminal device has performed a bag-dropping action; otherwise, it is determined that the terminal device has not performed a bag-dropping action. Or, if the comparison result indicates that the similarity between the acceleration data and the baseline bag-dropping acceleration data is greater than a similarity threshold, it is determined that the terminal device has performed a bag-dropping action; otherwise, it is determined that the terminal device has not performed a bag-dropping action.

[0200] In another possible implementation, the determination of whether the terminal device has performed a bag-dropping action can be based on the acceleration waveform, the angular velocity waveform collected by the angular velocity sensor, and the pressure sensor waveform collected by the pressure sensor.

[0201] Specifically, the terminal device's acceleration data in three-dimensional space (X, Y, Z axes) is collected using its accelerometer, forming an acceleration waveform. Each point on the acceleration waveform represents the acceleration value of the terminal device in these three directions at a given moment. The terminal device's rotational speed data is collected using its angular velocity sensor, forming an angular velocity waveform. External pressure data is collected using its pressure sensor, forming a pressure waveform. Acceleration feature information is extracted from the acceleration waveform, including, for example, the peak value of acceleration, the rate of change of direction, and the duration of acceleration. Angular velocity feature information is extracted from the angular velocity waveform, including at least one of the changes in rotational speed, the change in rotational direction, and the duration of rotation. Pressure feature information is extracted from the pressure waveform, including at least one of the changes in pressure and the duration of pressure. The extracted acceleration, angular velocity, and pressure feature information can be input into a bag-dropping action recognition model. This model analyzes the input feature information to determine whether the terminal device has performed a bag-dropping action. The bag-dropping action recognition model is obtained by training a neural network algorithm on the sample acceleration feature information, sample angular velocity feature information, and sample pressure feature information corresponding to bag-dropping actions and non-bag-dropping actions.

[0202] It should be understood that the pocketing action can be the process by which a terminal device is intentionally moved towards the pocket from its original position, and at least reaches the pocket entrance or nearby area. The pocketing action emphasizes the action of the terminal device moving towards the pocket itself, rather than whether the terminal device ultimately successfully pockets the pocket.

[0203] S402. When the terminal device performs a bag-dropping action, detect whether the terminal device has a proximity light sensor.

[0204] The pocketing action includes inverted pocketing and non-inverted pocketing. An inverted pocketing action can be understood as a pocketing action with the head (top) facing down. A non-inverted pocketing action can be a pocketing action with the head (top) facing up. A non-inverted pocketing action can also be any pocketing action other than inverted pocketing and head-up pocketing.

[0205] In this embodiment, if the terminal device does not perform a pocket-dropping action, the process of detecting whether the terminal device is in a pocket can be omitted. When the terminal device does perform a pocket-dropping action, the process of detecting whether the terminal device is in a pocket is initiated, which reduces system power consumption and improves user experience. Among these steps, "detecting whether the terminal device has a proximity sensor" is a primary step in the process of detecting whether the terminal device is in a pocket.

[0206] Optionally, the proximity sensor is positioned at the head or top, and an ambient light sensor may also be located at the top.

[0207] For example, the inverted pocket drop action is the process of moving the phone to at least the pocket entrance or nearby area with the top of the phone away from the pocket entrance. The non-inverted pocket drop action is the process of moving the phone to at least the pocket entrance or nearby area with the top of the phone not away from the pocket entrance, for example, specifically, moving the phone to at least the pocket entrance or nearby area with the top of the phone close to the pocket entrance.

[0208] It should be noted that the implementation process of "detecting whether the terminal device has a proximity light sensor" in S402 is the same as the implementation process of "detecting whether the terminal device has a proximity light sensor" in S301. For details, please refer to the specific implementation process of "detecting whether the terminal device has a proximity light sensor" in S301. This application embodiment will not repeat it here.

[0209] S302 in the foregoing embodiments can be implemented by S403; 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.

[0210] S403. When the terminal device performs an inverted pocket-dropping action and the proximity sensor reports proximity data, acquire the terminal device's sensing information and determine whether the terminal device is in the pocket based on the sensing information. The pocket-dropping action includes the inverted pocket-dropping action.

[0211] In this embodiment, the proximity sensor is positioned at the head or top, and an ambient light sensor may also be located at the head (i.e., the top). When the terminal device performs an inverted pocket-dropping action (top-down pocket-dropping action) and the proximity sensor reports proximity data, it indicates that the terminal device may be in a pocket. Since neither the proximity sensor nor the ambient light sensor is exposed outside the pocket, the terminal device's sensing information can be acquired, and based on this information, it can be further determined whether the terminal device is in a pocket. This improves the reliability and accuracy of acquiring sensing information through the ambient light sensor and detecting whether the terminal device is in a pocket based on that sensing information. The sensing information includes at least a first ambient light intensity.

[0212] Moreover, the system only acquires sensing information and determines whether the device is in the pocket when the terminal device is inverted and the proximity sensor reports proximity data. This avoids frequent collection of sensing information for pocket detection, reduces system power consumption, and improves user experience.

[0213] Determining whether a terminal device is in a pocket based on sensory information can be achieved in the following ways:

[0214] If the perceived information meets the perception conditions, it is determined that the terminal device is in a pocket; or;

[0215] When the perceived information meets the perception conditions, the first image captured by the image acquisition component of the terminal device is acquired, and if there is no target object in the first image, it is determined that the terminal device is in a pocket and the target object is an object with a human face.

[0216] If the sensing information does not meet the sensing conditions, acquire ultrasonic data from the terminal device and determine whether the terminal device is in the pocket based on the ultrasonic data.

[0217] It should be noted that the implementation process of these methods is the same as the implementation process of "determining whether the terminal device is in the pocket based on the sensing information" involved in S302 of the aforementioned embodiment. For details, please refer to the specific implementation process of "determining whether the terminal device is in the pocket based on the sensing information" in S302. This application embodiment will not repeat it here.

[0218] In the above method, if the perceived information meets the perception conditions, it can be determined that the terminal device is in the pocket.

[0219] Of course, if the perceived information meets the perception conditions, a first image can be captured. Facial recognition can then be performed on this first image to determine if a target object exists, serving as the basis for determining whether the terminal device is being used. If no target object is present in the first image, it indicates the terminal device is not being used by the user, confirming it is in a pocket. If a target object is present in the first image, it indicates the terminal device is being used by the user, confirming it is not in a pocket. Thus, facial recognition serves as a fallback mechanism for pocket detection. If a target object is present in the first image, the pocket detection process immediately exits, ensuring a smooth and uninterrupted user experience while using the terminal device. Furthermore, it can improve the accuracy of determining whether the terminal device is in a pocket.

[0220] In this embodiment of the application, the sensing information includes at least the first ambient light intensity. The following situations may occur if the sensing information does not meet the sensing conditions:

[0221] The first scenario: The terminal device is not in the pocket. The proximity sensor reports proximity data for some reason (such as being blocked by dust or dirt). The ambient light sensor detects the light intensity outside the pocket, so it determines that the sensing information does not meet the sensing conditions.

[0222] The first scenario: The terminal device is in the pocket, and the proximity sensor reports proximity data. However, the ambient light sensor may be interfered with by light from outside the pocket, causing it to fail to detect the low-light environment inside the pocket correctly. Therefore, it is determined that the sensing information does not meet the sensing conditions.

[0223] Based on this, considering the possibility that proximity sensors may be blocked by non-pocket obstacles, an ultrasonic sensor with similar function to the proximity sensor can be used to re-detect the distance between the terminal device and the obstacle to determine whether the terminal device is in the pocket, thus improving the accuracy of determining whether the terminal device is in the pocket.

[0224] Specifically, determining whether a terminal device is in a pocket involves measuring the distance between the terminal device and an obstacle using an ultrasonic sensor. If the distance is less than or equal to a target distance threshold, the device is considered to be in the pocket. Alternatively, if the distance is less than or equal to the target distance threshold, ultrasonic data from the terminal device can be acquired, and the device's pocket status can be determined based on this data, thus improving the accuracy of this determination. Ultrasonic data can be collected using the terminal device's ultrasonic sensor; this data includes at least one of the following: ultrasonic waveform (e.g., reflected wave waveform), amplitude, and frequency. The distance between the terminal device and the obstacle is calculated by measuring the time difference between the ultrasonic wave's transmission and reception, combined with the speed of sound.

[0225] In this embodiment, the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S403 is the same as the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. For details, please refer to the specific implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. This embodiment will not be elaborated here.

[0226] S404. When the terminal device performs a non-inverted bag-dropping action and the proximity sensor reports proximity data, the terminal device acquires a first image through its image acquisition component. If the target object is not present in the first image, the terminal device is determined to be in a pocket and the target object is an object with a human face.

[0227] The location where the proximity sensor is set is indicated as the head or top.

[0228] In this embodiment of the application, when the terminal device performs a non-inverted bag-dropping action and the proximity sensor reports proximity data, the following situations may occur:

[0229] The first possibility is that the terminal device is in a pocket, and the proximity sensor reports proximity data because the pocket is blocking it.

[0230] The second scenario is that the device is not in the pocket and its proximity sensor is blocked (not in the pocket). For example, if the device is a mobile phone, and the user is putting the phone in their pocket, just as they bring it to the pocket opening, someone talks to them, causing them to pause the action and hold the phone. While holding the phone, their hand may be blocking the proximity sensor. In this process, the phone detects a non-inverted placement motion and the proximity sensor reports proximity data, but the phone is not actually in the pocket. This non-inverted placement motion could mean the phone is moved to the pocket opening with its top near the opening.

[0231] An ambient light sensor may also be installed at the top. In the event of a non-inverted pocket drop, if the terminal device is in the pocket, the ambient light sensor may be exposed outside the pocket.

[0232] The above scheme assumes the proximity sensor reports proximity data, meaning it is not malfunctioning, while the ambient light sensor may be exposed outside the pocket. Furthermore, due to the high power consumption of ultrasonic sensors, they can be omitted if the proximity sensor is functioning correctly. Based on these considerations, to determine if the device is in a pocket, an image acquisition unit can capture a first image, and facial recognition can be performed on this image to determine if a target object is present, serving as a basis for determining if the device is in use. If no target object is present in the first image, it indicates the device is not in use, thus confirming it is in a pocket. If a target object is present, it indicates the device is in use, thus confirming it is not in a pocket. This improves the accuracy of determining if the device is in a pocket.

[0233] Furthermore, the first image is only acquired and facial recognition is performed on the first image when the terminal device performs a non-inverted bag-dropping action and the proximity sensor reports proximity data. This avoids the problem of excessive power consumption of the terminal device caused by frequent acquisition of the first image and facial recognition on the first image.

[0234] The first image was captured by the image acquisition unit in low-power mode. Low-power mode image acquisition can be understood as capturing images under low-light conditions, or capturing images based on the light intensity passively received by the camera. This reduces the overall power consumption of the bag detection and improves the user experience.

[0235] S405. When the terminal device performs a non-inverted pocket-dropping action and the proximity sensor does not report proximity data, acquire the ultrasonic data of the terminal device and determine whether the terminal device is in the pocket based on the ultrasonic data.

[0236] The location where the proximity sensor is set is indicated as the head or top.

[0237] In this embodiment of the application, if the terminal device performs a non-inverted bag-dropping action and the proximity sensor does not report proximity data, the following situations may exist:

[0238] The first scenario: The terminal device may be in a pocket, and the proximity sensor may be malfunctioning or exposed outside the pocket.

[0239] The second scenario: The device is not in the pocket. For example, if a user is putting their phone in their pocket and is interrupted by a sudden event just as they bring the phone to the pocket entrance, the proximity sensor will not report proximity data if it is not blocked by the user's hand. In this case, a non-inverted pocket placement action could be the process of the phone being moved to the pocket entrance with its top near the entrance.

[0240] Based on the above, and considering the risks of proximity sensors malfunctioning or being exposed outside the pocket, as well as the risk of ambient light sensors being exposed outside the pocket, an ultrasonic sensor, functionally similar to a proximity sensor, can be used to measure the distance between the terminal device and obstacles to determine whether the terminal device is in the pocket. This avoids missed detections due to proximity sensor malfunction or exposure outside the pocket, improving the accuracy of determining whether the terminal device is in the pocket.

[0241] Specifically, determining whether a terminal device is in a pocket involves measuring the distance between the terminal device and an obstacle using an ultrasonic sensor. If the distance is less than or equal to a target distance threshold, the device is considered to be in the pocket. Alternatively, if the distance is less than or equal to the target distance threshold, ultrasonic data from the terminal device can be acquired, and the device's pocket status can be determined based on this data, thus improving the accuracy of this determination. Ultrasonic data can be collected using the terminal device's ultrasonic sensor; this data includes at least one of the following: ultrasonic waveform (e.g., reflected wave waveform), amplitude, and frequency. The distance between the terminal device and the obstacle is calculated by measuring the time difference between the ultrasonic wave's transmission and reception, combined with the speed of sound.

[0242] In this embodiment, the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S405 is the same as the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. For details, please refer to the specific implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. This embodiment will not be elaborated here.

[0243] S406. When the terminal device performs a non-inverted pocket-dropping action and the terminal device does not have a proximity light sensor, acquire ultrasonic data of the terminal device and determine whether the terminal device is in the pocket based on the ultrasonic data.

[0244] In this embodiment, a non-inverted pocket-dropping action occurs on the terminal device, assuming the terminal device lacks a proximity sensor. In this case, an ultrasonic sensor, functionally similar to a proximity 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 avoids over-reliance on proximity sensors to detect whether the terminal device is in the pocket, overcoming the limitations of related technologies that rely too heavily on proximity sensors to detect whether the terminal device is in the pocket (e.g., unable to detect whether the terminal device is in the pocket when it lacks a proximity sensor), thus improving the versatility and accuracy of detecting whether the terminal device is in the pocket.

[0245] Specifically, determining whether a terminal device is in a pocket involves measuring the distance between the terminal device and an obstacle using an ultrasonic sensor. If the distance is less than or equal to a target distance threshold, the device is considered to be in the pocket. Alternatively, if the distance is less than or equal to the target distance threshold, ultrasonic data from the terminal device can be acquired, and the device's pocket status can be determined based on this data, thus improving the accuracy of this determination. Ultrasonic data can be collected using the terminal device's ultrasonic sensor; this data includes at least one of the following: ultrasonic waveform (e.g., reflected wave waveform), amplitude, and frequency. The distance between the terminal device and the obstacle is calculated by measuring the time difference between the ultrasonic wave's transmission and reception, combined with the speed of sound.

[0246] In this embodiment, the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S406 is the same as the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. For details, please refer to the specific implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. This embodiment will not be elaborated here.

[0247] S407. When the terminal device inverts and falls into the pocket, and the proximity sensor does not report proximity data, the ultrasonic data of the terminal device is acquired, and the terminal device is determined to be in the pocket based on the ultrasonic data.

[0248] In this embodiment of the application, if the terminal device performs an inverted bag-dropping action (a bag-dropping action with the top facing down), and the proximity sensor does not report proximity data, the following situations may occur:

[0249] The first scenario: The terminal device may be in a pocket, the proximity sensor may be faulty or may be malfunctioning.

[0250] The second scenario is when the device is outside the pocket, meaning it's not inside. For example, if a user is putting their phone into their pocket and is interrupted by a sudden event just as they bring the phone to the pocket entrance, and the proximity sensor is not blocked by the user's hand, then the proximity sensor will not report proximity data.

[0251] Based on the above, and considering the risk of proximity sensors malfunctioning or failing, relying solely on proximity sensors to detect whether the device is in a pocket during a non-inverted pocket-dropping action is inaccurate. Therefore, an ultrasonic sensor, functionally similar to a proximity sensor, can be used to measure the distance between the device and an obstacle to determine if the device is in a pocket. This avoids missed detections caused by proximity sensor failure or malfunction, improving the accuracy of determining whether the device is in a pocket.

[0252] Specifically, determining whether a terminal device is in a pocket involves measuring the distance between the terminal device and an obstacle using an ultrasonic sensor. If the distance is less than or equal to a target distance threshold, the device is considered to be in the pocket. Alternatively, if the distance is less than or equal to the target distance threshold, ultrasonic data from the terminal device can be acquired, and the device's pocket status can be determined based on this data, thus improving the accuracy of this determination. Ultrasonic data can be collected using the terminal device's ultrasonic sensor; this data includes at least one of the following: ultrasonic waveform (e.g., reflected wave waveform), amplitude, and frequency. The distance between the terminal device and the obstacle is calculated by measuring the time difference between the ultrasonic wave's transmission and reception, combined with the speed of sound.

[0253] In this embodiment, the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S407 is the same as the implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. For details, please refer to the specific implementation process of "acquiring ultrasonic data of the terminal device and determining whether the terminal device is in a pocket based on the ultrasonic data" in S302. This embodiment will not be elaborated here.

[0254] It should be noted that the descriptions of the same steps and contents in the embodiments of this application as in other embodiments can be referred to the descriptions in other embodiments, and will not be repeated here.

[0255] This application provides a method for detecting whether a terminal device has performed a pocket-dropping action. Upon the occurrence of this action, a process for "detecting whether the terminal device is in a pocket" is initiated. After the pocket-dropping action occurs, the method considers the type of action (inverted or non-inverted), the presence of a proximity sensor, and whether the sensor reports proximity data. It identifies potential risks associated with the proximity sensor (e.g., failure, malfunction, or exposure outside the pocket when the device is in the pocket) and the ambient light sensor (e.g., exposure of the ambient light sensor when the pocket is small). Based on these factors, a corresponding sensor is used to further detect whether the device is in a pocket, improving the accuracy of pocket-dropping detection. This solves the problem of misjudgment or missed detection in related technologies that rely on proximity sensors to determine whether a terminal device is in a pocket.

[0256] Figure 5This is a flowchart illustrating another bag detection method 500 provided in this application embodiment. Method 500 does not rely on... Figure 5 The specific order is a limitation. It should be understood that in other embodiments, the order of some steps in method 500 can be interchanged according to actual needs, or some steps can be omitted or deleted. Method 500 may include steps 501 to 503. The following is a detailed explanation of each step.

[0257] S501. Obtain touch information for the touch screen of the terminal device.

[0258] The touch information includes at least one of the following: touch location, touch area, and touch duration.

[0259] In this embodiment, touch position refers to the specific location on the touchscreen. Touch area refers to the size of the area in contact with the screen when touched. Touch duration refers to the duration of touching the touchscreen.

[0260] In one possible implementation, the touchscreen can be a capacitive touchscreen, which determines touch information by detecting changes in capacitance on the touchscreen. For example, the touchscreen area can be divided into multiple sub-areas, and the touch location can be determined by detecting which sub-area's capacitance changed. The touch area is determined by measuring the range and intensity of the capacitance change. The touch duration is determined by monitoring the duration of the capacitance change.

[0261] In this embodiment of the application, it can be determined whether the touch information meets the pocket touch condition, and based on the determination result, it can be detected whether the terminal device is in the pocket.

[0262] For example, the pocket touch conditions are that the touch area is less than or equal to the touch area threshold, or the touch position is within the target touch area, and the touch duration is less than a preset duration.

[0263] Specifically, if the touch information does not meet the pocket touch condition, it can be determined that the terminal device is not in a pocket. If the touch information meets the pocket touch condition, it may be a pocket touch, and further detection can be performed to determine whether the terminal device is in a pocket, thereby improving the accuracy of determining whether the terminal device is in a pocket.

[0264] For example, the touch information obtained for the touch screen of the terminal device is the touch area. If 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 then it can be determined that the terminal device is not in the pocket.

[0265] S502. When the touch information meets the pocket touch conditions, the first image is acquired by the image acquisition component of the terminal device.

[0266] In this embodiment, if the touch information meets the pocket touch condition, it is determined that the touch information may have been generated by pocket touch. A first image can be captured by the image acquisition component of the terminal device, and facial recognition can be performed on the first image to further determine whether the terminal device is in a pocket. If a target object is present in the first image, it indicates that the terminal device is being used or the user is about to use the terminal device, thus it can be determined that the terminal device is not in a pocket.

[0267] S503, if the target object is not present in the first image, determine that the terminal device is in a pocket and the target object is an object with a human face.

[0268] It should be noted that the descriptions of the same steps and contents in the embodiments of this application as in other embodiments can be referred to the descriptions in other embodiments, and will not be repeated here.

[0269] This application provides a pocket-in detection method, which acquires touch information from the touchscreen of a terminal device; when the touch information meets the conditions for pocket touch, a first image is captured by the image acquisition component of the terminal device; if no target object is found in the first image, it is determined that the terminal device is in a pocket, and the target object is an object with a face. Thus, by first identifying whether the touch behavior is a pocket touch or a non-pocket touch through the touch information, and then, if a pocket touch is detected, the first image is captured by the image acquisition component of the terminal device; if no target object is found in the first image, it is determined that the terminal device is in a pocket, thereby improving the accuracy of determining whether the terminal device is in a pocket.

[0270] Figure 6 This is a schematic flowchart of a bag detection method 600 provided for another embodiment of this application. Method 600 is... Figure 5 The method shown in 500 is a refinement; method 600 does not... Figure 6 The specific order is a limitation. It should be understood that in other embodiments, the order of some steps in method 600 can be interchanged according to actual needs, or some steps can be omitted or deleted. Method 600 may include steps 601 to 604. The steps are explained in detail below.

[0271] S601. Detect whether the terminal device has performed a bag dropping action.

[0272] It should be noted that the implementation process of S601 and S401 can be referred to the specific implementation process of S401, and will not be repeated here in the embodiments of this application.

[0273] S602. When the terminal device performs a bag-dropping action, obtain the touch information of the terminal device's touch screen.

[0274] The touch information includes at least one of the following: touch location, touch area, and touch duration.

[0275] It should be noted that the implementation process of "obtaining touch information for the touch screen of the terminal device" in S602 is the same as that in S501. For details, please refer to the specific implementation process of S501. This application embodiment will not be repeated here.

[0276] S603. When the touch information meets the pocket touch conditions, the first image is acquired by the image acquisition component of the terminal device.

[0277] S604. If the target object is not present in the first image, determine that the terminal device is in a pocket and the target object is an object with a human face.

[0278] It should be noted that the descriptions of the same steps and contents in the embodiments of this application as in other embodiments can be referred to the descriptions in other embodiments, and will not be repeated here.

[0279] This application provides a method for detecting whether a terminal device has made a pocket-dropping action. When a pocket-dropping action occurs, a process for "detecting whether the terminal device is in a pocket" is initiated. This process includes first identifying whether the touch action is a pocket touch or a non-pocket touch using touch information. If a pocket touch is detected, a first image is captured by the terminal device's image acquisition component. If a face is detected in the first image, it is determined that the terminal device is in a pocket, thus improving the accuracy of determining whether the terminal device is in a pocket.

[0280] Figure 7 This is a flowchart illustrating another bag detection method 700 provided in another embodiment of this application. Method 700 is applied to a terminal device, and is illustrated using a mobile phone as an example. Method 700 does not... Figure 7 The specific order is a limitation. It should be understood that in other embodiments, the order of some steps in method 700 can be interchanged according to actual needs, or some steps can be omitted or deleted. Method 700 may include steps 701 to 708. The following is a detailed explanation of each step.

[0281] S701, detect whether the phone has dropped into a pocket.

[0282] In this embodiment of the application, the subsequent detection process is not initiated if the mobile phone does not fall into the bag.

[0283] S702. When the phone is dropped into a bag, determine whether the phone has a proximity sensor.

[0284] Specifically, if the phone does not have a proximity sensor, either step S703 or S704b is executed. If the phone has a proximity sensor, step S704a is executed.

[0285] S703. Obtain touch information and determine whether the touch information meets the pocket touch conditions.

[0286] If the touch information meets the pocket touch condition, step S708 is executed. If the touch information does not meet the pocket touch condition, it can be determined that the phone is not in a pocket.

[0287] It should be noted that the implementation process of S703 is different from... Figure 5 The implementation process of "acquiring touch information and determining whether the touch information meets the pocket touch conditions" in the corresponding embodiments is the same, and can be referred to for details. Figure 5 The specific implementation process of "acquiring touch information and determining whether the touch information meets the pocket touch conditions" in the corresponding embodiments will not be repeated here.

[0288] S704a. Did the phone fall headfirst into the pocket?

[0289] In this embodiment, the head-down pocket-dropping action can be understood as the top-down pocket-dropping action, or the inverted pocket-dropping action. Here, "head" (top) refers to the location of the proximity sensor on the phone. Specifically, the head-down pocket-dropping action can be the process of the phone being moved, with its head (top) near the pocket entrance, to at least the pocket entrance or its vicinity.

[0290] Specifically, if the phone is in a head-down pocketing motion, S705a is executed. If the phone is not in a head-down pocketing motion, S705b is executed.

[0291] It should be noted that the implementation process of S704a is similar to... Figure 4 The implementation process of "whether the terminal device performs an inverted bag-dropping action" is the same in the corresponding embodiments, and can be referred to for details. Figure 4 The specific implementation process of "whether the terminal device performs an inverted bag-dropping action" in the corresponding embodiments will not be repeated here.

[0292] S704b: Determine if the phone has undergone a head-down pocketing motion.

[0293] Specifically, upon confirming that the phone has made a head-down pocketing motion, S707b is executed.

[0294] It should be noted that the implementation process of S704b is similar to... Figure 4 The implementation process of "whether the terminal device performs an inverted bag-dropping action" is the same in the corresponding embodiments, and can be referred to for details. Figure 4 The specific implementation process of "whether the terminal device performs an inverted bag-dropping action" in the corresponding embodiments will not be repeated here.

[0295] Although S704a and S704b have the same steps, the steps performed after S704a and S704b are different.

[0296] S705a. Determine whether the proximity sensor on the phone is reporting proximity data.

[0297] If it is determined that the proximity sensor on the phone has reported proximity data, step S706 is executed. If it is determined that the proximity sensor on the phone has not reported proximity data, step S707a is executed.

[0298] S705b: Determine whether the proximity sensor on the phone is reporting proximity data.

[0299] If it is determined that the proximity sensor on the phone has reported proximity data, step S708 is executed. If it is determined that the proximity sensor on the phone has not reported proximity data, step S707a is executed.

[0300] It should be noted that although S704a and S704b have the same steps, the steps performed after S705a are different from the steps performed after S705b.

[0301] S706. Determine whether the ambient light and orientation of the phone meet the pocket characteristics.

[0302] Among them, the ambient light of the mobile phone can be represented by the first ambient light intensity, and the posture of the mobile phone can be represented by posture information, which includes orientation information and stability information.

[0303] Specifically, if the ambient light and orientation of the phone satisfy the pocket characteristics, step S708 is executed. If the ambient light and orientation of the phone do not satisfy the pocket characteristics, step S707a is executed.

[0304] For example, the pocket feature can be the perception condition in the aforementioned embodiments, such as the ambient light intensity being less than or equal to the ambient light intensity threshold, and the phone being in a vertical and stable posture.

[0305] S707a: The distance between the mobile phone and the obstacle is detected by an ultrasonic sensor, and it is determined whether the distance is less than or equal to the target distance threshold.

[0306] If the distance is less than or equal to the target distance threshold, execute S708. If the distance is greater than the target distance threshold, determine that the phone is not in your pocket.

[0307] S707b: Detects the distance between the mobile phone and the obstacle using an ultrasonic sensor, and determines whether the distance is less than or equal to the target distance threshold.

[0308] Specifically, if the distance is less than or equal to the target distance threshold, step S708 is executed. If the distance is greater than the target distance threshold, it is determined that the phone is not in a pocket.

[0309] S708. The phone captures an image (i.e., the first image) using its camera, and determines whether the image contains a face. If a face is present, the phone is determined not to be in the pocket; if no face is present, the phone is determined to be in the pocket.

[0310] The above method uses the act of the phone being placed in a pocket as the trigger condition for initiating the "detection of whether the phone is in the pocket" process, ensuring the timeliness and specificity of the detection. During the detection process, if a proximity sensor is unavailable, malfunctioning, potentially exposed outside the pocket, or obstructed by other parts of the pocket, an ultrasonic sensor can be used for detection, considering the functional similarity between proximity sensors and ultrasonic sensors, thus improving the reliability and accuracy of pocket-placement detection. Furthermore, if other sensors detect the phone in a pocket, facial recognition is introduced as a fallback mechanism for pocket-placement detection. If facial recognition confirms the user is using the phone, the detection process immediately exits, ensuring a smooth and uninterrupted user experience. If facial recognition determines the user is not using the phone, the phone is confirmed to be in the pocket. This enhances the accuracy and robustness of pocket-placement detection.

[0311] It should be noted that the descriptions of the same steps and contents in the embodiments of this application as in other embodiments can be referred to the descriptions in other embodiments, and will not be repeated here.

[0312] This application provides a method for detecting whether a mobile phone has been placed in a pocket. Upon detecting this action, the method initiates a process to "detect whether the mobile phone is in a pocket." The method considers several factors, including the specific action, the presence of a proximity sensor, and whether the sensor reports proximity data when present. Corresponding detection methods are then used to determine whether the phone is in a pocket, thus improving the accuracy of determining whether the phone is in a pocket.

[0313] Figure 8This is a flowchart illustrating another pocket detection method 800 provided in another embodiment of this application. Method 800 can be executed after determining that the terminal device is in a pocket, for example, after determining that the terminal device is in a pocket using methods 300, 400, 500, 600, or 700 described above; it can also be executed after determining that the terminal device is in a pocket using other methods. Method 800 includes steps S801 to S802. The following provides a detailed explanation of each step.

[0314] S801. When the terminal device is in a pocket, determine the scene in which the terminal device is located.

[0315] In S801, the terminal device being in a pocket can be detected by the terminal device itself.

[0316] In this embodiment, the scenario in which the terminal device is located can be determined based on the current interface of the terminal device. The scenario can be divided into two types: a first scenario and a second scenario. The first scenario can be an operation continuity scenario, and the second scenario can be a video playback scenario or a target scenario. The target scenario can be any scenario other than the operation continuity scenario and the video playback scenario. Regarding operation continuity, the operation continuity scenario is stronger than the video playback scenario, and the video playback scenario is stronger than the target scenario.

[0317] Operational continuity scenarios refer to real-time, two-way, and highly interactive environments and situations where users can interact with the current interface. These scenarios demand extremely high levels of continuity and timeliness in operations, and interruptions significantly impact the user experience. Examples of operational continuity scenarios include payment and gaming scenarios.

[0318] Among them, the video playback scenario refers to the specific environment and situation in which users receive and enjoy multimedia entertainment resources through terminal devices. This scenario integrates multiple media elements such as images, audio, and subtitles.

[0319] The target scenarios include, but are not limited to, reading e-books, browsing web pages, online learning, remote work, or social chatting.

[0320] The following provides a detailed explanation of how to determine the current state of a terminal device based on its current interface.

[0321] In one possible implementation, if the current interface of the terminal device has at least one of the following information: a QR code for payment or receipt, a barcode for payment or receipt, or a payment control (such as a button to submit an order), the scenario in which the terminal device is located is determined to be a payment scenario.

[0322] In another possible implementation, if the current interface of the terminal device has game-specific visual elements and / or game-specific interaction methods, the scene in which the terminal device is located is determined to be a game scene. Alternatively, if the current interface of the terminal device is the interface of a game app, the scene in which the terminal device is located is determined to be a game scene.

[0323] For example, image recognition technology is used to detect the content of the current interface of the terminal device to determine whether there are game-specific visual elements on the current interface, such as characters, game user interface (UI) elements, scene background, etc. Then, the interaction method between the user and the current interface is analyzed to observe whether there are game-specific operational feedbacks, such as character movement, attack effects, sound effects, etc. If all of these are present, the scene in which the terminal device is located is determined to be a game scene.

[0324] In another possible implementation, if the current interface of the terminal device is the interface of a video playback app, the scenario in which the terminal device is located is determined to be a video scenario.

[0325] S802. Based on the scenario in which the terminal device is located, determine whether to control the terminal device to display the anti-accidental touch interface.

[0326] In this embodiment, the terminal device pre-stores at least one scene identifier corresponding to the display of the accidental touch prevention interface. The identifier of the scene in which the terminal device is located can be matched with the at least one scene identifier corresponding to the accidental touch prevention interface. If a scene identifier matching the one of the at least one scene identifiers is found, the terminal device is controlled to display the accidental touch prevention interface. If no scene identifier matching the one of the at least one scene identifiers is found, the terminal device is not controlled to display the accidental touch prevention interface.

[0327] S802 can be implemented in the following ways:

[0328] In scenario one, the terminal device is not controlled to display the accidental touch prevention interface. In scenario two, the terminal device is controlled to display the accidental touch prevention interface. Scenario one and scenario two differ. Scenario one prioritizes operational continuity over scenario two.

[0329] In this embodiment, the scenario where the terminal device is located is the first scenario, in which the terminal device may not be controlled to display the anti-mistouch interface. That is, the original interface of the terminal device is maintained, and the screen is not locked or the anti-mistouch interface is not displayed. In this way, the terminal device can respond to touch / touch input operations in real time, and this response capability is not affected by the device being in a pocket.

[0330] When the terminal device is in the second scenario, control the terminal device to display the anti-accidental touch interface. The second scenario is a video playback scenario or a conversation scenario through a conversation window, such as a social chat scenario.

[0331] Optionally, the anti-mistouch interface is located on top of all interface layers on the terminal device to prevent accidental touch notifications when the touchscreen is in a pocket.

[0332] Specifically, S802 can also be implemented through the following schemes:

[0333] Option 1: In scenarios where the terminal device operates continuously, the display of the anti-accidental touch interface will not be controlled. The first scenario is a continuous operation scenario, such as a payment scenario or a gaming scenario.

[0334] For example, taking a continuous operation scenario as a payment scenario, in the shopping payment process, such as... Figure 9 As shown, the payment code has been presented. If the user then realizes they have other items to purchase, they will put their phone in their pocket to retrieve them. During this process, the phone can detect that it has been placed in the pocket and, based on the current interface, determines that a payment scenario is in progress. The phone will not display the accidental touch prevention screen but will maintain the original interface. That is, the phone's display will still show... Figure 9 The payment interface shown makes it easier for users to continue using the service, avoiding the inconvenience that might be caused by the phone automatically entering the anti-accidental touch interface simply because it is in a pocket, thus improving the user experience.

[0335] In another example, taking a game scenario with continuous operation as an example, the user is playing a game, such as... Figure 10 As shown, the phone's interface is a game screen. If the user needs to wash their hands, they might put the phone in their pocket. During this process, the phone can detect that it has been placed in the pocket and, based on the current screen, determines that it is in a game scene. The phone will not display the accidental touch prevention screen but will maintain the original screen. In this way, even if the phone is in a pocket, its display screen remains unchanged. Figure 10 The game interface shown ensures that users can seamlessly continue playing the game on their phones afterward. This avoids the inconvenience that might occur if the anti-accidental touch interface is blindly displayed simply because the phone is in a pocket, thus improving the user experience.

[0336] Option 2: When the terminal device is in a video playback scenario, the terminal device is controlled to display an anti-accidental touch interface. Accordingly, the terminal device displays this anti-accidental touch interface. Here, the second scenario is a video playback scenario.

[0337] For example, a user watches videos (such as variety shows) at home, such as... Figure 11As shown in (a), the phone's interface is a landscape video playback screen. If someone knocks on the door, the user might put the phone in their pocket to open it. During this process, the phone can detect that it has been put in a pocket and, based on the current screen, determines that it is in a video playback scenario. The phone will then display an anti-mistouch screen, which will change the displayed screen from... Figure 11 Switch to the video playback interface shown in (a) Figure 11 The anti-accidental touch interface is shown in (b). Of course, when users watch videos at home, such as... Figure 11 As shown in (c), the phone's interface can also be a portrait-oriented video playback interface. When the phone detects that it has been put into a pocket and determines that it is in a video playback scenario based on the current interface, it will change the display interface from portrait to portrait. Figure 11 Switch to the video playback interface shown in (a) Figure 11 The anti-accidental touch interface shown in (d) is shown in the middle.

[0338] In video playback scenarios, since user interaction with the interface is relatively limited, displaying the anti-accidental touch interface can effectively prevent accidental touches on the phone, thereby improving the user experience.

[0339] Option 3: If the scenario in which the terminal device is located is the target scenario, determine that the terminal device should display the anti-mistouch interface. Accordingly, the terminal device displays this anti-mistouch interface. If the duration of displaying the anti-mistouch interface exceeds the target duration, control the terminal device to enter a locked screen state. Here, the second scenario is the target scenario.

[0340] The target duration may be, for example, 10 seconds. The target duration can be flexibly set according to the actual application. This application does not limit the specific target duration.

[0341] For example, during a break between classes, a user chats with others through a conversation window in application A on their mobile phone, such as... Figure 12 As shown in (a), this window supports text or voice input. When the class bell rings and the user puts the phone in their pocket, the phone can detect that it has been placed in the pocket and determine that the user is in a social chat scenario based on the current interface. The phone will automatically display an anti-accidental touch interface. For example, the phone will display the interface from... Figure 12 The chat interface shown in (a) switches to Figure 12 The anti-mistouch interface is shown in (b). When the duration of displaying this anti-mistouch interface exceeds the target duration, the phone will automatically enter lock screen mode, for example, as shown in (b). Figure 12The state is shown in (c). Therefore, considering the relatively weak continuity of user interaction with the phone interface in the target scenario, displaying the anti-mistouch interface effectively prevents accidental touches. Furthermore, if the duration of the anti-mistouch interface display exceeds the target duration, the terminal device remains locked. This prevents accidental touches from the pocket while protecting user privacy and data security, reducing power consumption, extending standby time, lowering power consumption, and improving the user experience.

[0342] In related technologies, an anti-mistouch interface is typically displayed when the phone is detected to be in a pocket. This approach is rather general and fails to fully consider the specific needs of different usage scenarios. The embodiments of this application, however, consider the continuity of operation in different scenarios when the terminal device is in a pocket, determining whether to display the anti-mistouch interface accordingly. Furthermore, for scenarios with weak operational continuity, considering factors such as the terminal device's power consumption, if the duration of displaying the anti-mistouch interface exceeds the target duration, the terminal device is locked, thereby extending the phone's standby time, reducing power consumption, and improving the user experience.

[0343] It should be noted that when the terminal device is in a pocket and the anti-mistouch interface is displayed, the anti-mistouch interface will exit if one or more of the following conditions are met: (The following is a list of conditions to be filled in)

[0344] The first item: The proximity sensor of the terminal device reports distance data, which is used to indicate that the distance between the proximity sensor and the obstacle is greater than the target distance threshold.

[0345] The second item: The target object is present in the second image captured by the image acquisition unit of the terminal device. The target object is an object with a human face. The second image is the image captured by the image acquisition unit of the terminal device within its field of view after the terminal device is in a pocket and the anti-accidental touch interface is displayed.

[0346] The third condition is that the second ambient light intensity of the terminal device is greater than the target intensity threshold, and the terminal device has undergone a lifting action.

[0347] The second ambient light intensity refers to the light intensity of the environment in which the terminal device is located when it is in a pocket and the anti-mistouch interface is displayed. The lifting action refers to the process of the user picking up or raising the terminal device from a stationary or placed state.

[0348] For example, the acceleration data of the terminal device can be detected by the accelerometer of the terminal device along different axes (X, Y, and Z axes), and the rotational motion of the phone around different axes (X, Y, and Z axes) can be detected by the gyroscope sensor. Based on this acceleration and angular velocity data, it can be identified whether the terminal device has undergone a lifting action.

[0349] Fourth item: The user's exit operation on the anti-accidental touch interface was detected.

[0350] In one possible implementation, if the proximity sensor of the terminal device reports a distance away after the terminal device is in a pocket and the anti-mistouch interface is displayed, the anti-mistouch interface will automatically exit.

[0351] Among them, the distance data is used to indicate that the distance between the proximity sensor and the obstacle is greater than the target distance threshold.

[0352] In this embodiment, when the proximity sensor reports "moving away," it is determined that the terminal device has left the pocket or been removed from the pocket. Based on this determination, the terminal device automatically exits the anti-mistouch interface to restore its responsiveness to user operations, improving the user experience and allowing users to operate the terminal device more conveniently.

[0353] In one possible implementation, after the terminal device is in a pocket and the anti-mistouch interface is displayed, an image, i.e., a second image, is captured by the terminal device's image acquisition component. Facial recognition is then performed on the second image to determine if a target object exists within it. If a target object is found in the second image, it indicates that the terminal device needs to be used by the user or is currently being used by the user, and the anti-mistouch interface can be automatically exited.

[0354] In one possible implementation, after the terminal device is in a pocket and the anti-mistouch interface is displayed, the second ambient light intensity of the terminal device is greater than the target intensity threshold, and the terminal device is raised.

[0355] Specifically, if the ambient light intensity of the terminal device is greater than the target intensity threshold and the terminal device is raised, it can be determined that the terminal device has left the pocket and can automatically exit the anti-mistouch interface.

[0356] In one possible implementation, after the terminal device is in a pocket and the anti-mistouch interface is displayed, the user can exit the anti-mistouch interface if an exit operation is detected.

[0357] For example, such as Figure 13 As shown, users can... Figure 13 The control shown for canceling the accidental touch prevention interface is slid twice to the right. The terminal device can respond to this operation by exiting the accidental touch prevention interface and displaying, as shown below. Figure 12 The interface shown in (a) is an example. The exit operation involves dragging the control used to undo the accidental touch prevention interface twice to the right.

[0358] It should be noted that the pocket in this application can refer to a trouser pocket, an outer coat pocket, an outer backpack pocket, etc. This application uses a trouser pocket as an example to illustrate the method of detecting lost pockets, and should not be construed as a limitation on the range of pockets to which this application applies.

[0359] This application provides a pocket-drop detection method that can identify the scene in which the terminal device is located and determine whether to control the terminal device to display an anti-accidental touch interface based on the scene. This avoids the inconvenience that may be caused to users simply because the terminal device is in a pocket, and improves the user experience.

[0360] It should be noted that the information collection process (such as collecting the first image, the second image, and touch information of the touch screen of the terminal device) / feature extraction process involved in this application is performed with the user's knowledge and permission. That is, the information collection process / feature extraction process is compliant and does not constitute an act that harms the public interest.

[0361] Based on the above embodiments, in other embodiments of this application, the terminal device is a mobile phone, and multiple modules can be deployed on the mobile phone to implement the above-mentioned bag detection method.

[0362] For example, the multiple modules include a multimodal fusion mobile phone pocketing module, a mobile phone motion state recognition module, a proximity light / ambient light recognition module, an ultrasonic recognition module, a Swing recognition module, and a scene recognition module.

[0363] Among them, the multimodal fusion mobile phone placement module can work with other modules, integrating at least two of the following: acceleration detection, face recognition, proximity light detection, ambient light detection, and ultrasonic detection, to detect whether the mobile phone is in the pocket, thus improving the accuracy of determining whether the mobile phone is in the pocket.

[0364] Mobile phone motion recognition module: By using acceleration data and considering the vertical and horizontal movement, it determines whether the phone has dropped into a bag.

[0365] Proximity / Ambient Light Recognition Module: By using a proximity sensor and an ambient light sensor, it can detect the distance between the phone and obstacles (i.e., surrounding objects) to determine whether the phone is in a pocket.

[0366] Ultrasonic recognition module: By transmitting ultrasound and detecting the correlation peaks of the signals received by the microphone, the distance to objects around the mobile phone user is identified to determine whether the mobile phone is in the pocket.

[0367] Swing recognition module: Utilizing the camera's Swing capability, it determines whether a face is looking at the phone, serving as evidence that someone is using the phone and thus determining whether it's in a pocket. The Swing capability refers to the camera's low-power face recognition function.

[0368] It should be understood that the camera mentioned in this article may be a camera with swing capability, that is, a camera that can acquire images (such as the aforementioned first image and second image) and perform face recognition on the images in low power mode.

[0369] For example, capturing images in low-power mode can be understood as capturing images under low-light conditions, or capturing images based on the light intensity passively received by the camera. Subsequently, facial recognition can be performed on the captured images to determine whether the phone is in a pocket. Compared to related technologies that require actively capturing high-resolution color images with the camera and then performing facial recognition based on those high-resolution color images, this process reduces power consumption, thereby optimizing the overall power consumption of the system.

[0370] Scene recognition module: This module can identify the phone's current environment and whitelist it during everyday use, such as gaming or payment scenarios, preventing the display of the accidental touch prevention interface. This avoids the inconvenience of blindly displaying the interface simply because the phone is in a pocket, greatly improving the user experience. After the accidental touch prevention interface is displayed, it can be promptly revoked based on multiple sensor detections or user actions, restoring responsiveness to user input and enhancing the user experience, making phone operation more convenient.

[0371] The foregoing section details examples of the bag-drop detection method provided in this application. It is understood that, to achieve the aforementioned functions, the terminal device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. This application can divide the bag-drop detection method into functional units based on the above method examples. For example, each function can be divided into separate functional units, or two or more functions can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application is illustrative and only represents a logical functional division; other division methods may exist in actual implementation.

[0372] Figure 14 A schematic diagram of the structure of a terminal device provided in this application is shown. Figure 14 The dashed line indicates that the unit or module is optional. Terminal device 14 can be used to implement the methods described in the above method embodiments. Terminal device 14 can be a terminal device or a chip (system).

[0373] Terminal device 14 includes one or more processors 1401, which can support terminal device 14 in implementing Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 and Figure 8 The method described in the corresponding method embodiment. Processor 1401 can be a general-purpose processor or a dedicated processor. For example, processor 1401 can be a central processing unit (CPU). The CPU can be used to control terminal device 14, execute software programs, and process data from the software programs. Terminal device 14 may also include a communication unit 1405 for implementing signal input (reception) and output (transmission).

[0374] 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 described above.

[0375] The communication unit 1405 may be an input and / or output circuit of the chip (system), or the communication unit 1405 may be a communication interface of the chip (system), and the chip (system) may be a component of the terminal device 14.

[0376] For example, the communication unit 1405 may be a transceiver of the terminal device 14, or the communication unit 1405 may be a transceiver circuit of the terminal device 14. The terminal device 14 may include one or more memories 1402, which store a program 1404. The program 1404 may be executed by the processor 1401 to generate instructions 1403, causing the processor 1401 to execute the method described in the above method embodiments according to the instructions 1403. Optionally, the memory 1402 may also store data. Optionally, the processor 1401 may also read the data stored in the memory 1402, which may be stored at the same memory address as the program 1404, or the data may be stored at a different memory address than the program 1404.

[0377] The processor 1401 and memory 1402 can be configured separately or integrated together, for example, integrated on the system-on-chip (SOC) of the terminal device. For details on how the processor 1401 performs the bag detection method, please refer to the relevant description in the method embodiments.

[0378] It should be understood that the steps of the above method embodiments can be implemented by hardware logic circuits or software instructions in the processor 1401. The processor 1401 may be a CPU, a digital signal processor (DSP), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gate, transistor logic devices, or discrete hardware components.

[0379] This application also provides a computer program product that, when executed by processor 1401, implements the method of any of the method embodiments in this application. The computer program product can be stored in memory 1402, for example, as program 1404. Program 1404 undergoes preprocessing, compilation, assembly, and linking processes to ultimately be converted into an executable object file that can be executed by processor 1401.

[0380] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, implements the method of any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.

[0381] The computer-readable storage medium is, for example, memory 1402. Memory 1402 can be volatile memory or non-volatile memory, or memory 1402 can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but 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 Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).

[0382] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and technical effects of the above-described apparatus and equipment can be referred to the corresponding processes and technical effects in the foregoing method embodiments, and will not be repeated here.

[0383] The systems, apparatuses, and methods disclosed in the embodiments provided in this application can be implemented in other ways. For example, some features of the method embodiments described above may be omitted or not performed. The apparatus embodiments described above are merely illustrative; the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Multiple units or components may be combined or integrated into another system. Furthermore, the coupling between units or components can be direct or indirect, including electrical, mechanical, or other forms of connection.

[0384] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

[0385] Finally, the above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting bag loss, characterized in that, Applied to a terminal device, the method includes: When the proximity sensor of the terminal device reports proximity data, the perception information of the terminal device is obtained and the terminal device is determined to be in a pocket based on the perception information. The perception information includes the first ambient light intensity of the terminal device and / or the attitude information of the terminal device. The proximity data is used to indicate that the distance between the proximity sensor and the obstacle is less than or equal to the target distance threshold. If the proximity sensor of the terminal device does not report the proximity data, or if the terminal device does not have the proximity sensor, the ultrasonic data of the terminal device is acquired, and the terminal device is determined to be in the pocket based on the ultrasonic data.

2. The method according to claim 1, characterized in that, The method further includes: Detect whether the terminal device has performed a bag-dropping action; When the bag-dropping action occurs on the terminal device, it is detected whether the terminal device has the proximity light sensor.

3. The method according to claim 2, characterized in that, The detection of whether the terminal device has performed a bag-dropping action includes: Acquire the acceleration data of the terminal device; Based on the acceleration data, it is determined whether the terminal device has performed a bag-dropping action.

4. The method according to any one of claims 1 to 3, characterized in that, When the proximity sensor of the terminal device reports proximity data, acquiring the sensing information of the terminal device and determining whether the terminal device is in a pocket based on the sensing information includes: When the terminal device performs an inverted pocket-dropping action and the proximity sensor reports the proximity data, the sensory information of the terminal device is acquired and the terminal device is determined to be in the pocket based on the sensory information. The pocket-dropping action includes the inverted pocket-dropping action.

5. The method according to any one of claims 1 to 4, characterized in that, Determining whether the terminal device is in a pocket based on the perceived information includes: If the perceived information satisfies the perception conditions, it is determined that the terminal device is in the pocket; or; When the perceived information satisfies the perceived conditions, a first image is acquired by the image acquisition component of the terminal device, and if no target object is found in the first image, it is determined that the terminal device is in the pocket, and the target object is an object with a human face; If the sensing information does not meet the sensing conditions, ultrasonic data of the terminal device is acquired, and the terminal device is determined to be in a pocket based on the ultrasonic data.

6. The method according to any one of claims 1 to 3, characterized in that, In the case where the proximity sensor of the terminal device does not report the proximity data, or the terminal device does not have the proximity sensor, acquiring the ultrasonic data of the terminal device and determining whether the terminal device is in the pocket based on the ultrasonic data includes: If the terminal device performs a non-inverted bag-dropping action and the proximity sensor does not report the proximity data, the ultrasonic data of the terminal device is acquired, and based on the ultrasonic data, it is determined whether the terminal device is in the pocket; or, When the terminal device performs the non-inverted bag-dropping action and the terminal device does not have the proximity sensor, ultrasonic data of the terminal device is acquired, and based on the ultrasonic data, it is determined whether the terminal device is in the pocket; or, If the terminal device inverts and falls into the pocket, and the proximity sensor of the terminal device does not report the proximity data, the ultrasonic data of the terminal device is acquired, and the terminal device is determined to be in the pocket based on the ultrasonic data.

7. The method according to any one of claims 1 to 6, characterized in that, Determining whether the terminal device is in a pocket based on the ultrasonic data includes: If the trend of the ultrasonic waveform changes in accordance with the target trend, it is determined that the terminal device is in the pocket, and the ultrasonic data includes the ultrasonic waveform; or... When the changing trend of the ultrasonic waveform satisfies the target changing trend, a first image is acquired by the image acquisition component of the terminal device, and if the target object is not present in the first image, it is determined that the terminal device is in a pocket, and the target object is an object with a human face.

8. The method according to claim 4, characterized in that, The method further includes: When the terminal device performs a non-inverted bag-dropping action and the proximity sensor reports the proximity data, the terminal device acquires a first image through its image acquisition component. If no target object is found in the first image, it is determined that the terminal device is in the pocket, and the target object is an object with a human face.

9. The method according to any one of claims 1 to 8, characterized in that, The method further includes: When the terminal device is in the pocket, based on the scenario in which the terminal device is located, it is determined whether to control the terminal device to display an anti-accidental touch interface.

10. The method according to claim 9, characterized in that, The step of determining whether to control the terminal device to display an anti-accidental touch interface based on the scenario in which the terminal device is located includes: In the scenario where the terminal device is located, the scenario is defined as the first scenario, and it is determined that the terminal device will not be controlled to display the anti-mistouch interface. If the scenario in which the terminal device is located is the second scenario, it is determined that the terminal device should be controlled to display the anti-accidental touch interface.

11. The method according to claim 10, characterized in that, The first scenario is an operation continuity scenario, and the second scenario is a video playback scenario or a target scenario, wherein the target scenario is a scenario other than the operation continuity scenario and the video playback scenario.

12. The method according to claim 11, characterized in that, The method further includes: When the terminal device is in the target scenario and the duration of displaying the anti-mistouch interface is greater than the target duration, the terminal device is controlled 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; the target scenario is a scenario where a conversation is conducted through a session window.

14. The method according to any one of claims 1 to 12, characterized in that, The method further includes: After the terminal device is in a pocket and the anti-mistouch interface is displayed, the anti-mistouch interface will exit if one or more of the following conditions are met: The proximity sensor of the terminal device reports distance data, which indicates that the distance between the proximity sensor and the obstacle is greater than the target distance threshold. The second image acquired by the image acquisition component of the terminal device contains a target object, which is an object with a human face. The second ambient light intensity of the terminal device is greater than the target intensity threshold, and the terminal device has undergone a lifting action; or, The user's exit operation on the anti-accidental touch interface was detected.

15. A method for detecting bag loss, characterized in that, Applied to a terminal device, the method includes: The touch information of the touch screen of the terminal device is obtained, wherein the touch information includes at least one of touch position, touch area, and touch duration; When the touch information meets the pocket touch conditions, a first image is acquired by the image acquisition component of the terminal device. If the target object is not present in the first image, it is determined that the terminal device is in the pocket, and the target object is an object with a human face.

16. The method according to claim 15, characterized in that, The step of obtaining touch information for the touch screen of the terminal device includes: Detect whether the terminal device has performed a bag-dropping action; When the bag-dropping action occurs on the terminal device, the touch information of the terminal device's touch screen is acquired.

17. The method according to claim 16, characterized in that, The detection of whether the terminal device has performed a bag-dropping action includes: Acquire the acceleration data of the terminal device; Based on the acceleration data, it is determined whether the terminal device has performed a bag-dropping action.

18. The method according to any one of claims 15-16, characterized in that, The method further includes: When the terminal device is in the pocket, based on the scenario in which the terminal device is located, it is determined whether to control the terminal device to display an anti-accidental touch interface.

19. The method according to claim 18, characterized in that, The step of determining whether to control the terminal device to display an anti-accidental touch interface based on the scenario in which the terminal device is located includes: In the scenario where the terminal device is located, the scenario is defined as the first scenario, and it is determined that the terminal device will not be controlled to display the anti-mistouch interface. If the scenario in which the terminal device is located is the second scenario, it is determined that the terminal device should be controlled to display the anti-accidental touch interface.

20. The method according to claim 19, characterized in that, The first scenario is an operation continuity scenario, and the second scenario is a video playback scenario or a target scenario, wherein the target scenario is a scenario other than the operation continuity scenario and the video playback scenario.

21. The method according to claim 20, characterized in that, The method further includes: When the terminal device is in the target scenario and the duration of displaying the anti-mistouch interface is greater than the target duration, the terminal device is controlled to be in a locked screen state.

22. The method according to claim 20 or 21, characterized in that, The operation continuity scenario is a game scenario or a payment scenario; the target scenario is a scenario where a conversation is conducted through a session window.

23. The method according to any one of claims 15 to 22, characterized in that, The method further includes: After the terminal device is in a pocket and the anti-mistouch interface is displayed, the anti-mistouch interface will exit if one or more of the following conditions are met: The proximity sensor of the terminal device reports distance data, which indicates that the distance between the proximity sensor and the obstacle is greater than the target distance threshold. The second image acquired by the image acquisition component of the terminal device contains a target object, which is an object with a human face. The second ambient light intensity of the terminal device is greater than the target intensity threshold, and the terminal device has undergone a lifting action; The user's exit operation on the anti-accidental touch interface was detected.

24. A method for detecting bag loss, characterized in that, Applied to a terminal device, the method includes: When the terminal device is in a pocket, determine the scene in which the terminal device is located; Based on the scenario in which the terminal device is located, determine whether to control the terminal device to display an anti-accidental touch interface.

25. The method according to claim 24, characterized in that, The step of determining whether to control the terminal device to display an anti-accidental touch interface based on the scenario in which the terminal device is located includes: In the scenario where the terminal device is located, the scenario is defined as the first scenario, and it is determined that the terminal device will not be controlled to display the anti-mistouch interface. If the scenario in which the terminal device is located is the second scenario, it is determined that the terminal device should be controlled to display the anti-accidental touch interface.

26. The method according to claim 25, characterized in that, The first scenario is an operation continuity scenario, and the second scenario is a video playback scenario or a target scenario, wherein the target scenario is a scenario other than the operation continuity scenario and the video playback scenario.

27. The method according to claim 26, characterized in that, The method further includes: When the terminal device is in the target scenario and the duration of displaying the anti-mistouch interface is greater than the target duration, the terminal device is controlled to be in a locked screen state.

28. The method according to claim 26 or 27, characterized in that, The operation continuity scenario is a game scenario or a payment scenario; the target scenario is a scenario where a conversation is conducted through a session window.

29. A terminal device, characterized in that, include: A processor coupled to a memory for storing programs or instructions, which, when executed by the processor, cause the terminal device to perform the method according to any one of claims 1-14, 15-23, or 24-28.

30. A chip system, characterized in that, The chip system includes a memory and a processor, the processor being configured to execute a computer program stored in the memory to implement the method as described in any one of claims 1-14, 15-23, or 24-28.

31. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they cause the computer to perform the method as described in any one of claims 1 to 14, 15 to 23, or 24 to 28.

32. A computer program product, characterized in that, Includes computer program instructions that cause the computer to perform the method as described in any one of claims 1-14, 15-23, or 24-28.