Method for preventing mistaken touch and electronic equipment

By combining information from proximity sensors, ultrasonic sensors, and ambient light sensors with attitude sensors and biometric identifiers, the problem of false triggering when the terminal device is obstructed is solved, improving detection accuracy and user experience.

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

Patent Information

Application Number
CN202411169792.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

When a terminal device is placed in a pocket or backpack, accidental operation may be triggered due to skin capacitance, affecting the user experience.

Method used

It uses proximity sensors, ultrasonic sensors, and ambient light sensors combined with posture sensors and biometric identifiers to determine whether the device is obstructed by information from multiple sensors, and activates the anti-accidental touch function when obstruction is detected.

Benefits of technology

It improves the detection accuracy of terminal devices when they are obstructed, reduces false triggering operations, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121603601A_ABST
    Figure CN121603601A_ABST
Patent Text Reader

Abstract

The invention provides a mistaken touch prevention method and electronic equipment, the method is applied to the electronic equipment, the electronic equipment comprises a proximity sensor, an ambient light sensor and an ultrasonic sensor, and the method comprises the following steps: acquiring first information from the proximity sensor; if the judgment result indicated by the first information is that the electronic equipment is not shielded, second information is obtained from the ultrasonic sensor, and if the judgment result indicated by the second information is shielded, the electronic equipment is controlled to start a mistaken touch prevention function; or if the judgment result indicated by the first information is shielding, third information is obtained from the ambient light sensor, and if the judgment result indicated by the third information is that the ambient light brightness is smaller than the first brightness value, the electronic equipment is controlled to start the mistaken touch prevention function. In the application, whether the electronic equipment is shielded or not can be comprehensively judged based on the proximity sensor, the ambient light sensor and the ultrasonic sensor, so that the mistaken touch prevention function can be started when the electronic equipment is shielded, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more specifically, to a method and electronic device for preventing accidental touches. Background Technology

[0002] For terminal devices that support touchscreen operation, users control the device to execute corresponding commands by tapping or swiping on the screen. However, when the device is in a pocket or backpack, if the screen is in contact with the skin and there is relative movement, accidental touches may occur due to capacitive factors such as skin contact, resulting in a poor user experience. For example, when the phone is in a pocket with the screen off or locked, accidental unlocking may occur; when the phone is in a pocket with the screen on, accidental app activation may occur. Therefore, there is an urgent need to design an effective anti-accidental touch solution to improve the user experience. Summary of the Invention

[0003] This application provides a method and electronic device for preventing accidental touches, so that the anti-accidental touch function can be activated when the electronic device is blocked, thereby improving the user experience.

[0004] Firstly, a method for preventing accidental touches is provided, applied to an electronic device including a proximity sensor, an ultrasonic sensor, and an ambient light sensor. The method may include:

[0005] The electronic device acquires first information from the proximity sensor, which indicates whether the proximity sensor determines whether the light is obstructed. If the first information indicates that the light is not obstructed, the device acquires second information from the ultrasonic sensor, which indicates whether the ultrasonic sensor determines whether the light is obstructed. If the second information indicates that the light is obstructed, the device activates the anti-accidental touch function. Alternatively, if the first information indicates that the light is obstructed, the device acquires third information from the ambient light sensor, which indicates whether the ambient light brightness is less than a first brightness value. If the third information indicates that the ambient light brightness is less than the first brightness value, the device activates the anti-accidental touch function.

[0006] In one implementation, the third information is used to indicate whether the ambient light sensor determines whether the ambient light brightness is less than or equal to the first brightness value. If the determination result indicated by the third information is that the ambient light brightness is less than or equal to the first brightness value, the electronic device is controlled to enable the anti-accidental touch function.

[0007] Based on the above scheme, a proximity sensor is used to determine whether the electronic device is obstructed. When the electronic device is obstructed, a third piece of information is obtained from an ambient light sensor to further determine whether the electronic device is obstructed. When the electronic device is not obstructed, a second piece of information is obtained from an ultrasonic sensor to determine whether the electronic device is obstructed. If the electronic device is determined to be obstructed based on the second or third piece of information, the anti-mistouch function of the electronic device is activated. In this way, by combining the results of the proximity sensor determination with the results of the ambient light sensor or ultrasonic sensor determination, the final detection result of whether the electronic device is obstructed is obtained. This improves the detection accuracy and enhances the user experience by activating the anti-mistouch function when the electronic device is obstructed.

[0008] In conjunction with the first aspect, in some implementations of the first aspect, the electronic device further includes an attitude sensor for detecting the motion trajectory of the electronic device, and the method further includes: acquiring fourth information from the attitude sensor, the fourth information being used to indicate the result of the attitude sensor determining whether the electronic device is on a first motion trajectory; if the determination result indicated by the fourth information is that the electronic device is on the first motion trajectory, then acquiring the first information from the proximity sensor.

[0009] Based on the above scheme, the fourth information obtained from the attitude sensor is used to determine whether the electronic device is in the first motion trajectory. Then, when the electronic device is in the first motion trajectory, the proximity sensor is activated to determine whether the electronic device is blocked.

[0010] In conjunction with the first aspect, in some implementations of the first aspect, if the signal strength of the reflected signal received by the proximity sensor is greater than a first preset strength value, then the determination result indicated by the first information is that the signal is blocked; or if the time delay of the reflected signal received by the proximity sensor is less than a first preset time delay value, then the determination result indicated by the first information is that the signal is blocked; or if the signal strength of the reflected signal received by the proximity sensor is less than or equal to the first preset strength value, then the determination result indicated by the first information is that the signal is not blocked; or if the time delay of the reflected signal received by the proximity sensor is greater than or equal to the first preset time delay value, then the determination result indicated by the first information is that the signal is not blocked.

[0011] Optionally, if the signal strength of the reflected signal received by the proximity sensor is greater than or equal to a first preset strength value, the determination result indicated by the first information is that the signal is blocked; or if the time delay of the reflected signal received by the proximity sensor is less than or equal to a first preset time delay value, the determination result indicated by the first information is that the signal is blocked; or if the signal strength of the reflected signal received by the proximity sensor is less than the first preset strength value, the determination result indicated by the first information is that the signal is not blocked; or if the time delay of the reflected signal received by the proximity sensor is greater than the first preset time delay value, the determination result indicated by the first information is that the signal is not blocked.

[0012] Based on the above scheme, the determination result of the first information indication is determined by the strength or time delay of the signal received by the proximity sensor, so that after the electronic device obtains the first information, it can know whether the electronic device is blocked, thereby enabling the electronic device to activate the anti-accidental touch function when it is blocked.

[0013] In conjunction with the first aspect, in certain implementations of the first aspect, if the ultrasonic sensor detects that the signal strength of the direct ultrasonic signal or the reflected ultrasonic signal is greater than a second preset intensity value, then the determination result of the second information indication is that the signal is blocked; or if the ultrasonic sensor detects that the time delay of the direct ultrasonic signal or the reflected ultrasonic signal is less than a second preset time delay value, then the determination result of the second information indication is that the signal is blocked; or if the ultrasonic sensor detects that the signal strength of the direct ultrasonic signal or the reflected ultrasonic signal is less than or equal to the second preset intensity value, then the determination result of the second information indication is that the signal is not blocked; or if the ultrasonic sensor detects that the time delay of the direct ultrasonic signal or the reflected ultrasonic signal is greater than or equal to the second preset time delay value, then the determination result of the second information indication is that the signal is not blocked.

[0014] Optionally, if the ultrasonic sensor detects a signal strength greater than or equal to a second preset intensity value for the direct or reflected ultrasonic signal, the determination result indicated by the second information is that the signal is blocked; or if the ultrasonic sensor detects a time delay less than or equal to a second preset time delay value for the direct or reflected ultrasonic signal, the determination result indicated by the second information is that the signal is blocked; or if the ultrasonic sensor detects a signal strength less than a second preset intensity value for the direct or reflected ultrasonic signal, the determination result indicated by the second information is that the signal is not blocked; or if the ultrasonic sensor detects a time delay greater than a second preset time delay value for the direct or reflected ultrasonic signal, the determination result indicated by the second information is that the signal is not blocked.

[0015] Based on the above scheme, the intensity or time delay of the direct or reflected ultrasonic signal received by the ultrasonic sensor is used to determine the judgment result of the second information indication. This enables the electronic device to know whether it is blocked after obtaining the second information, thereby enabling the electronic device to activate the anti-accidental touch function when it is blocked.

[0016] In conjunction with the first aspect, in some implementations of the first aspect, the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset intensity value, then the determination result of the second information indication is that the signal is blocked; or the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than a third preset delay value, then the determination result of the second information indication is... The result is that the signal is blocked; or the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor, and if the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to a third preset intensity value, then the determination result indicated by the second information is that the signal is not blocked; or the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor, and if the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to a third preset delay value, then the determination result indicated by the second information is that the signal is not blocked.

[0017] Optionally, the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to a third preset intensity value, the determination result indicated by the second information is that the signal is blocked. Alternatively, if the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor, and the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to a third preset delay value, the determination result indicated by the second information is that the signal is blocked. Alternatively, if the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor, and the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than a third preset intensity value, the determination result indicated by the second information is that the signal is not blocked. Alternatively, if the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor, and the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset delay value, the determination result indicated by the second information is that the signal is not blocked.

[0018] Based on the above scheme, when the electronic device includes a top ultrasonic sensor and a bottom ultrasonic sensor, the determination result of the second information indication is determined by the ratio between the signal strengths of the ultrasonic signals received by the top ultrasonic sensor and the bottom ultrasonic sensor, or the difference between the time delays of the ultrasonic signals received by the top ultrasonic sensor and the bottom ultrasonic sensor. This allows the electronic device to obtain more accurate second information, making the detection of whether the electronic device is blocked more accurate and improving the detection accuracy. As a result, the anti-accidental touch function is activated when the electronic device is blocked.

[0019] In conjunction with the first aspect, in some implementations of the first aspect, the electronic device further includes a biometric identifier. If the determination result indicated by the second information is that the image is obscured, or if the determination result indicated by the third information is that the ambient light brightness is less than the first brightness value, the method further includes: obtaining fifth information from the biometric identifier, the fifth information being used to instruct the biometric identifier to determine whether a face has appeared; if the determination result indicated by the fifth information is that no face has appeared, then controlling the electronic device to activate the anti-accidental touch function.

[0020] For example, if the determination result indicated by the third information is that the ambient light brightness is less than or equal to the first brightness value, the fifth information can also be obtained from the biometric identifier.

[0021] Based on the above scheme, if the second information indication indicates that the device is obscured, or if the third information indication indicates that the ambient light is less than the first brightness value, the fifth information is obtained from the biometric identifier to determine whether a face is present. This makes the detection results more accurate and improves the detection accuracy. Furthermore, when the electronic device is obscured, the anti-accidental touch function is activated to enhance the user experience.

