Mistouch prevention method and electronic device

By recognizing the capacitance, area, and posture characteristics of the touchscreen and combining multiple sensors to determine pocket touches, the problem of accidental touchscreen operation in pockets has been solved, achieving higher recognition accuracy and user experience.

WO2026137863A1PCT designated stage Publication Date: 2026-07-02HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2025-08-05
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

In the prior art, the touch screen of electronic devices is prone to accidental touch when placed in a pocket due to contact with human skin through clothing, leading to erroneous operation. Furthermore, existing methods to prevent accidental touch are not effective in certain environments or postures, affecting the user experience.

Method used

By identifying features such as capacitance, area, ellipticity, and the angle between the major axis and the screen of a touch operation, combined with environmental and posture sensors, it can determine whether it is a pocket touch and, if the conditions are met, either not respond or display an anti-mistouch interface to avoid accidental operation.

Benefits of technology

It improves the accuracy of pocket touch recognition, reduces misoperation, enhances user experience, does not rely on a single sensor and is effective in multiple situations, avoiding blind spots and interference of existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025112610_02072026_PF_FP_ABST
    Figure CN2025112610_02072026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present invention are a mistouch prevention method and an electronic device. The method comprises: displaying a first user interface by means of a touch-control screen of an electronic device, receiving a first touch operation for the first user interface, and when the first touch operation meets a preset condition, not responding to the first touch operation, and continuing to display the first user interface or displaying a mistouch prevention interface, thereby reducing mistouches caused by placing the electronic device in a pocket.
Need to check novelty before this filing date? Find Prior Art

Description

Methods to prevent accidental touches and electronic devices

[0001] This application claims priority to Chinese Patent Application No. 202411949867.1, filed on December 25, 2024, entitled "Method and Electronic Device for Preventing Accidental Touch", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This invention relates to the field of terminal technology, and in particular to a method for preventing accidental touches and an electronic device. Background Technology

[0003] A touch panel (TP), also known as a "touchscreen," consists of a touch panel and a display screen, relying on touch sensor technology to input information. A touchscreen includes a capacitive sensor array on the touch panel. When a finger or a charged conductor touches or approaches the touchscreen, a coupling capacitor is formed between the finger and the touchscreen. The touch operation is detected by the change in capacitance at that location.

[0004] However, when electronic devices, including touchscreen devices such as mobile phones, are put in a pocket, the touchscreen can make accidental touches as it comes into contact with the skin through the pocket. Summary of the Invention

[0005] This invention provides a method and electronic device for preventing accidental touches. The method can recognize pocket touches, thereby reducing accidental touches caused when the electronic device is placed in a pocket.

[0006] In a first aspect, embodiments of the present invention provide a method for preventing accidental touches, the method being applied to an electronic device, the electronic device including a touchscreen, the method comprising:

[0007] The touchscreen of the electronic device displays the first user interface;

[0008] The electronic device receives a first touch operation on the first user interface;

[0009] When the first touch operation meets the preset conditions, the electronic device does not respond to the first touch operation and continues to display the first user interface; or, when the first touch operation meets the preset conditions, the electronic device displays an anti-accidental touch interface.

[0010] The aforementioned preset conditions include one or more of the following conditions:

[0011] The capacitance values ​​within the touch area of ​​the first touch operation are all less than the second capacitance threshold.

[0012] The touch area of ​​the first touch operation is greater than the area threshold;

[0013] The ellipticity of the touch area during the first touch operation is within a preset range;

[0014] The angle between the long axis of the touch area of ​​the first touch operation and the long side of the touch screen is within a preset angle range.

[0015] The above method, when the electronic device displays the first user interface, if the received first touch operation meets the preset conditions, it indicates that the first touch operation is a pocket touch. Therefore, the first touch operation can be ignored, and the first user interface can continue to be displayed. This method of intercepting touch operations can reduce accidental touches caused by the electronic device being placed in a pocket, and the user is unaware of it, so it will not interfere with the user's normal use of the electronic device, thus improving the user experience; or, an anti-accidental touch interface can be displayed to reduce accidental touches caused by the electronic device being placed in a pocket, thereby improving the user experience.

[0016] Furthermore, identifying pocket touches can be made more accurate by using one or more combinations of factors such as capacitance value within the touch area, touch area, ellipticity of the touch area, and the angle between the major axis of the touch area and the long side of the touchscreen.

[0017] In conjunction with the first aspect, in one possible implementation, the method further includes:

[0018] The electronic device determines the touch area of ​​the first touch operation based on the capacitance value of each touch unit detected by the touch screen. The touch area is the connected area formed by touch units with capacitance values ​​greater than the first capacitance value.

[0019] The electronic device fits an ellipse based on the touch area;

[0020] The electronic equipment determines the major and minor axes of the ellipse;

[0021] The electronic device determines the ellipticity based on the major and minor axes of the ellipse.

[0022] The above method determines the ellipticity of the touch area by fitting an ellipse to the touch area, which can more accurately reflect the characteristics of pocket touch and improve the accuracy of pocket touch recognition.

[0023] In conjunction with the first aspect, in one possible implementation, when the first touch operation meets the preset conditions, the electronic device does not respond to the first touch operation and continues to display the first user interface; or, when the first touch operation meets the preset conditions, the electronic device displays an anti-mistouch interface. A specific implementation of this could be:

[0024] When the electronic device is in pocket mode and the first touch operation meets the preset conditions, it does not respond to the first touch operation and continues to display the first user interface; or, when the electronic device is in pocket mode and the first touch operation meets the preset conditions, it displays an anti-accidental touch interface.

[0025] The above method improves the accuracy of recognition by jointly determining whether the first touch operation is a pocket touch by combining the pocket pattern and the features of the first touch operation.

[0026] In conjunction with the first aspect, in one possible implementation, the method further includes: when the electronic device is in pocket mode and the touch duration of the first touch operation is less than a preset duration, it does not respond to the first touch operation and continues to display the first user interface; or, it displays an anti-mistouch interface.

[0027] At this time, when the first touch operation meets the preset conditions, the electronic device does not respond to the first touch operation and continues to display the first user interface; or, when the first touch operation meets the preset conditions, the electronic device displays an anti-mistouch interface. One specific implementation of this is that when the electronic device is in pocket mode, the touch duration of the first touch operation is less than or equal to a preset duration, and the first touch operation meets the preset conditions, it does not respond to the first touch operation and continues to display the first user interface; or, it displays an anti-mistouch interface.

[0028] The above method first identifies that the electronic device is in pocket mode. If the duration of the first touch operation is less than a preset duration, such as 150ms, then the first touch operation is determined to be a pocket touch, which is a erroneous operation. Furthermore, the first touch operation is not responded to, thus quickly intercepting short-duration touch operations when the electronic device is in pocket mode. Conversely, if the electronic device is in pocket mode, the duration of the first touch operation is greater than or equal to the preset duration, and the first touch operation does not meet preset conditions, then the first touch operation is determined to be a pocket touch, which is a erroneous operation. Furthermore, the first touch operation is not responded to, thus quickly intercepting long-duration touch operations when the electronic device is in pocket mode.

[0029] Optionally, when the electronic device is in pocket mode, the touch duration of the first touch operation is less than or equal to a preset duration, and the first touch operation does not meet the preset conditions, it can determine that the first touch operation is not a misoperation, and can respond to the first touch operation and display the user interface after the response.

[0030] In conjunction with the first aspect, in one possible implementation, the electronic device is determined to be in pocket mode when it meets one or more of the following conditions:

[0031] The ambient light intensity detected by the ambient light sensor of the electronic device is less than a first threshold.

[0032] The gyroscope and / or accelerometer of the electronic device detects that the electronic device is in an upright or head-down position;

[0033] The infrared light intensity detected by the proximity sensor of the electronic device is greater than the second threshold.

[0034] The echo energy detected by the ultrasonic sensor of the electronic device is greater than the third threshold.

[0035] The above method uses one or more combinations of ambient light sensors, gyroscopes, accelerometers, proximity sensors, and ultrasonic sensors to identify whether an electronic device is in pocket mode, which can improve the accuracy of identification.

[0036] In conjunction with the first aspect, in one possible implementation, the method further includes:

