Detection method for accidental touch prevention, and electronic device
By dynamically adjusting the ambient light entry threshold based on the ambient light intensity, the problem of accidental touches on electronic devices in pockets is solved, achieving higher accuracy in preventing accidental touches and a better user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2025-07-29
- Publication Date
- 2026-05-07
AI Technical Summary
In existing technologies, electronic devices in pockets are prone to accidental touches due to ambient light reflection, making it impossible to accurately enter the anti-accidental touch mode and affecting the user experience.
By calculating the ambient light intensity of the electronic device's environment, the ambient light entry threshold is dynamically adjusted to ensure accurate triggering of the anti-mistouch function in pocket anti-mistouch scenarios.
The accuracy of the anti-accidental touch function has been improved, reducing accidental touches by users and enhancing the user experience.
Smart Images

Figure CN2025111117_07052026_PF_FP_ABST
Abstract
Description
A method and electronic device for preventing accidental touch detection
[0001] This application claims priority to Chinese Patent Application No. 202411563206.5, filed on November 4, 2024, entitled "A Method for Preventing Accidental Touch Detection and Electronic Equipment", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technology, and in particular to a method and electronic device for preventing accidental touch detection. Background Technology
[0003] In daily life, the screen of electronic devices may be accidentally touched by users without their consent, or may be squeezed by other objects or rubbed by clothing, which may lead to the accidental activation of unnecessary functions by the electronic devices.
[0004] Taking the scenario of preventing accidental touches in a pocket (i.e., when the electronic device is in a pocket) as an example, for the electronic device to enter the accidental touch prevention state, that is, to pop up the accidental touch prevention interface, one of the conditions is that the light intensity of the environment in which the electronic device is located must be less than the ambient light entry threshold. In the existing technology, the ambient light entry threshold is generally set to a fixed value. Since the ambient light entry threshold is a fixed value, in some high-reflection scenarios, the light of the electronic device screen may be reflected, causing the ambient light sensor of the electronic device to detect that the light intensity of the environment may be greater than the ambient light entry threshold. As a result, the electronic device cannot enter the accidental touch prevention state and cannot pop up the accidental touch prevention interface, which may lead to accidental touches and a poor user experience. Summary of the Invention
[0005] This application provides a method for detecting accidental touches and an electronic device to improve the accuracy of triggering the pocket accidental touch prevention function, reduce accidental touches by users, and enhance the user experience.
[0006] To achieve the above objectives, this application adopts the following technical solution:
[0007] Firstly, this application provides a method for preventing accidental touch detection, which may include:
[0008] When an electronic device meets preset detection conditions, the ambient light intensity in the environment where the electronic device is located is calculated. Based on the calculated light intensity, an ambient light entry threshold is determined for the pocket-protection against accidental touches. This threshold is greater than the calculated light intensity, and the pocket-protection detection is performed using this threshold. In this way, under specific conditions, the ambient light intensity in the environment where the electronic device is located can be calculated, and then the ambient light entry threshold can be determined based on the calculated light intensity. This ensures that the ambient light entry threshold is greater than the calculated light intensity, thereby improving the accuracy of triggering the pocket-protection function, reducing accidental touches, and enhancing the user experience.
[0009] In some possible implementations, the ambient light entry threshold for the pocket anti-mistouch scenario is determined based on the calculated light intensity. Specifically, this could be:
[0010] The ambient light entry threshold in the pocket anti-accidental touch scenario can be determined by the sum of the calculated light intensity and the first fixed increment. That is, the first fixed increment is added to the calculated light intensity, and this value is used as the ambient light entry threshold in the pocket anti-accidental touch scenario. The first fixed increment needs to be greater than 0. For example, the range of the first fixed increment can be set to be greater than 0 and less than 30 lux.
[0011] Alternatively, the ambient light entry threshold in the pocket anti-mistouch scenario can be determined by multiplying the calculated light intensity by the first increment coefficient. That is, the calculated light intensity is multiplied by a first increment coefficient, and this value is used as the ambient light entry threshold in the pocket anti-mistouch scenario. The first increment coefficient needs to be greater than 1. For example, the range of the first increment coefficient can be set to be greater than 1 and less than 1.05.
[0012] Alternatively, the ambient light entry threshold in the pocket anti-mistouch scenario can be determined based on the difference between the calculated light intensity and the second fixed increment. That is, the second fixed increment is subtracted from the calculated light intensity, and this value is used as the ambient light entry threshold in the pocket anti-mistouch scenario. The second fixed increment needs to be less than 0. For example, the range of the second fixed increment can be set to less than 0 and greater than -30 lux.
[0013] Alternatively, the ambient light entry threshold in the pocket-friendly anti-mistouch scenario can be determined based on the ratio of the calculated light intensity to the second incremental coefficient. This involves taking the calculated light intensity and then dividing it by a second incremental coefficient, using this value as the ambient light entry threshold for the pocket-friendly anti-mistouch scenario. The second incremental coefficient must be less than 1; for example, its range can be less than 1 and greater than 0.95. It should be noted that the specific values and ranges of the first fixed increment, first incremental coefficient, second fixed increment, and second incremental coefficient mentioned above are merely illustrative examples. Those skilled in the art can set these values according to actual needs, and no limitations are imposed here.
[0014] In some possible ways, determining the ambient light intensity in the environment where the electronic device is located can specifically include:
[0015] Obtain the channel values from the ambient light sensor;
[0016] The ambient light intensity in the environment where the electronic device is located is determined based on the channel value and the fitting formula. The fitting formula is obtained by fitting the channel value of the ambient light sensor and the light intensity measured by the ambient light sensor in each test scenario when the electronic device is in the test scene for multiple tests. The test scene can be a scene that reflects the brightness of the screen of the electronic device. The electronic device needs to be in a bright state during the test.
[0017] Test scenarios can be categorized in various ways. For example, a test scenario could involve placing the electronic device in a pocket made of white glossy material (i.e., the side of the white pocket that contacts the electronic device is made of glossy material). Another example is placing the electronic device in a dark environment with a pure white card attached to its screen. The screen of the electronic device can display pure color images of different gray levels (e.g., it can display pure black images, pure white images, and pure red images).
[0018] Tests revealed that when the screen of the electronic device displays a pure white image and the device is placed in a white glossy material trouser pocket, the ambient light sensor receives the most light reflected from the screen, resulting in the highest slope of the fitting formula. Therefore, the fitting formula can be described using the example of the electronic device being tested while displaying a pure white image on its screen and placed in a white glossy material trouser pocket.
[0019] Furthermore, the following can be divided into several scenarios for discussion.
[0020] The first possible implementation is that the ambient light sensor can only detect the channel value of the C channel. The ambient light intensity in the environment where the electronic device is located is determined according to the first fitting formula corresponding to the channel value of the C channel. The first fitting formula can be Y = kC + b. For example, the first fitting formula can be as shown in Figure 10, Y = 0.0078C - 1.6701, where Y is the determined ambient light intensity in the environment where the electronic device is located, C is the channel value of the C channel, and k and b are fitting coefficients. For example, the first fitting formula is obtained by fitting the C channel value of the ambient light sensor and the light intensity measured by the ambient light sensor in each test. During the test, the screen of the electronic device displays a pure white image.
[0021] The second possible implementation involves an ambient light sensor detecting the channel values of each of the R, G, B, and C channels. The ambient light intensity in the environment where the electronic device is located is determined based on each channel value and the corresponding second fitting formula. The second fitting formula can be Y = a1R + b1G + c1B + d1C, where Y is the determined ambient light intensity in the environment where the electronic device is located, R is the channel value of the R channel, G is the channel value of the G channel, B is the channel value of the B channel, C is the channel value of the C channel, and a1, b1, c1, and d1 are fitting coefficients. For example, the second fitting formula is obtained by fitting the ambient light sensor's R, G, B, and C channel values obtained from each test, along with the ambient light intensity measured by the sensor, to a single value. During the test, the screen of the electronic device displays a pure white image.
[0022] The third possible implementation involves an ambient light sensor detecting the channel values of each of the R, G, and B channels. The ambient light intensity in the environment where the electronic device is located is determined based on each channel value and the corresponding third fitting formula. This third fitting formula can be Y = a²R + b²G + c²B, where Y is the determined ambient light intensity in the environment where the electronic device is located, R is the channel value of the R channel, G is the channel value of the G channel, B is the channel value of the B channel, and a², b², c², and d² are fitting coefficients. For example, this third fitting formula is obtained by fitting the R, G, and B channel values of the ambient light sensor and the ambient light intensity measured by the sensor during each test, with the screen brightness varying in each test (e.g., gradually increasing). The electronic device's screen displays a pure white image during the test. This is just an example; the fitting formula can also be obtained by fitting the electronic device under other test scenarios, and is not limited here.
[0023] In this way, the ambient light sensor of the electronic device can determine the ambient light intensity in the environment where the electronic device is located through any of the three methods mentioned above.
[0024] The difference between the three implementation methods is that the first implementation method only needs to detect the channel value of the C channel, and then calculate the ambient light intensity based on the channel value of the C channel. Compared with the second and third implementation methods, which use the channel values of multiple channels to calculate the ambient light intensity, this can reduce the amount of calculation and reduce the power consumption of electronic devices.
[0025] The third implementation requires detecting the channel values of each of the R, G, B, and C channels, and then calculating the ambient light intensity based on these channel values. This method uses richer channel information than the first and second implementations, resulting in a smaller error in the calculated light intensity. The ambient light sensor in the electronic device can choose the appropriate implementation method to calculate the light intensity based on actual needs. For example, if the electronic device has high power consumption, the first implementation method can be chosen. Conversely, if the electronic device has low power consumption and requires more accurate calculations, the third implementation method can be chosen. This is merely an example; those skilled in the art can set the method according to actual needs, and no limitations are imposed here.
[0026] In some possible implementations, considering the potential inconsistencies in screen display and device functionality between different electronic devices, even fitting curves and formulas obtained from testing two electronic devices with the same screen and devices under the same test scenario will still contain errors. Consequently, the fitting formula obtained by testing the electronic device may have significant errors when applied to the electronic device in this application or other electronic devices. Therefore, this application can also perform independent testing on each electronic device at the time of manufacture to obtain the corresponding fitting formula.
[0027] For example, taking the electronic device in this application as an example, when the electronic device leaves the factory, a pure white card can be attached to the screen of the electronic device and the screen of the electronic device can display a pure white image to perform the same test as the test electronic device in Embodiment 1. In this way, the corresponding fitting formula of the electronic device can be obtained (the fitting formula here can also be called the fourth fitting formula), thereby solving the error problem caused by the consistency of mobile phones.
[0028] In some possible implementations, the ambient light entry threshold for the pocket anti-mistouch scenario needs to be determined only in specific scenarios based on the calculated light intensity. The determined ambient light entry threshold for the pocket anti-mistouch scenario is then used to perform pocket anti-mistouch detection. Thus, in this application, when the electronic device meets the preset detection conditions, the determination of the ambient light intensity in the environment where the electronic device is located can be performed. This can reduce the probability of accidental triggering of the anti-mistouch function and reduce the amount of computation, saving a certain amount of power consumption.
[0029] For example, an electronic device may be determined to meet the preset detection conditions when it is in a locked state, when the touch panel detection value meets the large object detection threshold of the touch screen, or when the electronic device is in a head-down state. Alternatively, it may be determined to meet the preset detection conditions when it is in an unlocked state, when the touch panel detection value meets the large object detection threshold of the touch screen, when the electronic device is in a head-down state, or when the electronic device is in motion. It should be noted that this is only an example, and the judgment conditions for an electronic device to meet the preset detection conditions can be set according to actual needs. For example, it can also be set to determine that the preset detection conditions are met when one or more of the above judgment conditions are met, which is not limited here.
[0030] In some possible implementations, a defined ambient light entry threshold is used for pocket accidental touch detection, specifically:
[0031] The anti-mistouch function is triggered when the electronic device is locked, the touch panel detection value meets the large object detection threshold of the touch screen, the electronic device is upside down, and the ambient light intensity of the current environment of the electronic device is less than the ambient light entry threshold under the determined pocket anti-mistouch scenario.
[0032] The anti-mistouch function is triggered when the electronic device is in an unlocked state, the touch panel detects the large object detection threshold of the touch screen, the electronic device is in a head-down state, the electronic device is in motion, and the calculated light intensity is less than the ambient light entry threshold for the determined pocket anti-mistouch scenario.
[0033] Secondly, this application provides an electronic device, including: a processor and a memory;
[0034] The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the electronic device performs the method described in the first aspect.
[0035] Thirdly, this application provides a computer storage medium including computer instructions that, when executed on a mobile terminal, cause the electronic device to perform the method described in the first aspect. Attached Figure Description
[0036] Figure 1 is a schematic diagram of activating the anti-accidental touch function according to an embodiment of this application;
[0037] Figure 2 is a schematic diagram of an electronic device in a pocket according to an embodiment of this application;
[0038] Figure 3 is a schematic diagram of an interface designed to prevent accidental touches, provided in an embodiment of this application.
[0039] Figure 4 is a schematic diagram of an electronic device in a reflective scene according to an embodiment of this application;
[0040] Figure 5 is an interactive diagram of an anti-accidental touch detection method provided in an embodiment of this application;
[0041] Figure 6 is a schematic diagram of a TP (tumor detection) method for large objects provided in an embodiment of this application;
[0042] Figure 7 is a schematic diagram of the location and working principle of an ambient light sensor provided in an embodiment of this application;
[0043] Figure 8 is a schematic diagram of test data obtained by a test electronic device according to an embodiment of this application;
[0044] Figure 9 is a schematic diagram of the fitting curve between the channel value of the C channel corresponding to different pure color images displayed on the screen of an electronic device and the illumination intensity of ambient light in a test scenario of a white glossy material trouser pocket provided by an embodiment of this application.
[0045] Figure 10 is a schematic diagram of the fitting curve between the channel value of the C channel corresponding to the pure white image displayed on the screen of an electronic device and the illumination intensity of ambient light in a test scenario provided by an embodiment of this application, under the test scenario of a trouser pocket made of white glossy material.
[0046] Figure 11 is a schematic diagram of the fitting curves obtained by testing two electronic devices with the same screen and the same device under the same test scenario according to an embodiment of this application.
[0047] Figure 12 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0048] Figure 13 shows the software architecture of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.
[0050] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0051] In daily life, the screen of electronic devices may be accidentally touched by users without their consent, or may be squeezed by other objects or rubbed by clothing, which may lead to the accidental triggering of unnecessary functions, such as accidentally triggering payment functions or accidentally sending messages.
[0052] Therefore, most electronic devices nowadays are equipped with anti-accidental touch features to prevent accidental touches on the screen while the device is in a pocket or held in hand, thus avoiding unnecessary function triggers.
[0053] In some possible implementations, users can choose whether to enable the anti-mistouch function of the electronic device according to their needs. For example, as shown in Figure 1(a), when the user needs to enable the anti-mistouch function of the electronic device, the user touches the settings APP displayed on the electronic device's display interface. The electronic device's touch sensor can receive the user's touch operation on the settings APP icon and report the touch operation on the settings APP icon to the processor. After receiving the touch operation on the settings APP icon, the processor can respond to the above touch operation and launch the application (APP) corresponding to the icon.
[0054] After the electronic device launches the settings app, it can display the interface shown in Figure 1(b). The interface shown in Figure 1(b) includes different controls, such as desktop and personalization controls, sound and vibration controls, and accessibility functions. Users can click (touch) the accessibility functions, and then the electronic device can display the interface shown in Figure 1(c). The interface in Figure 1(c) can include an anti-accidental touch mode switch.
[0055] In some possible implementations, the accidental touch prevention mode switch 11 may include a switch control 12. The switch control 12 is placed at the left end of the accidental touch prevention mode switch 11, which indicates that the accidental touch prevention mode switch 11 is in the off state, that is, the accidental touch prevention function of the electronic device is off. When the user needs to turn on the accidental touch prevention function of the electronic device, he / she can turn on the accidental touch prevention mode switch 11, that is, by clicking the switch control 12 to control the switch control 12 to be placed at the right end of the accidental touch prevention mode switch 11, that is, the current position of the interface shown in (c) in Figure 1, thereby indicating that the accidental touch prevention function of the electronic device is in the on state.
[0056] The following example illustrates a scenario where an electronic device with its anti-mistouch function enabled is placed in a pocket. For instance, as shown in Figure 2(a), Figure 2(a) includes user 200 and electronic device 201 (here, the electronic device is a mobile phone). Electronic device 201 is placed in user 200's pants pocket. Electronic device 201 can determine whether the anti-mistouch condition is met based on its own state. When the anti-mistouch condition is met, the electronic device can display the anti-mistouch interface as shown in Figure 3. After the electronic device displays the anti-mistouch interface as shown in Figure 3, the electronic device may be locked. That is, it will not receive any other operations except for receiving user-specific unlocking operations (such as entering a password, fingerprint, or facial recognition) to unlock. In this case, the electronic device can prevent accidental touches and reduce unnecessary function triggering.
[0057] The following section details how electronic devices determine whether they meet the conditions for preventing accidental touches based on their own status.
[0058] Specifically, electronic devices can first determine whether they are in a locked state.
[0059] When an electronic device is determined to be in a locked state, it can be determined whether the touch panel detection value meets the large object detection threshold of the touch screen, whether the electronic device is in a head-down state, and whether the current ambient light intensity of the electronic device is less than the ambient light entry threshold. Among these, the locked state is a security protection state of the electronic device. When the electronic device is in a locked state, the user needs to perform a specific operation to unlock the electronic device and put it in an unlocked state (e.g., an unlocked state). Only then can the functions and data of the electronic device be accessed. The touch panel detection value is used to measure the size of the contact area between the display screen of the electronic device and the contact object. As shown in Figure 2(b), the electronic device (taking a mobile phone as an example) is in a head-down state when the angle between the B direction of the electronic device (the direction in which the center of the electronic device extends along the straight line of the camera) and the A direction (vertical downward direction) is less than 10 degrees.
[0060] When an electronic device is determined to be in a locked state, when the touch panel detection value meets the large object detection threshold of the touch screen, when it is in a head-down state, and when the ambient light intensity is less than the ambient light entry threshold, an anti-accidental touch interface can be displayed.
[0061] When an electronic device is determined to be in an unlocked state, it can be determined whether the touch panel detection value is above the object detection threshold, whether the electronic device is upside down, whether the electronic device is in motion, and whether the ambient light intensity of the electronic device is below the ambient light entry threshold.
[0062] When an electronic device is determined to be in an unlocked state, when the touch panel detection value meets the large object detection threshold of the touch screen, when it is in a head-down state, when it is in motion, and when the ambient light intensity is less than the ambient light entry threshold, an anti-accidental touch interface can be displayed.
[0063] As can be seen, in the pocket anti-mistouch scenario (i.e., when the electronic device is in a pocket), for the electronic device to enter the anti-mistouch state and display the anti-mistouch interface, one condition is that the ambient light intensity of the environment where the electronic device is located must be less than the ambient light entry threshold. In the existing technology, the ambient light entry threshold is generally set to a fixed value. Since the ambient light entry threshold is a fixed value, as shown in Figure 4, in some low-reflection scenarios, such as when the electronic device is in the pocket of dark pants and the screen of the electronic device is dark, the pants will not reflect the light from the screen of the electronic device. In this case, the ambient light intensity detected by the ambient light sensor of the electronic device is generally less than the ambient light entry threshold, and the electronic device can enter the anti-mistouch state. However, in some high-reflection scenarios, such as when the electronic device is in a bright pocket and the pocket is a shiny pocket of white pants (with high reflectivity), the pants will reflect the light from the screen of the electronic device. In this case, the ambient light intensity detected by the electronic device may be greater than the ambient light entry threshold, which will prevent the electronic device from entering the anti-mistouch state and displaying the anti-mistouch interface, and accidental touches may occur, resulting in a poor user experience.
[0064] In view of this, this application provides a method for preventing accidental touch detection, comprising: when the electronic device meets preset detection conditions, determining the ambient light intensity in the environment where the electronic device is located; determining an ambient light entry threshold in a pocket-based accidental touch scenario based on the light intensity; wherein the ambient light entry threshold in the pocket-based accidental touch scenario is greater than the calculated light intensity; and performing pocket-based accidental touch detection using the determined ambient light entry threshold in the pocket-based accidental touch scenario. Under specific conditions, this application can calculate the ambient light intensity in the environment where the electronic device is located, and then determine the ambient light entry threshold based on the calculated light intensity, so that the ambient light entry threshold is greater than the calculated light intensity, thereby improving the accuracy of triggering the pocket-based accidental touch function, reducing user accidental touches, and improving the user experience.
[0065] To make the technical solution of this application clearer and easier to understand, the following description, in conjunction with the above embodiments and corresponding drawings, using an electronic device as the executing entity and the Android operating system in the electronic device as an example, introduces the anti-mistouch detection method provided by the embodiments of this application, which can be referred to as Embodiment 1. As shown in Figure 5, the anti-mistouch detection method provided by Embodiment 1 of this application may include:
[0066] S501. Determine whether the screen of the electronic device is locked or unlocked.
[0067] The processor of an electronic device determines whether the screen of the electronic device is in a locked state or an unlocked state. The locked state refers to a security protection state of the electronic device. When the electronic device is in a locked state, the user cannot access the main interface and applications of the electronic device. The user needs to perform specific operations to unlock the electronic device and put it in an unlocked state, so that the functions and data of the electronic device can be accessed.
[0068] For example, the processor of an electronic device can query whether the screen of the electronic device is locked by calling or executing some services or APIs provided in the operating system. For example, in the Android system, the processor can call the KeyguardManager service to check whether the electronic device is locked or can call inKeyguardRestrictedIn
[0069] The putMode() function determines whether an electronic device is in a locked or unlocked state (also known as an unlocked state).
[0070] S502. Determine the contact area of the screen of the electronic device.
[0071] The touch screen controller of an electronic device can determine the contact area between the screen of the electronic device and an object. This step can also be called touch panel (TP) large object detection. TP large object detection is a detection mechanism that allows touch sensors and touch screen controllers to distinguish between normal finger touches and contact with larger objects (such as the palm and back of the hand) when detecting touch events.
[0072] For example, a touch sensor in an electronic device can detect touch events by measuring changes in screen capacitance. When a finger or other conductive object touches the screen, it forms a capacitance with the screen; this capacitance value can be called the touch capacitance. After detecting the touch capacitance, the touch sensor can send it to the touchscreen controller. The touchscreen controller can divide the screen into different touch areas (also called touch zones) based on the changes in touch capacitance, as shown in Figure 6(a). The touchscreen controller divides the screen into area a and area b. It can be seen that the touch capacitance in area a is significantly higher than that in area b. In the touch zone with the higher capacitance, i.e., area a, the touchscreen controller can record the major and minor axis attributes of the touch point, which refers to the major axis (also called the first axis) and minor axis (also called the second axis) of the ellipse shape of the touch area, as shown in Figure 6(b). The touchscreen controller can record the attributes of the first axis and the second axis, and thus determine the area of area a based on the attributes of the first axis and the second axis.
[0073] The touchscreen controller can also set a threshold value, called the TP large object detection threshold, based on the differences between the attributes of the first and second axes and normal touch. When the area of the touch zone (taking area a as an example here) meets (greater than or equal to) this TP large object detection threshold, it can be considered a valid touch action.
[0074] S503: Determine the orientation of the electronic device.
[0075] The processor of an electronic device can determine the orientation of the electronic device.
[0076] For example, the processor of an electronic device can acquire data collected by sensors such as orientation sensors, gyroscope sensors, and gravity sensors of the electronic device, and then determine the orientation of the electronic device based on this data.
[0077] S504. Determine whether the electronic device is in motion.
[0078] The processor of an electronic device can determine whether the electronic device is in motion. In this case, the electronic device being in motion means that the position or speed of the electronic device changes in real time.
[0079] For example, the processor of an electronic device can acquire data collected by sensors such as accelerometers, gyroscopes, and gravity sensors, and then determine whether the electronic device is in motion based on this data.
[0080] S505. Determine the ambient light intensity in the environment where the electronic device is located.
[0081] Ambient light sensors in electronic devices can determine the intensity of ambient light in the environment in which the electronic device is located.
[0082] First, let's look at the location of the ambient light sensor in an electronic device, for example. As shown in Figure 7(a), the electronic device may include a front-facing camera, an ambient light sensor, a display interface, a status bar area, etc. In the plan view of Figure 7(a), the ambient light sensor and the front-facing camera are both located in the status bar display area at the top of the display interface.
[0083] Next, we can introduce the working principle of the ambient light sensor. As shown in Figure 7(b), the ambient light detected by the ambient light sensor consists of two parts: the residual energy of the external ambient light passing through the screen and the energy reflected from the local pixels of the screen to the ambient light sensor. The magnitude of the ambient light in the environment where the electronic device is located can be measured by adding these two parts of energy.
[0084] The following section details how the ambient light sensor in this application determines the ambient light intensity in the environment in which the electronic device is located. Specifically, the ambient light sensor can detect its own channel values. The types of channels for the ambient light sensor can include, for example, R channels, G channels, B channels, and C channels. In the RGB color space, the R channel (red channel) includes information about all red components in the image. The G channel (green channel) includes information about all green components in the image. The B channel (blue channel) includes information about all blue components in the image. The C channel is a set of full-spectrum photodiodes (PDs), including the infrared component (the full spectrum including visible and infrared light). Channel values refer to the light intensity values measured by the ambient light sensor under a specific channel. For example, the types of channel values can include R channel values (also called R channel values), G channel values (also called G channel values), B channel values (also called B channel values), and C channel values (also called C channel values), etc.
[0085] After detecting its own channel value, the ambient light sensor can determine the ambient light intensity in the environment where the electronic device is located based on the channel value and the corresponding fitting formula. The fitting formula is obtained by fitting the channel value of the ambient light sensor and the light intensity measured by the ambient light sensor in each test scenario, where the electronic device is in a test scene undergoing multiple tests. The test scene can be a scene that reflects the brightness of the electronic device's screen. For example, the electronic device could be in a pocket made of white glossy material (i.e., the side of the white pocket in contact with the electronic device is glossy material). Alternatively, the electronic device could be placed in a dark scene with a pure white card attached to its screen. It should be noted that the electronic device needs to be in a bright state during the test; for example, the screen can display pure color images of different grayscale levels. Here, "test electronic device" refers to an electronic device specifically performing the test task, which may be different from the electronic device executing the embodiments of this application.
[0086] For example, consider a test electronic device displaying eight solid color images on its screen: 000000 (representing black), ff0000 (representing red), 00ff00 (representing green), 0000ff (representing blue), ffff00 (representing yellow), ff00ff (representing magenta), 00ffff (representing cyan), and ffffff (representing white). These images are tested under different scenarios (e.g., a pure white card attached to the screen, a pure gray card attached to the screen, the device in a white glossy trouser pocket, a white denim trouser pocket, a white denim skirt pocket, and a white glossy jacket pocket). The test results would be as shown in Figure 8, where `color` represents the color of the solid color image displayed on the screen, `DBV` represents the screen brightness, `Lux` represents the ambient light intensity calculated by the ambient light sensor, and `cal_noise_C` is the channel value of the C channel. Testing revealed that when the screen of the test electronic device displayed a pure white image and the device was placed in a white, glossy material trouser pocket, the ambient light sensor received the most reflected light from the screen. For example, by fitting the data obtained from the test scenario of the test electronic device in a white, glossy material trouser pocket (using the C-channel data and the ambient light intensity calculated by the sensor as examples), fitting curves between the C-channel values corresponding to different pure color images displayed on the screen of the test electronic device and the ambient light intensity can be obtained. For example, the fitting curves can be shown in Figure 9. It was found that the slope of the fitting curve and the fitting formula was highest when the screen of the test electronic device displayed a pure white image, as shown in Figure 10 (the horizontal axis of Figures 9 and 10 represents the C-channel values, and the vertical axis represents the ambient light intensity). Furthermore, the fitting formula obtained from testing the test electronic device with a pure white image displayed on the screen and placed in a white, glossy material trouser pocket will be described below as an example.
[0087] Furthermore, the following can be divided into several scenarios for discussion.
[0088] The first possible implementation is that the ambient light sensor can only detect the channel value of the C channel. The illumination intensity of the ambient light in the environment where the electronic device is located is determined according to the first fitting formula corresponding to the channel value of the C channel. Here, the first fitting formula can be Y = kC + b. For example, the first fitting formula can be as shown in Figure 10, Y = 0.0078C - 1.6701, where Y is the determined illumination intensity of the ambient light in the environment where the electronic device is located, C is the channel value of the C channel, and k and b are fitting coefficients. For example, the first fitting formula is obtained by fitting the C channel value of the ambient light sensor and the illumination intensity measured by the ambient light sensor in each test. During the test, the screen brightness of the electronic device can be different, for example, the screen brightness can be increased in each test. The first fitting formula is obtained by fitting the C channel value of the ambient light sensor and the illumination intensity measured by the ambient light sensor in each test. During the test, the screen of the electronic device presents a pure white image (i.e., an image composed of white pixels).
[0089] The second possible implementation involves an ambient light sensor detecting the channel values of each of the R, G, B, and C channels. Based on each channel value and the corresponding second fitting formula, the ambient light intensity in the environment where the electronic device is located is determined. The second fitting formula can be Y = a1R + b1G + c1B + d1C, where Y is the determined ambient light intensity in the environment where the electronic device is located, R is the channel value of the R channel, G is the channel value of the G channel, B is the channel value of the B channel, C is the channel value of the C channel, and a1, b1, c1, and d1 are fitting coefficients. For example, this... The second fitting formula is obtained by placing the test electronic device in a white glossy material trouser pocket (i.e., the side of the white pocket in contact with the test electronic device is glossy material) for multiple tests. The screen brightness of the test electronic device can be different in each test, for example, the screen brightness can be increased in each test. The fitting formula is obtained by fitting the R channel value, G channel value, B channel value, and C channel value of the ambient light sensor obtained in each test and the light intensity measured by the ambient light sensor. During the test, the screen of the test electronic device presents a pure white image (i.e., an image composed of white pixels).
[0090] The third possible implementation involves an ambient light sensor detecting the channel values of each of the R, G, and B channels. Based on each channel value and the corresponding third fitting formula, the ambient light intensity in the environment where the electronic device is located is determined. The third fitting formula can be Y = a²R + b²G + c²B, where Y is the determined ambient light intensity in the environment where the electronic device is located, R is the channel value of the R channel, G is the channel value of the G channel, B is the channel value of the B channel, and a², b², c², and d² are fitting coefficients. For example, this third fitting formula is used when the electronic device is placed in a white, glossy material trouser pocket (…). Multiple tests are conducted on a white bag (the side of the bag that contacts the electronic device is made of a glossy material). The screen brightness of the electronic device can be varied in each test, for example, the screen brightness can be increased gradually in each test. The formula is obtained by fitting the R-channel, G-channel, and B-channel values of the ambient light sensor and the light intensity measured by the ambient light sensor in each test. During the test, the screen of the electronic device displays a pure white image (i.e., an image composed of white pixels). Of course, the above is just an example. The fitting formula can also be obtained by fitting the electronic device under other test scenarios. It is not limited here.
[0091] In this way, the ambient light sensor of the electronic device can determine the ambient light intensity in the environment where the electronic device is located through any of the three methods mentioned above.
[0092] The difference between the three implementation methods is that the first implementation method only needs to detect the channel value of the C channel, and then calculate the ambient light intensity based on the channel value of the C channel. Compared with the second and third implementation methods, which use the channel values of multiple channels to calculate the ambient light intensity, this can reduce the amount of calculation and reduce the power consumption of electronic devices.
[0093] The third implementation requires detecting the channel values of each of the R, G, B, and C channels, and then calculating the ambient light intensity based on these channel values. This method uses richer channel information than the first and second implementations, resulting in a smaller error in the calculated light intensity. The ambient light sensor in the electronic device can choose the appropriate implementation method to calculate the light intensity based on actual needs. For example, if the electronic device has high power consumption, the first implementation method can be chosen. Conversely, if the electronic device has low power consumption and requires more accurate calculations, the third implementation method can be chosen. This is merely an example; those skilled in the art can set the method according to actual needs, and no limitations are imposed here.
[0094] In some possible implementations, the ambient light entry threshold for the pocket anti-mistouch scenario only needs to be determined based on the calculated light intensity in specific scenarios. The determined ambient light entry threshold for the pocket anti-mistouch scenario is then used to perform pocket anti-mistouch detection. Thus, in this application, when the electronic device meets the preset detection conditions, step S505 of this application is executed to determine the ambient light intensity in the environment where the electronic device is located. This can reduce the probability of accidentally triggering the anti-mistouch function and reduce the amount of computation, saving a certain amount of power consumption.
[0095] For example, an electronic device may be determined to meet the preset detection conditions when it is in a locked state, when the touch panel detection value meets the large object detection threshold of the touch screen, or when the electronic device is in a head-down state. Alternatively, it may be determined to meet the preset detection conditions when it is in an unlocked state, when the touch panel detection value meets the large object detection threshold of the touch screen, when the electronic device is in a head-down state, or when the electronic device is in motion. It should be noted that this is only an example, and the judgment conditions for an electronic device to meet the preset detection conditions can be set according to actual needs. For example, it can also be set to determine that the preset detection conditions are met when one or more of the above judgment conditions are met, which is not limited here.
[0096] S506. Determine the ambient light entry threshold in the pocket anti-accidental touch scenario based on the calculated light intensity.
[0097] The electronic device processor can receive the light intensity calculated by the ambient light sensor, and then determine the ambient light entry threshold in the pocket anti-mistouch scenario based on the light intensity. The ambient light entry threshold in the pocket anti-mistouch scenario is greater than the calculated light intensity.
[0098] In some possible implementations, the processor can determine the ambient light entry threshold in the pocket anti-mistouch scenario based on the sum of the calculated light intensity and the first fixed increment. That is, the first fixed increment is added to the calculated light intensity and used as the ambient light entry threshold in the pocket anti-mistouch scenario. The first fixed increment needs to be greater than 0. For example, the range of the first fixed increment can be set to be greater than 0 and less than 30 lux.
[0099] In some possible implementations, the processor can determine the ambient light entry threshold in the pocket anti-mistouch scenario based on the product of the calculated light intensity and the first increment coefficient. That is, the calculated light intensity is multiplied by the first increment coefficient, and this value is used as the ambient light entry threshold in the pocket anti-mistouch scenario. The first increment coefficient needs to be greater than 1. For example, the range of the first increment coefficient can be set to be greater than 1 and less than 1.05.
[0100] In some possible implementations, the processor can determine the ambient light entry threshold in the pocket anti-mistouch scenario based on the difference between the calculated light intensity and the second fixed increment. That is, the second fixed increment is subtracted from the calculated light intensity, and this value is used as the ambient light entry threshold in the pocket anti-mistouch scenario. The second fixed increment needs to be less than 0. For example, the range of the second fixed increment can be set to less than 0 and greater than -30 lux.
[0101] In some possible implementations, the processor can determine the ambient light entry threshold in the pocket anti-mistouch scenario based on the ratio of the calculated light intensity and the second incremental coefficient. That is, the calculated light intensity is compared with a second incremental coefficient, and this value is used as the ambient light entry threshold in the pocket anti-mistouch scenario. The second incremental coefficient needs to be less than 1. For example, the range of the second incremental coefficient can be set to less than 1 and greater than 0.95.
[0102] It should be noted that the specific values and ranges of the first fixed increment, the first increment coefficient, the second fixed increment, and the second increment mentioned above are only illustrative examples. Those skilled in the art can set them according to actual needs, and no limitations are made here.
[0103] In some possible implementations, the processor can also adjust the original ambient light entry threshold. For example, if the original ambient light entry threshold is 20 lux and the calculated light intensity is 30 lux, the original ambient light entry threshold can be adjusted, for example, to 31 lux, making it greater than the calculated light intensity. This adjusted ambient light entry threshold is then used as the ambient light entry threshold in a pocket-sized anti-mistouch scenario. A range of error between the adjusted ambient light entry threshold and the calculated light intensity can be set, for example, to 30 lux. In this case, the adjusted ambient light entry threshold must be greater than the calculated light intensity, and the difference between the adjusted ambient light entry threshold and the calculated light intensity must be kept within 30 lux. Of course, this 30 lux error range is just an example and not a limitation.
[0104] S507. When it is determined that the electronic device is in a locked state, the touch panel detection value meets the large object detection threshold of the touch screen, the electronic device is in a head-down state, and the current ambient light intensity of the electronic device is less than the ambient light entry threshold under the determined pocket anti-mistouch scenario, the anti-mistouch function is triggered.
[0105] When it is determined that the electronic device is in a locked state, it can be determined whether the touch panel detection value meets the large object detection threshold of the touch screen, whether the electronic device is in a head-down state, and whether the calculated light intensity is less than the ambient light entry threshold in the determined pocket anti-mistouch scenario.
[0106] When the processor of the electronic device determines that all the above conditions are met, it triggers the anti-mistouch function, and the processor can instruct the anti-mistouch interface to be displayed on the screen as shown in Figure 3.
[0107] S508. When it is determined that the electronic device is in an unlocked state, the touch panel detection value is the touch screen large object detection threshold, the electronic device is in a head-down state, the electronic device is in motion, and the calculated light intensity is less than the determined ambient light entry threshold for the pocket anti-mistouch scenario, the anti-mistouch function is triggered.
[0108] When it is determined that the electronic device is in an unlocked state, it can be determined whether the touch panel detection value is at the large object detection threshold, whether the electronic device is in an upside-down state, whether the electronic device is in motion, and whether the ambient light intensity of the environment in which the electronic device is located is less than the ambient light entry threshold in the determined pocket anti-mistouch scenario.
[0109] When the processor of the electronic device determines that all the above conditions are met, it triggers the anti-mistouch function, and the processor can instruct the anti-mistouch interface to be displayed on the screen as shown in Figure 3.
[0110] In this embodiment, it can be determined whether the screen of the electronic device is locked or unlocked, the contact area of the screen, the orientation of the electronic device, whether the electronic device is in motion, and the ambient light intensity in the environment where the electronic device is located. Then, the ambient light entry threshold in the pocket anti-mistouch scenario can be determined based on the calculated light intensity. The ambient light entry threshold in the pocket anti-mistouch scenario needs to be greater than the calculated light intensity. Finally, the determined ambient light entry threshold in the pocket anti-mistouch scenario can be used to perform pocket anti-mistouch detection. When it is determined that the electronic device is locked, the touch panel detection value meets the touch screen large object detection threshold, the electronic device is upside down, and the light intensity of the current environment where the electronic device is located is less than the determined ambient light entry threshold in the pocket anti-mistouch scenario, the anti-mistouch function can be triggered. When it is determined that the electronic device is unlocked, the touch panel detection value meets the large object detection threshold, the electronic device is upside down, the electronic device is in motion, and the light intensity of the environment where the electronic device is located is less than the determined ambient light entry threshold in the pocket anti-mistouch scenario, the anti-mistouch function can be triggered. In this embodiment, the ambient light intensity in the environment where the electronic device is located can be calculated, and then an ambient light entry threshold can be determined based on the calculated light intensity, so that the ambient light entry threshold is greater than the calculated light intensity, thereby improving the accuracy of triggering the pocket anti-mistouch function, reducing user accidental touches, and improving the user experience.
[0111] In some possible implementations, considering the potential inconsistencies in screen display and device functionality among different electronic devices, as shown in Figures 11(a) and (b), Figure 11 (horizontal axis represents the channel value of channel C, and vertical axis represents the ambient light intensity) shows the fitted curves and fitting formulas obtained from testing two electronic devices with the same screen and device under the same test scenario. It can be seen that there are still differences in the coefficient of k, k1 = 0.0178.
[0112] The k² = 0.0138 introduces an error, which means that the fitting formula obtained through testing the electronic device may have significant errors when applied to the electronic device in this application or other electronic devices. Therefore, this application can also perform independent testing on each electronic device at the time of manufacture to obtain the corresponding fitting formula.
[0113] For example, taking the electronic device in this application as an example, when the electronic device leaves the factory, a pure white card can be attached to the screen of the electronic device and the screen of the electronic device can display a pure white image to perform the same test as the test electronic device in Embodiment 1. In this way, the corresponding fitting formula of the electronic device can be obtained (the fitting formula here can also be called the fourth fitting formula), thereby solving the error problem caused by the consistency of mobile phones.
[0114] In addition, this application also provides another embodiment, which can be referred to as Embodiment 2. Since the ambient light entry threshold is determined based on the calculated light intensity, the ambient light entry threshold must be greater than the calculated light intensity. Therefore, in Embodiment 2, step S506 of determining the ambient light entry threshold in the pocket anti-mistouch scenario based on the calculated light intensity can be cancelled, and the ambient light entry threshold mechanism can be cancelled in the judgment condition for triggering the anti-mistouch function. By judging whether the calculated light intensity is within the preset range, it is determined whether the anti-mistouch condition is met. The remaining steps are similar to the implementation principle in Embodiment 1, and will not be described in detail here.
[0115] When an electronic device is determined to be in a locked state, it can be determined whether the touch panel detection value meets the large object detection threshold of the touch screen, whether the electronic device is in a head-down position, and whether the ambient light intensity of the electronic device is within a preset range. When the electronic device is determined to be in a locked state, the touch panel detection value meets the large object detection threshold of the touch screen, the device is in a head-down position, and the calculated light intensity is within a preset range, it can be determined that the electronic device is in a pocket and meets the conditions for triggering the anti-mistouch function, and thus the anti-mistouch interface can be displayed.
[0116] When the electronic device is determined to be in an unlocked state, it can be determined whether the touch panel detection value meets the large object detection threshold, whether the electronic device is upside down, whether the electronic device is in motion, and whether the calculated light intensity is within a preset range. When the electronic device is determined to be in an unlocked state, the touch panel detection value meets the touch screen large object detection threshold, the device is determined to be upside down, the device is determined to be in motion, and the calculated light intensity is determined to be within a preset range, it can be determined that the electronic device is in a pocket and meets the conditions for triggering the accidental touch prevention function. Therefore, an accidental touch prevention interface can be displayed. It should be noted that the preset range can be set by those skilled in the art according to their needs, for example, 0-200 lux, and is not limited here.
[0117] In existing technologies, light from electronic device screens may be reflected in certain high-reflectivity scenarios. Since the ambient light threshold in existing technologies is a fixed value, the ambient light intensity detected by the electronic device may exceed this threshold. This prevents the electronic device from entering the anti-mistouch state and displaying the anti-mistouch interface, potentially leading to accidental touches and a poor user experience. This embodiment of the present application proposes that when other conditions for triggering the anti-mistouch function are met, the calculated light intensity can be determined to be within a certain range. If the calculated light intensity is within a preset range, it can be determined that the electronic device is in a pocket and meets the conditions for triggering the anti-mistouch function, thus allowing the anti-mistouch interface to be displayed. This improves the accuracy of triggering the pocket anti-mistouch function, reduces accidental touches, and enhances the user experience.
[0118] The method provided in this application can be executed on an electronic device. In some embodiments, the electronic device can be a mobile phone, tablet computer, desktop computer, laptop computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (PDA), wearable electronic device, smartwatch, etc. This application does not impose any special limitations on the specific form of the above-mentioned electronic device. In this embodiment, the structure of the electronic device can be as shown in Figure 12, which is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0119] As shown in Figure 12, the electronic device may include a processor 1201, a sensor module 1202, a display screen 1203, etc. The sensor module 1202 may include a touch sensor 1202A, a gyroscope sensor 1202B, an accelerometer sensor 1202C, and an ambient light sensor 1202D, etc.
[0120] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0121] Processor 1201 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. The different processing units may be independent devices or integrated into one or more processors.
[0122] The controller can serve as the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.
[0123] The processor 1201 can also be used to calculate the ambient light entry threshold in the pocket anti-mistouch scenario based on the light intensity calculated by the ambient light sensor. The ambient light entry threshold needs to be greater than the calculated light intensity, and then the determined ambient light entry threshold is used to perform pocket anti-mistouch detection.
[0124] In some embodiments, the processor 1201 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, a universal asynchronous receiver / transmitter (UART) interface, or a mobile industry processor interface (MIPI).
[0125] 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 1201 may include multiple I2C buses. The processor 1201 can couple the touch sensor 1202A through different I2C bus interfaces. For example, the processor 1201 can couple the touch sensor 1202A through the I2C interface, enabling the processor 1201 and the touch sensor 1202A to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device.
[0126] Electronic devices implement display functions through a GPU, a display screen 1203, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 1203 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 1201 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0127] The display screen 1203 is used to display images, videos, etc. The display screen 1203 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 minimized display, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N displays 1203, where N is a positive integer greater than 1.
[0128] The display screen 1203 of the electronic device can display a series of graphical user interfaces (GUIs), which serve as the main screen of the electronic device. Generally, the size of the display screen 1203 is fixed, and only a limited number of controls can be displayed on it. A control is a GUI element, a software component contained within an application, that controls all the data processed by the application and the interactive operations related to that data. Users can interact with controls through direct manipulation, thereby reading or editing information related to the application. Generally, controls can include visual interface elements such as icons, widgets, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0129] Touch sensor 1202A, also known as a "touch device," can be disposed on display screen 1203. The touch sensor 1202A and display screen 1203 together form a touchscreen, also known as a "touchscreen." Touch sensor 1202A is used to detect 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 1203. In other embodiments, touch sensor 1202A may also be disposed on the surface of the electronic device, in a different location than display screen 1203.
[0130] The gyroscope sensor 1202B can be used to determine the motion attitude of an electronic device. In some embodiments, the gyroscope sensor 1202B can determine the angular velocity of the electronic device around three axes (i.e., the x, y, and z axes). The gyroscope sensor 1202B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 1202B detects the angle of the electronic device's shake, 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 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 1202B can also be used in navigation and motion-sensing gaming scenarios.
[0131] The 1202C accelerometer sensor can detect the magnitude of acceleration in various directions (typically three axes) of an electronic device. When the electronic device is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices, and is applicable to screen orientation switching, pedometers, and other applications.
[0132] The 1202D ambient light sensor is used to detect ambient light levels. Electronic devices can adaptively adjust the brightness of their displays based on the detected ambient light. The 1202D ambient light sensor can also be used to automatically adjust white balance when taking photos. The 1202D ambient light sensor also detects whether an electronic device is in a pocket to prevent accidental touches.
[0133] The software architecture of this application is described below. The software architecture of the electronic device of this application can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses a layered architecture Android system as an example for illustrative purposes. As shown in Figure 13:
[0134] As shown in Figure 13, the software architecture of the electronic device of this application can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example for illustrative purposes.
[0135] A layered architecture divides 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 five layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system libraries, and the kernel layer.
[0136] The application layer may include a series of application packages. For example, it may include camera, gallery, calendar, calling, map, navigation, WLAN, Bluetooth, music, video, SMS, etc.
[0137] The application framework layer provides applications with an application programming interface (API) and a programming framework. The application framework layer includes some predefined functions. In this embodiment, the application framework may include a view system and a display system Android Interface Definition Language (AIDL) interface, as well as an Activity Recognition Management Service (ARMS).
[0138] 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 for setting up an application may include views for displaying text and views for displaying images.
[0139] The application layer and framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and 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.
[0140] The kernel layer is the layer between hardware and software. The kernel layer provided in this application embodiment includes a display driver, an audio driver, and a sensor driver.
[0141] The technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.
[0142] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for preventing accidental touch detection, characterized in that, include: When the electronic device meets the preset detection conditions, the ambient light intensity in the environment in which the electronic device is located is determined; The ambient light entry threshold for the pocket anti-accidental touch scenario is determined based on the light intensity, and the ambient light entry threshold is greater than the light intensity. Pocket accidental touch detection is performed using the determined ambient light entry threshold.
2. The method according to claim 1, characterized in that, The step of determining the ambient light entry threshold in the pocket anti-accidental touch scenario based on the light intensity includes: The ambient light entry threshold is determined based on the sum of the light intensity and the first fixed increment, or based on the product of the light intensity and the first increment coefficient, or based on the difference between the light intensity and the second fixed increment, or based on the ratio of the light intensity and the second increment coefficient, wherein the first fixed increment is greater than 0, the first increment coefficient is greater than 1, the second fixed increment is less than 0, and the second increment coefficient is less than 1.
3. The method according to claim 1, characterized in that, Determining the ambient light intensity in the environment where the electronic device is located includes: Obtain the channel values from the ambient light sensor; The ambient light intensity in the environment where the electronic device is located is determined based on the channel value and the fitting formula. The fitting formula is obtained by fitting the channel value of the ambient light sensor and the light intensity measured by the ambient light sensor in each test scenario when the electronic device is in a test scene and undergoes multiple tests. The test scenario is a scenario that reflects the brightness of the screen of the electronic device and the electronic device is in a bright screen state.
4. The method according to claim 3, characterized in that, The test scenario is a white bag, and the side of the white bag that contacts the test electronic device is made of a glossy material. The acquisition of the channel values of the ambient light sensor includes: acquiring the C channel value of the ambient light sensor. The step of determining the ambient light intensity in the environment where the electronic device is located based on the channel value and the fitting formula includes: The ambient light intensity in the environment where the electronic device is located is determined based on the C-channel value and the first fitting formula. The first fitting formula is obtained by fitting the C-channel value of the ambient light sensor and the light intensity measured by the ambient light sensor in each test scenario where the electronic device is in a white pocket and undergoes multiple tests. The pixels in the screen area of the electronic device are white pixels.
5. The method according to claim 3, characterized in that, The test scenario is a white bag, and the side of the white bag that contacts the test electronic device is made of a glossy material. The acquisition of the channel values of the ambient light sensor includes: acquiring the R channel value, G channel value, B channel value, and C channel value of the ambient light sensor. The step of determining the ambient light intensity in the environment where the electronic device is located based on the channel value and the fitting formula includes: The ambient light intensity in the environment where the electronic device is located is determined based on the R channel value, G channel value, B channel value, C channel value, and the second fitting formula. The second fitting formula is obtained by fitting the ambient light intensity measured by the ambient light sensor with the R channel value, G channel value, B channel value, C channel value, and ambient light intensity obtained in each test, after multiple tests in a scenario where the electronic device is in a white pocket. The pixels in the screen area of the electronic device are white pixels.
6. The method according to claim 3, characterized in that, The test scenario is a white bag, and the side of the white bag that contacts the test electronic device is made of a glossy material. The acquisition of the channel values of the ambient light sensor includes: acquiring the R channel value, G channel value, and B channel value of the ambient light sensor. The step of determining the ambient light intensity in the environment where the electronic device is located based on the channel value and the fitting formula includes: The ambient light intensity in the environment where the electronic device is located is determined based on the R channel value, G channel value, B channel value and the third fitting formula. The second fitting formula is obtained by fitting the R channel value, G channel value, B channel value and the light intensity measured by the ambient light sensor in each test scenario where the electronic device is in a white pocket for multiple tests. The pixels in the screen area of the electronic device are white pixels.
7. The method according to claim 1, characterized in that, Determining the ambient light intensity in the environment where the electronic device is located includes: Obtain the C channel value from the ambient light sensor; The ambient light intensity in the environment where the electronic device is located is determined based on the C-channel value and the fourth fitting formula. The fourth fitting formula is obtained by fitting the C-channel value of the ambient light sensor and the light intensity measured by the ambient light sensor in each test scenario where the display screen of the electronic device is covered with white reflective material. The pixels in the screen area of the electronic device are white pixels.
8. The method according to any one of claims 1-7, characterized in that, When the electronic device meets the preset detection conditions, determining the ambient light intensity in the environment where the electronic device is located includes: When the electronic device is in a locked state, the touch panel detection value of the electronic device meets the large object detection threshold of the touch screen, and the electronic device is in a head-down state, determine the ambient light intensity in the environment where the electronic device is located. When the electronic device is in an unlocked state, the touch panel detection value of the electronic device meets the large object detection threshold of the touch screen, the electronic device is in an upside-down state, and the electronic device is in motion, the ambient light intensity in the environment where the electronic device is located is determined.
9. The method according to any one of claims 1-8, characterized in that, The method of using the ambient light entry threshold for pocket accidental touch detection includes: When the electronic device is in a locked state, the touch panel detection value of the electronic device meets the large object detection threshold of the touch screen, the electronic device is in a head-down state, and the light intensity is less than the ambient light entry threshold, an anti-accidental touch interface is presented. When the electronic device is in an unlocked state, the touch panel detection value of the electronic device meets the large object detection threshold of the touch screen, the electronic device is in an upside-down state, the electronic device is in motion, and the light intensity is less than the ambient light entry threshold, an anti-accidental touch interface is displayed.
10. An electronic device, characterized in that, include: Processor and memory; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1-9.
11. A computer storage medium, characterized in that, Used to store computer instructions, which, when executed on an electronic device, perform the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Parameter configuration method and related product
CN107566161A
Terminal-mistaken-touch preventing method and device
CN107786743A
Control method of proximity light sensor and electronic equipment
CN109547629A
Method for preventing mistaken touch and electronic equipment
CN114070928A
Devices and Methods for Adjusting the Provision of Notifications
US20190342447A1