[0022] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: controlling the proximity sensor to turn off when the electronic device acquires the first information from the proximity sensor; or controlling the ultrasonic sensor to turn off when the electronic device acquires the second information from the ultrasonic sensor; or controlling the ambient light sensor to turn off when the electronic device acquires the third information from the ambient light sensor; or controlling the attitude sensor to turn off when the electronic device acquires the fourth information from the attitude sensor; or controlling the biometric identifier to turn off when the electronic device acquires the fifth information from the biometric identifier.

[0023] Based on the above scheme, the proximity sensor, ultrasonic sensor, ambient light sensor, posture sensor, and biometric identifier will be turned off after detecting the intensity or delay of the currently received reflected signal, the intensity or delay of the ultrasonic signal, the brightness of the ambient light, and whether a human face is present, respectively. This can reduce the power consumption of electronic devices.

[0024] In a second aspect, an electronic device is provided, comprising: one or more processors, a memory, a proximity sensor, an ultrasonic sensor, and an ambient light sensor; the memory includes instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps:

[0025] The electronic device acquires first information from the proximity sensor, which indicates whether the proximity sensor determines whether the light is obstructed. If the first information indicates that the light is not obstructed, the device acquires second information from the ultrasonic sensor, which indicates whether the ultrasonic sensor determines whether the light is obstructed. If the second information indicates that the light is obstructed, the device activates the anti-accidental touch function. Alternatively, if the first information indicates that the light is obstructed, the device acquires third information from the ambient light sensor, which indicates whether the ambient light brightness is less than a first brightness value. If the third information indicates that the ambient light brightness is less than the first brightness value, the device activates the anti-accidental touch function.

[0026] In conjunction with the second aspect, in some implementations of the second aspect, the electronic device further includes an attitude sensor for detecting the motion trajectory of the electronic device. When the instruction is executed by the one or more processors, the electronic device performs the following steps: acquiring fourth information from the attitude sensor, the fourth information indicating the result of the attitude sensor determining whether the electronic device is on the first motion trajectory; if the determination result indicated by the fourth information is that the electronic device is on the first motion trajectory, then acquiring the first information from the proximity sensor.

[0027] In conjunction with the second aspect, in some implementations of the second aspect, if the signal strength of the reflected signal received by the proximity sensor is greater than a first preset strength value, then the determination result indicated by the first information is that the signal is blocked; or if the time delay of the reflected signal received by the proximity sensor is less than a first preset time delay value, then the determination result indicated by the first information is that the signal is blocked; or if the signal strength of the reflected signal received by the proximity sensor is less than or equal to the first preset strength value, then the determination result indicated by the first information is that the signal is not blocked; or if the time delay of the reflected signal received by the proximity sensor is greater than or equal to the first preset time delay value, then the determination result indicated by the first information is that the signal is not blocked.

[0028] In conjunction with the second aspect, in some implementations of the second aspect, if the ultrasonic sensor detects that the signal strength of the direct ultrasonic signal or the reflected ultrasonic signal is greater than a second preset intensity value, then the determination result of the second information indication is that the signal is blocked; or if the ultrasonic sensor detects that the time delay of the direct ultrasonic signal or the reflected ultrasonic signal is less than a second preset time delay value, then the determination result of the second information indication is that the signal is blocked; or if the ultrasonic sensor detects that the signal strength of the direct ultrasonic signal or the reflected ultrasonic signal is less than or equal to the second preset intensity value, then the determination result of the second information indication is that the signal is not blocked; or if the ultrasonic sensor detects that the time delay of the direct ultrasonic signal or the reflected ultrasonic signal is greater than or equal to the second preset time delay value, then the determination result of the second information indication is that the signal is not blocked.

[0029] In conjunction with the second aspect, in some implementations of the second aspect, the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset intensity value, then the determination result of the second information indication is that the signal is blocked; or the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than a third preset delay value, then the determination result of the second information indication is... The result is that the signal is blocked; or the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor, and if the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to a third preset intensity value, then the determination result indicated by the second information is that the signal is not blocked; or the ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor, and if the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to a third preset delay value, then the determination result indicated by the second information is that the signal is not blocked.

[0030] In conjunction with the second aspect, in some implementations of the second aspect, the electronic device further includes a biometric identifier. When the instruction is executed by the one or more processors, the electronic device performs the following steps: obtaining fifth information from the biometric identifier, the fifth information being used to instruct the biometric identifier to determine whether a face has appeared; if the determination result indicated by the fifth information is that no face has appeared, then controlling the electronic device to activate the anti-accidental touch function.

[0031] In conjunction with the second aspect, in some implementations of the second aspect, when the instruction is executed by the one or more processors, it causes the electronic device to perform the following steps: when the electronic device acquires the first information from the proximity sensor, it controls the proximity sensor to turn off; or when the electronic device acquires the second information from the ultrasonic sensor, it controls the ultrasonic sensor to turn off; or when the electronic device acquires the third information from the ambient light sensor, it controls the ambient light sensor to turn off; or when the electronic device acquires the fourth information from the attitude sensor, it controls the attitude sensor to turn off; or when the electronic device acquires the fifth information from the biometric identifier, it controls the biometric identifier to turn off.

[0032] Thirdly, a computer-readable storage medium is provided that stores a computer program (e.g., program code) or instructions that, when executed on an electronic device, cause the electronic device to perform the methods described in the first aspect and any possible implementation thereof.

[0033] Fourthly, a computer-readable storage medium is provided that stores a computer program (e.g., program code) or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect and any possible implementation thereof.

[0034] Fifthly, a computer program product is provided, the computer program product including computer instructions that, when the computer program product is run on a computer, cause the computer to perform the methods described in the first aspect and any possible implementation thereof.

[0035] In a sixth aspect, a chip product is provided, the chip product including a processor for reading instructions stored in a memory, wherein when the processor executes the instructions, the chip implements the methods described in the first aspect and any possible implementation thereof. Attached Figure Description

[0036] Figure 1 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.

[0037] Figure 2 This is a schematic diagram of a mobile phone appearance provided in an embodiment of this application.

[0038] Figure 3 This is a schematic block diagram of the software structure of an electronic device provided in an embodiment of this application.

[0039] Figure 4 This is a schematic flowchart of a method for preventing accidental touches provided in an embodiment of this application.

[0040] Figure 5 This is a schematic flowchart illustrating another method for preventing accidental touches provided in the embodiments of this application.

[0041] Figure 6 This is a schematic block diagram of an electronic device provided in an embodiment of this application.

[0042] Figure 7 This is a schematic block diagram of another electronic device provided in the embodiments of this application. Detailed Implementation

[0043] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0044] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one, two, or more than two. The term “and / or” is used to describe the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.

[0045] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0046] The methods provided in this application can be applied to electronic devices such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not impose any restrictions on the specific type of electronic device.

[0047] Figure 1 This is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application.

[0048] like Figure 1As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a gravity sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, an ultrasonic sensor 180M, etc.

[0049] It is understood that the structures illustrated in the embodiments of this application 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 various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0050] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0051] 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.

[0052] 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 system.

[0053] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0054] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0055] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0056] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0057] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0058] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0059] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0060] The SIM interface can be used to communicate with the SIM card interface 195 to transmit data to or read data from the SIM card.

[0061] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

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

[0063] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0064] The power management module 141 connects 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, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0065] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0066] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0067] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0068] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0069] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0070] 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 via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

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

[0072] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (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 screens 194, where N is a positive integer greater than 1. Preferably, the display screen 194 has touch functionality and can be called a touchscreen, meaning that electronic device 100 can respond to the user touching the corresponding location of the display screen 194.

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

[0074] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0075] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0076] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0077] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0078] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0079] 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, video, and other files can be saved on the external memory card.

[0080] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0081] 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.

[0082] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0083] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.

[0084] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0085] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0086] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0087] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0088] The gyroscope sensor 180B 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 about 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.

[0089] Gravity sensor 180C is used to measure gravity. In some embodiments, electronic device 100 can use gravity sensor 180C to measure the direction of gravity and gravity data values ​​to assist in the switching of the display screen.

[0090] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0091] 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.

[0092] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0093] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a photosensor, such as 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. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in a holster mode or pocket mode for automatic unlocking and locking of the screen. In one embodiment, the proximity sensor and the ultrasonic sensor can be coupled to determine whether the electronic device has enabled the anti-mistouch function. For example, the electronic device enables the anti-mistouch function when either the proximity sensor or the ultrasonic sensor detects that the current electronic device is in an obstructed state; or the electronic device enables the anti-mistouch function only when both the proximity sensor and the ultrasonic sensor detect that the current electronic device is in an obstructed state.

[0094] An ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of its display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L can also work in conjunction with a proximity sensor 180G to detect whether the electronic device 100 is in a pocket, preventing accidental touches. In one embodiment, the ambient light sensor and an ultrasonic sensor can be coupled to determine whether the electronic device has the accidental touch prevention function enabled. For example, even if the ultrasonic sensor detects that the electronic device is obstructed, if the ambient light sensor detects that the ambient light brightness is higher than a certain value, the accidental touch prevention function will not be enabled; or the electronic device will only enable the accidental touch prevention function when the ambient light sensor detects that the ambient light brightness is lower than a first brightness value, such as 10 lux (lx), and the ultrasonic sensor detects that the current electronic device is obstructed.

[0095] 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.

[0096] 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 handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

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

[0098] The ultrasonic sensor 180M is used to detect the current state of the electronic device 100 by emitting and receiving ultrasonic waves, and then the processor 110 determines whether to activate the anti-accidental touch mode.

[0099] Ultrasonic sensors are sensors developed using the properties of ultrasound. Ultrasound is a mechanical wave with a vibration frequency higher than that of sound waves, characterized by high frequency, short wavelength, minimal diffraction, good directionality, and the ability to propagate directionally as a ray. Ultrasound has strong directionality. Ultrasound can propagate in gases, liquids, and solids, with varying propagation speeds. It also exhibits phenomena such as refraction, reflection, and diffraction, and attenuates during propagation. Ultrasound propagates at a lower frequency in air, typically tens of kilohertz (kHz), while its frequency is higher in solids and liquids. It attenuates more rapidly in air than in liquids and solids, allowing it to travel further.

[0100] An ultrasonic sensor may include an ultrasonic transmitter and an ultrasonic receiver. In this embodiment, references to ultrasonic transmitter and ultrasonic receiver are intended to cover all functional alternatives that can be collectively referred to as an ultrasonic sensor. The ultrasonic transmitter emits ultrasonic signals, which are reflected back to the ultrasonic receiver when they encounter an obstacle, thus enabling the ultrasonic sensor to detect the object being measured.