[0037] When the ambient light intensity detected by the ambient light sensor is less than a first threshold and the infrared light intensity detected by the proximity light sensor is greater than a third threshold, the electronic device determines that it is in pocket mode, where the third threshold is less than the second threshold.

[0038] The above method uses an ambient light sensor and a proximity light sensor together to identify whether an electronic device is in pocket mode, and lowers the threshold of the proximity light sensor, thereby improving the accuracy of pocket mode recognition when the pocket color is black or other dark colors.

[0039] It should be understood that gyroscopes, accelerometers, and ultrasonic sensors can also be used to identify pocket patterns to further improve the accuracy of pocket pattern recognition.

[0040] In conjunction with the first aspect, in one possible implementation, the anti-mistouch interface includes a first control for exiting the anti-mistouch mode, and the method further includes:

[0041] The electronic device receives a second touch operation on the first control, the second touch operation being used to indicate exiting the anti-mistouch mode;

[0042] The electronic device responds to the second touch operation by displaying a first user interface, displaying a lock screen, or turning off the screen.

[0043] The above method ensures that the anti-mistouch interface of the electronic device will only exit when it receives a touch operation of the first control used to exit the anti-mistouch mode, thus exiting the anti-mistouch interface without affecting the user's normal use.

[0044] In conjunction with the first aspect, in one possible implementation, the method further includes:

[0045] When an electronic device responds to a touch operation on the anti-mistouch interface that is different from the second touch operation mentioned above, such as a third touch operation, it does not respond to the third touch operation and continues to display the anti-mistouch interface in order to block touch operations other than the second touch operation input on the anti-mistouch interface.

[0046] In conjunction with the first aspect, in one possible implementation, the method further includes:

[0047] After the electronic device displays the anti-accidental touch interface for a first period of time, the touch screen is turned off or the first user interface is restored.

[0048] In conjunction with the first aspect, in one possible implementation, the aforementioned first user interface is a lock screen / wake screen interface.

[0049] In conjunction with the first aspect, in one possible implementation, the aforementioned first user interface is a non-lock screen interface.

[0050] In a second aspect, embodiments of the present invention also provide an electronic device, including one or more processors, one or more memory and a touch screen, wherein the touch screen and the one or more memory are respectively coupled to the one or more memory, and the one or more memory is used to store computer program code, the computer program code including computer instructions, wherein when the one or more processors execute the computer instructions, the electronic device causes the electronic device to implement the method as described in the first aspect or any implementation of the first aspect.

[0051] Thirdly, embodiments of the present invention provide a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in the first aspect or any implementation thereof.

[0052] Fourthly, this application provides a computer program product containing instructions that, when the computer program product is run on a processor, causes an electronic device to implement the method described in the first aspect or any implementation thereof.

[0053] It should be understood that the technical effects achieved in the above aspects can be referred to each other or to the beneficial effects in the method embodiments shown below, which will not be repeated here. Attached Figure Description

[0054] Figure 1 is a schematic illustration of an accidental touch scenario provided in an embodiment of this application;

[0055] Figure 2 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application;

[0056] Figure 3 is a schematic diagram illustrating the touch area of ​​the pocket touch provided in an embodiment of this application;

[0057] Figure 4A is a schematic illustration of a pocket touch provided in an embodiment of this application;

[0058] Figure 4B is a schematic diagram illustrating the angle between the long axis of the touch area and the long side of the electronic device provided in the embodiment of this application;

[0059] Figures 5A-5D are schematic flowcharts of several pocket touch recognition methods provided in the embodiments of this application;

[0060] Figures 6A and 6B are schematic flowcharts of several pocket pattern recognition methods provided in the embodiments of this application;

[0061] Figure 7 is a flowchart illustrating an anti-accidental touch method provided in an embodiment of this application;

[0062] Figures 8A-8C are schematic diagrams of the user interface involved in the anti-accidental touch method provided in the embodiments of this application in one scenario;

[0063] Figures 9A-9C are schematic diagrams of the user interface involved in another scenario of the anti-accidental touch method provided in the embodiments of this application;

[0064] Figure 10 is a flowchart illustrating another method for preventing accidental touches provided in an embodiment of this application;

[0065] Figure 11 is a flowchart illustrating another method for preventing accidental touches provided in an embodiment of this application;

[0066] Figure 12 is a schematic diagram of the hardware and software structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0067] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0068] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0069] It should be noted that in this application, the words "in some embodiments," "exemplarily," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "in some embodiments," "exemplarily," or "for example" should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "in some embodiments," "exemplarily," and "for example" is intended to present the relevant concepts in a specific manner.

[0070] Please refer to Figure 1, which is a schematic diagram of an accidental touch scenario provided by an embodiment of this application. When a user puts an electronic device (such as a mobile phone) into their pocket, such as a pants pocket, if the touch screen is facing the user, the touch screen may come into contact with the user's skin through their clothing when the user is walking, running, jumping, or when the pocket is tight, thus triggering a touch event.

[0071] To prevent accidental touches, existing technologies offer several solutions for different scenarios.

[0072] Lock screen and screen-on scenarios can include the following three solutions:

[0073] Option 1: When the phone is currently displaying the lock screen or on screen, if a touch operation is received, it will determine whether the proximity sensor is obstructed. If it is obstructed, an anti-mistouch interface will pop up.

[0074] The proximity sensor may include an infrared light source (such as a light-emitting diode) and a photodetector (such as a photodiode). The electronic device emits infrared light outward through the light-emitting diode and uses the photodiode to detect the infrared reflected light from nearby objects. Then, based on the intensity of the reflected infrared light, it senses the distance to the object and whether there is an object blocking it.

[0075] In Solution 1, the proximity sensor suffers from a black-light issue. Specifically, when the phone is placed in a dark-colored pocket, if the pocket is close enough to the screen, the infrared light emitted by the infrared light source will not be effectively reflected back to the light detector. In other words, there is no effective light transmission between the infrared light detector and the infrared light source. In this situation, the proximity sensor cannot report the proximity status, cannot detect that the phone is in a pocket or is obstructed, and it is difficult to trigger the accidental touch prevention function.

[0076] Option 2: When the phone is currently displaying the lock screen or the screen on, if a touch operation is received, the system uses the ambient light sensor to determine whether the phone is in a dark environment and whether the phone is upside down. If the phone is in a dark environment and upside down, an anti-mistouch interface will pop up.

[0077] In Option 2, the anti-mistouch function can only be triggered when the phone is in a dark environment and upside down. It cannot be triggered when the phone is in a non-dark environment or in other postures, resulting in poor anti-mistouch performance.

[0078] Option 3: When the phone is currently displaying the lock screen or on screen, if a touch operation is received, the screen will be turned off if the phone is in an upright position and the area of ​​the touch operation is large.

[0079] In Option 3, the anti-mistouch function can only be triggered when the phone is in a vertical position and the touch operation is a large object touch, which has a certain blind spot.

[0080] Non-lock screen scenarios can include the following one solution:

[0081] When an electronic device receives a touch operation while the current display interface is not locked, it uses an ambient light sensor to detect whether the phone is in a dark environment, whether the phone is upside down, whether the user is walking or running, and the area of ​​the touch operation to determine whether it is a large object touch. If the phone is in a dark environment, upside down, the user is walking or running, and the touch operation is a large object touch, an anti-mistouch interface will pop up.

[0082] In this solution, if the anti-accidental touch interface pops up when the phone is not locked, it will interfere with the user's normal use and thus reduce the user experience.

[0083] Furthermore, this solution is limited to triggering the anti-mistouch function only in low-light environments, when the user is upside down, or when the user is walking or running and touching a large object. It has a detection blind spot; for example, it cannot trigger the anti-mistouch function when the phone is upside down or when the user is stationary.

[0084] It should be understood that in the embodiments of this application, the non-lock screen interface can be the desktop, the display interface of an application, etc.

[0085] Therefore, embodiments of this application provide a method and electronic device for preventing accidental touches.

[0086] The following describes an electronic device according to an embodiment of this application, with reference to Figure 2.

