Light sensor shading detection method, device and electronic equipment
By detecting illuminance values in different wavelength bands using a light sensor, the problem of misjudgment caused by the light sensor being blocked by a finger is solved, ensuring accurate adjustment of the display backlight brightness and realizing finger occlusion detection of the light sensor.
Patent Information
- Application Number
- CN202311135542.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-09-04
AI Technical Summary
Because the secondary display screen is small, users' fingers can easily block the light sensor, causing the terminal to misjudge that the ambient light has darkened, thus incorrectly reducing the backlight brightness of the secondary display screen. Existing technology cannot detect whether the light sensor is blocked by a finger.
The system detects ambient light using a light sensor, obtains illuminance values for different wavelengths, and determines whether the first and second illuminance values meet preset conditions when the ambient light intensity detected by the light sensor decreases, in order to determine whether the light sensor is blocked by a finger.
It enables finger occlusion detection of the light sensor, avoiding false judgments caused by the light sensor being blocked by a finger, and ensuring accurate adjustment of the display backlight brightness.
Smart Images

Figure CN117215435B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic equipment, and specifically relates to a method, apparatus and electronic equipment for detecting occlusion of a light sensor. Background Technology
[0002] With the development of mobile terminals, foldable terminals have emerged. Foldable terminals can reduce their size by folding vertically or horizontally. To facilitate user operation when the terminal is folded, a secondary display screen is provided on the back cover. Users can perform operations on the secondary display screen, which will then display the information triggered by the operation.
[0003] Because the area of one back cover of a folded terminal is limited, the secondary display screen is typically small. To ensure the backlight brightness of the display changes according to the ambient light level, a light sensor is usually placed near the display screen. This light sensor detects the ambient light around the display screen, allowing the terminal to adjust the backlight brightness accordingly. A similar light sensor is also located near the secondary display screen.
[0004] However, due to the small size of the secondary display screen, when users operate on it, their fingers can easily block the detection end of the light sensor. This causes the terminal to mistakenly judge that the ambient light has darkened, thus incorrectly reducing the backlight brightness of the secondary display screen. Currently, it is impossible to detect whether the light sensor is blocked by a finger. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, and electronic device for detecting occlusion of a light sensor, which can solve the problem of not being able to determine whether the light sensor detects a dimming of ambient light because the light sensor is being blocked by a finger.
[0006] In a first aspect, embodiments of this application provide an occlusion detection method for a light sensor, applied to an electronic device, the electronic device including a light sensor, the method comprising: The ambient light is detected by the light sensor, and a first illuminance value of the first band and a second illuminance value of the second band are obtained. The wavelength ranges of the first band and the second band are different. When the ambient light intensity detected by the light sensor decreases, and when the first illuminance value and the second illuminance value meet preset conditions, it is determined that the light sensor is blocked by a finger.
[0007] Secondly, embodiments of this application provide an occlusion detection device for a light sensor, applied to an electronic device, the electronic device including a light sensor, and the device comprising: The acquisition module is used to detect ambient light through the light sensor and acquire a first illuminance value of a first band and a second illuminance value of a second band, wherein the wavelength ranges of the first band and the second band are different. The determination module is used to determine that the light sensor is blocked by a finger when the ambient light intensity detected by the light sensor decreases and when the first illuminance value and the second illuminance value meet preset conditions.
[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of any of the methods described in the first aspect.
[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in any of the first aspects.
[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in any of the first aspects.
[0011] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in any of the first aspects.
[0012] In this embodiment of the application, after the first illuminance value of the first band and the second illuminance value of the second band of ambient light are obtained by the light sensor of the electronic device, when the ambient light intensity detected by the light sensor decreases, it is determined whether the first illuminance value and the second illuminance value meet the preset conditions. If the first illuminance value and the second intensity value meet the preset conditions, it is determined that the light sensor is blocked by a finger, thereby realizing the detection of finger occlusion of the light sensor, and thus avoiding the problem that the electronic device mistakenly judges that the ambient light has darkened and thus erroneously reduces the backlight brightness of the display screen due to the light sensor being blocked by a finger. Attached Figure Description
[0013] Figure 1 This is one of the block diagrams of the electronic device provided in the embodiments of this application; Figure 2 This is a second block diagram of the electronic device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of an optical sensor provided in an embodiment of this application; Figure 4This is a schematic diagram of the spectral sensitivity variation curve of a light sensor provided in an embodiment of this application; Figure 5 This is a graph showing the change in finger transmittance provided in an embodiment of this application.
[0014] Figure 6 This is one of the flowcharts of the occlusion detection method for a light sensor provided in the embodiments of this application; Figure 7 This is the second flowchart of the occlusion detection method for the optical sensor provided in the embodiments of this application; Figure 8 This is the third flowchart of the occlusion detection method for the optical sensor provided in the embodiments of this application; Figure 9 This is the fourth flowchart of the occlusion detection method for the optical sensor provided in the embodiments of this application; Figure 10 This is the fifth flowchart of the occlusion detection method for the optical sensor provided in the embodiments of this application; Figure 11 This is the sixth flowchart of the occlusion detection method for the optical sensor provided in the embodiments of this application; Figure 12 This is a block diagram of an occlusion detection device for a light sensor provided in an embodiment of this application; Figure 13 This is a block diagram of an electronic device provided in an embodiment of this application; Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0015] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0016] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0017] The occlusion detection method, apparatus, and device of the optical sensor provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0018] Please refer to Figure 1 This illustrates a block diagram of an electronic device provided in an embodiment of this application. Figure 1 As shown, the electronic device 100 includes a light sensor 102 and a processor 103. The light sensor 102, also known as an ambient light sensor or color temperature sensor, is used to detect the ambient light intensity around the electronic device and output illuminance data. Illuminance intensity is abbreviated as light strength. The illuminance data includes at least a first illuminance value for a first wavelength band and a second illuminance value for a second wavelength band, the first and second wavelength bands having different wavelength ranges. The processor 103 is connected to the light sensor 102. The processor 103 is used to detect whether the light sensor is blocked by a finger based on the illuminance data output by the light sensor 102. Optionally, the electronic device 100 can be a mobile phone, computer, tablet, wearable device, etc.
[0019] Optionally, the electronic device 100 further includes a display screen 101, with a light sensor 102 disposed near the display screen 101 for detecting the ambient light intensity around the display screen 101. A processor 103 is also connected to the display screen 101 and is used to adjust the backlight brightness of the display screen 101 based on the illuminance data output by the light sensor 102. For example, the processor 103 can reduce the backlight brightness of the display screen 101 when it determines that the ambient light is decreasing and the light sensor is not blocked by a finger, based on the illuminance data from the light sensor. Conversely, the processor 103 can increase the backlight brightness of the display screen 101 when it determines that the ambient light is increasing, based on the illuminance data from the light sensor. The processor 103 can also maintain the backlight brightness of the display screen 101 when it determines that the ambient light is decreasing and the light sensor is blocked by a finger, based on the illuminance data from the light sensor.
[0020] In an alternative case, such as Figure 2 As shown, the electronic device 100 includes two displays: a first display screen 1011 and a second display screen 1012. The first display screen 1011 is also referred to as the first screen module or the main display screen. The second display screen 1012 is also referred to as the second screen module or the secondary display screen, and it is mounted on the back panel of the electronic device.
[0021] The electronic device 100 further includes a first light sensor 1021 and a second light sensor 1022. The first light sensor 1021 is disposed near the first display screen 1011 and is used to detect the ambient light intensity around the first display screen 1011 and output illuminance data. The second light sensor 1022 is disposed near the second display screen 1012 and is used to detect the ambient light intensity around the second display screen 1012 and output illuminance data. In an optional application scenario, the first display screen 1011 typically operates in the unfolded state of the electronic device, in which case the first light sensor 1021 can be used to detect the ambient light intensity around the first display screen in the unfolded state. The second display screen 1012 typically operates in the folded state of the electronic device, in which case the second light sensor 1022 can be used to detect the ambient light intensity around the second display screen in the folded state.
[0022] Optionally, such as Figure 2 As shown, the electronic device 100 also includes: a memory 104, a clock module 105, a power module 106, a battery 107, a first display processing module 1081, a first display driving module 1091, a second display processing module 1082, and a second display driving module 1092.
[0023] The processor 103 serves as the data processing, computation, and control center for the electronic device. The processor 103 can execute the occlusion detection method for the light sensor provided in this embodiment. The memory 104 stores programs or instructions that can run on the processor, as well as various types of data generated during the operation of the electronic device. The clock module 105 provides the system clock signal required for the operation of the electronic device. The power module 106 converts the input voltage provided by the battery into the required output voltage to power subsequent devices. The battery 107 stores the electrical energy required by the electronic device to power its various components.
[0024] The first display processing module 1081 processes the data stream of each frame of the first display screen, the data stream containing color information and backlight brightness of each frame. The first display driving module 1091 converts the data stream of each frame into hardware control signals and outputs them to the first display screen 1011. The first display screen 1011 adjusts the backlight brightness and displays the image according to the received hardware control signals.
[0025] The second display processing module 1082 processes the data stream of each frame of the second display screen, the data stream containing color information and backlight brightness of each frame. The second display driving module 1092 converts the data stream of each frame into hardware control signals and outputs them to the second display screen 1012. The second display screen 1012 adjusts the backlight brightness and displays the image according to the received hardware control signals.
[0026] Optionally, such as Figure 3 As shown, the light sensor 102 includes: multiple photodetectors 301, a channel value register 302, and a processor. Each photodetector 301 converts a received light signal into an electrical signal and transmits it to the processor. The processor processes the received electrical signal to obtain ambient light illuminance data and transmits the illuminance data to the channel value register 302. The light sensor 102 outputs the illuminance data stored in the channel value register 302.
[0027] The multiple photodetectors 301 can be divided into multiple groups of photodetectors. Each group of photodetectors may include one or more photodetectors. Each group of photodetectors has different spectral sensitivities to light of different wavelengths, so as to receive incident light in different wavelength ranges, convert the received optical signals into electrical signals, and transmit the electrical signals to the processor. Accordingly, the illuminance data generated by the processor by receiving the electrical signals includes: the illuminance value of the corresponding wavelength band received by each group of photodetectors.
[0028] Correspondingly, there are multiple connection paths between the processor and the channel value register 302. Each connection path corresponds one-to-one with a photodetector group, and each connection path is used by the processor to transmit one channel data to the channel value register 302, so that the processor can transmit multiple channel data (Channel Xn) to the channel value register 302. Each channel data is the illuminance value of the photodetector group corresponding to the connection path generated by the processor. It is easy to understand that the multiple channel data are illuminance values of multiple different wavelength bands.
[0029] Wherein, each channel data Channel Xn satisfies: ; This represents the photocurrent conversion coefficient. Indicating the optical sensor for Spectral sensitivity of light at a given wavelength. express The incident light power of light of a given wavelength.
[0030] For example, the light sensor includes seven sets of photodetectors. These seven sets of photodetectors include: a visible light detector, a red light detector, a green light detector, a blue light detector, an ultra-wideband light detector, a flicker light detector, and an infrared (IR / PROX) light detector. The visible light detector, red light detector, green light detector, blue light detector, ultra-wideband light detector, and flicker light detector sequentially output seven channels of data to the processor: C (visible light) channel data, R (red light) channel data, G (green light) channel data, B (blue light) channel data, W (ultra-wideband light) channel data, F (flicker light) channel data, and infrared light channel data.
[0031] Please refer to Figure 4 The diagram illustrates the spectral sensitivity variation curve of a light sensor provided in an embodiment of this application. The horizontal axis of the spectral sensitivity variation curve represents wavelength, and the vertical axis represents spectral sensitivity. For example... Figure 4 As shown, it displays the spectral sensitivity variation curves of 7 groups of photodetectors in the wavelength range of 300-1100 nanometers (nm).
[0032] The spectral sensitivity curve of the visible light detector shows that it has high spectral sensitivity to light in the wavelength range of 400-700 nm, making it suitable for receiving incident light in this range. Correspondingly, the C-channel data represents the illuminance values in the 400-700 nm wavelength range.
[0033] The spectral sensitivity curve of the red light detector shows that it has high spectral sensitivity to light in the wavelength range of 560-700 nm, making it suitable for receiving incident light in this range. Correspondingly, the R-channel data represents the illuminance values in the 560-700 nm wavelength range.
[0034] The spectral sensitivity curve of the green light detector shows that it has high spectral sensitivity to light in the wavelength range of 450-650 nm, making it suitable for receiving incident light in this range. Correspondingly, the G-channel data represents the illuminance values in the 450-650 nm wavelength range.
[0035] The spectral sensitivity curve of the blue light detector shows that it has high spectral sensitivity to light in the wavelength range of 400-560 nm, making it suitable for receiving incident light in this range. Correspondingly, the B-channel data represents the illuminance values in the 400-560 nm wavelength range.
[0036] The spectral sensitivity variation curves of the ultra-wideband optical detector show that it has high spectral sensitivity to light in the wavelength range of 300-1100 nm, making it suitable for receiving incident light in this range. Correspondingly, the W-channel data represents the illuminance values in the 300-1100 nm wavelength range.
[0037] When a light sensor is blocked by a finger, the finger blocks certain wavelengths of light to varying degrees, reducing the illuminance of those wavelengths after they pass through the finger. In other words, the illuminance of some wavelengths before passing through the finger is greater than the illuminance after passing through the finger. Based on this, a finger has a blocking wavelength band. When the light sensor is blocked by a finger, the sensor detects that the illuminance of the blocked wavelength band is less than an illuminance threshold.
[0038] In one possible scenario, if the illuminance threshold is 0, or a value close to 0, the finger almost completely blocks light within the blocked wavelength range, making it virtually impossible for light within that range to penetrate the finger. In other words, the transmittance of the finger through the blocked wavelength range is almost zero. Finger transmittance refers to the percentage of luminous flux passing through the finger relative to the incident luminous flux. For an example, please refer to... Figure 5 This displays the transmittance spectrum of a finger, specifically a graph showing the variation in the finger's transmittance. The horizontal axis of the transmittance curve represents wavelength, and the vertical axis represents transmittance. For example... Figure 5 As shown, the transmittance of light with wavelengths in the 400-600nm range through a finger is almost zero, meaning that light in this range can hardly penetrate the finger. The transmittance in the 600-1000nm range shows a step-like change compared to the 400-600nm range. Therefore, the wavelength range blocked by a finger can be 400-600nm.
[0039] Therefore, when the light sensor is blocked by a finger, even under the same unblocked environment, the illuminance values of each wavelength of light detected will change. Correspondingly, the data output by each channel of the light sensor will also change. Specifically, when the light sensor is blocked by a finger, the data output by each channel (Channel Xn') satisfies: ; Indicates the obstruction is aimed at The transmittance of light at a given wavelength.
[0040] Furthermore, since each group of photoelectric sensors can receive light in different wavelengths, the changes in the channel data corresponding to each group of photoelectric sensors differ before and after the light sensor is blocked by a finger; that is, the changes in illuminance values detected by the light sensor in different wavelength bands are different.
[0041] For example, take the aforementioned optical sensor as an example. Among the seven photodetectors in the optical sensor, the visible light detector can receive incident light in the wavelength range of 400-1100nm, the red light detector can receive incident light in the wavelength range of 560-700nm, the green light detector can receive incident light in the wavelength range of 450-650nm, the blue light detector can receive incident light in the wavelength range of 400-560nm, and the ultra-wideband optical detector can receive incident light in the wavelength range of 300-1100nm.
[0042] When the light sensor is not obstructed, the R channel data Channel X1 of the light sensor satisfies: ChannelX1 = The G-channel data Channel X2 satisfies: ChannelX2 = Channel X3 of the B channel data satisfies: Channel X3 = Channel X4 data in channel C satisfies: Channel X4 = The W channel data Channel X5 satisfies: Channel X5 = .
[0043] in, to The values represent the photocurrent conversion coefficients corresponding to the R-channel data, G-channel data, B-channel data, C-channel data, and W-channel data, respectively. to The optical sensors are sequentially represented for... Spectral sensitivity of light at a given wavelength.
[0044] When the light sensor is blocked by a finger, if the blocked wavelength is 400-600nm, then the R channel data of the light sensor, Channel X1', becomes: Channel X1' = = The G channel data Channel X2' becomes: Channel X2' = The data for channel B, Channel X3', becomes: Channel X3' = The C channel data Channel X4' becomes: Channel X4' = = ≈ Channel X1'. The data for channel W, Channel X5', becomes: Channel X5' = .
[0045] Based on the changes in data from each channel of the optical sensor before and after it was blocked by a finger, it can be observed that compared to the unblocked state, the values of the R, G, B, C, and W channels all decrease after the optical sensor is blocked by a finger. Among them, the R and C channels show a significant decrease, while the B channel value almost drops to zero.
[0046] Based on this, the change in illuminance values across multiple different wavelengths detected by the light sensor can be used to determine whether the light sensor is blocked by a finger.
[0047] Please refer to Figure 6 The diagram illustrates a flowchart of an occlusion detection method for a light sensor according to an embodiment of this application. This occlusion detection method for a light sensor can be applied to… Figure 1 or Figure 2 The illustrated electronic device. Optionally, the occlusion detection method of the light sensor can be executed by a processor in the electronic device. For example... Figure 6 As shown, the occlusion detection method for the optical sensor includes: Step 601: Detect ambient light using a light sensor to obtain the first illuminance value of the first band and the second illuminance value of the second band. The wavelength ranges of the first band and the second band are different.
[0048] Optionally, the light sensor can detect ambient light in real time or periodically to output a first illuminance value in a first band and a second illuminance value in a second band of the ambient light. The processor can acquire the first and second illuminance values output by the light sensor in real time or periodically.
[0049] The first and second bands have different wavelength ranges. Optionally, the first and second bands can be the wavelengths of incident light that can be received by any two different sets of photodetectors in the optical sensor. Correspondingly, the first and second illuminance values are two channel data outputs from the optical sensor.
[0050] In one alternative implementation, the minimum value of the first band is less than the minimum value of the finger-occluded band, and the maximum value of the first band is greater than the maximum value of the finger-occluded band. The second band overlaps with the finger-occluded band. That is, the first band includes the finger-occluded band, and the second band overlaps with the finger-occluded band at least partially.
[0051] Because the illuminance values of all wavelengths decrease when the light sensor is blocked by a finger, and when the ambient light around the electronic device dims, the change in data for each channel is related to the proportion of overlapping wavelengths within the corresponding wavelength range of the channel data. Overlapping wavelengths are at least a portion of the wavelength range that overlaps with the wavelength range blocked by the finger. For example, the wavelength range corresponding to channel G data is 450-650nm, and the wavelength range corresponding to channel B data is 400-560nm. The wavelength range blocked by the finger is 400-600nm. Since the overlapping wavelength range between channel G data and the finger-blocked wavelength range is 450-600nm, and the overlapping wavelength range between channel B data and the finger-blocked wavelength range is 400-560nm, the proportion of overlapping wavelengths within the wavelength range corresponding to channel G data is less than the proportion within the wavelength range corresponding to channel B data. In other words, the impact of finger blocking on channel G data is less than its impact on channel B data. Therefore, before and after the light sensor is blocked by a finger, the decrease in G channel data is less than the change in B channel data.
[0052] If the ambient darkness around the electronic device causes a decrease in data across all channels of the optical sensor, the degree of data reduction is similar for each channel. Therefore, selecting a first band with a wavelength range greater than the finger-occlusion band, and a second band whose wavelength range at least partially overlaps with the finger-occlusion band, ensures that the accuracy of the optical sensor's finger occlusion detection can be accurately determined by subsequently analyzing changes in the first illuminance value of the first band and the second illuminance value of the second band.
[0053] For example, the first band can be any candidate band from multiple candidate bands of the optical sensor that meets the first band condition. The candidate bands are the bands of incident light that each group of photodetectors within the optical sensor can receive. The first band condition is: the minimum value of the band is less than the minimum value of the band blocked by a finger, and the maximum value of the band is greater than the maximum value of the band blocked by a finger. Accordingly, the electronic device obtains the first illuminance value by acquiring the channel data corresponding to the first band.
[0054] Similarly, the second band can be any candidate band from among multiple candidate bands corresponding to the light sensor that meets the second band condition. The second band condition is that the band overlaps with the band blocked by the finger. Accordingly, the electronic device obtains the second illuminance value by acquiring the channel data corresponding to the second band.
[0055] Optionally, the second band can be a band from among multiple candidate bands corresponding to the light sensor whose overlapping wavelength range with the finger-occluded band is greater than a range threshold. Thus, the greater the overlap with the finger-occluded band, the greater the change in illuminance value of the light sensor before and after being occluded by the finger. Therefore, selecting a second band with a large overlap with the finger-occluded band allows the light sensor to detect the second illuminance value of the second band that is significantly affected by finger occlusion, ensuring the accuracy of subsequent judgments regarding finger occlusion of the light sensor based on the second illuminance value.
[0056] Specifically, taking the aforementioned optical sensor as an example, among the seven photodetectors of the optical sensor, the candidate wavelength band for the visible light detector is 400-700nm, the candidate wavelength band for the red light detector is 560-700nm, the candidate wavelength band for the green light detector is 450-650nm, the candidate wavelength band for the blue light detector is 400-560nm, and the candidate wavelength band for the ultra-wideband optical detector is 300-1100nm. The first wavelength band can be 300-1100nm, the second wavelength band can be 450-650nm, and / or 400-560nm.
[0057] Step 602: When the ambient light intensity detected by the light sensor decreases, and when the first illuminance value and the second illuminance value meet the preset conditions, it is determined that the light sensor is blocked by a finger.
[0058] In this embodiment, the preset conditions can be used to reflect the changes in the first and second illuminance values detected by the light sensor before and after the light sensor is blocked by a finger. Optionally, the electronic device can determine whether the first and second illuminance values meet the preset conditions when the ambient light intensity detected by the light sensor decreases, so that if the first and second illuminance values meet the preset conditions, it is determined that the light sensor is blocked by a finger. Optionally, if the first and second illuminance values do not meet the preset conditions, the electronic device determines that the light sensor is not blocked by a finger.
[0059] In one optional implementation, after acquiring a first illuminance value and a second illuminance value, the electronic device can compare the first illuminance value with a historical first illuminance value, and / or compare the second illuminance value with a historical second illuminance value, to determine that the ambient light intensity detected by the light sensor has decreased if the first illuminance value is less than the historical first illuminance value, and / or the second illuminance value is less than the historical second illuminance value. Here, the historical first illuminance value is the first illuminance value previously acquired by the electronic device. The historical second illuminance value is the second illuminance value previously acquired by the electronic device.
[0060] In another alternative implementation, since there may be discrepancies between the ambient light detected by the light sensor and the actual ambient light around the display screen, an illuminance factor can be used to calculate the actual illuminance value of the ambient light based on the illuminance value of the fifth band detected by the light sensor. This allows for the determination that the ambient light around the electronic device has dimmed, thus confirming a decrease in the intensity of the ambient light detected by the light sensor. The illuminance factor reflects the degree of difference between the actual illuminance value of the ambient light and the illuminance value detected by the light sensor. Optionally, the illuminance factor reflects the ratio of the actual illuminance value of the ambient light to the illuminance value detected by the light sensor. The fifth band can be any band of light that can be received by any set of photodetectors in the light sensor. Optionally, the fifth band can be the band corresponding to a visible light detector, specifically the 400nm-700nm band.
[0061] Optionally, the reduction in ambient light intensity detected by the light sensor may include: the product of the illuminance value of the fifth band and the illuminance factor being less than a third threshold. The third threshold is less than the product of the illuminance value of the fifth band and the illuminance factor when the light sensor is not obstructed.
[0062] Thus, since the product of the illuminance value of the fifth band and the illuminance factor can represent the actual illuminance value of the ambient light, if the product of the illuminance value of the fifth band and the illuminance factor is less than the product of the illuminance value of the fifth band and the illuminance factor when the light sensor is not blocked, it can be accurately determined that the ambient light around the electronic device has darkened, thereby determining the dimming of the ambient light detected by the light sensor.
[0063] In some embodiments of this application, when the minimum value of the first band is less than the minimum value of the finger-blocking band, the maximum value of the first band is greater than the maximum value of the finger-blocking band, and the second band overlaps with the finger-blocking band, satisfying the preset conditions for the first illuminance value and the second illuminance value may include: The ratio of the first illuminance value to the second illuminance value is greater than a first proportional threshold. The first proportional threshold is greater than the ratio of the illuminance value of the first band to the illuminance value of the second band when the light sensor is not blocked.
[0064] Because the overlap between the first band and the finger-occluded band in the first band is less than the overlap between the second band and the finger-occluded band in the second band, the decrease in the first illuminance value is less than the decrease in the second illuminance value before and after the light sensor is occluded by the finger. Therefore, if the ratio of the first illuminance value to the second illuminance value is greater than a first proportional threshold, it can be determined that the light sensor is occluded by the finger. Optionally, the first proportional threshold is x + 0.1, x + 0.2, or x + 0.25, where x is the ratio of the illuminance value of the first band to the illuminance value of the second band when the light sensor is not occluded.
[0065] For example, the first wavelength band is 300nm-1100nm. In the case of the second wavelength band being 450nm-650nm, the first proportional threshold is the first threshold value. Taking the aforementioned optical sensor as an example, the first illuminance value and the second illuminance value satisfying preset conditions may include: Channel X5' / Channel X2' > α. α > Channel X5 / Channel X2.
[0066] In the second wavelength band of 400nm-560nm, the first proportional threshold is the second threshold. Taking the aforementioned optical sensor as an example, the first illuminance value and the second illuminance value satisfying the preset conditions may include: Channel X5' / Channel X3' > β. β > Channel X5 / Channel X3.
[0067] When the second wavelength band includes 450nm-650nm and 400nm-560nm, the ratio of the first illuminance value to the second illuminance value is greater than a first proportional threshold, including: the ratio of the first illuminance value to the second illuminance value in the 450nm-650nm wavelength band is greater than the first threshold, and the ratio of the first illuminance value to the second illuminance value in the 400nm-560nm wavelength band is greater than a second threshold. Taking the aforementioned optical sensor as an example, the first illuminance value and the second illuminance value satisfying preset conditions may include: Channel X5' / Channel X2' > α, and Channel X5' / Channel X3' > β.
[0068] In some embodiments of this application, when the ambient light intensity detected by the light sensor decreases, if it is determined that the light sensor is blocked by a finger, the backlight brightness of the display screen can be maintained. If it is determined that the light sensor is not blocked by a finger, the backlight brightness of the display screen can be reduced. In this way, the problem of the electronic device mistakenly judging that the ambient light has darkened and thus erroneously reducing the backlight brightness of the display screen due to the light sensor being blocked by a finger can be solved.
[0069] In summary, the occlusion detection method for a light sensor provided in this application, after obtaining the first illuminance value of the first band and the second illuminance value of the second band of ambient light through the light sensor of the electronic device, when the ambient light intensity detected by the light sensor decreases, determines whether the first intensity value and the second intensity value meet preset conditions. If the first intensity value and the second intensity value meet the preset conditions, it determines that the light sensor is occluded by a finger, thereby realizing finger occlusion detection of the light sensor and avoiding the problem that the electronic device mistakenly judges that the ambient light has darkened and thus erroneously reduces the backlight brightness of the display screen due to the light sensor being occluded by a finger.
[0070] Please refer to Figure 7The diagram illustrates a flowchart of an occlusion detection method for a light sensor according to an embodiment of this application. This occlusion detection method for a light sensor can be applied to… Figure 1 or Figure 2 The illustrated electronic device. Optionally, the occlusion detection method of the light sensor can be executed by a processor in the electronic device. For example... Figure 7 As shown, the occlusion detection method for the optical sensor includes: Step 701: Detect ambient light using a light sensor to obtain the first illuminance value of the first band, the second illuminance value of the second band, the third illuminance value of the third band, and the fourth illuminance value of the fourth band. The wavelength ranges of the first, second, third, and fourth bands are all different.
[0071] The explanation and implementation of this step can be found in the explanation and implementation of step 601 above, and will not be repeated in this embodiment. It should be noted that, optionally, the first to fourth bands can be the bands of incident light that can be received by any four different photodetectors in the optical sensor. Correspondingly, the first to fourth illuminance values are the four channel data output by the optical sensor.
[0072] In one alternative implementation, the non-overlapping bands of the third band and the finger-blocking band are the same as the non-overlapping bands of the fourth band and the finger-blocking band.
[0073] Optionally, the third and fourth bands can be two candidate bands from multiple candidate bands of the optical sensor that satisfy the conditions for the third and fourth bands. The conditions for the third and fourth bands are: two bands that are the same as the non-overlapping bands of the finger occlusion band. Accordingly, the electronic device obtains the third illuminance value by acquiring the channel data corresponding to the third band; and obtains the fourth band by acquiring the channel data corresponding to the fourth band.
[0074] Specifically, taking the aforementioned optical sensor as an example, among the seven photodetectors in the optical sensor, the candidate wavelength range for the visible light detector is 400-700nm, for the red light detector it is 560-700nm, for the green light detector it is 450-650nm, for the blue light detector it is 400-560nm, and for the ultra-wideband optical detector it is 300-1100nm. The third wavelength range can be 400nm-700nm, and the fourth wavelength range can be 560nm-700nm.
[0075] Step 702: When the ambient light intensity detected by the light sensor decreases, and when the first illuminance value, the second illuminance value, the third illuminance value, and the fourth illuminance value meet the preset conditions, it is determined that the light sensor is blocked by a finger.
[0076] In this embodiment, the preset conditions can be used to reflect the changes in the first, second, third, and fourth illuminance values detected by the light sensor before and after it is blocked by a finger. Optionally, the electronic device can determine whether the first, second, third, and fourth illuminance values meet the preset conditions when the ambient light intensity detected by the light sensor decreases, so that if the first, second, third, and fourth illuminance values meet the preset conditions, it is determined that the light sensor is blocked by a finger. Optionally, the electronic device determines that the light sensor is not blocked by a finger if the first and second illuminance values, or the third and fourth illuminance values, do not meet the preset conditions.
[0077] In one optional implementation, the non-overlapping bands of the third band and the finger-occluded band are the same as the non-overlapping bands of the fourth band and the finger-occluded band. In one case, the minimum value of the third band and the minimum value of the fourth band are equal, the maximum value of the third band and the maximum value of the fourth band are not equal, and both are located within the finger-occluded band. In another case, the maximum value of the third band and the maximum value of the fourth band are equal, the minimum value of the third band and the minimum value of the fourth band are not equal, and both are located within the finger-occluded band. Based on this, the third illuminance value and the fourth illuminance value satisfy the preset conditions including: The ratio of the third illuminance value to the fourth illuminance value is less than the second proportional threshold. If the target value of the third band is less than the target value of the fourth band, then the second proportional threshold is less than the ratio of the illuminance value of the third band to the illuminance value of the fourth band when the light sensor is not blocked. If the target value of the third band is greater than the target value of the fourth band, then the second proportional threshold is greater than the ratio of the illuminance value of the third band to the illuminance value of the fourth band when the light sensor is not blocked. Optionally, the second proportional threshold can be 1 or 1.02.
[0078] The target value is an endpoint value that differs between the third and fourth bands. Since the third band and the finger-occluded band are non-overlapping, and the fourth band and the finger-occluded band are the same, when the light sensor is obscured by a finger, the third and fourth illuminance values are approximately the same, and their ratio is approximately 1. When the light sensor is not obscured, if the target value of the third band is less than the target value of the fourth band, the ratio of the illuminance value of the third band to the illuminance value of the fourth band is greater than 1; if the target value of the third band is greater than the target value of the fourth band, the ratio is less than 1. Therefore, when the target value of the third band is less than the target value of the fourth band, the second ratio threshold is less than the ratio of the illuminance value of the third band to the illuminance value of the fourth band when the light sensor is not obscured. When the target value in the third band is greater than the target value in the fourth band, the second proportional threshold is greater than the ratio of the illuminance value in the third band to the illuminance value in the fourth band when the light sensor is not blocked.
[0079] For example, the third band is 400nm-700nm, and the fourth band is 560nm-700nm. Taking the aforementioned optical sensor as an example, the preset conditions for the third and fourth illuminance values to meet the conditions may include: Channel X4' / Channel X1' < γ; γ < Channel X4 / Channel X1; γ ≈ 1.
[0080] In another example, the fourth band is 400nm-700nm, and the third band is 560nm-700nm. Taking the aforementioned optical sensor as an example, the preset conditions for the third and fourth illuminance values to meet the conditions may include: Channel X1' / Channel X4' < γ. γ > Channel X1 / Channel X4. γ ≈ 1.
[0081] Optionally, if the minimum value of the first band is less than the minimum value of the finger-occluded band, the maximum value of the first band is greater than the maximum value of the finger-occluded band, the second band overlaps with the finger-occluded band, and the third band is the same as the non-overlapping band of the finger-occluded band, and the fourth band is the same as the non-overlapping band of the finger-occluded band, then satisfying the preset conditions for the first, second, third, and fourth illuminance values may include: The ratio of the first illuminance value to the second illuminance value is greater than the first proportional threshold, and the ratio of the third illuminance value to the fourth illuminance value is less than the second proportional threshold.
[0082] In some embodiments of this application, when the ambient light intensity detected by the light sensor decreases, if it is determined that the light sensor is blocked by a finger, the backlight brightness of the display screen can be maintained. If it is determined that the light sensor is not blocked by a finger, the backlight brightness of the display screen can be reduced. In this way, the problem of the electronic device mistakenly judging that the ambient light has darkened and thus erroneously reducing the backlight brightness of the display screen due to the light sensor being blocked by a finger can be solved.
[0083] In this embodiment, after the first illuminance value of the first band and the second illuminance value of the second band of ambient light are obtained by the light sensor of the electronic device, when the ambient light intensity detected by the light sensor decreases, it is determined whether the first intensity value and the second intensity value meet the preset conditions. If the first intensity value and the second intensity value meet the preset conditions, it is determined that the light sensor is blocked by a finger, thereby realizing the detection of finger occlusion of the light sensor and avoiding the problem that the electronic device mistakenly judges that the ambient light has darkened and thus erroneously reduces the backlight brightness of the display screen due to the light sensor being blocked by a finger.
[0084] To facilitate understanding, the technical solutions provided in the embodiments of this application will be further illustrated by the following four examples.
[0085] For example, such as Figure 8 As shown, the processor acquires illuminance data detected by the light sensor. The illuminance data includes: illuminance values for the first band, the second band, the third band, the fourth band, and the fifth band. Specifically, the first band is 300nm-1100nm; the second band includes 450nm-650nm and 400nm-560nm; the third band is 400nm-700nm; and both the fourth and fifth bands are 560nm-700nm.
[0086] The processor determines whether the product of the illuminance value of the fifth band and the illuminance factor is less than a third threshold. If not, it adjusts the backlight brightness of the display. If yes, it determines whether the ratio of the illuminance value of the first band to the illuminance value of the band ranging from 450nm to 650nm is greater than a first threshold. If not, it adjusts the backlight brightness of the display. If yes, it determines whether the ratio of the illuminance value of the first band to the illuminance value of the band ranging from 400nm to 560nm is greater than a second threshold. If not, it adjusts the backlight brightness of the display. If yes, it determines whether the ratio of the illuminance value of the third band to the illuminance value of the fourth band is less than a second proportional threshold. If not, it adjusts the backlight brightness of the display. If yes, it maintains the backlight brightness of the display.
[0087] Another example, such as Figure 9As shown, the processor acquires illuminance data detected by the light sensor. The illuminance data includes: illuminance values for the first band, the second band, and the fifth band. Specifically, the first band is 300nm-1100nm; the second band is 450nm-650nm; and the fifth band is 560nm-700nm.
[0088] The processor determines whether the product of the illuminance value of the fifth band and the illuminance factor is less than a third threshold. If not, it adjusts the backlight brightness of the display. If so, it determines whether the ratio of the illuminance value of the first band to the illuminance value of the band ranging from 450nm to 650nm is greater than a first threshold. If not, it adjusts the backlight brightness of the display. If so, it maintains the backlight brightness of the display.
[0089] Another example, such as Figure 10 As shown, the processor acquires illuminance data detected by the light sensor. The illuminance data includes: illuminance values for the first band, the second band, and the fifth band. Specifically, the first band is 300nm-1100nm; the second band is 400nm-560nm; and the fifth band is 560nm-700nm.
[0090] The processor determines whether the product of the illuminance value of the fifth band and the illuminance factor is less than a third threshold. If not, it adjusts the backlight brightness of the display. If yes, it determines whether the ratio of the illuminance value of the first band to the illuminance value of the band ranging from 400nm to 560nm is greater than a second threshold. If not, it adjusts the backlight brightness of the display. If yes, it maintains the backlight brightness of the display.
[0091] Another example, such as Figure 11 As shown, the processor acquires illuminance data detected by the light sensor. The illuminance data includes: illuminance values for the first band, the second band, the third band, the fourth band, and the fifth band. Specifically, the first band is 300nm-1100nm; the second band includes 450nm-650nm and 400nm-560nm; the third band is 400nm-700nm; and both the fourth and fifth bands are 560nm-700nm.
[0092] The processor determines whether the product of the illuminance value of the fifth band and the illuminance factor is less than a third threshold. If not, it adjusts the backlight brightness of the display. If so, it determines whether the ratio of the illuminance value of the third band to the illuminance value of the fourth band is less than a second proportional threshold. If not, it adjusts the backlight brightness of the display. If so, it maintains the backlight brightness of the display.
[0093] In summary, the occlusion detection method for a light sensor provided in this application, after obtaining the first illuminance value of the first band and the second illuminance value of the second band of ambient light through the light sensor of the electronic device, when the ambient light intensity detected by the light sensor decreases, determines whether the first intensity value and the second intensity value meet preset conditions. If the first intensity value and the second intensity value meet the preset conditions, it determines that the light sensor is occluded by a finger, thereby realizing finger occlusion detection of the light sensor and avoiding the problem that the electronic device mistakenly judges that the ambient light has darkened and thus erroneously reduces the backlight brightness of the display screen due to the light sensor being occluded by a finger.
[0094] Please refer to Figure 12 The diagram illustrates a block diagram of an occlusion detection device for a light sensor according to an embodiment of this application. Figure 12 As shown, the occlusion detection device 1200 for the light sensor includes: an acquisition module 1201 and a determination module 1202.
[0095] The acquisition module 1201 is used to detect ambient light through a light sensor and acquire a first illuminance value of a first band and a second illuminance value of a second band, wherein the wavelength ranges of the first band and the second band are different. The determination module 1202 is used to determine that the light sensor is blocked by a finger when the ambient light intensity detected by the light sensor decreases and when the first illuminance value and the second illuminance value meet preset conditions.
[0096] Optionally, the first illuminance value and the second illuminance value satisfy preset conditions, including: The ratio of the first illuminance value to the second illuminance value is greater than the first proportional threshold. The first proportional threshold is greater than the ratio of the illuminance value of the first band to the illuminance value of the second band when the light sensor is not blocked. The minimum value of the first band is less than the minimum value of the finger-blocked band, the maximum value of the first band is greater than the maximum value of the finger-blocked band, and the second band overlaps with the finger-blocked band. When the light sensor is blocked by a finger, the illuminance value of the finger-blocked band detected by the light sensor is less than the illuminance threshold.
[0097] Optionally, the first wavelength band is 300nm-1100nm. When the second wavelength band is 450nm-650nm, the first proportional threshold is the first threshold. When the second wavelength band is 400nm-560nm, the first proportional threshold is the second threshold; When the second band includes 450nm-650nm and 400nm-560nm, the ratio of the first illuminance value to the second illuminance value is greater than the first ratio threshold, including: the ratio of the first illuminance value to the second illuminance value in the band of 450nm-650nm is greater than the first threshold, and the ratio of the first illuminance value to the second illuminance value in the band of 400nm-560nm is greater than the second threshold.
[0098] Optionally, the acquisition module 1201 is also used to acquire the third illuminance value of the third band and the fourth illuminance value of the fourth band, wherein the wavelength ranges of the first band, the second band, the third band and the fourth band are all different; The determination module 1202 is also used to determine that the light sensor is blocked by a finger when the first illuminance value, the second illuminance value, the third illuminance value and the fourth illuminance value meet the preset conditions.
[0099] Optionally, the changes in the third and fourth illuminance values satisfy preset conditions, including: The ratio of the third illuminance value to the fourth illuminance value is less than the second proportional threshold. The second proportional threshold is less than the ratio of the illuminance value of the third band to the illuminance value of the fourth band when the light sensor is not blocked. The non-overlapping bands of the third band and the finger-blocking band are the same as the non-overlapping bands of the fourth band and the finger-blocking band. When the light sensor is blocked by a finger, the illuminance value of the finger-blocking band detected by the light sensor is less than the illuminance threshold.
[0100] Optionally, the third band is 400nm-700nm and the fourth band is 560nm-700nm.
[0101] Optionally, the ambient light intensity detected by the light sensor is reduced, including: the product of the illuminance value of the fifth band and the illuminance factor is less than a third threshold, wherein the third threshold is less than the product of the illuminance value of the fifth band and the illuminance factor when the light sensor is not blocked, and the illuminance factor reflects the degree of difference between the illuminance value of the ambient light detected by the light sensor and the actual illuminance value of the ambient light.
[0102] In this embodiment, after the electronic device obtains the first illuminance value of the first band and the second illuminance value of the second band of ambient light through the light sensor, when the ambient light intensity detected by the light sensor decreases, it determines whether the first illuminance value and the second illuminance value meet a preset condition. If the first illuminance value and the second illuminance value meet the preset condition, it determines that the light sensor is blocked by a finger, thereby realizing the detection of finger occlusion of the light sensor and avoiding the problem that the electronic device mistakenly judges that the ambient light has darkened and thus erroneously reduces the backlight brightness of the display screen due to the light sensor being blocked by a finger.
[0103] The occlusion detection method for a light sensor provided in this application can be executed by a control device of a camera module. This application uses the control device of the camera module executing the occlusion detection method as an example to illustrate the control device of the camera module provided in this application.
[0104] The control device for the camera module in this application embodiment can be a controller of an electronic device, or a component within the controller of an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc., and can also be a personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.
[0105] The control device for the camera module in this embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment does not specifically limit the specific operating system used.
[0106] The control device for the camera module provided in this application embodiment can achieve... Figure 6 to Figure 7 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0107] Optionally, such as Figure 13 As shown, this application embodiment also provides an electronic device 1300, including the camera module, processor 1301 and memory 1302 provided in the foregoing embodiment. The memory 1302 stores a program or instructions that can run on the processor 1301. When the program or instructions are executed by the processor 1301, they implement the various steps of the above-described light sensor occlusion detection method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0108] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0109] Figure 14 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. The electronic device 1400 includes, but is not limited to, components such as: a radio frequency unit 1401, a network module 1402, an audio output unit 1403, an input unit 1404, a sensor 1405, a display unit 1406, a user input unit 1407, an interface unit 1408, a memory 1409, and a processor 1410. The display unit 1406 is a display screen. The electronic device 1400 also includes a light sensor.
[0110] Those skilled in the art will understand that the electronic device 1400 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1410 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 9 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0111] The processor 1410 is configured to detect ambient light through the light sensor and obtain a first illuminance value of a first band and a second illuminance value of a second band, wherein the first band and the second band have different wavelength ranges. It is also used to determine that the light sensor is blocked by a finger when the ambient light intensity detected by the light sensor decreases and when the first illuminance value and the second illuminance value meet preset conditions.
[0112] In this embodiment, after the electronic device obtains the first illuminance value of the first band and the second illuminance value of the second band of ambient light through the light sensor, when the ambient light intensity detected by the light sensor decreases, it determines whether the first illuminance value and the second illuminance value meet a preset condition. If the first illuminance value and the second illuminance value meet the preset condition, it determines that the light sensor is blocked by a finger, thereby realizing the detection of finger occlusion of the light sensor and avoiding the problem that the electronic device mistakenly judges that the ambient light has darkened and thus erroneously reduces the backlight brightness of the display screen due to the light sensor being blocked by a finger.
[0113] Optionally, the first illuminance value and the second illuminance value satisfy preset conditions, including: the ratio of the first illuminance value to the second illuminance value is greater than a first ratio threshold, and the first ratio threshold is greater than the ratio of the illuminance value of the first band to the illuminance value of the second band when the light sensor is not blocked; Wherein, the minimum value of the first band is less than the minimum value of the finger-occluded band, the maximum value of the first band is greater than the maximum value of the finger-occluded band, the second band has an overlapping portion with the finger-occluded band, and when the light sensor is occluded by a finger, the illuminance value of the finger-occluded band detected by the light sensor is less than the illuminance threshold.
[0114] Optionally, the first wavelength band is 300nm-1100nm. When the second band is 450nm-650nm, the first ratio threshold is the first threshold. When the second band is 400nm-560nm, the first ratio threshold is the second threshold; When the second band includes 450nm-650nm and 400nm-560nm, the ratio of the first illuminance value to the second illuminance value is greater than the first ratio threshold, including: the ratio of the first illuminance value to the second illuminance value in the band of 450nm-650nm is greater than the first threshold, and the ratio of the first illuminance value to the second illuminance value in the band of 400nm-560nm is greater than the second threshold.
[0115] Optionally, the processor 1410 is also configured to acquire a third illuminance value of a third band and a fourth illuminance value of a fourth band, wherein the wavelength ranges of the first band, the second band, the third band, and the fourth band are all different. It is also used to determine that the light sensor is blocked by a finger when the first illuminance value, the second illuminance value, the third illuminance value and the fourth illuminance value meet preset conditions.
[0116] Optionally, the third illuminance value and the fourth illuminance value satisfy preset conditions, including: the ratio of the third illuminance value and the fourth illuminance value is less than a second proportional threshold, and the second proportional threshold is less than the ratio of the illuminance value of the third band to the illuminance value of the fourth band when the light sensor is not blocked; Among them, the non-overlapping bands of the third band and the finger-occluded band are the same as the non-overlapping bands of the fourth band and the finger-occluded band. When the light sensor is blocked by a finger, the illuminance value of the finger-occluded band detected by the light sensor is less than the illuminance threshold.
[0117] Optionally, the third band is 400nm-700nm, and the fourth band is 560nm-700nm.
[0118] Optionally, the reduced ambient light intensity detected by the light sensor includes: the product of the illuminance value of the fifth band and the illuminance factor being less than a third threshold. The third threshold is less than the product of the illuminance value of the fifth band and the illuminance factor when the light sensor is not blocked. The illuminance factor reflects the degree of difference between the illuminance value of the ambient light detected by the light sensor and the actual illuminance value of the ambient light.
[0119] In this embodiment, after the electronic device obtains the first illuminance value of the first band and the second illuminance value of the second band of ambient light through the light sensor, when the ambient light intensity detected by the light sensor decreases, it determines whether the first illuminance value and the second illuminance value meet a preset condition. If the first illuminance value and the second illuminance value meet the preset condition, it determines that the light sensor is blocked by a finger, thereby realizing the detection of finger occlusion of the light sensor and avoiding the problem that the electronic device mistakenly judges that the ambient light has darkened and thus erroneously reduces the backlight brightness of the display screen due to the light sensor being blocked by a finger.
[0120] It should be understood that, in this embodiment, the input unit 1404 may include a graphics processing unit (GPU) 14041 and a microphone 14042. The GPU 14041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1406 may include a display panel 14061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1407 includes at least one of a touch panel 14071 and other input devices 14072. The touch panel 14071 is also called a touch screen. The touch panel 14071 may include a touch detection device and a touch controller. Other input devices 14072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0121] The memory 1409 can be used to store software programs and various data. The memory 1409 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1409 may include volatile memory or non-volatile memory, or it may include both volatile and non-volatile memory. The non-volatile memory may 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), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1409 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0122] Processor 1410 may include one or more processing units; optionally, processor 1410 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1410.
[0123] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described occlusion detection method embodiment for a light sensor and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0124] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0125] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described occlusion detection method embodiment of the optical sensor, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0126] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0127] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described occlusion detection method embodiment of the optical sensor, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0128] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0129] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0130] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for detecting occlusion of a light sensor, applied to an electronic device, the electronic device including a light sensor, characterized in that, The method includes: The ambient light is detected by the light sensor, and a first illuminance value of the first band and a second illuminance value of the second band are obtained. The wavelength ranges of the first band and the second band are different. When the ambient light intensity detected by the light sensor decreases, and when the first illuminance value and the second illuminance value meet a preset condition, it is determined that the light sensor is blocked by a finger. The first illuminance value and the second illuminance value satisfy preset conditions, including: The ratio of the first illuminance value to the second illuminance value is greater than a first proportional threshold, and the first proportional threshold is greater than the ratio of the illuminance value of the first band to the illuminance value of the second band when the light sensor is not blocked. Wherein, the minimum value of the first band is less than the minimum value of the finger-occluded band, the maximum value of the first band is greater than the maximum value of the finger-occluded band, the second band has an overlapping portion with the finger-occluded band, and when the light sensor is blocked by a finger, the illuminance value of the finger-occluded band detected by the light sensor is less than the illuminance threshold.
2. The method according to claim 1, characterized in that, The first band is 300nm-1100nm. When the second band is 450nm-650nm, the first ratio threshold is the first threshold. When the second band is 400nm-560nm, the first ratio threshold is the second threshold; When the second wavelength band includes 450nm-650nm and 400nm-560nm, the ratio of the first illuminance value to the second illuminance value is greater than a first ratio threshold, including: The ratio of the first illuminance value to the second illuminance value in the band of 450nm-650nm is greater than the first threshold, and the ratio of the first illuminance value to the second illuminance value in the band of 400nm-560nm is greater than the second threshold.
3. The method according to claim 1, characterized in that, The method further includes: obtaining the third illuminance value of the third band and the fourth illuminance value of the fourth band, wherein the wavelength ranges of the first band, the second band, the third band and the fourth band are all different; When the third illuminance value and the fourth illuminance value meet the preset conditions, it is determined that the light sensor is blocked by a finger. The preset conditions for the third illuminance value and the fourth illuminance value to meet the preset conditions include: the ratio of the third illuminance value and the fourth illuminance value is less than a second proportional threshold, and the second proportional threshold is less than the ratio of the illuminance value of the third band to the illuminance value of the fourth band when the light sensor is not blocked. The non-overlapping bands of the third band and the finger-blocking band are the same as the non-overlapping bands of the fourth band and the finger-blocking band. The third band is 400nm-700nm, and the fourth band is 560nm-700nm.
4. The method according to claim 1, characterized in that, The reduced ambient light intensity detected by the optical sensor includes: the product of the illuminance value and the illuminance factor in the fifth band being less than the third threshold. The third threshold is less than the product of the illuminance value of the fifth band and the illuminance factor when the light sensor is not blocked. The illuminance factor reflects the degree of difference between the illuminance value of the ambient light detected by the light sensor and the actual illuminance value of the ambient light.
5. An occlusion detection device for a light sensor, applied to an electronic device, the electronic device including a light sensor, characterized in that, The device includes: The acquisition module is used to detect ambient light through the light sensor and acquire a first illuminance value of a first band and a second illuminance value of a second band, wherein the wavelength ranges of the first band and the second band are different. The determination module is used to determine that the light sensor is blocked by a finger when the ambient light intensity detected by the light sensor decreases and when the first illuminance value and the second illuminance value meet a preset condition. The first and second illuminance values meet preset conditions, including: The ratio of the first illuminance value to the second illuminance value is greater than the first proportional threshold. The first proportional threshold is greater than the ratio of the illuminance value of the first band to the illuminance value of the second band when the light sensor is not blocked. The minimum value of the first band is less than the minimum value of the finger-blocked band, the maximum value of the first band is greater than the maximum value of the finger-blocked band, and the second band overlaps with the finger-blocked band. When the light sensor is blocked by a finger, the illuminance value of the finger-blocked band detected by the light sensor is less than the illuminance threshold.
6. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the occlusion detection method of the optical sensor as described in any one of claims 1 to 4.
7. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the occlusion detection method for the optical sensor as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Ambient light detection method, electronic device and medium
CN111366240A
Screen brightness adjusting method, electronic equipment and storage medium
CN113920963A