[0101] The ultrasonic transmitter and ultrasonic receiver of an ultrasonic sensor can be integrated on the same device or separated. The ultrasonic sensor can even be any available combination of ultrasonic transmitter and ultrasonic receiver with identical functionality. On electronic device 100, the number of ultrasonic sensors can be one or more. Alternatively, the ultrasonic transmitter is intended to include one or more ultrasonic transmitters, and the ultrasonic receiver is intended to include one or more ultrasonic receivers. The number of ultrasonic transmitters and the number of ultrasonic receivers can be equal or unequal. This application embodiment does not impose any limitation on the number and location of ultrasonic sensors on electronic device 100.

[0102] One or more handsets, speakers, and microphones of electronic device 100 used for audio functions can also be used for ultrasonic measurements. It is understood that handsets and speakers can be used as ultrasonic transmitters, and microphones can be used as ultrasonic receivers, thus saving on component costs and internal space for electronic device 100.

[0103] Figure 2 This is a schematic diagram of the appearance of a mobile phone 200 provided in an embodiment of this application. Figure 2 As shown, in one embodiment, an earpiece 201 may be installed above or below the front of the mobile phone 200, or at the top or bottom of the mobile phone 200. The earpiece 201 can be used as an ultrasonic transmitter to emit ultrasonic signals. A noise-canceling microphone 202 may be installed at the top or bottom of the mobile phone 200. The microphone 202 can be used as an ultrasonic receiver to receive ultrasonic echo signals.

[0104] 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.

[0105] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0106] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0107] 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 and detach from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, and other SIM cards. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication.

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

[0109] Figure 3 This is a schematic block diagram of the software structure of an electronic device 100 provided in an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0110] The application layer can include a series of application packages.

[0111] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0112] The application layer can also include an anti-accidental touch mode application, which requires calling the ultrasonic sensor to send / receive ultrasonic signals when running.

[0113] 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. Applications are primarily user interface (UI) components, typically written in Java that calls the application framework layer's interfaces.

[0114] like Figure 3As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, Local Profile Assistant (LPA), and ultrasonic sensor call control manager.

[0115] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0116] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0117] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0118] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0119] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0120] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and so on.

[0121] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0122] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0123] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0124] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0125] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0126] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0127] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0128] A 2D graphics engine is a graphics engine for 2D drawing.

[0129] The kernel layer is the layer between hardware and software. The kernel layer includes at least the display driver, camera driver, audio driver, sensor driver, and virtual card driver. The sensor driver includes a driver for an ultrasonic sensor, specifically for driving an ultrasonic sensor 180M. Correspondingly, the ultrasonic sensor 180M is used to send and receive ultrasonic signals.

[0130] It should be understood that the technical solutions in the embodiments of this application can be used in systems such as Android, iOS, and HarmonyOS.

[0131] The following describes some application scenarios involved in the embodiments of this application.

[0132] This application primarily addresses the detection of whether an electronic device is currently obstructed. When the device is detected to be obstructed, such as in a pocket or backpack, it automatically activates the accidental touch prevention function, entering an accidental touch prevention mode. Simultaneously, upon entering this mode, the device uses a proximity sensor, and / or an ultrasonic sensor, and / or an ambient light sensor, and / or a biometric identifier to determine if it has been removed from the pocket or backpack. If the device is removed, the accidental touch prevention function is deactivated, exiting the mode.

[0133] It should be understood that in the anti-accidental touch mode, electronic devices do not respond to touch operations, screen unlocking, raise to wake, always on display (AOD) commands, which can prevent accidental touches and reduce the power consumption of electronic devices, thereby improving the user experience.

[0134] Screen unlocking can include swipe-up unlocking, touch unlocking, password unlocking, gesture unlocking, fingerprint unlocking, face unlocking, voice unlocking, voiceprint unlocking, and so on. Furthermore, in anti-accidental touch mode, the commands that the electronic device can respond to are limited to, but not limited to, the aforementioned touch operations, screen unlocking, raise-to-wake, AOD, etc. Other commands can also be used, such as raising to answer a call, automatically adjusting brightness, etc. Developers can configure these settings according to specific circumstances, and this application does not impose any restrictions on them.

[0135] In one embodiment, the electronic device is in a pocket, meaning it is currently in a pocket scenario. In this pocket scenario, the user places the electronic device in their pocket, and the device can detect that it is being obstructed, thus entering an anti-accidental touch mode. This embodiment does not impose any restrictions on the material of the pocket; the pocket material can be cotton, chiffon, polyester, blended fabrics, etc.

[0136] In another embodiment, the electronic device is located inside a bag or suitcase; that is, the electronic device is currently in a bag or suitcase scenario. In this scenario, when the user places the electronic device inside the bag or suitcase, the device can detect that it is being obstructed and then enter an anti-accidental touch mode. The "bag or suitcase scenario" here is a broad concept and can include backpacks, shoulder bags, handbags, wallets, tote bags, suitcases, etc. This embodiment does not limit the material of the backpack; the material can be cotton, cowhide, leather, canvas, plastic, or a combination of materials.

[0137] In another embodiment, the electronic device is held in the palm of the hand, with the palm touching the top of the electronic device at a distance of 0 cm. In this case, the phone is considered to be blocked, and the electronic device activates the anti-mistouch function.

[0138] It should be noted that in the aforementioned pocket, bag, or handheld scenarios, or when the electronic device is held in the palm of the hand, the device may be in a locked, unlocked, or off state. Specifically, when the device is locked, there is a possibility of accidentally dialing a phone number, locking with a password, or accidentally turning on the flashlight. When the device is unlocked, there is a possibility of accidentally locking the screen. When the device is off, there is a possibility of accidentally turning on the screen, accidentally triggering face unlock, or accidentally activating the Always-On Display (AOD).

[0139] The application scenarios shown above do not limit the embodiments of this application. In addition to being applied in pocket scenarios, backpack scenarios, bag scenarios, and palm-covering scenarios, the anti-accidental touch mode is also applied in situations where other electronic devices are covered, such as books covering, faces covering (during calls), etc. Developers can set it according to specific circumstances, and this application does not impose any restrictions on it.

[0140] Currently, when electronic devices are placed in a user's pocket or backpack, accidental touches can easily occur if the screen comes into contact with the skin due to walking, running, or other physical activities. This can lead to accidental locking of the device or accidental activation of applications, negatively impacting the user experience. To address this issue, methods such as proximity sensors, large-area touch panel (TP) anti-accidental touch measures, posture detection, and ultrasonic sensors have been introduced. However, these methods have drawbacks. For example, proximity sensors emit infrared light, and the reflected infrared light is used to determine if an object is obstructing the view. This can lead to a "black hair" effect, where a large amount of infrared light is absorbed when the reflecting object is black, potentially causing missed detections. Furthermore, large-area TP anti-accidental touch methods require a short detection distance, which may not be sufficient for large-area skin contact when the device is in a pocket, potentially causing detection failure. Posture detection methods cannot cover scenarios where the device is facing upwards. Finally, ultrasonic sensors require continuous ultrasonic wave transmission and reception, increasing the device's power consumption.

[0141] In view of this, this application proposes a novel method for preventing accidental touches. This method obtains information on whether the device is obstructed from a proximity sensor. If the proximity sensor determines that the device is not obstructed, it then obtains information on whether the device is obstructed from an ultrasonic sensor. If the ultrasonic sensor determines that the device is obstructed, the method activates the accidental touch prevention function. Conversely, if the proximity sensor determines that the device is not obstructed, it then obtains information on whether the device is obstructed from an ambient light sensor. If the ambient light sensor determines that the device is obstructed, the method activates the accidental touch prevention function. By using the combined detection results from the ambient light sensor, the ultrasonic sensor, and / or the ambient light sensor, the method determines whether the accidental touch prevention function needs to be activated, thereby improving the accuracy of determining whether the device is obstructed and thus enhancing the user experience.

[0142] Figure 4 This is a schematic flowchart of a method 400 for preventing accidental touches provided in an embodiment of this application. The method 400 is applied to an electronic device, which includes a proximity sensor, an ultrasonic sensor, and an ambient light sensor. Figure 4 The method 400 shown may include the following steps.

[0143] S410. Obtain first information from the proximity sensor, the first information being used to indicate the result of the proximity sensor's determination of whether it is blocked.

[0144] The proximity sensor receives reflected signals to determine the presence of objects near the electronic device. For example, the closer the object is to the electronic device, the stronger the reflected signal and the shorter the delay, indicating that the electronic device is obstructed. Conversely, the farther the object is from the electronic device, the weaker the reflected signal and the longer the delay, indicating that the electronic device is not obstructed.

[0145] It should be noted that the reflected signal can be a proximity light signal or other reflected signals that can be used to determine the distance between the obstruction and the electronic device, such as an ultrasonic signal. This application embodiment does not limit this. Further, the proximity sensor determines whether the electronic device is obstructed based on the signal strength or time delay of the received reflected signal. Specifically, if the signal strength of the reflected signal received by the proximity sensor is greater than a first preset strength value, the determination result indicated by the first information is that the device is obstructed; or, if the signal strength of the reflected signal received by the proximity sensor is less than or equal to the first preset strength value, the determination result indicated by the first information is that the device is not obstructed; or, if the time delay of the reflected signal received by the proximity sensor is less than a first preset time delay value, the determination result indicated by the first information is that the device is obstructed; or, if the time delay of the reflected signal received by the proximity sensor is greater than or equal to the first preset time delay value, the determination result indicated by the first information is that the device is not obstructed.

[0146] For ease of description, the following description uses the example of a proximity sensor emitting infrared light to illustrate how the proximity sensor determines whether an electronic device is obstructed by receiving the reflected signal. It is understood that the proximity sensor in this embodiment may also be referred to as a proximity light sensor in some implementations.

[0147] In one implementation, a proximity sensor can emit infrared light through a light-emitting diode (LED) and detect the intensity of reflected light from nearby objects using a photodiode. The electronic device can acquire the signal strength of the reflected light signal detected by the proximity sensor in real time and determine whether the device is currently in an obstructed state based on the received signal strength. Alternatively, the electronic device can acquire the time delay of the reflected light signal detected by the proximity sensor in real time and determine whether the device is currently in an obstructed state based on the received time delay.

[0148] As an example, an electronic device can acquire the signal intensity of the reflected light signal detected by a proximity sensor in real time. The signal intensity of the reflected light signal can also be referred to as the light intensity of the reflected light. If the signal intensity of the reflected light signal received by the proximity sensor is greater than a first preset intensity value, the determination result indicated by the first information is that the light is blocked. The first preset intensity value can be predefined. Alternatively, if the signal intensity of the reflected light signal received by the proximity sensor is less than or equal to the first preset intensity value, the determination result indicated by the first information is that the light is not blocked. The statement "if the signal intensity of the reflected light signal received by the proximity sensor is less than or equal to the first preset intensity value" can be understood as follows: if the signal intensity of the reflected light signal received by the proximity sensor is less than the first preset intensity value, or if the signal intensity of the reflected light signal received by the proximity sensor is equal to the first preset intensity value, or if the signal intensity of the reflected light signal received by the proximity sensor is both less than and equal to the first preset intensity value, then the determination result indicated by the first information is that the light is blocked. This application does not limit this interpretation.