[0087] The electronic device provided in the above embodiments of this application is described below. Figure 2 shows a schematic diagram of the structure of the electronic device 100. The exemplary electronic device 100 provided in the embodiments of this application may be configured with a touch screen, and may be, but is not limited to, a mobile phone, laptop, tablet computer (portable android device, PAD), desktop computer, laptop computer, handheld computer, augmented reality (AR) device, virtual reality (VR) device, personal computer (PC), mobile terminal device, etc. It may also be a smart bracelet, smartwatch, electronic photo frame, artificial intelligence (AI) device, game console, other smart wearable device, etc. This application does not limit the type of device.

[0088] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 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 module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, an ultrasonic sensor 180M, etc.

[0089] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0090] Processor 110 may include one or more processing units, such as application processors (APs), central processing units (CPUs), graphics processing units (GPUs), neural network processing units (NPUs), modem processors, image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, etc. Different processing units may be independent devices or integrated into one or more processors. In some embodiments, electronic device 100 may also include one or more processors 110.

[0091] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0092] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the electronic device 100.

[0093] The processor 110 can couple to memory (such as internal memory 121 and / or external memory), call computer instructions stored in the memory, and execute the methods described in the above embodiments, which will not be repeated here.

[0094] The charging management module 140 receives charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.

[0095] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.

[0096] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices through wireless communication technology.

[0097] Electronic device 100 can realize display function through GPU, display screen 194, and application processor.

[0098] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0099] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0100] Camera 193 is used to capture still images or videos. In some embodiments, electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0101] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, photos, videos, and other data can be stored on the external memory card.

[0102] Internal memory 121 can be used to store one or more computer programs, which include instructions. Processor 110 can cause electronic device 100 to perform the methods provided in some embodiments of this application, as well as various functional applications and data processing, by executing the instructions stored in internal memory 121.

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

[0104] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.

[0105] The gyroscope sensor 180B, also known as a gyroscope, can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0106] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0107] The magnetic sensor 180D includes a Hall sensor.

[0108] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0109] In this embodiment of the application, the attitude of the electronic device 100 determined by the gyroscope sensor 180B and / or the accelerometer sensor 180E can be used to determine whether the electronic device 100 is in a vertical position or upside down, so as to help determine whether the electronic device 100 is in pocket mode.

[0110] Distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser.

[0111] The proximity sensor 180G may include, for example, an infrared light source and a photodetector. The infrared light source may be a light-emitting diode (LED) or an infrared laser, and the photodetector may be a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects, and then, based on the intensity value or integral value of the reflected infrared light, senses the proximity of the object or whether it is blocked by an object. When the intensity value or integral value is large, i.e., sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When the intensity value or integral value is small, i.e., insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.

[0112] The ambient light sensor 180L is used to sense ambient light levels. The electronic device 100 can adaptively adjust the brightness of its display screen 194 based on the sensed ambient light intensity. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking photos. The ambient light sensor 180L can also be used alone or in conjunction with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket, i.e., whether it is in pocket mode, to prevent accidental touches.

[0113] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0114] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature processing strategy.

[0115] The touch sensor 180K, also known as a touch panel or touch-sensitive surface, can be located on the display screen 194. The touch sensor 180K and the display screen 194 together form a touchscreen, also called a "touchscreen." The touch sensor 180K detects touch operations applied to or near it. The touch sensor can then 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 194.

[0116] The 180M ultrasonic sensor can include an ultrasonic transmitter and an ultrasonic receiver. The ultrasonic transmitter can be a handset used to emit ultrasonic signals; the ultrasonic receiver can be a microphone used to receive the echo signals of the ultrasonic signals. Electronic devices can determine whether they are placed in a pocket based on the energy of the echo signal (also known as echo energy).

[0117] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0118] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc.

[0119] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with or separate from the electronic device 100.

[0120] The electronic device 100 shown in Figure 2 can display the various user interfaces described in the above embodiments via a touch screen. The electronic device 100 can detect touch operations in each user interface via the touch screen, such as click operations (e.g., touch operations on icons, double-click operations), swipe operations up or down, or circle drawing gestures, etc.

[0121] This application also provides a method for preventing accidental touches, which can be applied to the aforementioned electronic device. In this method, when the electronic device detects a touch operation, it can identify whether the touch operation meets the conditions for pocket touch (i.e., preset conditions). If the touch operation meets the conditions for pocket touch, the device will not respond to the touch operation or display an anti-accidental touch interface, thereby reducing or avoiding accidental touches caused by the electronic device being in a pocket.

[0122] If the electronic device does not respond to the touch operation when the conditions for pocket touch are met, and continues to display the current user interface without popping up the anti-accidental touch interface, then it will not interfere with the user's normal use of the electronic device.

[0123] In addition, compared with existing technologies, this method does not rely on the use of sensors such as ambient light sensors, proximity light sensors, and gyroscopes. It does not have the problem of proximity light sensors turning black, nor does it only trigger the anti-mistouch function when the electronic device is in a dark environment, in a head-down posture, or when there is an obstacle nearby. It can prevent accidental touches as long as the conditions for pocket touch are met.

[0124] In other embodiments, the electronic device can also identify whether it is in pocket mode (i.e., whether it is in a pocket) based on the ambient light intensity detected by the ambient light sensor, the posture of the electronic device detected by the gyroscope and / or accelerometer, whether the proximity light sensor is obstructed, and other sensors. When the electronic device is in pocket mode and the detected touch operation meets the conditions for pocket touch, the touch operation is not responded to or the anti-accidental touch interface is displayed to reduce or avoid accidental touches caused by the electronic device being in a pocket.

[0125] Specifically, when an electronic device is in pocket mode and the touch operation meets the conditions for pocket touch, it will not respond to the touch operation, continue to display the current user interface, and will not pop up the anti-accidental touch interface, thus not interfering with the user's normal use of the electronic device.

[0126] First, the terms “touch operation”, “direct touch” and “pocket touch” involved in the embodiments of this application will be explained.

[0127] Touch operation refers to the change in capacitance value of the touch sensor at the contact point caused by a user's skin directly or through clothing. Typically, a touch operation is determined to have been detected when the capacitance value of one or more touch sensors exceeds a first preset value.

[0128] Touch operation based on the way users touch the touchscreen can be divided into direct touch, pocket touch, etc.

[0129] Direct touch refers to the user's skin directly contacting the touchscreen, causing a change in the capacitance value of the touch sensor at the contact location on the touchscreen.

[0130] Pocket touch refers to an electronic device containing a touchscreen being placed in a user's pocket or backpack, where it comes into contact with the user's skin through clothing or other items. This causes a change in the capacitance value of the touch sensor at the contact point on the touchscreen, resulting in a mis-touch or erroneous operation. For any type of touchscreen, pocket touch triggers a smaller capacitance value compared to direct touch.

[0131] In this embodiment, the determination of whether a touch operation is a pocket touch is based on whether the touch operation meets the conditions of pocket touch (also known as preset conditions) or whether it conforms to the characteristics of pocket touch.

[0132] The following describes a pocket touch recognition method according to an embodiment of this application.

[0133] When the touchscreen is on, it detects all touch units on the screen, determines the touch area and the corresponding touch point for each touch area, and identifies the major and minor axes of the touch area. The touch area is a connected region composed of at least one touch unit with a capacitance value greater than a first capacitance threshold. The major axis and minor axis of the touch area are both defined as the major axis of the ellipse fitted to the touch area.

[0134] Figure 3 illustrates the touch area of ​​a pocket touch system using a single touch area as an example. When an electronic device is placed in a pocket, the first area 301 on the touchscreen contacts the user's skin through clothing, allowing the electronic device to detect touch input on the first area 301. The right side of Figure 3 exemplarily shows the capacitance value of the touch unit on the second area 302, which includes the first area 301.

[0135] Pocket Touch has one or more of the following characteristics, or in other words, Pocket Touch satisfies one or more of the following conditions:

[0136] (1) The capacitance value of pocket touch is smaller than that of direct contact. The capacitance values ​​of pocket touch and direct contact vary depending on the touchscreen model. However, regardless of the touchscreen model, the capacitance value of pocket touch is always smaller than that of direct contact. Here, the capacitance value of pocket touch can be set to be less than a second capacitance threshold, where the second capacitance threshold is greater than a first capacitance threshold. It can be less than the maximum capacitance value or the average capacitance value of direct contact, for example, q times the maximum capacitance value or q times the average capacitance value of direct contact. Here, q is less than 1. For example, 0.4 ≤ q ≤ 0.9, and q can be set to 0.5, 0.7, 0.8, etc.