[0149] It should be noted that if the signal intensity of the reflected light signal received by the proximity sensor is greater than the first preset intensity value, it indicates that the proximity sensor has detected sufficient reflected light, and there is an object in the vicinity of the electronic device. In this case, it can be determined that the electronic device is currently blocked. If the signal intensity of the received reflected light signal is less than the first preset time delay value, it indicates that there is no object in the vicinity of the electronic device. In this case, it can be determined that the electronic device is currently not blocked.

[0150] It should also be noted that, in one possible implementation, if the signal strength of the reflected light signal received by the proximity sensor is greater than or equal to a first preset intensity value, then the determination result indicated by the first information is that the light is blocked. Alternatively, if the signal strength of the reflected light signal received by the proximity sensor is less than the first preset intensity value, then the determination result indicated by the first information is that the light is not blocked.

[0151] As another example, taking the real-time acquisition of the time delay of the reflected light signal detected by the proximity sensor by an electronic device as an example, if the time delay of the reflected light signal received by the proximity sensor is less than a first preset time delay value, then the determination result indicated by the first information is that the signal is blocked. Here, the first preset time delay value can be predefined. Alternatively, if the time delay of the reflected light signal received by the proximity sensor is greater than or equal to the first preset time delay value, then the determination result indicated by the first information is that the signal is not blocked. The statement that the determination result of the first information is that the signal is not blocked can be understood as follows: if the time delay of the reflected light signal received by the proximity sensor is greater than the first preset time delay value, or if the time delay of the reflected light signal received by the proximity sensor is equal to the first preset time delay value, or if the time delay of the reflected light signal received by the proximity sensor is greater than and equal to the first preset time delay value, then the determination result indicated by the first information is that the signal is not blocked. This application does not limit this interpretation.

[0152] It should be noted that if the delay of the reflected light signal received by the proximity sensor is less than the first preset delay value, it means that the proximity sensor has not detected sufficient reflected light, and there is no object in the vicinity of the electronic device. In this case, it can be determined that the electronic device is not currently obstructed. If the delay of the received reflected light signal is greater than or equal to the first preset delay value, it means that there is no object in the vicinity of the electronic device. In this case, it can be determined that the electronic device is not currently obstructed.

[0153] It should also be noted that, in one possible implementation, if the time delay of the reflected light signal received by the proximity sensor is less than or equal to a first preset time delay value, then the determination result indicated by the first information is that the light is blocked. Alternatively, if the time delay of the reflected light signal received by the proximity sensor is greater than the first preset time delay value, then the determination result indicated by the first information is that the light is not blocked.

[0154] Optionally, the electronic device further includes an attitude sensor for detecting the motion trajectory of the electronic device. The method 400 further includes: obtaining fourth information from the attitude sensor, the fourth information being used to indicate the result of the attitude sensor determining whether the electronic device is on a first motion trajectory; if the determination result indicated by the fourth information is that the electronic device is on the first motion trajectory, then obtaining the first information from the proximity sensor.

[0155] It should be noted that the aforementioned attitude sensor includes an accelerometer and / or a gyroscope. In this application, it could also be a sensor capable of detecting the motion trajectory of an electronic device in the future; however, this embodiment does not limit the application to this type of sensor.

[0156] It is understood that when the attitude sensor includes an accelerometer, the motion trajectory of the electronic device is detected by the accelerometer; when the attitude sensor includes a gyroscope, the motion trajectory of the electronic device is detected by the gyroscope; when the attitude sensor includes both an accelerometer and a gyroscope, the motion trajectory of the electronic device is detected by the combined use of the accelerometer and the gyroscope. This application does not limit the scope of the application.

[0157] For ease of description, the following description uses attitude sensors, including accelerometers and / or gyroscopes, as an example.

[0158] As an example, when the attitude sensor includes an accelerometer, the accelerometer detects the magnitude of the electronic device's acceleration in various directions (typically three axes) to determine the electronic device's motion trajectory.

[0159] As another example, when the attitude sensor includes a gyroscope sensor, the gyroscope sensor detects the magnitude of the electronic device's angular velocity in various directions (typically three axes) and thus determines the electronic device's trajectory.

[0160] As another example, electronic devices obtain acceleration and angular velocity through accelerometers and gyroscopes to determine their trajectory.

[0161] For example, in the actual detection process, the motion trajectory of the electronic device can be determined by the acceleration detected by the accelerometer and the angular velocity detected by the gyroscope. Specifically, after the acceleration detected by the accelerometer and the angular velocity detected by the gyroscope, a motion trajectory determination algorithm is used to simulate the actual motion trajectory of the electronic device. If the electronic device is on the first motion trajectory, it is considered that the electronic device is currently being placed in a pocket or backpack by the user. The motion trajectory determination algorithm can be any current algorithm capable of determining the motion trajectory of an electronic device, or it can be an algorithm capable of determining the motion trajectory of an electronic device in the future; this application embodiment does not limit this.

[0162] The first motion trajectory can be understood as a motion mode of the electronic device. For example, the electronic device moves and then stops. At this time, the accelerometer detects that the acceleration of the electronic device changes from a first acceleration value to a second acceleration value, and / or the gyroscope sensor detects that the angular velocity of the electronic device changes from a first angular velocity value to a second angular velocity value. The second acceleration value can be infinitely close to 0 or equal to 0, and the second angular velocity value can also be infinitely close to 0 or equal to 0. In other words, the accelerometer detects a change in the acceleration of the electronic device, and the change in acceleration is greater than or equal to a first preset acceleration value, and / or the gyroscope sensor detects a change in the angular velocity of the electronic device, and the change in angular velocity is greater than or equal to a first preset angular velocity value. As another example, the electronic device moves continuously. During this continuous movement, the electronic device may tilt. At this time, the gyroscope sensor detects a change in the angular velocity of the electronic device. When the change in angular velocity is greater than or equal to a second preset angular velocity value, the electronic device is considered to be on the first motion trajectory. The duration for which the gyroscope sensor detects the angular velocity of the electronic device is not limited and can be less than a certain preset threshold.

[0163] In one possible implementation, the first motion trajectory is an electronic device moving from top to bottom for a period of time, followed by a period of stillness. For example, after a user finishes a phone call, the electronic device is held in the user's hand. The user then wants to put the electronic device in their pocket. During this process, the electronic device moves from top to bottom and then comes to a standstill. At this time, the accelerometer will detect a change in the acceleration of the electronic device, and / or the gyroscope will detect a change in the angular velocity of the electronic device. More specifically, the accelerometer detects that the acceleration of the electronic device changes from a first angular velocity value to a second acceleration value, and the time taken for this change is a first duration, for example, 2 seconds (s). Furthermore, the accelerometer detects that the acceleration of the electronic device remains at the second acceleration value for a second duration, for example, 1 second. At this point, it is determined that the electronic device is on the first motion trajectory. Further, if the determination result indicated by the fourth information is that the electronic device is on the first motion trajectory, then the first information is obtained from the proximity sensor. In other words, when the proximity sensor is detected to be in the first motion trajectory by the accelerometer and / or gyroscope sensor, the proximity sensor is triggered to turn on in order to obtain the first information from the proximity sensor.

[0164] In the embodiments of this application, when the electronic device is on the first motion trajectory, the electronic device may be in an inverted posture (i.e., head down) or in a non-inverted posture (i.e., head up) on the first motion trajectory. The electronic device may also be in a flat posture on the first motion trajectory. The embodiments of this application do not limit this.

[0165] For example, the electronic device being on a first motion trajectory can also be understood as the electronic device being on a first motion trajectory that satisfies the condition that the electronic device is in a landing state. The landing state includes landing in a non-inverted state (head up) and landing in an inverted state (head down). Specifically, the electronic device can calculate the tilt angle and / or angular velocity based on the accelerometer and / or gyroscope sensor, and determine whether the electronic device is currently landing head down or head up based on the tilt angle and / or angular velocity.

[0166] It should be noted that when a user places an electronic device in a pocket, backpack, or bag, the device will be in a landing posture, which can be detected by the accelerometer and / or gyroscope sensor. However, in some possible scenarios, such as after a phone call or while holding the device and swinging it up and down, the device will also be in a landing posture.

[0167] It should also be noted that when the electronic device is in the first trajectory, it can be considered that the electronic device is in a falling posture, that is, the electronic device is in the action of falling into a pocket, or the electronic device is in the action of falling into a backpack.

[0168] Furthermore, based on the judgment result indicated by the first information, the subsequent execution steps include either Case 1 or Case 2, as detailed below.

[0169] Case 1: The determination result of the first information indication is that it is not obscured, including steps S420a and S430a.

[0170] S420a. If the determination result indicated by the first information is that the device is not blocked, then the second information is obtained from the ultrasonic sensor. The second information is used to indicate the result of the ultrasonic sensor's determination of whether the device is blocked.

[0171] It should be noted that when the proximity sensor emits infrared light signals, due to the "black hair" effect, the proximity sensor is prone to missing detection when encountering black obstructions. Therefore, to avoid missed detections, the ultrasonic sensor is activated for ultrasonic detection when the first information indication indicates that there is no obstruction. That is, if the first information indication indicates that there is no obstruction, the second information is obtained from the ultrasonic sensor.

[0172] In this system, the ultrasonic sensor emits ultrasonic signals and receives reflected ultrasonic signals, or receives direct ultrasonic signals. In some implementations, the electronic device does not have an ultrasonic sensor installed; in this case, the earpiece, speaker, or microphone in the electronic device can be used for ultrasonic measurement. That is, the earpiece and speaker can be used as ultrasonic transmitters, and the microphone can be used as ultrasonic receivers.

[0173] For example, after the ultrasonic sensor is turned on, the electronic device can obtain the result of the ultrasonic sensor's determination of whether it is blocked in real time.

[0174] In a first possible implementation, the electronic device is equipped with an ultrasonic sensor located at the top or bottom of the electronic device. The ultrasonic sensor includes an ultrasonic transmitter and an ultrasonic receiver. The ultrasonic transmitter is used to emit ultrasonic signals, and the ultrasonic receiver is used to receive ultrasonic signals reflected or directly returned.