[0137] The second capacitance threshold can also be set based on empirical values ​​of pocket touch on the touchscreen. For example, the first capacitance threshold is 500, the average capacitance value of direct touch is 2500, and the second capacitance threshold is 2000.

[0138] (2) Compared to touch methods such as direct touch with a single finger or direct touch with multiple fingers, pocket touch has a larger touch area, exceeding the area threshold. This area threshold can be 200mm². 2 -600mm 2 For example, 300mm 2 400mm 2 Or other values.

[0139] Electronic devices can first identify touch units on the touchscreen whose capacitance value is greater than a first capacitance threshold (e.g., 1000). The number or area of ​​touch units with capacitance values ​​greater than the first capacitance threshold (e.g., 1000) is then determined as the touch area of ​​the touch operation.

[0140] (3) The pattern of pocket touch is different from the pattern of non-pocket touch such as single-finger touch and multi-finger touch. Usually, when an electronic device is put in a pocket, the touch screen contacts the thigh through clothing, and the elliptic or similar elliptic shape of the touch area is within a preset range.

[0141] Optionally, the ellipticity of the touch area refers to the ellipticity of the ellipse fitted based on the touch area. After determining the touch area for the touch operation, the electronic device can fit an ellipse based on the touch area and the capacitance value corresponding to each touch unit within the touch area, exemplarily the first region 301 described by the dashed box in FIG3, and then determine the length a of the major axis and the length b of the minor axis of the ellipse.

[0142] Optionally, the ellipticity of the touch area can be such that the major axis a of the ellipse is the straight line corresponding to the maximum length of the touch area, and the minor axis b of the ellipse is the maximum width or average width of the touch area in the direction perpendicular to the major axis.

[0143] The ellipticity can be expressed as a / b, where a is the length of the major axis of the ellipse and b is the length of the minor axis.

[0144] For example, k1 < a / b < k2, where k1 is less than k2. k1 can be 2, 3 or other values, etc.; k2 can be 10, 8, 7, 5 or other values.

[0145] (4) Accidental touches caused by electronic devices being placed in pockets near the thighs, usually with the long axis of the touch area having a certain angle α with the long side of the touch screen.

[0146] As shown in Figure 4A, the electronic device 401 is placed in a pocket near the thigh. Touch operations on the touchscreen of the electronic device 401 will occur along the extension direction 402 of the thigh. As shown in Figure 4B, this extension direction is typically the major axis of the smallest circumscribed ellipse 403 of the touch area. Empirically, the angle α between this major axis and the long side of the electronic device follows a pattern, usually within a preset angle range. This preset angle range can be, for example, 0° < α < 75°, or 10° < α < 60°, or 20° < α < 50°, etc.

[0147] Therefore, pocket touches can be identified based on a combination of one or more features possessed by the aforementioned pocket touches. Exemplary embodiments of this application provide the following methods for identifying pocket touches.

[0148] The first method to identify pocket touches is by the area of ​​the touch.

[0149] Figure 5A shows a flowchart of the pocket touch recognition method. This method can be implemented by an electronic device and may include, but is not limited to, some or all of the following steps:

[0150] S101, determine whether the touch area of ​​the touch operation is greater than or equal to the area threshold. If yes, execute S102 to determine that the touch operation is a pocket touch; otherwise, execute S103 to determine that the touch operation is a non-pocket touch.

[0151] S102, confirm the touch operation as pocket touch.

[0152] S103, confirm that the touch operation is a non-pocket touch.

[0153] The setting of the area threshold can be found in the relevant description of the features of pocket touch mentioned above.

[0154] The second method for identifying pocket touches is through a combination of touch area and capacitance value.

[0155] Figure 5B shows a flowchart of the pocket touch recognition method. This method can be implemented by an electronic device and includes, but is not limited to, some or all of the following steps:

[0156] S201, determine whether the capacitance value of the touch operation is less than or equal to the second capacitance threshold. If yes, execute S202; otherwise, execute S204.

[0157] In a specific implementation, it can be determined whether the capacitance value at the touch area of ​​the touch operation is less than the second capacitance value, or whether the average capacitance value at the touch area is less than the second capacitance threshold. If so, the touch operation may be a pocket touch, and S202 can be executed to further determine whether the touch operation is a pocket touch; otherwise, the touch operation is a non-pocket touch, and S204 can be executed.

[0158] S202, determine whether the touch area of ​​the touch operation is greater than or equal to the area threshold. If yes, the touch operation is a pocket touch and proceed to S203; otherwise, proceed to S204 to determine whether the touch operation is a non-pocket touch.

[0159] S203, confirm the touch operation as pocket touch.

[0160] S204, Determine that the touch operation is a non-pocket touch.

[0161] The settings for the area threshold and the second capacitance threshold can be found in the relevant descriptions of the features of pocket touch mentioned above.

[0162] It should be understood that in another implementation, S202 can be executed first, followed by S201. If the touch area of ​​the touch operation is greater than or equal to the area threshold and the capacitance value of the touch operation is less than or equal to the second capacitance threshold, the touch operation is determined to be a pocket touch; conversely, if the touch area of ​​the touch operation is less than the area threshold or the capacitance value of the touch operation is greater than the second capacitance threshold, the touch operation is determined to be a non-pocket touch.

[0163] A third method for identifying pocket touches: identification through a combination of touch area, capacitance value, and touch pattern.

[0164] Figure 5C shows a flowchart of the pocket touch recognition method. This method can be implemented by an electronic device and includes, but is not limited to, some or all of the following steps:

[0165] S301, determine whether the capacitance value of the touch operation is less than or equal to the second capacitance threshold. If yes, execute S302; otherwise, execute S305.

[0166] In a specific implementation, it can be determined whether the capacitance value at the touch area of ​​the touch operation is less than the second capacitance threshold, or whether the average capacitance value at the touch area is less than the second capacitance threshold. If so, the touch operation may be a pocket touch, and S302 can be executed to further determine whether the touch operation is a pocket touch; otherwise, the touch operation is a non-pocket touch, and S305 can be executed.

[0167] S302, determine whether the touch area of ​​the touch operation is greater than or equal to the area threshold. If so, the touch operation may be a pocket touch, then execute S303; otherwise, execute S305 to determine that the touch operation is a non-pocket touch.

[0168] S303, determine whether the ellipticity of the touch area is within a preset range. If yes, the touch operation is a pocket touch and S304 is executed; otherwise, if the ellipticity of the touch area is not within the preset range, S305 is executed to determine that the touch operation is a non-pocket touch.

[0169] S304, the touch operation is confirmed as pocket touch.

[0170] S305, confirm that the touch operation is a non-pocket touch.

[0171] The area threshold, the second capacitance threshold, and the preset range are described in the relevant descriptions of the features of pocket touch mentioned above.

[0172] It should be understood that in another implementation, S301, S302, and S303 can also be executed in any order. When the touch area of ​​the touch operation is greater than or equal to an area threshold, the capacitance value of the touch operation is less than or equal to a second capacitance threshold, or the ellipticity of the touch area is within a preset range, the touch operation is determined to be a pocket touch. Conversely, when the touch area of ​​the touch operation is less than an area threshold, or the capacitance value of the touch operation is greater than a second capacitance threshold, or the ellipticity of the touch area is not within a preset range, the touch operation is determined to be a non-pocket touch.

[0173] A fourth method for identifying pocket touches: identification through a combination of touch area, capacitance value, touch pattern, and angle α.

[0174] Figure 5D shows a flowchart of the pocket touch recognition method. This method can be implemented by an electronic device and may include, but is not limited to, some or all of the following steps:

[0175] S401, determine whether the capacitance value of the touch operation is less than or equal to the second capacitance threshold. If yes, execute S402; otherwise, execute S406.

[0176] In a specific implementation, it can be determined whether the capacitance value at the touch area of ​​the touch operation is less than the second capacitance value, or whether the average capacitance value at the touch area is less than the second capacitance threshold. If so, the touch operation may be a pocket touch, and S402 can be executed to further determine whether the touch operation is a pocket touch; otherwise, the touch operation is a non-pocket touch, and S406 can be executed.