[0175] As an example, if the ultrasonic sensor detects that the signal strength of a direct or reflected ultrasonic signal is greater than a second preset intensity value, the determination result of the second information indication is that the signal is blocked; wherein, the first preset time delay value can be predefined. Alternatively, if the ultrasonic sensor detects that the signal strength of a direct or reflected ultrasonic signal is less than or equal to the second preset intensity value, the determination result of the second information indication is that the signal is not blocked. The determination result of the second information indication being "not blocked" can be understood as follows: if the ultrasonic sensor detects that the signal strength of a direct or reflected ultrasonic signal is less than the second preset intensity value, or if the ultrasonic sensor detects that the signal strength of a direct or reflected ultrasonic signal is equal to the second preset intensity value, or if the ultrasonic sensor detects that the signal strength of a direct or reflected ultrasonic signal is both less than and equal to the second preset intensity value, then the determination result of the second information indication is "not blocked," and this application does not limit this.

[0176] It should be noted that after the ultrasonic sensor is activated, the electronic device can emit ultrasonic signals. When there is an obstruction near the electronic device, the obstruction can reflect the ultrasonic signal. The electronic device can then receive the direct or reflected ultrasonic signal through the ultrasonic sensor. The farther the obstruction is from the ultrasonic wave (i.e., the electronic device), the weaker the intensity of the direct or reflected ultrasonic signal received by the electronic device; conversely, the closer the obstruction is to the ultrasonic wave (i.e., the electronic device), the stronger the intensity of the direct or reflected ultrasonic signal received by the electronic device. In other words, if the ultrasonic sensor detects a direct or reflected ultrasonic signal with a signal strength greater than a second preset strength value, it indicates that the external object is close to the electronic device, and the electronic device is currently obstructed. If the detected signal strength is less than or equal to the second preset strength value, it indicates that the external object is far from the electronic device, and the electronic device is currently not obstructed.

[0177] It should also be noted that, in one possible implementation, if the ultrasonic sensor detects that the signal strength of the direct ultrasonic signal or the reflected ultrasonic signal is greater than or equal to the second preset intensity value, the determination result indicated by the second information is that the signal is blocked; or if the ultrasonic sensor detects that the signal strength of the direct ultrasonic signal or the reflected ultrasonic signal is less than the second preset intensity value, the determination result indicated by the second information is that the signal is not blocked.

[0178] As another example, if the time delay of the direct or reflected ultrasonic signal detected by the ultrasonic sensor is less than a second preset time delay value, the determination result of the second information indication is that the signal is blocked; wherein, the first preset time delay value can be predefined. Alternatively, if the time delay of the direct or reflected ultrasonic signal detected by the ultrasonic sensor is greater than or equal to the second preset time delay value, the determination result of the second information indication is that the signal is not blocked. The determination result of the second information indication being "not blocked" can be understood as follows: if the time delay of the direct or reflected ultrasonic signal detected by the ultrasonic sensor is greater than the second preset time delay value, or if the time delay of the direct or reflected ultrasonic signal detected by the ultrasonic sensor is equal to the second preset time delay value, or if the time delay of the direct or reflected ultrasonic signal detected by the ultrasonic sensor is greater than and equal to the second preset time delay value, then the determination result of the second information indication is "not blocked," and this application does not limit this.

[0179] It should be noted that if the time delay of the direct or reflected ultrasonic signal detected by the ultrasonic sensor is less than the second preset time delay value, it indicates that the external object is relatively close to the electronic device, and in this case, it can be determined that the electronic device is currently blocked. If the time delay of the direct or reflected ultrasonic signal detected is greater than or equal to the second preset time delay value, it indicates that the external object is relatively far from the electronic device, and in this case, it can be determined that the electronic device is currently not blocked.

[0180] It should also be noted that, in one possible implementation, if the time delay of the ultrasonic sensor detecting the direct ultrasonic signal or the reflected ultrasonic signal is less than or equal to the second preset time delay value, the determination result indicated by the second information is that the signal is blocked; or if the time delay of the ultrasonic sensor detecting the direct ultrasonic signal or the reflected ultrasonic signal is less than the second preset time delay value, the determination result indicated by the second information is that the signal is not blocked.

[0181] In a second possible implementation, the electronic device includes a top ultrasonic sensor and a bottom ultrasonic sensor; alternatively, the electronic device may not have an ultrasonic sensor installed, in which case the earpiece, speaker, or microphone on the top of the electronic device acts as the top ultrasonic sensor, and the earpiece, speaker, or microphone on the bottom of the electronic device acts as the bottom ultrasonic sensor. The top ultrasonic sensor includes a top ultrasonic transmitter and a top ultrasonic receiver, the top ultrasonic transmitter for emitting ultrasonic signals, and the top ultrasonic receiver for receiving direct or reflected ultrasonic signals; the bottom ultrasonic sensor includes a bottom ultrasonic transmitter and a bottom ultrasonic receiver, the bottom ultrasonic transmitter for emitting ultrasonic signals, and the bottom ultrasonic receiver for receiving direct or reflected ultrasonic signals.

[0182] As an example, if the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset intensity value, the second information indicates that the signal is blocked; wherein the third preset intensity value is predefined. Alternatively, if the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to the third preset intensity value, the second information indicates that the signal is not blocked. Wherein, if the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to a third preset intensity value, then the determination result of the second information indication is that it is not obstructed. This can be understood as follows: if the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than the third preset intensity value, or if the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is equal to the third preset intensity value, or if the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than and equal to the third preset intensity value, then the determination result of the second information indication is that it is not obstructed. This application does not limit this.

[0183] It should be noted that after the ultrasonic sensors are activated, the electronic device can emit ultrasonic signals through the top and bottom ultrasonic transmitters. When there is an obstruction near the electronic device, the obstruction can reflect the ultrasonic signal. The electronic device can then receive the directly transmitted or reflected ultrasonic signal through the top and bottom ultrasonic receivers. The farther the obstruction is from the ultrasonic wave (i.e., the electronic device), the weaker the intensity of the directly transmitted or reflected ultrasonic signal received by the electronic device through the top and bottom ultrasonic receivers; conversely, the closer the obstruction is to the ultrasonic wave (i.e., the electronic device), the stronger the directly transmitted or reflected ultrasonic signal received by the electronic device through the top and bottom ultrasonic receivers. In other words, if the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset intensity value, it indicates that the external object is close to the electronic device, and the electronic device is currently obstructed. If the ratio between the signal strength of the ultrasonic signal detected by the top and bottom ultrasonic sensors is less than or equal to the third preset intensity value, it indicates that the external object is far from the electronic device, and the electronic device is currently not obstructed.

[0184] It should also be noted that, in one possible implementation, if the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to a third preset intensity value, then the determination result indicated by the second information is that the signal is blocked; or if the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is less than a third preset intensity value, then the determination result indicated by the second information is that the signal is not blocked.

[0185] For example, the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor can be either the signal strength of the ultrasonic signal detected by the top ultrasonic sensor divided by the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor, or vice versa. For instance, when an electronic device falls headfirst into a pocket, the ratio of the signal strength of the ultrasonic signal detected by the top ultrasonic sensor to the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is A / B. Specifically, assuming the signal strength of the ultrasonic signal detected by the top ultrasonic sensor is A and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is B, the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is A / B. For example, when an electronic device falls into a pocket headfirst, the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is equal to the signal strength of the ultrasonic signal detected by the top ultrasonic sensor. Specifically, assuming the signal strength of the ultrasonic signal detected by the top ultrasonic sensor is A and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is B, the ratio between the signal strength of the ultrasonic signal detected by the top ultrasonic sensor and the signal strength of the ultrasonic signal detected by the bottom ultrasonic sensor is B / A.

[0186] As another example, if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than a third preset time delay value, then the second information indicates that the signal is blocked; wherein the third preset time delay value is predefined. Alternatively, if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to the third preset time delay value, then the second information indicates that the signal is not blocked. Wherein, if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to a third preset time delay value, then the determination result of the second information indication is that it is not blocked. This can be understood as follows: if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset intensity value, or if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is equal to the third preset time delay value, or if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than and equal to the third preset time delay value, then the determination result of the second information indication is that it is not blocked. This application does not limit this.

[0187] It should be noted that if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than the third preset time delay value, it indicates that the external object is relatively close to the electronic device, and in this case, it can be determined that the electronic device is currently blocked. If the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to the third preset time delay value, it indicates that the external object is relatively far from the electronic device, and in this case, it can be determined that the electronic device is currently not blocked.

[0188] It should also be noted that, in one possible implementation, if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to a third preset time delay value, then the determination result indicated by the second information is that the signal is blocked; or if the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than the third preset time delay value, then the determination result indicated by the second information is that the signal is not blocked.

[0189] For example, the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor can be the time delay of the ultrasonic signal detected by the top ultrasonic sensor minus the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor, or it can be the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor minus the time delay of the ultrasonic signal detected by the top ultrasonic sensor. For example, when an electronic device falls headfirst into a pocket, the time delay of the ultrasonic signal detected by the top ultrasonic sensor minus the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor. Specifically, assuming the time delay of the ultrasonic signal detected by the top ultrasonic sensor is C and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is D, then the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is CD. For example, when an electronic device falls into a pocket headfirst, the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than the time delay of the ultrasonic signal detected by the top ultrasonic sensor. Specifically, assuming the time delay of the ultrasonic signal detected by the top ultrasonic sensor is C and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is D, the difference between the time delay of the ultrasonic signal detected by the top ultrasonic sensor and the time delay of the ultrasonic signal detected by the bottom ultrasonic sensor is DC.

[0190] In this embodiment, the ultrasonic signal detected by the top ultrasonic sensor can be understood as either a reflected or a direct ultrasonic signal detected by the top ultrasonic sensor, that is, a reflected or a direct ultrasonic signal received by the top ultrasonic receiver. Similarly, the ultrasonic signal detected by the bottom ultrasonic sensor can be understood as either a reflected or a direct ultrasonic signal detected by the bottom ultrasonic sensor, that is, a reflected or a direct ultrasonic signal received by the bottom ultrasonic receiver.

[0191] S430a. If the determination result of the second information indication is that the device is blocked, then control the electronic device to enable the anti-accidental touch function.

[0192] If the second information indication indicates that the device is blocked, then the electronic device is considered to be in a blocked state. In other words, the electronic device is considered to meet the characteristics of being in a pocket scenario and / or a backpack scenario. That is, the electronic device is in a scenario such as a leather bag blocking scenario, a canvas bag blocking scenario, a cotton shirt pocket blocking scenario, or a jeans pocket blocking scenario. At this time, the anti-accidental touch function of the electronic device is activated.

[0193] Furthermore, when the electronic device is detected to be in an obstructed scene by the ultrasonic sensor, in order to further improve the accuracy of the detection, the electronic device also includes a biometric identifier, and the method 400 further includes: obtaining fifth information from the biometric identifier, the fifth information being used to instruct the biometric identifier to determine whether a face has appeared; if the determination result indicated by the fifth information is that no face has appeared, then controlling the electronic device to activate the anti-accidental touch function.