[0177] S402, determine whether the touch area of ​​the touch operation is greater than or equal to the area threshold. If so, the touch operation may be a pocket touch, then execute S403; otherwise, execute S406 to determine that the touch operation is a non-pocket touch.

[0178] S403, determine whether the ellipticity of the touch area is within a preset range. If yes, the touch operation may be a pocket touch, then execute S404; otherwise, execute S406 to determine that the touch operation is a non-pocket touch.

[0179] S404, determine whether the angle α between the major axis of the elliptical region and the major axis of the touch screen is within the preset angle range. If it is, the touch operation is a pocket touch, and then execute S405; otherwise, execute S406 to determine that the touch operation is a non-pocket touch.

[0180] S405, confirm touch operation as pocket touch.

[0181] S406, Determine that the touch operation is a non-pocket touch.

[0182] The area threshold, second capacitance threshold, preset range, and preset angle range are described in the relevant descriptions of the features of pocket touch mentioned above.

[0183] It should be understood that in another implementation, S401, S402, S403, and S404 can also be executed in any order. When the touch area of ​​the touch operation is greater than or equal to an area threshold, the capacitance value of the touch operation is less than or equal to a second capacitance threshold, the ellipticity of the touch area is within a preset range, and the included angle α is within a preset included angle range, the touch operation is determined to be a pocket touch. Conversely, when the touch area of ​​the touch operation is less than an area threshold, or the capacitance value of the touch operation is greater than a second capacitance threshold, or the ellipticity of the touch area is not within a preset range, or the included angle α is not within a preset included angle range, the touch operation is determined to be a non-pocket touch.

[0184] Not limited to the five methods of recognizing pocket touches mentioned above, the embodiments of this application can also be implemented by one or more other combinations of touch area, capacitance value, touch pattern and included angle α, which will not be elaborated here.

[0185] The following describes a pocket pattern recognition method according to an embodiment of this application.

[0186] In this embodiment, pocket patterns can be identified using a combination of one or more of the following sensors:

[0187] Research has found that when electronic devices are in a pocket, they are often in an upright or head-down position. The light intensity detected by the ambient light sensor is much lower than when used in a normally well-lit environment, and the proximity light sensor is usually blocked. Therefore, these sensors or combinations thereof can be used to determine whether an electronic device is in pocket mode.

[0188] (1) Ambient light sensor

[0189] Electronic devices can be equipped with ambient light sensors. These sensors detect the light intensity (also known as illuminance) of the environment in which the electronic device is located. When an electronic device is placed in a pocket, the ambient light is weaker than the outside environment. Therefore, whether the electronic device is in a pocket, or in pocket mode, can be determined by whether the current ambient light intensity detected by the ambient light sensor is less than a first threshold. When the light intensity is less than the first threshold, it can be determined that the electronic device is in or may be in pocket mode.

[0190] (2) Gyroscope and / or accelerometer

[0191] Electronic devices may be equipped with gyroscopes and / or accelerometers. Gyroscopes and / or accelerometers can be used to detect motion information of the electronic device. This motion information may include, but is not limited to, pitch, roll, yaw, horizontal velocity, horizontal acceleration, vertical velocity, and vertical acceleration. The attitude of the electronic device can be analyzed based on this motion information.

[0192] In other embodiments, the electronic device can identify whether it is in a pocket, i.e., whether it is in pocket mode, by detecting whether the electronic device's posture is vertical, using a gyroscope and / or accelerometer. When the electronic device's posture is vertical, it can be determined that the electronic device is in or may be in pocket mode.

[0193] In this context, "vertical state" refers to the touch screen of an electronic device being perpendicular or approximately perpendicular to the horizontal plane. "Approximately perpendicular" means that the angle between the touch screen of the electronic device and the horizontal plane is greater than 90°-Δ and less than 90°+Δ, where Δ can be less than 45°, such as 15°.

[0194] In other embodiments, the electronic device can identify whether it is in a pocket, i.e., in pocket mode, by detecting whether its posture is upside down using a gyroscope and / or accelerometer. When the electronic device is upside down, it can be determined that the electronic device is in or may be in pocket mode.

[0195] (3) Proximity light sensor

[0196] Electronic devices may be equipped with proximity sensors. A proximity sensor may include an infrared light source (such as a light-emitting diode) and a photodetector (such as a photodiode). The electronic device emits infrared light outward through the light-emitting diode and uses the photodiode to detect infrared reflected light from nearby objects. Then, based on the intensity of the reflected infrared light, it senses the distance to the object and whether there is an object obstructing the view.

[0197] When an electronic device is placed in a pocket, its proximity sensor is obscured by clothing. Therefore, the obstruction of the proximity sensor can be identified by checking if the intensity of the infrared light detected by the sensor exceeds a second threshold, thus determining whether the electronic device is in a pocket, i.e., whether it is in pocket mode. If the intensity exceeds the second threshold, it can be determined that the electronic device is in or may be in pocket mode.

[0198] (4) Ultrasonic sensor

[0199] Electronic devices can be equipped with ultrasonic sensors. An ultrasonic sensor can include an ultrasonic transmitter and an ultrasonic receiver. The ultrasonic transmitter can be an earpiece for emitting ultrasonic signals; the ultrasonic receiver can be a microphone for receiving the echo signals. Electronic devices can determine whether they are in a pocket based on the energy of the echo signal (also called echo energy). When the echo energy exceeds a third threshold, it can be determined that the electronic device is in or may be in pocket mode.

[0200] In some embodiments, the presence or absence of an electronic device in pocket mode can be determined by the sensors described above, either individually or in combination.

[0201] Methods for identifying pocket patterns: Identification via ambient light sensors, gyroscopes, or proximity sensors.

[0202] Figure 6A shows a flowchart of the pocket pattern recognition method. This method can be implemented by an electronic device and may include, but is not limited to, some or all of the following steps:

[0203] S501 detects the current ambient light level using an ambient light sensor.

[0204] S502, determine whether the ambient light intensity detected by the ambient light sensor is less than the first threshold. If yes, execute S507; otherwise, execute S508.

[0205] S503 acquires motion information of electronic devices through gyroscopes and / or accelerometers.

[0206] S504: Based on motion information, determine whether the electronic device is facing down. If so, execute S507; otherwise, execute S508.

[0207] The S505 detects the intensity of received infrared light using a proximity light sensor.

[0208] S506: Determine whether the proximity sensor is blocked based on the detected infrared light intensity. If it is, execute S507; otherwise, execute S508.

[0209] Specifically, if the infrared light intensity detected by the proximity sensor is greater than the second threshold, it is determined that the proximity sensor is blocked; otherwise, it is determined that the proximity sensor is not blocked.

[0210] S507, confirm that the electronic device is in pocket mode.

[0211] S508, determines that the electronic device is in non-pocket mode.

[0212] It should be understood that the above S501-S502, S503-S504, and S505-S506 can be executed sequentially or simultaneously without regard to the order.

[0213] In another implementation of pocket pattern recognition, multiple sensors can be used in combination to improve recognition accuracy.

[0214] For example, after executing S501-S502, if the determination result of S502 is yes, then S503-S504 are executed; otherwise, S508 is executed. Further, if the determination result of S504 is yes, then S505-S506 are executed; otherwise, S508 is executed. In this method, if the ambient light sensor detects light intensity greater than or equal to a light intensity threshold, and the electronic device is in a head-down position and close to a light sensor that is blocked, then the electronic device is determined to be in pocket mode.

[0215] As another example, when the ambient light intensity detected by the ambient light sensor is less than a first threshold and the electronic device is in a head-down position, the electronic device determines that the electronic device is in pocket mode.

[0216] As another example, when the ambient light intensity detected by the ambient light sensor is less than a first threshold and the proximity light sensor is blocked, the electronic device determines that the electronic device is in pocket mode.

[0217] For example, when the electronic device is in a head-down, vertical position and the infrared light intensity detected by the light sensor is greater than a second threshold or the echo energy detected by the ultrasonic sensor is greater than a third threshold, the electronic device determines that it is in pocket mode.