[0194] Among them, the biometric identifier is used for face recognition. The biometric identifier can also be called a face recognition device, a camera in an electronic device, an image recognition device, or an iris recognition device. The embodiments of this application do not limit the name of the biometric identifier. Any identifier with face recognition function is within the protection scope of this application.

[0195] For example, the Swing function in an electronic device can be used to detect whether a face appears in the Swing context. If no face appears, it means the electronic device is being obscured, and the device's anti-mistouch function is activated. Alternatively, if no face appears, the electronic device is assumed to be in a pocket or backpack scenario.

[0196] It's important to note that the presence of a face in Swing indicates that the user is currently using the electronic device, such as answering a call, replying to a message, or browsing the web. When a face is present in Swing, it's assumed the electronic device is not in a pocket or bag; that is, the device is not currently placed in a pocket or bag, but it is obscured, for example, by a book.

[0197] As an example, if the second information indicates that the electronic device is not obstructed, it can be considered that the electronic device is in an unobstructed state at this time, which means that the electronic device is not placed in a pocket or backpack.

[0198] Case 2: The determination result of the first information indication is that it is blocked, including steps S420b and S430b.

[0199] S420b If the determination result indicated by the first information is that the light is blocked, then the third information is obtained from the ambient light sensor. The third information is used to indicate whether the ambient light sensor determines whether the ambient light brightness is less than the first brightness value.

[0200] The first brightness value can be predefined. For example, if the first brightness value is 10 lux (lx), and the ambient light sensor detects an ambient light brightness of 9 lx, the ambient light brightness is less than the first brightness value, then the third information indication will determine that the ambient light brightness is less than the first brightness value. As another example, if the ambient light sensor detects an ambient light brightness of 12 lx, the ambient light brightness is greater than the first brightness value, then the third information indication will determine that the ambient light brightness is greater than the first brightness value.

[0201] As an example, if the determination result of the third information indication is that the ambient light brightness is greater than the first brightness value, or if the determination result of the third information indication is that the ambient light brightness is greater than or equal to the first brightness value, then the electronic device is considered to be in an unobstructed state.

[0202] As another example, if the determination result of the third information indication is that the ambient light brightness is less than the first brightness value, then the electronic device is controlled to activate the anti-accidental touch function, specifically as follows: step S430b.

[0203] S430b: If the determination result of the third information indication is that the ambient light brightness is less than the first brightness value, then control the electronic device to enable the anti-accidental touch function.

[0204] If the third information indicates that the ambient light is less than the first brightness value, then the electronic device is considered to be in a blocked state. In other words, the electronic device is considered to meet the characteristics of being in a pocket scene and / or backpack scene. That is, the electronic device is in a leather bag blocking scene, canvas bag blocking scene, cotton shirt pocket blocking scene, jeans pocket blocking scene, etc. At this time, the control electronic device is activated to enable the anti-accidental touch function.

[0205] It should be noted that, in one possible implementation, if the determination result of the third information indication is that the ambient light brightness is equal to the first brightness value, the electronic device can also be considered to be in a blocked state; or, if the determination result of the third information indication is that the ambient light brightness is less than or equal to the first brightness value, the electronic device can also be considered to be in a blocked state. However, if the determination result of the third information indication is that the ambient light brightness is greater than the first brightness value, the electronic device is considered to be in an unblocked state.

[0206] In another possible implementation, if the third information indicates that the ambient light brightness is greater than or equal to the first brightness value, then the second information is obtained from the ultrasonic sensor, and based on the determination result indicated by the second information, it is determined whether the electronic device is obstructed. For example, if the determination result specified by the second information is that it is not obstructed, then the electronic device will not be controlled to activate the anti-accidental touch function. As another example, if the determination result specified by the second information is that it is obstructed, then the fifth information is obtained from the biometric identifier.

[0207] Furthermore, when the electronic device is detected to be in an occluded scene by the ambient light sensor, in order to further improve the accuracy of the detection, the electronic device also includes a biometric identifier, and the method 400 further includes: obtaining fifth information from the biometric identifier, the fifth information being used to instruct the biometric identifier to determine whether a face has appeared; if the determination result indicated by the fifth information is that no face has appeared, then controlling the electronic device to activate the anti-accidental touch function.

[0208] For a detailed description of the biometric identifier and the fifth piece of information used to instruct the biometric identifier on whether a face has appeared, please refer to step S430a above, and it will not be repeated here.

[0209] Optionally, when the proximity sensor detects a reflected signal strength less than a fourth preset strength value, and / or the proximity sensor detects a reflected signal delay greater than or equal to a fourth preset delay value, the ambient light sensor detects an ambient light brightness higher than a first brightness value, and / or the accelerometer detects a pitch angle change greater than a first angle value, and / or the ultrasonic sensor receives a direct or reflected ultrasonic signal with a signal strength less than a fifth preset strength value, and / or the ultrasonic sensor receives a direct or reflected ultrasonic signal with a delay less than a fifth preset delay value, and / or the ratio between the ultrasonic signal strength detected by the top ultrasonic sensor and the ultrasonic signal strength detected by the bottom ultrasonic sensor is less than a sixth preset strength value, and / or the difference between the ultrasonic signal delay detected by the top ultrasonic sensor and the ultrasonic signal delay detected by the bottom ultrasonic sensor is greater than a sixth preset delay value, and / or the biometrics reader detects a human face, the electronic device deactivates the anti-mistouch function.

[0210] Optionally, when the electronic device obtains the first information from the proximity sensor, it controls the proximity sensor to turn off; or when the electronic device obtains the second information from the ultrasonic sensor, it controls the ultrasonic sensor to turn off; or when the electronic device obtains the third information from the ambient light sensor, it controls the ambient light sensor to turn off; or when the electronic device obtains the fourth information from the attitude sensor, it controls the attitude sensor to turn off; or when the electronic device obtains the fifth information from the biometric identifier, it controls the biometric identifier to turn off.

[0211] For example, the electronic device may use a third time to acquire first information from a proximity sensor, after which the proximity sensor is turned off. Alternatively, the electronic device may use a fourth time to acquire second information from an ultrasonic sensor, after which the ultrasonic sensor is turned off. Or, the electronic device may use a fifth time to acquire third information from an ambient light sensor, after which the ambient light sensor is turned off. Or, the electronic device may use a sixth time to acquire fourth information from an attitude sensor, after which the attitude sensor is turned off. Or, the electronic device may use a seventh time to acquire fifth information from a biometric identifier, after which the biometric identifier is turned off. In this way, the proximity sensor, ultrasonic sensor, ambient light sensor, attitude sensor, and biometric identifier will be turned off after operating for a period of time, reducing the power consumption of the electronic device.

[0212] It should be noted that, in this application, the proximity sensor can be turned off, the ultrasonic sensor can be turned off, the posture sensor can be turned off, the ambient light sensor can be turned off, and the biometric identifier can be turned off when the proximity sensor, ultrasonic sensor, posture sensor, ambient light sensor, and biometric identifier respectively detect the intensity or delay of the reflected signal, the intensity or delay of the ultrasonic signal, the motion trajectory of the electronic device, the ambient light brightness, and whether a human face appears.

[0213] Optionally, in this embodiment, after obtaining the fourth information from the attitude sensor, if the determination result indicated by the fourth information is that the electronic device is on the first motion trajectory, it can also be determined whether the electronic device is obstructed by large-area contact of the TP. If it is determined that the electronic device is obstructed, the fifth information can be further obtained from the biometric recognition device. If the determination result indicated by the fifth information is that no face appears, the electronic device is controlled to activate the anti-accidental touch function. If the determination result indicated by the fifth information is that a face appears, it is considered that the electronic device has not been placed in a pocket or backpack.

[0214] As an example, after determining that the electronic device is blocked through the above steps, before controlling the electronic device to enable the anti-mistouch function, it can be further determined whether the electronic device is currently in a locked screen scene, a screen-off scene, or an entertainment scene.

[0215] It's understandable that the accidental touch prevention function of electronic devices might be interrupted when receiving incoming calls (including phone calls or voice / video requests from instant messaging software) or notification messages. In entertainment scenarios such as playing videos or running games, electronic devices can be set to not activate the accidental touch prevention function. Therefore, even if the electronic device is detected to be obstructed—for example, when a user is playing a game in landscape mode and their hand covers the top of the device—the automatic screen-off function will not be activated. Alternatively, users can manually enable or disable the accidental touch prevention function, or configure one or more applications to enable or disable it.

[0216] It should be noted that this application does not impose any restrictions on the number or type of sensors used in electronic devices or the coupling logic between the sensors, as long as the purpose of preventing accidental touches as described in this application can be achieved.

[0217] In this embodiment, the fourth information obtained from the attitude sensor determines whether the electronic device is on a first motion trajectory. When the electronic device is on the first motion trajectory, a proximity sensor is activated to determine if the electronic device is obstructed. If the electronic device is obstructed, a third information is obtained from the ambient light sensor to determine if it is obstructed. When the electronic device is not obstructed, a second information is obtained from the ultrasonic sensor to determine if it is obstructed. If, based on the second or third information, it is determined that the electronic device is obstructed, the anti-mistouch function is activated. By combining the results from the proximity sensor and the ambient light or ultrasonic sensor, the detection result of whether the electronic device is obstructed is finally obtained, thus improving detection accuracy. Furthermore, activating the anti-mistouch function when the electronic device is obstructed enhances the user experience.

[0218] Figure 5 This is a schematic flowchart of another method 500 for preventing accidental touches provided in this application embodiment. Method 500 is applied to an electronic device, which includes an attitude sensor, a proximity sensor, an ambient light sensor, an ultrasonic sensor, and a biometric identifier. Figure 5 The method 500 shown may include the following steps.

[0219] S510. Obtain fourth information from the attitude sensor. The fourth information is used to indicate the result of the attitude sensor's determination that the electronic device is in the first motion trajectory.

[0220] For example, if the determination result indicated by the fourth information is that the electronic device is in the first motion trajectory, then step S520 is executed.

[0221] For a detailed description of the attitude sensor and the first motion trajectory, please refer to step S410 above, which will not be repeated here.

[0222] S520. Obtain first information from the proximity sensor, the first information being used to indicate the result of the proximity sensor's determination of whether the object is blocked.

[0223] Based on the judgment result indicated by the first information, the subsequent execution steps can be divided into two cases: Case 1 and Case 2.

[0224] Scenario 1: The initial information indication is determined to be obscured. This includes two implementation methods: Method 1 and Method 2. Details are as follows.

[0225] If the determination result indicated by the first information is that the object is blocked, depending on whether the third information is obtained from the ambient light sensor, the subsequent steps can be the steps in Method 1 (e.g., steps S530a to S550a; or steps S530a, S530c, S540a and S550a; or steps S530a, S530c and S540c) or the steps in Method 2 (e.g., steps S530b to S540b; or steps S530b to S540c), as detailed below.

[0226] Method 1: If the first information indicates that the light is blocked, the third information is obtained from the ambient light sensor.

[0227] S530a: Obtain third information from the ambient light sensor. The third information is used to indicate the result of the ambient light sensor determining whether the ambient light brightness is less than the first brightness value.

[0228] For a detailed description of step S530a, please refer to step S420b above, which will not be repeated here.

[0229] In one implementation, if the determination result indicated by the third information is that the ambient light brightness is less than the first brightness value, then the subsequent steps are S540a and S550a.

[0230] S540a. Obtain fifth information from the biometric identifier. The fifth information is used to instruct the biometric identifier to determine whether a face has appeared.

[0231] If the determination result of the fifth information indication is that no face appears, it is considered that the electronic device is blocked, and step S550a is executed.

[0232] S550a, controls the activation of the anti-accidental touch function for electronic devices.

[0233] For a detailed description of steps S540a and S550a, please refer to steps S430a or S430b above, which will not be repeated here.

[0234] In another implementation, if the determination result of the third information indication is that the ambient light brightness is greater than or equal to the first brightness value, that is, if the determination result of the third information indication is that the ambient light brightness is not less than the first brightness value, the subsequent steps can be steps S530c, S540a, and S550a, or steps S530c and S540c. The details are as follows.

[0235] S530c: Obtain second information from the ultrasonic sensor, the second information being used to indicate the result of the ultrasonic sensor's determination of whether it is blocked.

[0236] For a detailed description of step S530c, please refer to step S420a above, which will not be repeated here.

[0237] In the first example, if the determination result indicated by the second information is that the image is occluded, then the fifth information is obtained from the biometric identifier, that is, step S540a is executed.

[0238] S540a. Obtain fifth information from the biometric identifier. The fifth information is used to instruct the biometric identifier to determine whether a face has appeared.

[0239] For a detailed description of step S540a, please refer to step S430a above, and it will not be repeated here.

[0240] In one implementation, if the determination result of the fifth information indication is that no face appears, the electronic device is considered to be obstructed, and step S550a is executed.

[0241] S550a, controls the activation of the anti-accidental touch function for electronic devices.

[0242] For a detailed description of step S550a, please refer to step S430a above, which will not be repeated here.

[0243] In another implementation, if the determination result of the fifth information indication is that a face appears, it is considered that the electronic device is not obstructed, and the anti-accidental touch function will not be activated, and step S540c will be executed.

[0244] S540c, electronic devices are not obstructed.

[0245] In the second example, if the determination result indicated by the second information is that the device is not obstructed, it is assumed that the electronic device is not placed in a pocket or backpack, and step S540c is executed.

[0246] S540c, electronic devices are not obstructed.

[0247] Method 2: If the first information indicator indicates that the image is occluded, the fifth information is obtained from the biometric identifier. That is, steps S530b and S540b are executed, or steps S530b and S540c are executed.

[0248] S530b: Obtain fifth information from the biometric identifier, the fifth information being used to instruct the biometric identifier to determine whether a face has appeared.

[0249] For a detailed description of step S540a, please refer to step S430a above, and it will not be repeated here.

[0250] In one implementation, if the determination result of the fifth information indication is that no face appears, the electronic device is considered to be obstructed, and step S550a is executed.

[0251] S540b controls the activation of the anti-accidental touch function in electronic devices.

[0252] For a detailed description of step S540b, please refer to step S430a above, which will not be repeated here.

[0253] In another implementation, if the determination result of the fifth information indication is that a face appears, it is considered that the electronic device is not obstructed, and the anti-accidental touch function will not be activated, and step S540c will be executed.

[0254] S540c, electronic devices are not obstructed.

[0255] Scenario 2: If the first information indicates that the signal is unobstructed, then the second information is obtained from the ultrasonic sensor. This includes the following steps.

[0256] S530c: Obtain second information from the ultrasonic sensor, the second information being used to indicate the result of the ultrasonic sensor's determination of whether it is blocked.

[0257] For a detailed description of step S530c, please refer to step S420a above, which will not be repeated here.

[0258] In the first example, if the determination result indicated by the second information is that the image is occluded, then the fifth information is obtained from the biometric identifier, that is, step S540a is executed.

[0259] S540a. Obtain fifth information from the biometric identifier. The fifth information is used to instruct the biometric identifier to determine whether a face has appeared.

[0260] For a detailed description of step S540a, please refer to step S430a above, and it will not be repeated here.

[0261] In one implementation, if the determination result of the fifth information indication is that no face appears, the electronic device is considered to be obstructed, and step S550a is executed.

[0262] S550a, controls the activation of the anti-accidental touch function for electronic devices.

[0263] For a detailed description of step S550a, please refer to step S430a above, which will not be repeated here.

[0264] In another implementation, if the determination result of the fifth information indication is that a face appears, it is considered that the electronic device is not obstructed, and the anti-accidental touch function will not be activated, and step S540c will be executed.

[0265] S540c, electronic devices are not obstructed.

[0266] In the second example, if the determination result indicated by the second information is that the device is not obstructed, it is assumed that the electronic device is not placed in a pocket or backpack, and step S540c is executed.

[0267] S540c, electronic devices are not obstructed.

[0268] In this embodiment, the fourth information obtained from the attitude sensor determines whether the electronic device is on a first motion trajectory. When the electronic device is on the first motion trajectory, a proximity sensor is activated to determine if the electronic device is obstructed. If the electronic device is obstructed, a third information is obtained from the ambient light sensor to determine if it is obstructed. When the electronic device is not obstructed, a second information is obtained from the ultrasonic sensor to determine if it is obstructed. If, based on the second or third information, it is determined that the electronic device is obstructed, the anti-mistouch function is activated. By combining the results from the proximity sensor and the ambient light or ultrasonic sensor, the detection result of whether the electronic device is obstructed is finally obtained, thus improving detection accuracy. Furthermore, activating the anti-mistouch function when the electronic device is obstructed enhances the user experience.

[0269] The above, combined with Figures 4 to 5 The methods provided in the embodiments of this application are described in detail below. Figures 6 to 7 This application provides a detailed description of the electronic device provided in its embodiments. It should be understood that the descriptions of the electronic device embodiments correspond to the descriptions of the method embodiments; therefore, any content not described in detail here can be found in the above method embodiments, and for the sake of brevity, will not be repeated here.

[0270] Figure 6 This is a schematic diagram of an electronic device 1000 provided in an embodiment of this application. For example... Figure 6As shown, the electronic device 1000 includes an acquisition module 1010 and a control module 1020.

[0271] The acquisition module 1010 is used to acquire first information from the proximity sensor, which is used to indicate the result of the proximity sensor's determination of whether it is blocked.

[0272] In one implementation, if the determination result indicated by the first information is that the device is not blocked, the acquisition module 1010 is further configured to acquire second information from the ultrasonic sensor, the second information being used to indicate the result of the ultrasonic sensor's determination of whether the device is blocked.

[0273] If the second information indicates that the device is blocked, the control module 1020 is used to control the electronic device to enable the anti-accidental touch function.

[0274] In another implementation, if the determination result indicated by the first information is that the light is blocked, the acquisition module 1010 is further configured to acquire third information from the ambient light sensor, which is used to indicate the result of the ambient light sensor determining whether the ambient light brightness is less than the first brightness value.

[0275] If the third information indicates that the ambient light brightness is less than the first brightness value, the control module 1020 is used to control the electronic device to activate the anti-accidental touch function.

[0276] Optionally, the acquisition module 1010 is further configured to acquire fourth information from the attitude sensor, the fourth information being used to indicate the result of the attitude sensor determining whether the electronic device is on the first motion trajectory.

[0277] Optionally, the acquisition module 1010 is further configured to acquire fifth information from the biometric identifier, the fifth information being used to instruct the biometric identifier to determine whether a face has appeared.

[0278] If the fifth information indication indicates that no face appears, the control module 1020 is also used to control the electronic device to enable the anti-accidental touch function.

[0279] It should be understood that the electronic device 1200 here is embodied in the form of a functional module. The term "module" here can refer to application-specific integrated circuits (ASICs), electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors, etc.) and memories for executing one or more software or firmware programs, integrated logic circuits, and / or other suitable components supporting the described functions. In an alternative example, those skilled in the art will understand that the electronic device 1000 may be specifically the electronic device in the above embodiments, or the functions of the electronic device in the above embodiments may be integrated into the electronic device 1000. The electronic device 1000 may be used to execute the various processes and / or steps corresponding to the electronic device in the above method embodiments; to avoid repetition, these will not be described again here.

[0280] The aforementioned electronic device 1000 has the function of implementing the corresponding steps performed by the electronic device in the above method; the above function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function.

[0281] It should be pointed out that, Figure 6 The electronic device mentioned can be the electronic device in the foregoing embodiments, or it can be a chip or a chip system, such as a system on a chip (SoC). The acquisition module can be an input / output circuit or a communication interface; the control module is a processor, microprocessor, or integrated circuit integrated on the chip. No limitations are imposed here.

[0282] Figure 7 A schematic block diagram of another electronic device 2000 provided in an embodiment of this application is shown. The electronic device 2000 includes a processor 2010 and a memory 2020. The processor 2010 is coupled to the memory 2020. The memory 2020 is used to store computer programs or instructions and / or data. The processor 2010 is used to execute the computer programs or instructions stored in the memory 2020, or to read the data stored in the memory 2020, to perform the methods in the above-described method embodiments.

[0283] Optionally, there may be one or more processors 2010.

[0284] Optionally, the memory 2020 may be one or more.

[0285] Alternatively, the memory 2020 can be integrated with the processor 2010, or it can be set up separately.

[0286] Optionally, such as Figure 7As shown, the electronic device 2000 also includes a transceiver 2030 for receiving and / or transmitting signals. For example, the processor 2010 controls the transceiver 2030 to receive and / or transmit signals. For example, the transceiver 2030 is used to receive ultrasonic signals reflected by an ultrasonic sensor.

[0287] As one approach, the electronic device 2000 is used to implement the operations performed by the electronic device in the various method embodiments described above.

[0288] For example, processor 2010 is used to execute computer programs or instructions stored in memory 2020 to implement the relevant operations of the electronic device in the various method embodiments described above.