[0218] When using a proximity sensor to identify whether an electronic device is in pocket mode, many dark pockets (such as black pockets) absorb a large amount of infrared light, which may lead to misjudgments that the proximity sensor is not blocked and the electronic device is not in a pocket. To avoid inaccurate judgments when using a proximity sensor alone in scenarios where the electronic device is in a black pocket, this application embodiment also provides a pocket mode identification method.

[0219] As shown in Figure 6B, this application provides a pocket pattern recognition method. This method can be implemented by an electronic device and may include, but is not limited to, some or all of the following steps:

[0220] S601: Determine whether the ambient light intensity detected by the ambient light sensor is less than a first threshold. If so, execute S602 to further determine whether the electronic device is blocked; otherwise, execute S604 to determine that the electronic device is in non-pocket mode.

[0221] S602, determine whether the infrared light intensity detected by the proximity sensor is greater than the third threshold. If so, it means that the proximity sensor is blocked, that is, the electronic device is blocked. Then execute S603 to determine that the electronic device is in pocket mode. Otherwise, execute S604 to determine that the electronic device is in non-pocket mode.

[0222] The third threshold can be less than the second threshold.

[0223] S603, confirm that the electronic device is in pocket mode.

[0224] S604, Determine that the electronic device is in non-pocket mode.

[0225] The above method can combine ambient light sensor and proximity light sensor to determine the color of the pocket when it is black, and lower the threshold of light intensity that the proximity light sensor triggers to identify the obstructed light, thereby improving the accuracy of the identification.

[0226] The method for preventing accidental touches provided in this application will be described in three embodiments below.

[0227] Example 1:

[0228] As shown in Figure 7, the method for preventing accidental touches can be implemented by an electronic device and may include, but is not limited to, some or all of the following steps:

[0229] S11, the touchscreen of the electronic device displays the first user interface.

[0230] Based on the different first user interfaces, the embodiments of this application divide the scenarios into two types: the unlocked screen scenario and the locked screen-on scenario. Figures 8A-8C illustrate the user interface involved in the anti-mistouch method in the unlocked screen scenario, while Figures 9A-9C illustrate the user interface involved in the anti-mistouch method in the locked screen-on scenario.

[0231] For example, the first user interface can be a non-lock screen interface, such as the user interface provided by an application. This application can be a system application such as a desktop, settings, video, music, or camera, or a third-party application such as WeChat or Alipay. As shown in Figure 8A, the first user interface is desktop 81, which includes icons or cards of multiple applications.

[0232] As an example, as shown in FIG9A, the first user interface may be a lock screen interface 91. The lock screen interface may include an unlock control 901. The unlock control 901 is used to unlock the electronic device.

[0233] S12, the electronic device receives a touch operation input on the first user interface.

[0234] A touchscreen includes a display panel and a touch panel (also called a touch sensor). The touch panel may include multiple touch units arranged in an array.

[0235] When displaying a first user interface, the touchscreen of an electronic device can detect all touch units on the screen and obtain the capacitance value of each touch unit. Further, if one or more capacitance values ​​among all touch units are greater than or equal to a first capacitance threshold, a touch event is determined to have occurred, and the electronic device receives a touch operation. Conversely, if the capacitance values ​​of all touch points are less than the first capacitance threshold, it is determined that no touch operation was detected. The first capacitance threshold can vary depending on the touchscreen model; for example, the first capacitance threshold can be 500.

[0236] For example, as shown in FIG8B, when the electronic device is placed in a pocket while displaying the desktop 81 shown in FIG8A, if the area 801 on the touch screen comes into contact with the user's skin through clothing, the electronic device detects a touch operation input in the area 801.

[0237] As another example, as shown in FIG9B, when an electronic device is placed in a pocket, if the area 902 on the touch screen comes into contact with the user's skin through clothing while the lock screen interface 91 shown in FIG9A is displayed, the electronic device detects a touch operation input in the area 902.

[0238] S13, the electronic device determines whether the detected touch operation is a pocket touch, that is, whether it meets one or more conditions / features of a pocket touch. If yes, it executes S14, not responding to the touch operation or displaying the anti-mistouch interface; if no, it executes S15, determining that the touch operation is a non-pocket touch. When the touch operation is a non-pocket touch, the electronic device may respond to the touch operation, or further identify whether the touch operation is another type of erroneous operation. If it is not another type of erroneous operation, it will then respond to the touch operation.

[0239] The method for recognizing pocket touches can be found in the pocket touch recognition method described in Figures 5A-5D below, and will not be repeated here.

[0240] S14, the electronic device does not respond to the touch operation or displays the anti-accidental touch interface.

[0241] In some embodiments, the anti-mistouch interface may include a prompt message indicating that the system is currently in anti-mistouch mode. Optionally, the anti-mistouch interface may further include a first control. This first control is used to exit the anti-mistouch mode.

[0242] Optionally, after displaying the anti-accidental touch interface for a first duration, the electronic device may turn off the touchscreen, display preset content (such as time, weather, images, etc.) in an always-on display (AOD) mode, or resume displaying the first user interface. The first duration can be 2 seconds, 5 seconds, 10 seconds, or other durations.

[0243] Figure 8C shows a schematic diagram of an anti-mistouch interface provided in an embodiment of this application. The anti-mistouch interface 82 may include a first control 802 and prompt information. When the electronic device displays the anti-mistouch interface 82, if a touch operation is received at any position on the interface, and if the touch operation is not an operation to exit the anti-mistouch mode input to the first control 802, the electronic device will not respond to the touch operation. The prompt information can be used to indicate that the device is currently in anti-mistouch mode, and to indicate a method for exiting the anti-mistouch mode, such as "swipe twice below to exit".

[0244] Optionally, if the electronic device receives a user's operation to exit the anti-mistouch mode for input on the first control 802, such as a swipe operation from the first control 802 in a first direction, then it exits the anti-mistouch mode. The first direction can be right, left, up, down, or other directions. To prevent the swipe operation from the first control 802 in the first direction from being a mis-touch operation, the electronic device can also receive two swipe operations from the first control 802 in the first direction within a second duration before exiting the anti-mistouch mode. The second duration can be 1 second, 2 seconds, or other durations.

[0245] Similarly, in the lock screen and on screen scenarios, if the electronic device detects a pocket touch operation, it can either not respond to the touch operation, turn off the touch screen, or display the anti-accidental touch interface, as shown in Figure 9C.

[0246] Similar to Figure 8C above, as shown in Figure 9C, the anti-mistouch interface 92 may include a first control 903 and prompt information. When the electronic device displays the anti-mistouch interface 92, if a touch operation is received at any position on the interface 92, and if the touch operation is not an operation to exit the anti-mistouch mode input to the first control 903, the electronic device will not respond to the touch operation. Optionally, if the electronic device receives a user operation to exit the anti-mistouch mode input to the first control 903, such as a swipe operation from the first control 903 in a first direction, then it exits the anti-mistouch mode.

[0247] In non-locked screen or locked screen on scenarios, electronic devices can display the first user interface or turn off the screen after exiting the anti-mistouch mode.

[0248] It should be understood that the anti-mistouch mode is the state in which the electronic device displays the anti-mistouch interface. Exiting the anti-mistouch mode means that the anti-mistouch interface will no longer be displayed.

[0249] S15, the electronic device determines that the touch operation is a non-pocket touch.

[0250] In some embodiments, when the electronic device determines that the touch operation is a non-pocket touch, it may respond to the touch operation by displaying a second user interface.

[0251] For example, if the touch operation is a click on the "Gallery" icon on the desktop shown in Figure 8A, then the Gallery will be opened and the main interface of the Gallery will be displayed.

[0252] For example, if the touch operation is an unlock operation input to the lock screen interface shown in Figure 9A, then the electronic device is unlocked and the desktop or other interface is displayed.

[0253] It should be understood that in the embodiments of this application, pocket touch is a misoperation, but non-pocket touch may be a user operation that requires a response or a misoperation. Therefore, in some other embodiments, after the electronic device recognizes that the touch operation is a non-pocket touch, it can further identify whether the touch operation belongs to other types of misoperations. If it is not a misoperation, it can respond to the touch operation, while if it is a misoperation, it can not respond to the touch operation or pop up an anti-misoperation interface.