[0289] For example, the memory 2020 includes instructions that, when executed by one or more processors 2010, cause the electronic device 2000 to perform the following steps: acquiring first information from a proximity sensor, the first information indicating whether the proximity sensor has determined whether the object is obstructed; if the determination result indicated by the first information is that the object is not obstructed, acquiring second information from an ultrasonic sensor, the second information indicating whether the ultrasonic sensor has determined whether the object is obstructed; if the determination result indicated by the second information is that the object is obstructed, controlling the electronic device to activate the anti-accidental touch function; or if the determination result indicated by the first information is that the object is obstructed, acquiring third information from an ambient light sensor, the third information indicating whether the ambient light brightness is less than a first brightness value; if the determination result indicated by the third information is that the ambient light brightness is less than the first brightness value, controlling the electronic device to activate the anti-accidental touch function.

[0290] It should be understood that the processor mentioned in the embodiments of this application can be a central processing unit (CPU), or other general-purpose processors, DSPs, ASICs, field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0291] It should also be understood that the memory mentioned in the embodiments of this application can be volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM). For example, RAM can be used as an external cache. By way of example and not limitation, RAM includes the following forms: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0292] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, the memory (storage module) can be integrated into the processor.

[0293] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0294] This application also provides a computer-readable storage medium storing a computer program or instructions for implementing the methods executed by an electronic device in the above-described method embodiments. For example, when the computer program or instructions are run on an electronic pen, the electronic device performs the above-described methods (such as method 400 or method 500).

[0295] This application also provides a computer program product comprising instructions that, when executed by a computer, implement the methods performed by an electronic device in the above-described method embodiments. For example, when the computer program or instructions are run on an electronic device, the electronic device performs the above-described methods (such as method 400 or method 500).

[0296] The explanations and beneficial effects of the relevant content in any of the above-mentioned electronic devices can be found in the corresponding method embodiments provided above, and will not be repeated here.

[0297] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of apparatus or units may be electrical, mechanical, or other forms.

[0298] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The 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 processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. For example, the computer can be a personal computer, a server, or a network device, etc. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the 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 (DSL)) 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 media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs). For example, the aforementioned available media include, but are not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0299] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for preventing accidental touches, characterized in that, Applied to electronic devices, including proximity sensors, ambient light sensors, and ultrasonic sensors, the method includes: First information is obtained from the proximity sensor, and the first information is used to indicate the result of the proximity sensor's determination of whether it is blocked; If the first information indicates that the device is not obstructed, then second information is obtained from the ultrasonic sensor. This second information indicates the result of the ultrasonic sensor's determination of whether the device is obstructed. If the second information indicates that the device is obstructed, then the electronic device is controlled to activate the anti-accidental touch function; or If the determination result indicated by the first information is that the light is blocked, then third information is obtained from the ambient light sensor. The third information is used to indicate whether the ambient light brightness is less than the first brightness value. If the determination result indicated by the third information is that the ambient light brightness is less than the first brightness value, then the electronic device is controlled to enable the anti-accidental touch function.

2. The method according to claim 1, characterized in that, The electronic device further includes an attitude sensor for detecting the motion trajectory of the electronic device, and the method further includes: The fourth information is obtained from the attitude sensor, and the fourth information is used to indicate the result of the attitude sensor's determination of whether the electronic device is on the first motion trajectory; If the determination result indicated by the fourth information is that the electronic device is on the first motion trajectory, then the first information is obtained from the proximity sensor.

3. The method according to claim 1 or 2, characterized in that, If the signal strength of the reflected signal received by the proximity sensor is greater than a first preset strength value, then the determination result indicated by the first information is that the signal is blocked; or If the delay of the reflected signal received by the proximity sensor is less than the first preset delay value, then the determination result indicated by the first information is that the signal is blocked. or If the signal strength of the reflected signal received by the proximity sensor is less than or equal to a first preset strength value, then the determination result indicated by the first information is that the device is not obstructed; or If the time delay of the reflected signal received by the proximity sensor is greater than or equal to the first preset time delay value, then the determination result indicated by the first information is that it is not blocked.

4. The method according to any one of claims 1-3, characterized in that, If the ultrasonic sensor detects a direct ultrasonic signal or a reflected ultrasonic signal with a signal strength greater than a second preset strength value, then the determination result indicated by the second information is that the signal is blocked; or If the time delay of the ultrasonic sensor detecting a direct ultrasonic signal or a reflected ultrasonic signal is less than a second preset time delay value, then the determination result indicated by the second information is that the signal is blocked; or If the ultrasonic sensor detects a direct ultrasonic signal or a reflected ultrasonic signal with a signal strength less than or equal to a second preset strength value, then the determination result indicated by the second information is that the signal is not blocked; or If the ultrasonic sensor detects a direct ultrasonic signal or a reflected ultrasonic signal with a time delay greater than or equal to a second preset time delay value, then the determination result indicated by the second information is that the signal is not blocked.

5. The method according to any one of claims 1-3, characterized in that, The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset intensity value, then the determination result indicated by the second information is that the signal is blocked; or The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than a third preset delay value, then the determination result indicated by the second information is that the signal is blocked; or The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to a third preset intensity value, then the determination result indicated by the second information is that the signal is not blocked; or The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to a third preset delay value, then the determination result indicated by the second information is that it is not blocked.

6. The method according to any one of claims 1-5, characterized in that, The electronic device further includes a biometric identifier. If the determination result indicated by the second information is that the image is obstructed, or if the determination result indicated by the third information is that the ambient light brightness is less than a first brightness value, the method further includes: The fifth information is obtained from the biometrics identifier, and the fifth information is used to instruct the biometrics identifier to determine whether a face has appeared. If the determination result of the fifth information indication is that no face appears, then control the electronic device to enable the anti-accidental touch function.

7. The method according to any one of claims 1-6, characterized in that, When the electronic device acquires the first information from the proximity sensor, it controls the proximity sensor to turn off; or When the electronic device acquires the second information from the ultrasonic sensor, it controls the ultrasonic sensor to turn off; or When the electronic device acquires the third information from the ambient light sensor, it controls the ambient light sensor to turn off; or When the electronic device acquires the fourth information from the attitude sensor, it controls the attitude sensor to turn off; or When the electronic device obtains the fifth information from the biometric identifier, it controls the biometric identifier to turn off.

8. An electronic device, characterized in that, include: One or more processors, a memory, a proximity sensor, an ultrasonic sensor, and an ambient light sensor; the memory includes instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps: First information is obtained from the proximity sensor, and the first information is used to indicate the result of the proximity sensor's determination of whether it is blocked; If the first information indicates that the determination result is not blocked, then the second information is obtained from the ultrasonic sensor. The second information is used to indicate the result of the ultrasonic sensor's determination of whether the device is blocked. If the second information indicates that the determination result is blocked, then the electronic device is controlled to enable the anti-accidental touch function. or If the determination result indicated by the first information is that the light is blocked, then third information is obtained from the ambient light sensor. The third information is used to indicate whether the ambient light brightness is less than the first brightness value. If the determination result indicated by the third information is that the ambient light brightness is less than the first brightness value, then the electronic device is controlled to enable the anti-accidental touch function.

9. The electronic device according to claim 8, characterized in that, The electronic device further includes an attitude sensor for detecting the motion trajectory of the electronic device. When the instruction is executed by the one or more processors, the electronic device performs the following steps: The fourth information is obtained from the attitude sensor, and the fourth information is used to indicate the result of the attitude sensor's determination of whether the electronic device is on the first motion trajectory; If the determination result indicated by the fourth information is that the electronic device is on the first motion trajectory, then the first information is obtained from the proximity sensor.

10. The electronic device according to claim 8 or 9, characterized in that, If the signal strength of the reflected signal received by the proximity sensor is greater than a first preset strength value, then the determination result indicated by the first information is that the signal is blocked; or If the delay of the reflected signal received by the proximity sensor is less than the first preset delay value, then the determination result indicated by the first information is that the signal is blocked. or If the signal strength of the reflected signal received by the proximity sensor is less than or equal to a first preset strength value, then the determination result indicated by the first information is that the device is not obstructed; or If the time delay of the reflected signal received by the proximity sensor is greater than or equal to the first preset time delay value, then the determination result indicated by the first information is that it is not blocked.

11. The electronic device according to any one of claims 8-10, characterized in that, If the ultrasonic sensor detects a direct ultrasonic signal or a reflected ultrasonic signal with a signal strength greater than a second preset strength value, then the determination result indicated by the second information is that the signal is blocked; or If the time delay of the ultrasonic sensor detecting a direct ultrasonic signal or a reflected ultrasonic signal is less than a second preset time delay value, then the determination result indicated by the second information is that the signal is blocked; or If the ultrasonic sensor detects a direct ultrasonic signal or a reflected ultrasonic signal with a signal strength less than or equal to a second preset strength value, then the determination result indicated by the second information is that the signal is not blocked; or If the ultrasonic sensor detects a direct ultrasonic signal or a reflected ultrasonic signal with a time delay greater than or equal to a second preset time delay value, then the determination result indicated by the second information is that the signal is not blocked.

12. The electronic device according to any one of claims 8-10, characterized in that, The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than a third preset intensity value, then the determination result indicated by the second information is that the signal is blocked; or The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is less than a third preset delay value, then the determination result indicated by the second information is that the signal is blocked; or The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the ratio between the signal intensity of the ultrasonic signal detected by the top ultrasonic sensor and the signal intensity of the ultrasonic signal detected by the bottom ultrasonic sensor is less than or equal to a third preset intensity value, then the determination result indicated by the second information is that the signal is not blocked; or The ultrasonic sensor includes a top ultrasonic sensor and a bottom ultrasonic sensor. If the difference between the signal delay of the ultrasonic signal detected by the top ultrasonic sensor and the signal delay of the ultrasonic signal detected by the bottom ultrasonic sensor is greater than or equal to a third preset delay value, then the determination result indicated by the second information is that it is not blocked.

13. The electronic device according to any one of claims 8-12, characterized in that, The electronic device further includes a biometric identifier, and when the instruction is executed by the one or more processors, the electronic device performs the following steps: The fifth information is obtained from the biometrics identifier, and the fifth information is used to instruct the biometrics identifier to determine whether a face has appeared. If the determination result of the fifth information indication is that no face appears, then control the electronic device to enable the anti-accidental touch function.

14. The electronic device according to any one of claims 8-13, characterized in that, When the instruction is executed by the one or more processors, the electronic device performs the following steps: When the electronic device acquires the first information from the proximity sensor, it controls the proximity sensor to turn off; or When the electronic device acquires the second information from the ultrasonic sensor, it controls the ultrasonic sensor to turn off; or When the electronic device acquires the third information from the ambient light sensor, it controls the ambient light sensor to turn off; or When the electronic device acquires the fourth information from the attitude sensor, it controls the attitude sensor to turn off; or When the electronic device obtains the fifth information from the biometric identifier, it controls the biometric identifier to turn off.

15. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 7.

17. A chip product, characterized in that, include: A processor for reading instructions stored in memory, which, when executed, cause the chip to perform the method of any one of claims 1 to 7.