[0254] Alternatively, after S12 and before S13, the electronic device can also determine whether the touch operation is another type of accidental operation. If it is an accidental operation, it can not respond to the touch operation. If it is not another type of accidental operation, it can then determine whether it is a pocket touch. If it is, it can not respond to the accidental operation or pop up the anti-accidental touch interface. Otherwise, it can respond to the touch operation.

[0255] Example 2:

[0256] As shown in Figure 10, the method for preventing accidental touches can be implemented by an electronic device and may include, but is not limited to, some or all of the following steps:

[0257] S21, the touch screen of the electronic device displays the first user interface.

[0258] S22, the electronic device receives a touch operation input on the first user interface.

[0259] S23, the electronic device determines whether it is in pocket mode. If so, S24 is executed to further determine whether the touch operation is a pocket touch; if not, S26 is executed to determine that the touch operation is a non-pocket touch.

[0260] The method for recognizing pocket patterns can be found in the pocket pattern recognition methods described in Figures 5A-5D above, and will not be repeated here.

[0261] S24, the electronic device determines whether the touch operation is a pocket touch. If yes, then proceed to S25, not responding to the touch operation or displaying the anti-mistouch interface; if no, then proceed to S26, determining that the touch operation is not a pocket touch. When the touch operation is not a pocket touch, the electronic device may respond to the touch operation, or further identify whether the touch operation is a misoperation, and only respond to the touch operation if it is not a misoperation.

[0262] The method for recognizing pocket touches can be found in the pocket touch recognition method described in Figures 6A-6B above, and will not be repeated here.

[0263] S25, the electronic device does not respond to the touch operation or display the anti-accidental touch interface.

[0264] S26, the electronic device determines that the touch operation is a non-pocket touch.

[0265] The specific implementations of S21-S22 can be found in S11-S12 of the above embodiment 1, and the specific implementations of S25-S26 can be found in S14-S15 of the above embodiment 1, which will not be repeated here.

[0266] Similar to Embodiment 1 above, in some embodiments, when the electronic device determines that the touch operation is not a pocket touch, it can respond to the touch operation and display a second user interface. Alternatively, it can further identify whether the touch operation is a misoperation. If it is not a misoperation, it can respond to the touch operation. Or, after S22 and before S24, it can determine whether the touch operation is another type of misoperation. If it is a misoperation, it can not respond to the touch operation. If it is not another type of misoperation, it can further determine whether it is a pocket touch. If it is, it can not respond to the misoperation or pop up an anti-misoperation interface. Otherwise, it can respond to the touch operation.

[0267] It should be understood that, in another embodiment, the electronic device may first determine whether the touch operation is a pocket touch, and then identify whether it is currently in pocket mode. If the electronic device is in pocket mode and the touch operation is a pocket touch, S25 is executed, while if the electronic device is in non-pocket mode or the touch operation is a non-pocket touch, S26 is executed.

[0268] Example 3:

[0269] As shown in Figure 11, the method for preventing accidental touches can be implemented by an electronic device and may include, but is not limited to, some or all of the following steps:

[0270] S31, the electronic device's touchscreen displays the first user interface.

[0271] S32, the electronic device receives a touch operation input on the first user interface.

[0272] S33, the electronic device identifies whether it is in pocket mode based on the sensor. If so, S34 is executed to further determine whether the touch operation is a pocket touch; if not, S37 is executed to determine that the touch operation is a non-pocket touch.

[0273] The method for recognizing pocket patterns can be found in the pocket pattern recognition methods described in Figures 5A-5D above, and will not be repeated here.

[0274] S34, the electronic device determines whether the duration of the touch operation is less than a preset duration. If yes, then proceed to S36; otherwise, proceed to S35 or respond to the touch operation.

[0275] The preset duration can be less than 1 second, or it can be 100ms, 150ms or other values.

[0276] S35, the electronic device determines whether the touch operation is a pocket touch. If yes, proceed to S36, either not responding to the touch operation or displaying an anti-mistouch interface; if no, proceed to S37, determining that the touch operation is not a pocket touch. When the touch operation is not a pocket touch, the electronic device may respond to the touch operation, or further identify whether the touch operation is a misoperation. If it is not a misoperation, then the electronic device will respond to the touch operation.

[0277] The method for recognizing pocket touches can be found in the pocket touch recognition method described in Figures 6A-6B above, and will not be repeated here.

[0278] S36, The electronic device does not respond to the touch operation or display the anti-accidental touch interface.

[0279] S37, the electronic device determines that the touch operation is a non-pocket touch.

[0280] Similar to Embodiment 2 above, in some embodiments, when the electronic device determines that the touch operation is not a pocket touch, it can respond to the touch operation and display a second user interface; alternatively, it can further identify whether the touch operation is another type of erroneous operation, and only respond to the touch operation if it is not another type of erroneous operation. It should be understood that other types of erroneous operations can be performed before pocket touch is identified.

[0281] When users are walking or running quickly, accidental touches on electronic devices in their pockets typically have a duration shorter than a preset duration, such as 150ms. Therefore, in pocket mode, touches with a duration shorter than the preset duration (e.g., 150ms) can be blocked to quickly intercept these shorter-duration touches. For touches with a duration greater than or equal to the preset duration (e.g., 150ms), it is further determined whether the touch is a pocket touch. If it is, the touch is blocked; otherwise, it can be responded to, allowing longer-duration non-pocket touches to be responded to in pocket mode.

[0282] The hardware and software system architecture of the above electronic device is described below with reference to Figure 12.

[0283] The hardware and software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture of the Android system as an example to exemplify the hardware and software system architecture of electronic device 100.

[0284] A layered architecture divides hardware and software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the system is divided into multiple layers, from top to bottom: application layer (not shown in Figure 12), application framework layer (not shown in Figure 12), Android runtime and system libraries (not shown in Figure 12), hardware abstraction layer (HAL), kernel layer, and hardware layer. Wherein:

[0285] The application layer can include a series of application packages. Application packages can include applications such as camera, gallery, calendar, calling, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0286] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. It may include a sensor manager, window manager, content provider, and view system. The sensor manager is used to manage and schedule the operation of sensors.

[0287] The runtime is responsible for system scheduling and management. The runtime includes core libraries and a virtual machine. System libraries can include multiple functional modules. Examples include a Surface Manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL).

[0288] The Hardware Access Layer (HAL) is the interface layer between the operating system kernel and upper-level software, designed to abstract the hardware. The HAL acts as an abstract interface for the device kernel driver, providing an application programming interface (API) for accessing the underlying device to higher-level Java API frameworks. As shown in Figure 12, the HAL can include a sensor HAL, sensor AIDL, TP AIDL, TP HAL, and an app touch daemon. The sensor HAL can be a wrapper around the sensor driver in the kernel. The sensor AIDL is used to identify pocket modes; its implementation can be found in the pocket mode identification method described in the above method embodiments, and will not be repeated here. The TP HAL is a wrapper around the TP driver in the kernel. The TP AIDL is used to transmit indication information for pocket and / or non-pocket modes. The specific implementation of the touch detection unit can be found in the software flow of the anti-mistouch method described below, and will not be repeated here.

[0289] The kernel layer is the layer between hardware and software. As shown in Figure 12, the kernel layer may contain at least one or more sensor drivers, TP drivers, display drivers (not shown in Figure 12), etc. Among them, sensor drivers may include ambient light sensor drivers, gyroscope drivers, accelerometer drivers, proximity sensor drivers, etc.

[0290] The hardware layer may include one or more sensors, such as an ambient light sensor, a gyroscope, an accelerometer (not shown in Figure 12), a proximity sensor, etc., and may also include a touch screen and other hardware.

[0291] Figure 12 also illustrates the software flow when the electronic device 100 executes the anti-accidental touch method provided in this application. The following is a detailed description.

[0292] ①TP power-on monitoring sensor.

[0293] Electronic devices can register listening sensors when the touchscreen is started via TP AIDL.

[0294] ②Pocket mode notification process.

[0295] Sensors can report the information they detect, also known as sensor data, to their driver. Different sensors report different types of sensor data. For example, an ambient light sensor reports the detected ambient light intensity, a gyroscope and / or accelerometer reports detected motion information, a proximity sensor reports the detected infrared light intensity, and an ultrasonic sensor reports the detected echo energy.

[0296] Furthermore, after receiving sensor data, the sensor driver can send the sensor data to the sensor HAL. The sensor AIDL can determine whether the electronic device is in pocket mode based on the sensor data. If so, it sends a first indication message to the TP AIDL, which indicates that the electronic device is in pocket mode. If not, the sensor AIDL can send a second indication message to the TP AIDL, which indicates that the electronic device is in non-pocket mode.

[0297] After receiving the indication information (such as the first indication information or the second indication information), the TP AIDL can send the indication information to the TP HAL. After receiving the indication information, the TP HAL can send the indication information to the TP driver. After receiving the indication information, the TP driver can send the indication information to the touch detection unit.

[0298] ③TP capacitance data reporting process.

[0299] After the touchscreen is powered on, it can detect the capacitance value of each touch unit in real time and send the detected capacitance data, i.e., the capacitance value of each touch unit, to the TP driver. After receiving the capacitance data, the TP driver can report it to the touch detection unit. The touch detection unit can determine whether a touch operation has been received based on the received capacitance data. After confirming that a touch operation has been received, it can identify whether the touch operation is a pocket touch based on the capacitance data.

[0300] In some embodiments, the touch detection unit does not execute the coordinate reporting process ④ when it determines that the touch operation is a pocket touch, or when the electronic device is in pocket mode and the touch operation is a pocket touch.

[0301] In some embodiments, when the touch detection unit determines that the touch operation is a non-pocket touch, it determines the coordinate data corresponding to the touch operation and executes the coordinate reporting process ④.

[0302] In some other embodiments, when the touch detection unit determines that the touch operation is not a pocket touch and is not another accidental touch operation, it determines the coordinate data corresponding to the touch operation and executes the coordinate reporting process ④.

[0303] In some other embodiments, when the electronic device is in non-pocket mode or the touch operation is a non-pocket touch, the touch detection unit determines the coordinate data corresponding to the touch operation and executes the coordinate reporting process ④.

[0304] In some other embodiments, when the electronic device is in pocket mode and the touch operation is a non-pocket touch, the touch detection unit determines the coordinate data corresponding to the touch operation and executes the coordinate reporting process ④.

[0305] ④ Coordinate reporting process.

[0306] The touch detection unit sends the coordinate data corresponding to the touch operation to the TP HAL, which then forwards the coordinate data to the input management module. The input management module can then send the coordinate data to the foreground application, which can respond to the touch operation upon receiving the coordinate data.

[0307] In some embodiments, the touch detection unit may also send a third indication message to the TP HAL when the touch operation is a pocket touch or other types of accidental operation. The TP HAL then sends the third indication message to the input management module. In response to the third indication message, the input management module can trigger the touchscreen to display an anti-accidental touch interface.

[0308] It should be understood that the specific implementation of TP AIDL in recognizing pocket patterns can also refer to the methods described in Figures 6A-6B above, and the specific implementation of the touch detection unit in recognizing pocket touch can also refer to the methods described in Figures 5A-5D above.

[0309] The above method allows the touch detection unit of the electronic device to avoid reporting coordinate data to the input management module when it detects a pocket touch operation. In this case, neither the input management module nor the foreground application will be aware of the touch event, and the user will not be aware of it. This will not interfere with the user's use of the electronic device and will improve the user experience.

[0310] This application also provides a computer program product, which includes a computer program (also referred to as code or instructions) that, when run, causes a computer to perform the method executed by the electronic device in any of the above embodiments.

[0311] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the method executed by the electronic device in any of the above embodiments.

[0312] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.

[0313] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk).

[0314] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for preventing accidental touches, characterized in that, The method includes: The touchscreen of the electronic device displays the first user interface; The electronic device receives a first touch operation on the first user interface; When the first touch operation meets the preset conditions, the electronic device does not respond to the first touch operation and continues to display the first user interface; or, when the first touch operation meets the preset conditions, the electronic device displays an anti-accidental touch interface. The preset conditions include one or more of the following conditions: The capacitance values ​​within the touch area of ​​the first touch operation are all less than the second capacitance threshold; The touch area of ​​the first touch operation is greater than the area threshold; The ellipticity of the touch area in the first touch operation is within a preset range; The angle between the long axis of the touch area of ​​the first touch operation and the long side of the touch screen is within a preset angle range.

2. The method as described in claim 1, characterized in that, The method further includes: The electronic device determines the touch area of ​​the first touch operation based on the capacitance value of each touch unit detected by the touch screen. The touch area is a connected area formed by touch units with capacitance values ​​greater than the first capacitance value. The electronic device fits an ellipse based on the touch area; The electronic device determines the major and minor axes of the ellipse; The electronic device determines the ellipticity based on the major and minor axes of the ellipse.

3. The method as described in claim 1 or 2, characterized in that, When the first touch operation meets the preset conditions, the electronic device does not respond to the first touch operation and continues to display the first user interface; Alternatively, when the first touch operation meets preset conditions, the electronic device displays an anti-accidental touch interface, specifically including: When the electronic device is in pocket mode and the first touch operation meets the preset conditions, it does not respond to the first touch operation and continues to display the first user interface; Alternatively, when the electronic device is in pocket mode and the first touch operation meets preset conditions, it displays an anti-accidental touch interface.

4. The method as described in claim 1 or 2, characterized in that, The method further includes: when the electronic device is in pocket mode and the touch duration of the first touch operation is less than a preset duration, it does not respond to the first touch operation and continues to display the first user interface; or, it displays an anti-accidental touch interface. When the first touch operation meets the preset conditions, the electronic device does not respond to the first touch operation and continues to display the first user interface; or, when the first touch operation meets the preset conditions, the electronic device displays an anti-accidental touch interface, specifically including: when the electronic device is in pocket mode, the touch duration of the first touch operation is less than or equal to the preset duration, and the first touch operation meets the preset conditions, it does not respond to the first touch operation and continues to display the first user interface; or, it displays an anti-accidental touch interface.

5. The method as described in claim 3 or 4, characterized in that, The electronic device is determined to be in pocket mode when it meets one or more of the following conditions: The ambient light illuminance detected by the ambient light sensor of the electronic device is less than a first threshold. The gyroscope of the electronic device detects that the electronic device is in an upright position or head-down position; The infrared light intensity detected by the proximity sensor of the electronic device is greater than the second threshold. The echo energy detected by the ultrasonic sensor of the electronic device is greater than the third threshold.

6. The method as described in claim 3 or 4, characterized in that, The method further includes: When the ambient light intensity detected by the ambient light sensor is less than a first threshold and the infrared light intensity detected by the proximity light sensor is greater than a third threshold, the electronic device determines that it is in pocket mode, where the third threshold is less than the second threshold.

7. The method according to any one of claims 1-6, characterized in that, The anti-mistouch interface includes a first control, which is used to exit the anti-mistouch mode. The method further includes: The electronic device receives a second touch operation on the first control, the second touch operation being used to indicate exiting the anti-mistouch mode; The electronic device responds to the second touch operation by displaying the first user interface, displaying the lock screen, or turning off the screen.

8. The method as described in claim 7, characterized in that, The method further includes: The electronic device responds to a third touch operation on the anti-accidental touch interface, or does not respond to the third touch operation, but continues to display the anti-accidental touch interface. The third touch operation is different from the second touch operation.

9. The method according to any one of claims 1-8, characterized in that, The method further includes: After displaying the anti-accidental touch interface for a first period of time, the electronic device either turns off the touchscreen or resumes displaying the first user interface.

10. The method according to any one of claims 1-9, characterized in that, The first user interface is the lock screen / wake screen interface.

11. The method according to any one of claims 1-9, characterized in that, The first user interface is a non-lock screen interface.

12. An electronic device, characterized in that, The device includes one or more processors, one or more memories, and a touch screen, wherein the touch screen and the one or more memories are coupled to the one or more memories, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when the one or more processors execute the computer instructions, cause the electronic device to perform the method as described in any one of claims 1-11.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by an electronic device, implements the method as described in any one of claims 1-11.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by an electronic device, it implements the method as described in any one of claims 1-11.