Ambient light intensity detection method, electronic equipment, storage medium and chip
By setting light channels on the glass cover and screen of electronic devices and processing ambient light intensity, the inaccurate detection of ambient light intensity caused by installing ambient light sensors under the screen is solved, and the detection accuracy and user experience are improved.
Patent Information
- Application Number
- CN202410533923.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-04-29
AI Technical Summary
Electronic devices that use the under-screen method to install ambient light sensors lead to inaccurate detection of ambient light intensity due to the interference of screen light and loss of light inlet, which reduces the user experience.
By setting light channels on the glass cover and screen of the electronic device, ambient light and screen light are refracted by the glass cover and illuminated on the front ambient light sensor, based on the geometric parameters of the light channel, optical parameters of the glass cover and The intensity of screen light, the intensity of ambient light, remove interference light intensity and/or compensate for lost light intensity, thereby improving detection accuracy.
Effectively remove interference from screen light and make up for the loss of light input, improve the accuracy of ambient light intensity detected by ambient light sensor, and improve user experience.
Smart Images

Figure CN119252159A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a method for detecting ambient light intensity, an electronic device, a storage medium and a chip. Background Art
[0002] In order to make electronic devices have better screen display effects, electronic devices can install ambient light sensors by replacing the hole-punch method with the under-screen method. After installing the sensor under the screen, the screen of the electronic device can display a complete picture, thereby improving the screen display effect.
[0003] However, for electronic devices that use an under-screen ambient light sensor, the ambient light intensity detected by the ambient light sensor is inaccurate due to factors such as interference from screen light and loss of incoming light, thereby reducing the user experience. Summary of the invention
[0004] The present application provides a method for detecting ambient light intensity, an electronic device, a storage medium and a chip, which can remove interference from screen light and / or compensate for the loss of incoming light, and can make the ambient light intensity detected by the ambient light sensor more accurate, thereby improving the user experience.
[0005] In a first aspect, a method for detecting the intensity of ambient light is provided, which is applied to an electronic device, wherein the electronic device comprises a glass cover plate, a screen and a front ambient light sensor which are sequentially arranged along a thickness direction of the electronic device, wherein an optical channel is arranged on the screen, and the ambient light and the screen light refracted by the glass cover plate can be irradiated on the front ambient light sensor through the optical channel, and the method comprises: in response to a trigger event, detecting a first ambient light intensity through the front ambient light sensor; based on a first relationship between geometric parameters of the optical channel, optical parameters of the glass cover plate and the screen light intensity of the current screen light, processing the first ambient light intensity to obtain a second ambient light intensity;
[0006] Among them, the second ambient light intensity is the ambient light intensity after removing the interference light intensity and / or adding the loss light intensity from the first ambient light intensity, the interference light intensity is the ambient light intensity of the screen light after being refracted through the glass cover plate and irradiated on the front ambient light sensor through the optical channel, the loss light intensity is the ambient light intensity lost when the ambient light is refracted through the glass cover plate and passes through the optical channel, the first relationship includes a correspondence between multiple first distances and multiple first screen light intensities, the first distance is the distance between the position where the screen light enters the optical channel through the glass cover plate and the center position of the optical channel, one first distance corresponds to one first screen light intensity, and when the first distance is the radius of the optical channel, the first screen light intensity is the screen light intensity of the current screen light.
[0007] In the related scheme, when the front ambient light sensor is installed under the screen, since the ambient light can be irradiated on the front ambient light sensor through the optical channel after being refracted by the glass cover plate, this will cause the loss of ambient light, and since the screen light can be irradiated on the front ambient light sensor through the optical channel after being refracted by the glass cover plate, this will interfere with the value detected by the front ambient light sensor. Due to the above factors, the ambient light intensity detected by the front ambient light sensor is inaccurate. The embodiment of the present application can process the first ambient light intensity based on the first relationship corresponding to the radius of the optical channel, the refractive index and reflectivity of the glass cover plate, and the screen light intensity of the current screen light, and obtain the second ambient light intensity after removing the interference light intensity irradiated on the front ambient light sensor through the optical channel after the screen light is refracted by the glass cover plate, and / or adding the loss light intensity lost when the ambient light is refracted by the glass cover plate through the optical channel. Compared with the related scheme, the interference of the screen light can be removed and / or the loss can be compensated, so that the value detected by the front ambient light sensor can be more accurate, thereby improving the user experience.
[0008] In combination with the first aspect, in certain implementations of the first aspect, based on a first relationship corresponding to geometric parameters of the light channel, optical parameters of the glass cover plate, and screen light intensity of the current screen light, the first ambient light intensity is processed to obtain a second ambient light intensity, including: determining a first light input amount of the front ambient light sensor based on the first ambient light intensity and the geometric parameters of the light channel; determining the second ambient light intensity based on the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate, and the first relationship.
[0009] In an embodiment of the present application, the electronic device can first determine the first light input amount of the front ambient light sensor based on the first ambient light intensity and the geometric parameters of the optical channel, and then accurately determine the second ambient light intensity according to the first light input amount, the geometric parameters of the optical channel, the optical parameters of the glass cover and the first relationship.
[0010] In combination with the first aspect, in some implementations of the first aspect, the second ambient light intensity is the ambient light intensity after removing the interference light intensity from the first ambient light intensity; and determining the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate, and the first relationship includes:
[0011] Based on the optical parameters of the glass cover plate, the geometric parameters of the optical channel and the first relationship, a second amount of light input is determined, where the second amount of light input is the amount of light input when the screen light is refracted through the glass cover plate and illuminates the front ambient light sensor through the optical channel; the first amount of light input and the second amount of light input are differenced to obtain a third amount of light input; based on the third amount of light input and the geometric parameters of the optical channel, the second ambient light intensity is determined.
[0012] In the embodiment of the present application, the second light input amount determined based on the optical parameters of the glass cover plate, the geometric parameters of the optical channel and the first relationship is the light input amount of the screen light after being refracted through the glass cover plate and irradiated on the front ambient light sensor through the optical channel, and the first light input amount is the light input amount corresponding to the first ambient light intensity detected by the front ambient light sensor. The electronic device performs difference processing on the first light input amount and the second light input amount to obtain a third light input amount, which is the light input amount after deducting the light input amount of the screen light after being refracted through the glass cover plate and irradiating on the front ambient light sensor through the optical channel from the first light input amount. Therefore, based on the third light input amount and the geometric parameters of the optical channel, the determined second ambient light intensity refers to the ambient light intensity after deducting the interference light intensity from the first ambient light intensity. Since the interference light intensity is removed, the second ambient light intensity is more accurate than the ambient light intensity detected by the front ambient light sensor in the related scheme.
[0013] In combination with the first aspect, in some implementations of the first aspect, the second ambient light intensity is the ambient light intensity obtained by adding the loss light intensity to the first ambient light intensity; and determining the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate, and the first relationship includes:
[0014] Based on the first light input amount, the optical parameters of the glass cover, the geometric parameters of the optical channel and the first relationship, a fourth light input amount is determined, where the fourth light input amount is the amount of light input lost when the ambient light passes through the optical channel after being refracted by the glass cover; the first light input amount and the fourth light input amount are summed to obtain a fifth light input amount; based on the fifth light input amount and the geometric parameters of the optical channel, the second ambient light intensity is determined.
[0015] In the embodiment of the present application, the fourth light input amount determined based on the first light input amount, the optical parameters of the glass cover plate, the geometric parameters of the optical channel and the first relationship is the light input amount lost when the ambient light passes through the optical channel after being refracted by the glass cover plate, the first light input amount is the light input amount corresponding to the first ambient light intensity detected by the front ambient light sensor, and the electronic device sums the first light input amount and the fourth light input amount, and the fifth light input amount obtained is the light input amount after compensating for the light input amount lost when the ambient light passes through the optical channel after being refracted by the glass cover plate in the first light input amount. Therefore, based on the fifth light input amount and the geometric parameters of the optical channel, the second ambient light intensity determined refers to the ambient light intensity after the lost light intensity is added to the first ambient light intensity. The second ambient light intensity is more accurate than the ambient light intensity detected by the front ambient light sensor in the related scheme due to the addition of the lost light intensity.
[0016] In combination with the first aspect, in some implementations of the first aspect, the second ambient light intensity is the ambient light intensity obtained by removing the interference light intensity and adding the loss light intensity from the first ambient light intensity; and determining the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate, and the first relationship, includes:
[0017] Based on the optical parameters of the glass cover plate, the geometric parameters of the optical channel and the first relationship, a second amount of light input is determined, where the second amount of light input is the amount of light input that the screen light refracts through the glass cover plate and illuminates the front ambient light sensor through the optical channel; based on the first amount of light input, the second amount of light input and the optical parameters of the glass cover plate, a sixth amount of light input is determined, where the sixth amount of light input is the amount of light input obtained by subtracting the amount of light input that the screen light refracts through the glass cover plate and illuminates the front ambient light sensor through the optical channel from the first amount of light input, and the amount of light input that is lost when the ambient light is refracted through the glass cover plate and passes through the optical channel; based on the sixth amount of light input and the geometric parameters of the optical channel, a second ambient light intensity is determined.
[0018] In the embodiment of the present application, due to the first light input amount, the second light input amount and the optical parameters of the glass cover plate, the determined sixth light input amount is the light input amount obtained by deducting the screen light that is refracted by the glass cover plate and then irradiated on the front ambient light sensor through the optical channel, and the light input amount lost when the ambient light is refracted by the glass cover plate and then passes through the optical channel from the first light input amount. Therefore, based on the sixth light input amount and the geometric parameters of the optical channel, the determined second ambient light intensity refers to the ambient light intensity after deducting the interference light intensity and adding the loss light intensity from the first ambient light intensity. The second ambient light intensity is more accurate than the ambient light intensity detected by the front ambient light sensor in the related scheme because the interference light intensity is removed and the loss light intensity is added.
[0019] In combination with the first aspect, in some implementations of the first aspect, the geometric parameters of the light channel include the radius of the light channel, and the optical parameters of the glass cover plate include the refractive index and reflectivity of the glass cover plate.
[0020] In combination with the first aspect, in some implementations of the first aspect, the second ambient light intensity is the ambient light intensity obtained by the first ambient light intensity detected by the front ambient light sensor for the i-th time, where i is an integer greater than 1; and the method further includes:
[0021] When it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, the temperature or color temperature of the screen is adjusted.
[0022] In combination with the first aspect, in some implementations of the first aspect, the electronic device further includes a first ambient light sensor; and, when it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, adjusting the temperature or color temperature of the screen includes:
[0023] When it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the i-1th time, adjust the temperature or color temperature of the screen.
[0024] In the embodiment of the present application, the electronic device can accurately determine whether the ambient light intensity in the current environment has changed, and accurately determine whether the front ambient light sensor is blocked, based on the values detected by the front ambient light sensor and the first ambient light sensor. When the ambient light intensity in the current environment changes, the brightness or color temperature of the screen is adjusted according to the value detected by the front ambient light sensor, thereby avoiding adjusting the brightness or color temperature of the screen when the front ambient light sensor is blocked but the ambient light intensity in the current environment has not changed, thereby improving the user experience.
[0025] In combination with the first aspect, in some implementations of the first aspect, when it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the (i-1)th time, adjusting the temperature or color temperature of the screen includes:
[0026] When it is determined that the second ambient light intensity obtained by passing through the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by passing through the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by passing through the first ambient light sensor for the i-1th time is different from the third ambient light intensity obtained by passing through the first ambient light sensor for the i-1th time, and the third ambient light intensity obtained by passing through the first ambient light sensor for the i-th time and the second ambient light intensity obtained by passing through the front ambient light sensor for the i-th time meet a first condition, adjust the temperature or color temperature of the screen, and the first condition is used to indicate that the front ambient light sensor is not blocked.
[0027] In the embodiment of the present application, the electronic device can accurately determine whether the ambient light intensity in the current environment has changed, and accurately determine whether the front ambient light sensor is blocked based on the values detected by the front ambient light sensor, the first ambient light sensor and the first condition.
[0028] In combination with the first aspect, in some implementations of the first aspect, the first condition is that the third ambient light intensity obtained by the first ambient light sensor for the i-th time has a linear relationship with the second ambient light intensity obtained by the front ambient light sensor for the i-th time.
[0029] In combination with the first aspect, in some implementations of the first aspect, the first ambient light sensor is a rear ambient light sensor.
[0030] In a second aspect, an electronic device is provided, and the electronic device is used to execute the method provided in the first aspect. Specifically, the electronic device may include a processing unit for executing any possible implementation manner of the first aspect.
[0031] In a third aspect, an electronic device is provided, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, enable the electronic device to execute a method in any possible implementation of the first aspect.
[0032] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect.
[0033] In a fifth aspect, a chip is provided, comprising a memory for storing instructions; and a processor for calling and executing instructions from the memory, so that an electronic device equipped with the chip executes the method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 An example diagram of an electronic device detecting ambient light intensity is provided.
[0035] Figure 2 It is a structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0036] Figure 3 It is a schematic diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
[0037] Figure 4 It is a schematic diagram of detecting ambient light intensity provided in an embodiment of the present application.
[0038] Figure 5 This is another schematic diagram of detecting ambient light intensity provided in an embodiment of the present application.
[0039] Figure 6 This is another schematic diagram of detecting ambient light intensity provided in an embodiment of the present application.
[0040] Figure 7 It is a timing diagram of a method 200 for detecting ambient light intensity provided in an embodiment of the present application.
[0041] Figure 8 This is an example diagram of the relationship between screen light intensity and position provided in an embodiment of the present application.
[0042] Fig. 9 This is an example diagram of the amount of light input generated by screen light provided in an embodiment of the present application.
[0043] Fig.10 This is an example diagram of light input loss provided in an embodiment of the present application.
[0044] Fig.11 This is an example diagram of a front ambient light sensor and a rear ambient light sensor provided in an embodiment of the present application.
[0045] Fig.12 It is a schematic diagram provided by an embodiment of the present application for determining whether the ambient light intensity of the current environment has changed. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0047] In order to make electronic devices have better screen display effects, electronic devices can install ambient light sensors by replacing the hole-punch method with the under-screen method. After installing the sensor under the screen, the screen of the electronic device can display a complete picture, thereby improving the screen display effect.
[0048] However, for electronic devices that use an under-screen ambient light sensor, the ambient light intensity detected by the ambient light sensor is inaccurate due to factors such as interference from screen light and loss of incoming light, thereby reducing the user experience. For example, due to the inaccurate ambient light intensity detected by the ambient light sensor, the electronic device cannot adjust the screen to an appropriate brightness or color temperature, affecting the user experience.
[0049] For example, please refer to Figure 1 , Figure 1 An example diagram of an electronic device detecting ambient light intensity is provided. Figure 1 (a) in FIG. 1 shows an example of an electronic device detecting ambient light intensity by installing an ambient light sensor in a hole-digging manner. Figure 1From (a) in the figure, it can be seen that when an electronic device adopts a hole-digging method to install an ambient light sensor, holes can be drilled in both the glass cover and the screen, and the ambient light sensor is installed directly below the hole. The ambient light can directly shine on the ambient light sensor through the hole (the hole can be called an optical channel for light to pass through the glass cover and the screen), and the value detected by the ambient light sensor is close to the ambient light intensity of the surrounding environment.
[0050] Figure 1 (b) in FIG. 1 shows an example of an electronic device detecting ambient light intensity by installing an ambient light sensor under the screen. Figure 1 As shown in (b), when an electronic device uses an under-screen method to install an ambient light sensor, only a hole is made in the screen, but not in the glass cover. The ambient light sensor is installed directly below the hole in the screen. In this way, the ambient light first shines on the glass cover, which refracts and reflects the ambient light. After refraction and reflection, the ambient light passes through the hole in the screen (the hole can be called the light channel for light to pass through the screen) and shines on the ambient light sensor. This will cause the glass cover to refract and reflect the ambient light, resulting in a loss of light that finally shines on the ambient light sensor. In addition, the screen will also generate screen light, which will first shine on the glass cover, and then shine on the ambient light sensor through reflection and refraction of the glass cover, which will interfere with the value detected by the ambient light sensor.
[0051] By the above Figure 1 As can be seen from (b) in the figure, the value detected by the ambient light sensor deviates too much from the ambient light intensity of the surrounding environment due to factors such as interference from screen light and loss of incoming light, and the ambient light intensity detected by the ambient light sensor is inaccurate.
[0052] An embodiment of the present application provides a method for detecting ambient light intensity, which can remove interference from screen light and / or compensate for the loss of incoming light after the ambient light sensor detects the ambient light intensity, thereby making the ambient light intensity detected by the ambient light sensor more accurate and improving the user experience.
[0053] The detection method of ambient light intensity provided in the embodiment of the present application is applied to electronic devices. The electronic device may also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device may be a mobile phone, a smart TV, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a wearable device, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the electronic device.
[0054] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below.
[0055] Figure 2 1 is a schematic diagram of the structure of an electronic device 100 (taking a mobile phone as an example) provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, an antenna 1, an antenna 2, a mobile communication module 140, a wireless communication module 150, a sensor module 160, an ambient light sensor 160A, a touch sensor 160B, a display screen 170, a camera 180, and the like.
[0056] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0057] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (Application processor, App), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0058] In the embodiment of the present application, the processor 110 can remove the interference of the screen light in the ambient light intensity detected by the front ambient light sensor, and / or compensate for the loss of the amount of light entering. It can also determine whether the ambient light intensity in the current environment has changed according to the values detected by the front ambient light sensor and the rear ambient light sensor, and determine whether the front ambient light sensor is blocked.
[0059] The processor 110 may also be provided with a memory for storing instructions and data.
[0060] The wireless communication module 150 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication function of the electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 140, wireless communication module 150, modem processor and baseband processor.
[0061] The display screen 170 is used to display images, videos, etc.
[0062] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .
[0063] The internal memory 121 may be used to store computer executable program codes, where the executable program codes include instructions.
[0064] The ambient light sensor 160A is used to sense the brightness of ambient light. In some embodiments, the ambient light sensor may also be referred to as a photosensitive sensor, a light sensor, a brightness sensor, etc., which is not limited in the embodiments of the present application. The electronic device 100 may adaptively adjust the brightness of the display screen 170 according to the perceived brightness of ambient light. The ambient light sensor 160A may also be used to automatically adjust the white balance when taking photos. The ambient light sensor 160A may also detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0065] The touch sensor 160B is also called a "touch panel". The touch sensor 160B can be disposed on the display screen 170. The touch sensor 160B and the display screen 170 form a touch screen, also called a "touch screen". The touch sensor 160B is used to detect a touch operation on or near it.
[0066] The hardware structure of the electronic device 100 is introduced here. It can be understood that: Figure 2 The components included in the hardware structure shown do not constitute a specific limitation on the electronic device 100. The electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different component configuration.
[0067] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.
[0068] The operating system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the operating system of the electronic device 100.
[0069] Figure 3 1 is a schematic diagram of the software structure of the electronic device 100 of the embodiment of the present application. The software structure includes several layers, each layer has a clear role and division of labor, and the layers communicate with each other through software interfaces. The software structure may include an application layer, an application framework layer, a hardware abstraction layer, a kernel layer, and a hardware layer.
[0070] The application layer, referred to as the application layer, can include a series of application packages. Figure 3As shown, the application package may include an application for detecting the ambient light intensity. Of course, in other embodiments, it may also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0071] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0072] like Figure 3 As shown, the application framework layer may include a sensor service, a window manager, etc. In other embodiments, the application framework layer may also include a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0073] The sensor service is used to receive detection requests from the application layer and send detection notifications to the lower layer. For example, the sensor service user receives a detection request for detecting ambient light intensity from an application program that detects ambient light intensity in the application layer, and then sends a notification for detecting ambient light intensity to the hardware abstraction layer.
[0074] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0075] The hardware abstraction layer is a package of the Linux kernel driver, providing an interface to the upper layer. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms. The kernel layer uses file descriptors to access files. File descriptors are non-negative integers. When opening an existing file or creating a new file, the kernel returns a file descriptor. Reading and writing files also requires the use of file descriptors to specify the file to be read or written.
[0076] The hardware abstraction layer (HAL) includes an ambient light intensity detection module and an ambient light intensity algorithm module.
[0077] The ambient light intensity detection module is used to send an instruction to detect the ambient light intensity to the kernel layer after receiving the notification of detecting the ambient light intensity from the sensor service. The ambient light intensity algorithm module is used to process the ambient light intensity reported by the kernel layer. The ambient light intensity after processing is as follows: Figure 3 The ambient light intensity 2 is shown, and then the ambient light intensity 2 is reported to the application layer through the framework layer.
[0078] The kernel layer is the layer between hardware and software. The kernel layer contains at least the camera driver and the sensor driver. The sensor driver is used to send detection instructions to the ambient light sensor in the hardware layer, so that the ambient light sensor detects the ambient light intensity. For example, the ambient light intensity detected by the ambient light sensor is Figure 3 The ambient light intensity is shown as 1.
[0079] The hardware layer includes ambient light sensors, cameras, etc.
[0080] It should be understood that the technical solutions in the embodiments of the present application can be used in Android, IOS, Hongmeng and other systems.
[0081] The above embodiments introduce the hardware structure and software architecture of the electronic device in combination with the accompanying drawings. The following embodiments introduce the application scenarios of the method for detecting the ambient light intensity provided in the embodiments of the present application in combination with the accompanying drawings.
[0082] For example, please refer to Figure 4 , Figure 4 It is a schematic diagram of detecting ambient light intensity provided in an embodiment of the present application.
[0083] Please refer to Figure 4 , the electronic device includes a power button 4011, Figure 4 The user interface shown in (a) is an interface 401 displayed when the electronic device is powered on. When the electronic device is powered on, the user presses the power button for a preset time, for example, 3 seconds. In response to the user's operation, the electronic device displays the following Figure 4 The user interface 402 shown in (b) is as follows: Figure 4 As shown in (b), the interface includes a "restart" control 4021 and a "shutdown" control 4022. When a user clicks the "restart" control 4021, the electronic device responds to the user's click on the control 4021 by detecting the ambient light intensity through the ambient light sensor, and then adaptively adjusts the display brightness or color temperature in the electronic device according to the detected ambient light intensity.
[0084] Please refer to Figure 5 , Figure 5 This is another schematic diagram of detecting ambient light intensity provided in an embodiment of the present application.
[0085] Please refer to Figure 5 , Figure 5 The user interface 501 shown in (a) includes a series of application icons, including "Camera", "Gallery", "Settings", etc. The user clicks the "Settings" icon 5011. In response to the user clicking the icon 5011, the electronic device displays the following Figure 5The user interface 502 shown in (b) includes controls such as "flight mode", "wireless LAN", "cellular network", and "display and brightness". The user clicks the "display and brightness" control 5021. In response to the user's operation, the electronic device displays the following Figure 5 The user interface 503 shown in (c) includes an "auto-adjustment" control 5031. When a user clicks the "auto-adjustment" control 5031, the electronic device detects the ambient light intensity through the ambient light sensor in response to the user's click of the control 5031, and then adaptively adjusts the brightness of the display screen in the electronic device according to the detected ambient light intensity.
[0086] Please refer to Figure 6 , Figure 6 This is another schematic diagram of detecting ambient light intensity provided in an embodiment of the present application.
[0087] Please refer to Figure 6 , Figure 6 The user interface 601 shown in (a) includes a series of application icons, including "camera", "gallery", "games", etc. The user clicks the "game" icon 6011. In response to the user clicking the icon 6011, the electronic device displays the following Figure 6 The user interface 602 shown in (b) of FIG. Figure 6 The electronic device shown in (b) is in a horizontal screen state. The user can perform game operations through the user interface 602, such as moving the "game character" in the control user interface 602 forward or backward. When the user performs game operations through the user interface 602, the ambient light sensor in the electronic device can detect the ambient light intensity in real time, and when a change in the ambient light intensity is detected, the color temperature or brightness of the screen can be adjusted in real time.
[0088] The above embodiments are combined with the accompanying drawings to introduce the application scenarios of detecting the ambient light intensity provided by the present application. Figure 3 The software architecture in the embodiment of the present application introduces the implementation process of detecting the ambient light intensity.
[0089] Please refer to Figure 7 , Figure 7 8 is a timing diagram of a method 200 for detecting ambient light intensity provided in an embodiment of the present application. The method 200 includes steps 810 to 890.
[0090] Step 810: The application layer generates a request 1 for detecting the ambient light intensity in response to a user operation.
[0091] It should be understood that user operations can be Figure 4 The operation of the user clicking the control 4021 shown in (b) may also be Figure 5(c) in FIG. 5 shows an operation of the user clicking the control 5031. Of course, the user operation may also be other operations that can trigger the ambient light sensor to detect the ambient light intensity, which is not limited in the embodiment of the present application.
[0092] It should also be understood that user operations may also be operations such as touch, slide, voice command, etc., which are not limited in the embodiments of the present application.
[0093] Step 820: The application layer sends a request 1 to the sensor service in the framework layer.
[0094] Step 830: After receiving the request 1, the sensor service sends a notification 1 of detecting the ambient light intensity to the ambient light intensity detection module in the HAL layer.
[0095] Step 840: After receiving the notification 1, the ambient light intensity detection module sends an instruction 1 for detecting the ambient light intensity to the ambient light sensor driver in the kernel layer, and then the ambient light sensor driver sends the instruction 1 to the ambient light sensor.
[0096] In step 850 , the ambient light sensor in the hardware layer detects the ambient light intensity.
[0097] Step 860: The ambient light sensor reports the detected ambient light intensity 1 to the ambient light intensity algorithm module in the HAL layer through the ambient light sensor driver.
[0098] It should be understood that the ambient light sensor of the embodiment of the present application is installed in the electronic device through the under-screen method. The explanation of the under-screen method can refer to the above embodiment and will not be repeated here. Therefore, the ambient light intensity 1 detected by the ambient light sensor may be inaccurate due to factors such as interference from the screen light and loss of the incoming light.
[0099] Step 870 : The ambient light intensity algorithm module processes the ambient light intensity 1 to obtain the ambient light intensity 2 .
[0100] It should be understood that the role of the ambient light intensity algorithm module is to remove the interference of screen light in the ambient light intensity 1 and / or compensate for the loss of incoming light, so that the ambient light intensity detected by the ambient light sensor can be more accurate.
[0101] The specific implementation process of step 870 can be referred to the following embodiment and will not be described here in detail.
[0102] Step 880: The ambient light intensity algorithm module reports the ambient light intensity 2 to the application layer through the sensor service in the framework layer.
[0103] Step 890: The application layer adjusts the brightness or color temperature of the screen according to the ambient light intensity 2.
[0104] During implementation, the application layer can send a request to adjust the brightness or color temperature of the screen to the lower layer (such as the framework layer, HAL, etc.), and the lower layer (such as the display driver in the kernel layer) can send an instruction to adjust the screen to the display in the hardware layer, thereby realizing functions such as adjusting the brightness or color temperature of the screen. The embodiment of the present application does not limit the implementation process of the application layer adjusting the brightness or color temperature of the screen according to the ambient light intensity 2.
[0105] It should be understood that since the ambient light sensor is installed in the electronic device under the screen, the ambient light intensity 1 detected by the ambient light sensor may be inaccurate due to factors such as interference from screen light and loss of incoming light. The embodiment of the present application can remove the interference of screen light in the ambient light intensity 1 and / or compensate for the loss of incoming light through the ambient light intensity algorithm module, so that the ambient light intensity detected by the ambient light sensor can be more accurate.
[0106] The above embodiments are combined with the attached Figure 7 The implementation process of the method 200 for detecting the ambient light intensity provided in the embodiment of the present application is introduced. The implementation process of step 870 in the method 200 is introduced in conjunction with the accompanying drawings in the following embodiment.
[0107] Before specifically introducing the implementation process of step 870, the principle that the ambient light intensity algorithm module can remove the interference of screen light in the ambient light intensity 1 and / or compensate for the loss of incoming light is introduced.
[0108] It should be understood that the ambient light intensity detected by the ambient light sensor is related to the amount of incoming light, and the relationship between the two can be referred to the following formula 1:
[0109]
[0110] Among them, I represents the amount of light entering, which refers to the amount of light passing through the glass cover (such as Figure 1 The amount of light irradiated onto the ambient light sensor by the glass cover shown in (b), πd 2 refers to the area of the light channel (e.g. Figure 1 (b) shows the cross-sectional area of the light channel formed by the opening process in the screen), d refers to the diameter of the light channel, L refers to the ambient light intensity, Refers to the conversion coefficient between ambient light intensity and incoming light amount.
[0111] The following section details the principles of the ambient light intensity algorithm module in three ways.
[0112] Method 1: The ambient light intensity algorithm module can remove the interference of screen light in ambient light intensity 1 and compensate for the loss of incoming light.
[0113] It should be understood that the ambient light sensor is installed in the electronic device in an under-screen manner, which may cause the ambient light intensity 1 detected by the ambient light sensor to be inaccurate due to factors such as interference from the screen light and loss of the amount of incoming light. Therefore, the ambient light intensity algorithm module can remove the interference of the screen light from the amount of incoming light detected by the ambient light sensor, and compensate for the loss of the amount of incoming light, and obtain the amount of incoming light A1, which is less interfered by the screen light and has less loss after reflection and refraction through the glass cover. Afterwards, the ambient light intensity algorithm module can substitute the amount of incoming light A1 into the above formula 1 for calculation, and obtain ambient light intensity 2, which is closer to the ambient light intensity of the surrounding environment than the ambient light intensity 1. The ambient light intensity algorithm module can calculate the amount of incoming light A1 by the following formula 2.1.
[0114] I A1 =I B -I C +I D .
[0115] Among them, I A1 Refers to the amount of light entering A1, I B It refers to the amount of light entering the room according to the ambient light intensity detected by the ambient light sensor. C Refers to the amount of light entering due to interference from screen light, I D It refers to the amount of light lost.
[0116] It should also be understood that in the above formula 2.1, I B It can be obtained by the above formula 1, for example:
[0117]
[0118] Here, L1 refers to the ambient light intensity 1 detected by the ambient light sensor.
[0119] I in Formula 2.1 C It can be obtained by the following formula 3, for example:
[0120]
[0121] in, Refers to the conversion coefficient between ambient light intensity and incoming light amount. Refers to the reflectivity of the glass cover (e.g. Figure 1 (b) shows the reflectivity of the glass cover), refers to the refractive index of the glass cover (e.g. Figure 1 (b) shows the refractive index of the glass cover), r i It refers to the position where the screen light shines on the light channel, L(r i) refers to the screen light intensity at different positions of the light channel when the screen light is irradiated. The screen light intensity refers to the intensity of the light emitted by the light source in the screen, which can also be called screen brightness. It should be understood that the position where the screen light is irradiated on the light channel can be characterized by the distance from the center position of the light channel. For example, the position where the screen light is irradiated on the light channel is the radius r of the light channel, and the position refers to the distance from the center position of the light channel to the radius r. For example, L(r i ) and the position of the screen light in the light channel can be referred to Figure 8 , Figure 8 is an example diagram of the relationship between screen light intensity and position provided by an embodiment of the present application. Figure 8 It can be seen that: the greater the value of the position where the screen light shines on the light channel, the greater the screen light intensity, and the smaller the value of the position where the screen light shines on the light channel, the smaller the screen light intensity. When the position where the screen light shines on the light channel is the radius r of the light channel, the screen light intensity is the screen light intensity of the current screen. It should also be understood that when the screen light intensity of the current screen changes, for example, Figure 8 The screen light intensity L corresponding to the position where the screen light is irradiated on the light channel is the radius r of the light channel. A If the value of changes, then the screen light shines on other positions on the light channel (such as Figure 8 The corresponding screen light intensity values are shown as r1 and r2 (for example Figure 8 L shown B and L C ) will also change.
[0122] For example, the above formula 3 can be obtained by the following method, please refer to Fig. 9 , Fig. 9 is an example diagram of the amount of light input generated by a screen light provided in an embodiment of the present application. Fig. 9 As shown, assuming that the screen light generated by the screen has two beams of light that interfere with the amount of ambient light entering, including the first beam of screen light and the second beam of screen light. The first beam of screen light enters the light channel from position O1 on the glass cover after reflection and refraction. The distance between position O1 and the center position O3 of the light channel is the radius r of the light channel. Then the amount of light entering the first beam of screen light can be calculated by the following formula 3.1:
[0123]
[0124] Among them, I C1 Refers to the amount of light entering the first beam of screen light. A It refers to the screen light intensity corresponding to the distance between the position where the first beam of screen light enters the light channel and the center position of the light channel equals the radius r of the light channel. A The size can be referenced Figure 8 .
[0125] The second beam of screen light is reflected and refracted by the glass cover plate and enters the light channel from position O2 on the glass cover plate. The distance between position O2 and the center position O3 of the light channel is the radius r1 of the light channel. Then the amount of light entering the second beam of screen light can be calculated by the following formula 3.2:
[0126]
[0127] Among them, I C2 Refers to the amount of light entering the second beam of screen light. B It refers to the screen light intensity corresponding to the position where the second beam of screen light enters the light channel and the center position of the light channel is r1. B The size can be referenced Figure 8 .
[0128] It should be understood that the calculation method of the light input amount of other beams of screen light can refer to the calculation method of the light input amount of the first beam of screen light and the second beam of screen light mentioned above, which will not be repeated here. For example, the third beam of screen light can be calculated by the following formula 3.3:
[0129]
[0130] Among them, I C3 refers to the amount of light entering the third beam of screen light. r2 refers to the distance between the position where the third beam of screen light enters the light channel and the center position of the light channel. L C It refers to the screen light intensity when the distance between the position where the screen light enters the light channel and the center position of the light channel is r2. c The size can be referenced Figure 8 .
[0131] By the above Fig. 9 It can be seen that the amount of light entering the light channel from multiple screen lights is I C It can be obtained by the following formula:
[0132]
[0133] Here, i is an integer greater than 1.
[0134] The following section introduces the amount of ambient light that remains after the amount of light entering is lost due to refraction and reflection by the glass cover.
[0135] For example, please refer to Fig.10 , Fig.10 is an example diagram of light input loss provided in an embodiment of the present application, such as Fig.10As shown in (a), when the ambient light first irradiates the upper surface of the glass cover, the ambient light is reflected for the first time and refracted for the first time. The first refracted ambient light passes through the upper surface of the glass cover and irradiates the lower surface of the glass cover. Therefore, the amount of ambient light after the first refraction can be calculated by the following formula 4.1:
[0136]
[0137] Among them, I D1 Represents the amount of ambient light entering after the first refraction.
[0138] like Fig.10 As shown in (b), the ambient light refracted for the first time irradiates the lower surface of the glass cover and is reflected for the second time. The ambient light reflected for the second time irradiates the upper surface of the glass cover. The amount of ambient light after the second reflection can be calculated by the following formula 4.2:
[0139]
[0140] Among them, I D2 Represents the amount of ambient light entering after being reflected for the second time.
[0141] The ambient light refracted for the first time is irradiated onto the lower surface of the glass cover and then refracted for the second time. The ambient light refracted for the second time is irradiated onto the ambient light sensor through the optical channel. The amount of ambient light refracted for the second time can be calculated by the following formula 4.3:
[0142]
[0143] Among them, I D3 Represents the amount of ambient light entering after the second refraction.
[0144] like Fig.10 As shown in (c), the ambient light reflected for the second time irradiates the upper surface of the glass cover plate and is reflected for the third time. The ambient light reflected for the third time irradiates the lower surface of the glass cover plate. The amount of ambient light reflected for the third time can be calculated by the following formula 4.4:
[0145]
[0146] Among them, I D4 Represents the amount of ambient light entering after being reflected for the second time.
[0147] like Fig.10As shown in (d), the third reflected ambient light is refracted for the third time after irradiating the lower surface of the glass cover. The third refracted ambient light irradiates the ambient light sensor through the optical channel. The amount of ambient light refracted for the third time can be calculated by the following formula 4.5:
[0148]
[0149] Among them, I D5 Represents the amount of ambient light entering after the third refraction.
[0150] Above Fig.10 Only the calculation method of the amount of ambient light entering the ambient light sensor through the optical channel after being refracted for the first to third times is shown. The calculation method of the amount of light entering after being refracted for other times can refer to the above method. For example, the amount of ambient light entering after being refracted for the fourth time can be calculated by the following formula 4.6:
[0151]
[0152] Among them, I D6 Represents the amount of ambient light entering after the fourth refraction.
[0153] Depend on Fig.10 From (d) in the figure, we can see that the ambient light refracted for the first time will not be irradiated to the ambient light sensor through the optical channel, and the ambient light refracted each time thereafter will be irradiated to the ambient light sensor through the optical channel. Therefore, the amount of ambient light entering after multiple refractions can be calculated by the following formula 4.7:
[0154]
[0155] Wherein, n and k are integers greater than 0.
[0156] It can be understood that the amount of light entering in the above formula 4.7 represents the amount of light entering after the amount of ambient light entering is lost due to refraction and reflection of the glass cover, and does not include the amount of light entering from the screen. That is, the amount of light entering in formula 4.7 can represent I in formula 2.1 A1 -I D Combining the above formula 2.1 and formula 4.7, we can get the following formula 5:
[0157]
[0158] By processing Formula 5, we can get Formula 6:
[0159]
[0160] Among them, I B It can be obtained from the above formula 1, IC It can be obtained from the above formula 3, and is a constant, so we can get I A1 . After getting I A1 Afterwards, I A1 Substituting into formula 1, we can get the ambient light intensity 2.
[0161] Therefore, the implementation process of step 870 in the embodiment of the present application can be: exemplarily, after the ambient light intensity algorithm module receives the ambient light intensity 1, it can process the ambient light intensity 1 based on the diameter of the light channel in the screen, the reflectivity and refractive index of the glass cover, and the screen light intensity at different positions of the screen light irradiated on the light channel to obtain the ambient light intensity 2.
[0162] Specifically, after the ambient light intensity algorithm module receives the ambient light intensity 1, the ambient light intensity 1, the diameter of the light channel in the screen, the reflectivity and refractive index of the glass cover, and the screen light intensity at different positions of the light channel irradiated by the screen light can be substituted into the above formula 6. By formula 6, I A1 , will I A1 Substituting into formula 1, we can get the ambient light intensity 2. The ambient light intensity 2 compensates for the loss of light input due to reflection and refraction of the glass cover, and removes the interference of screen light. The ambient light intensity 2 is closer to the ambient light intensity in the surrounding environment than the ambient light intensity 1.
[0163] Method 2: The ambient light intensity algorithm module can remove the interference of screen light in ambient light intensity 1.
[0164] In some embodiments, the ambient light intensity algorithm module can remove the interference of screen light from the amount of light entering detected by the ambient light sensor, and obtain the amount of light entering A2, which is less interfered by the screen light. Afterwards, the ambient light intensity algorithm module can substitute the amount of light entering A2 into the above formula 1 for calculation, and obtain ambient light intensity 2, which is closer to the ambient light intensity of the surrounding environment than ambient light intensity 1. The ambient light intensity algorithm module can calculate the amount of light entering A2 by the following formula 2.2.
[0165] I A2 =I B -I C .
[0166] Among them, I A2 Refers to the amount of light entering A2. B and I C The definition of can refer to the above embodiment and will not be repeated here.
[0167] Combining the above formula 1 and formula 3, it can be known that the amount of light entering A2 can also be obtained by the following formula 7:
[0168]
[0169] For the meaning of each parameter in Formula 7, please refer to the above embodiment and will not be repeated here.
[0170] Therefore, in some embodiments, the implementation process of step 870 can be: exemplarily, after the ambient light intensity algorithm module receives the ambient light intensity 1, it can process the ambient light intensity 1 based on the diameter of the light channel in the screen, the reflectivity and refractive index of the glass cover, and the screen light intensity at different positions of the light channel irradiated by the screen light to obtain the ambient light intensity 2.
[0171] Specifically, after the ambient light intensity algorithm module receives the ambient light intensity 1, the ambient light intensity 1, the diameter of the light channel in the screen, the reflectivity and refractive index of the glass cover, and the screen light intensity at different positions of the light channel irradiated by the screen light can be substituted into the above formula 7 to obtain I A2 , will I A2 Substituting into formula 1, we can get the ambient light intensity 2. The ambient light intensity 2 removes the interference of the screen light, and the ambient light intensity 2 is closer to the ambient light intensity in the surrounding environment than the ambient light intensity 1.
[0172] Method 3: The ambient light intensity algorithm module can remove and compensate for the loss of incoming light.
[0173] In some embodiments, the ambient light intensity algorithm module can compensate for the loss of the incoming light amount in the incoming light amount detected by the ambient light sensor, and can obtain the incoming light amount A3, which has less loss after reflection and refraction of the glass cover. Afterwards, the ambient light intensity algorithm module can substitute the incoming light amount A3 into the above formula 1 for calculation, and can obtain the ambient light intensity 2, which is closer to the ambient light intensity of the surrounding environment than the ambient light intensity 1. The ambient light intensity algorithm module can calculate the incoming light amount A3 by the following formula 2.3.
[0174] I A3 =I B +I D .
[0175] Among them, I B It can be calculated by the above formula 1, that is:
[0176]
[0177] Among them, I D It can be obtained from the above formula 5 and formula 6:
[0178] From formula 5, we can know that:
[0179]
[0180] Then based on the above formula 5, I D It can be obtained by the following formula 8:
[0181]
[0182] Also because I A1 It can be obtained by the above formula 6, that is:
[0183]
[0184] Then, the above formula 8 can also be:
[0185]
[0186] Finally, combining the above formula 1, formula 8 and formula 2.3, we can get formula 9:
[0187]
[0188] For the meaning of each parameter in Formula 9, please refer to the above embodiment and will not be repeated here.
[0189] Therefore, in some embodiments, the implementation process of step 870 can be: exemplarily, after the ambient light intensity algorithm module receives the ambient light intensity 1, it can process the ambient light intensity 1 based on the diameter of the light channel in the screen, the reflectivity and refractive index of the glass cover, and the screen light intensity at different positions of the light channel irradiated by the screen light to obtain the ambient light intensity 2.
[0190] Specifically, after the ambient light intensity algorithm module receives the ambient light intensity 1, the ambient light intensity 1, the diameter of the light channel in the screen, the reflectivity and refractive index of the glass cover, and the screen light intensity at different positions of the light channel irradiated by the screen light can be substituted into the above formula 9 to obtain I A3 , will I A3 Substituting into formula 1, we can get the ambient light intensity 2, which makes up for the loss of light input due to reflection and refraction of the glass cover. Compared with ambient light intensity 1, ambient light intensity 2 is closer to the ambient light intensity in the surrounding environment.
[0191] The above embodiments are combined Figures 7 to 10 The present invention provides an implementation process for detecting the ambient light intensity, which can be applied to Figures 4 to 6 In the application scenario shown above, Figures 4 to 6In the scenarios shown, the electronic devices all detect the ambient light intensity through the front ambient light sensor, and then adaptively adjust the color temperature or brightness of the screen according to the detected ambient light intensity. The installation position of the front ambient light sensor can be referred to Fig.11 , Fig.11 This is an example diagram of a front ambient light sensor and a rear ambient light sensor provided in an embodiment of the present application.
[0192] However, in other scenarios, when the front ambient light sensor, such as Fig.11 The front ambient light sensor 701 is shown to be temporarily blocked by an obstruction (e.g., Fig.11 701 is blocked by the user's finger. Figure 6 When the electronic device in landscape mode is playing a game, the user's finger blocks the front ambient light sensor. The front ambient light sensor will think that the ambient light intensity has changed, but the ambient light intensity in the current environment has not changed. In this case, the electronic device will also adjust the color temperature or brightness of the screen to a color temperature or brightness that does not match the ambient light intensity in the surrounding environment. To avoid the above situation, the electronic device can combine Fig.11 (a) shows the ambient light intensity detected by the front ambient light sensor 701, and Fig.11 The ambient light intensity detected by the rear ambient light sensor 702 shown in (b) determines whether the ambient light intensity of the current environment has changed, and then the electronic device decides whether to adjust the color temperature or brightness of the screen based on the result of determining whether the ambient light intensity of the current environment has changed.
[0193] The following embodiment introduces the implementation process of an electronic device determining whether the ambient light intensity of the current environment has changed.
[0194] For example, please refer to Fig.12 , Fig.12 This is a schematic diagram of determining whether the ambient light intensity of the current environment has changed, provided by an embodiment of the present application. The schematic diagram includes steps 120 to 127.
[0195] In step 120, the electronic device detects ambient light intensity 2 through the front ambient light sensor and detects ambient light intensity 3 through the rear ambient light sensor. The front ambient light sensor and the rear ambient light sensor report the detected ambient light intensity to the electronic device processor for processing.
[0196] It should be understood that the front ambient light sensor can refer to Fig.11 701 shown in (a) of FIG. 701. When the electronic device adopts the under-screen method to install the ambient light sensor, the ambient light intensity 2 can be the above Fig.11The ambient light intensity 2 in the embodiment shown in (a) of FIG. Of course, the ambient light intensity 2 may also refer to the ambient light intensity detected by the electronic device in which the ambient light sensor is installed by digging a hole, and the embodiment of the present application is not limited to this.
[0197] The rear ambient light sensor can refer to Fig.11 (b) in FIG. 702 shows. Generally, an electronic device can be equipped with a rear ambient light sensor when a rear camera is installed, and the rear ambient light sensor is installed on the back of the electronic device. For ease of description, the value detected by the rear ambient light sensor is referred to as ambient light intensity 3 in the embodiment of the present application.
[0198] It should also be understood that the front ambient light sensor and the rear ambient light sensor can detect the ambient light intensity once every time length 1, and report the detected ambient light intensity to the processor each time. The embodiment of the present application does not limit the time length 1.
[0199] Step 121 : The processor in the electronic device determines whether the i-th ambient light intensity 2 is the same as the (i-1)-th ambient light intensity 2 .
[0200] It should be understood that the i-th ambient light intensity 2 can be understood as the ambient light intensity 2 obtained by the ambient light intensity 1 detected by the front ambient light sensor at the current moment, the i-1-th ambient light intensity 2 can be understood as the ambient light intensity 2 obtained by the ambient light intensity 1 detected by the front ambient light sensor at the previous moment of the current moment, and the time interval between the i-1-th and the i-th times can be duration 1, where i is an integer greater than 1.
[0201] It is also understandable that the processor can adjust the color temperature or brightness of the screen based on the i-th ambient light intensity 2. In implementation, the processor can adjust the color temperature or brightness of the screen according to the corresponding relationship 1 and the ambient light intensity 2. For example, the corresponding relationship 1 can refer to Table 1:
[0202] Table 1
[0203] Ambient light intensity Screen brightness Screen color temperature Value 1 Brightness 1 Color Temperature 1 Value 2 Brightness 2 Color Temperature 2 Value 3 Brightness 3 Color Temperature 3
[0204] Among them, in Table 1, value 1 is smaller than value 2, and value 2 is smaller than value 3. Brightness 1 is smaller than brightness 2, and brightness 2 is smaller than brightness 3. Color temperature 1 is smaller than color temperature 2, and color temperature 2 is smaller than color temperature 3.
[0205] Exemplarily, assuming that the ambient light intensity 2 detected by the front ambient light sensor at the current moment is the value 1 shown in Table 1, the processor can adjust the screen brightness to brightness 1 according to Table 1, or adjust the screen color temperature to color temperature 1. Assuming that the ambient light intensity 2 detected by the front ambient light sensor at the current moment is the value 2 shown in Table 1, the processor can adjust the screen brightness to brightness 2 and / or adjust the screen color temperature to color temperature 2 according to Table 1.
[0206] From the implementation process of the above-mentioned processor adjusting the color temperature or brightness of the screen, it can be seen that when the i-th ambient light intensity 2 is the same as the i-1-th ambient light intensity 2 (for example, the i-th ambient light intensity 2 and the i-1-th ambient light intensity 2 are both the value 1 in Table 1), the processor can consider that the ambient light intensity of the current environment has not changed, and the processor does not need to adjust the screen brightness or color temperature.
[0207] When the i-th ambient light intensity 2 is different from the i-1-th ambient light intensity 2, the processor may deem that the ambient light intensity of the current environment has changed, and the processor may adjust the screen brightness or color temperature according to the i-th ambient light intensity 2. However, the difference between the i-th ambient light intensity 2 and the i-1-th ambient light intensity 2 may be caused by the front ambient light sensor being blocked, in addition to the change in the ambient light intensity of the current environment. Therefore, after determining that the i-th ambient light intensity 2 is different from the i-1-th ambient light intensity 2, the processor needs to further determine whether the ambient light intensity of the current environment has changed through subsequent steps.
[0208] Step 122 : When the processor determines that the ambient light intensity 2 at the i-th time is the same as the ambient light intensity 2 at the (i-1)th time, the processor indicates that the ambient light intensity of the current environment has not changed.
[0209] Step 123 , when the processor determines that the i-th ambient light intensity 2 is different from the (i-1)-th ambient light intensity 2 , the processor determines whether the i-th ambient light intensity 3 is the same as the (i-1)-th ambient light intensity 3 .
[0210] It should be understood that the i-th ambient light intensity 3 can be understood as the ambient light intensity 3 detected by the rear ambient light sensor at the current moment, the i-1-th ambient light intensity 3 can be understood as the ambient light intensity 3 detected by the rear ambient light sensor at the previous moment before the current moment, and the time interval between the i-1-th and the i-th times can be a duration of 1, where i is an integer greater than 1.
[0211] It should also be understood that the rear ambient light sensor can detect the ambient light intensity 3 every time period 1, and report the ambient light intensity 3 detected each time to the processor.
[0212] Step 124 , when the processor determines that the i-th ambient light intensity 3 is the same as the (i-1)-th ambient light intensity 3 , it determines that the ambient light intensity of the current environment has not changed and the front ambient light sensor is blocked.
[0213] It should be understood that when the value detected by the front ambient light sensor changes, but the value detected by the rear ambient light sensor does not change, it can be considered that the ambient light intensity of the current environment has not changed and the front ambient light sensor is blocked. At this time, the processor does not need to adjust the screen brightness or color temperature.
[0214] Step 125 , when the processor determines that the i-th ambient light intensity 3 is different from the i-1-th ambient light intensity 3 , the processor determines whether the i-th ambient light intensity 2 and the i-th ambient light intensity 3 satisfy condition 1 .
[0215] It should be understood that condition 1 is a condition obtained through test data and data analysis for determining whether the front ambient light sensor is blocked when the value detected by the front ambient light sensor changes. For example, condition 1 may be:
[0216] lux 2i = k × lux 3i +b.
[0217] Among them, lux 2i Represents the ambient light intensity of the i-th time, 2, lux 2i represents the ambient light intensity 3 for the i-th time, k and b are coefficients.
[0218] It should also be understood that, through test data and data analysis, it is found that when the ambient light intensity of the current environment changes and the front ambient light sensor and the rear ambient light sensor are not blocked, the ambient light intensity 2 and the ambient light intensity 3 meet the above condition 1. Therefore, in the implementation, when the processor determines that the i-th ambient light intensity 3 is different from the i-1-th ambient light intensity 3, the i-th ambient light intensity 2 and the i-th ambient light intensity 3 can be substituted into the above condition 1. If the above condition 1 is met, the processor determines that the ambient light intensity of the current environment has changed and the front ambient light sensor and the rear ambient light sensor are not blocked, and the processor adjusts the brightness or color temperature of the screen according to the i-th ambient light intensity 2. If condition 1 is not met, the processor determines that the ambient light intensity of the current environment has not changed and the front ambient light sensor is blocked, and the processor does not adjust the brightness or color temperature of the screen.
[0219] Step 126, when the processor determines that the i-th ambient light intensity 2 and the i-th ambient light intensity 3 satisfy condition 1, it indicates that the ambient light intensity of the current environment has changed and the front ambient light sensor and the rear ambient light sensor are not blocked, and the processor adjusts the brightness or color temperature of the screen according to the i-th ambient light intensity 2.
[0220] Step 127 : When the processor determines that the i-th ambient light intensity 2 and the i-th ambient light intensity 3 do not satisfy condition 1 , it indicates that the ambient light intensity of the current environment has not changed and the front ambient light sensor is blocked.
[0221] The embodiments of the present application can accurately determine whether the ambient light intensity in the current environment has changed, and accurately determine whether the front ambient light sensor is blocked, based on the values detected by the front ambient light sensor and the rear ambient light sensor. When the ambient light intensity in the current environment changes, the brightness or color temperature of the screen is adjusted according to the value detected by the front ambient light sensor, thereby avoiding adjusting the brightness or color temperature of the screen when the front ambient light sensor is blocked but the ambient light intensity in the current environment has not changed, thereby improving the user experience.
[0222] The above embodiments introduce the implementation process of an electronic device determining whether the ambient light intensity of the current environment has changed. The following embodiments introduce the method for detecting the ambient light intensity provided by the embodiments of the present application. Figure 2 The electronic device 100 shown is executed, and may also be executed by a processor or chip in the electronic device 100, and the present application embodiment does not impose any limitation. For ease of description, the method is described in detail by taking an electronic device as an example.
[0223] The method is applied to an electronic device, wherein the electronic device comprises a glass cover plate, a screen and a front ambient light sensor which are sequentially arranged along the thickness direction of the electronic device, wherein an optical channel is arranged on the screen, and the ambient light and the screen light refracted by the glass cover plate can be irradiated on the front ambient light sensor through the optical channel, and the method comprises:
[0224] The electronic device detects a first ambient light intensity through a front ambient light sensor in response to a trigger event; processes the first ambient light intensity based on a first relationship between geometric parameters of the light channel, optical parameters of the glass cover, and screen light intensity of current screen light to obtain a second ambient light intensity;
[0225] Among them, the second ambient light intensity is the ambient light intensity after removing the interference light intensity and / or adding the loss light intensity from the first ambient light intensity, the interference light intensity is the ambient light intensity of the screen light after being refracted through the glass cover plate and irradiated on the front ambient light sensor through the optical channel, the loss light intensity is the ambient light intensity lost when the ambient light is refracted through the glass cover plate and passes through the optical channel, the first relationship includes a correspondence between multiple first distances and multiple first screen light intensities, the first distance is the distance between the position where the screen light enters the optical channel through the glass cover plate and the center position of the optical channel, one first distance corresponds to one first screen light intensity, and when the first distance is the radius of the optical channel, the first screen light intensity is the screen light intensity of the current screen light.
[0226] It should be understood that the glass cover, screen and front ambient light sensor included in the electronic device, as well as the positional relationship of these three components can be referred to Figure 1 In (b), the light channel refers to the hole obtained by digging the screen, through which the ambient light and the screen light can be irradiated to the ambient light sensor.
[0227] It should also be understood that a trigger event refers to an event that triggers the ambient light sensor to detect the ambient light intensity, such as Figure 4 The user is shown clicking on a "restart" control 4021, Figure 5 As shown, the user clicks on the “auto adjust” control 5031 , etc. The embodiment of the present application does not limit the triggering event.
[0228] It should also be understood that the light path of ambient light in the electronic device is: Please refer to Fig.10 When the ambient light first irradiates the upper surface of the glass cover plate, the ambient light is reflected for the first time and refracted for the first time. The ambient light refracted for the first time irradiates the lower surface of the glass cover plate through the upper surface of the glass cover plate. The ambient light refracted for the first time irradiates the lower surface of the glass cover plate and is refracted for the second time. The ambient light refracted for the second time irradiates the ambient light sensor through the optical channel. The ambient light refracted for the first time irradiates the lower surface of the glass cover plate and is reflected for the second time. The ambient light reflected for the second time irradiates the upper surface of the glass cover plate. The ambient light reflected for the second time irradiates the upper surface of the glass cover plate and is reflected for the third time. The ambient light reflected for the third time irradiates the lower surface of the glass cover plate. The ambient light reflected for the third time irradiates the lower surface of the glass cover plate and is refracted for the third time. The ambient light refracted for the third time irradiates the ambient light sensor through the optical channel. Fig.10 Only the ambient light irradiated onto the ambient light sensor through the optical channel after being refracted for the first to third times is shown in the figure, and the ambient light refracted for other times can refer to the above method.
[0229] It can also be understood that the light path of the screen light in the electronic device is: assuming that the screen light generated by the screen has two beams of light that interfere with the amount of ambient light entering, including the first beam of screen light and the second beam of screen light. The first beam of screen light enters the light channel after reflection and refraction by the glass cover plate, and then shines on the ambient light sensor. The second beam of screen light enters the light channel after reflection and refraction by the glass cover plate, and then shines on the ambient light sensor. The paths of other beams of screen light can refer to the paths of the first beam of screen light and the second beam of screen light, and will not be repeated here.
[0230] The front ambient light sensor can refer to Fig.11In 701, the first ambient light intensity refers to the value detected by the front ambient light sensor. The geometric parameters of the optical channel may include the diameter and radius of the optical channel, and the optical parameters of the glass cover may include the reflectivity and refractive index of the glass cover.
[0231] It should also be understood that the meaning of the first relationship can refer to the above embodiment, wherein the first distance in the first relationship can be Figure 8 Shown are r, r1, r2, etc. The screen light intensity can be Figure 8 The LA, LB and LC shown, etc., the current screen light intensity refers to Figure 8 It should be understood that Figure 8 The screen light intensity L corresponding to the position where the screen light is irradiated on the light channel is the radius r of the light channel. A If the value of changes, then the screen light shines on other positions on the light channel (such as Figure 8 The corresponding screen light intensity values are shown as r1 and r2 (for example Figure 8 L shown B and L C ) will also change. In implementation, the electronic device will configure a plurality of corresponding relationships between screen light intensities and a plurality of first relationships, such as screen light intensity 1 corresponding to first relationship 1, screen light intensity 2 corresponding to first relationship 2, and screen light intensity 3 corresponding to first relationship 3. The electronic device can process the first ambient light intensity using the first relationship corresponding to the screen light intensity of the current screen light to obtain the second ambient light intensity, such as the first relationship corresponding to the screen light intensity of the current screen light is first relationship 2.
[0232] In implementation, after the electronic device detects the first ambient light intensity through the front ambient light sensor, it can process the first ambient light intensity based on the first relationship between the radius of the optical channel, the refractive index and reflectivity of the glass cover plate, and the screen light intensity of the current screen light to obtain a second ambient light intensity obtained by removing the interference light intensity of the screen light refracted through the glass cover plate and irradiating the front ambient light sensor through the optical channel, or by adding the loss light intensity of the ambient light lost when passing through the optical channel after being refracted through the glass cover plate, or by removing the interference light intensity of the screen light refracted through the glass cover plate and irradiating the front ambient light sensor through the optical channel and by adding the loss light intensity of the ambient light lost when passing through the optical channel after being refracted through the glass cover plate.
[0233] In the related scheme, when the front ambient light sensor is installed under the screen, since the ambient light can be irradiated on the front ambient light sensor through the optical channel after being refracted by the glass cover plate, this will cause the loss of ambient light, and since the screen light can be irradiated on the front ambient light sensor through the optical channel after being refracted by the glass cover plate, this will interfere with the value detected by the front ambient light sensor. Due to the above factors, the ambient light intensity detected by the front ambient light sensor is inaccurate. The embodiment of the present application can process the first ambient light intensity based on the first relationship corresponding to the radius of the optical channel, the refractive index and reflectivity of the glass cover plate, and the screen light intensity of the current screen light, and obtain the second ambient light intensity after removing the interference light intensity irradiated on the front ambient light sensor through the optical channel after the screen light is refracted by the glass cover plate, and / or adding the loss light intensity lost when the ambient light is refracted by the glass cover plate through the optical channel. Compared with the related scheme, the interference of the screen light can be removed and / or the loss can be compensated, so that the value detected by the front ambient light sensor can be more accurate, thereby improving the user experience.
[0234] In some embodiments, the electronic device processes the first ambient light intensity based on a first relationship between geometric parameters of the light channel, optical parameters of the glass cover, and screen light intensity of the current screen light to obtain a second ambient light intensity, including:
[0235] The electronic device determines a first light input amount of the front ambient light sensor based on the first ambient light intensity and the geometric parameters of the optical channel; and determines a second ambient light intensity according to the first light input amount, the geometric parameters of the optical channel, the optical parameters of the glass cover and the first relationship.
[0236] It should be understood that the ambient light intensity detected by the ambient light sensor is related to the amount of incoming light. The relationship between the ambient light intensity and the amount of incoming light can refer to Formula 1 in the above embodiment.
[0237] In the embodiment of the present application, the interference light input amount can be removed from the light input amount (first light input amount) corresponding to the ambient light intensity detected by the ambient light sensor, and / or the lost light input amount can be compensated. The interference light input amount is caused by the reflection and refraction of the screen light, and the lost light input amount is caused by the reflection and refraction of the ambient light. Then, the second ambient light intensity in the above embodiment can be obtained based on the relationship between the ambient light intensity and the light input amount.
[0238] In implementation, after the front ambient light sensor detects the first ambient light intensity, the first ambient light intensity and the diameter of the light channel can be substituted into Formula 1 in the above embodiment to obtain the first light input amount of the front ambient light sensor. Thereafter, the second ambient light intensity is determined based on the first light input amount, the radius and diameter of the light channel, the refractive index and reflectivity of the glass cover, and the first relationship.
[0239] In an embodiment of the present application, the electronic device can first determine the first light input amount of the front ambient light sensor based on the first ambient light intensity and the geometric parameters of the optical channel, and then accurately determine the second ambient light intensity according to the first light input amount, the geometric parameters of the optical channel, the optical parameters of the glass cover and the first relationship.
[0240] In some embodiments, the electronic device determines the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover, and the first relationship, including:
[0241] The electronic device determines a second amount of light input based on the optical parameters of the glass cover, the geometric parameters of the optical channel and the first relationship, where the second amount of light input is the amount of light input from the screen that is refracted by the glass cover and shines on the front ambient light sensor through the optical channel; performs difference processing on the first amount of light input and the second amount of light input to obtain a third amount of light input; and determines the second ambient light intensity based on the third amount of light input and the geometric parameters of the optical channel.
[0242] It should be understood that the second ambient light intensity in the embodiment of the present application is the ambient light intensity obtained by removing the interference light intensity from the first ambient light intensity.
[0243] In implementation, the electronic device can substitute the refractive index and reflectivity of the glass cover, the radius of the light channel and the first relationship into Formula 3 in the above embodiment to obtain the second light input amount. Afterwards, the electronic device can substitute the first light input amount and the second light input amount into Formula 2.2 in the above embodiment to obtain the third light input amount. Afterwards, the electronic device substitutes the third light input amount and the diameter of the light channel into Formula 1 to obtain the second ambient light intensity.
[0244] In the embodiment of the present application, the second light input amount determined based on the optical parameters of the glass cover plate, the geometric parameters of the optical channel and the first relationship is the light input amount of the screen light after being refracted through the glass cover plate and irradiated on the front ambient light sensor through the optical channel, and the first light input amount is the light input amount corresponding to the first ambient light intensity detected by the front ambient light sensor. The electronic device performs difference processing on the first light input amount and the second light input amount to obtain a third light input amount, which is the light input amount after deducting the light input amount of the screen light after being refracted through the glass cover plate and irradiating on the front ambient light sensor through the optical channel from the first light input amount. Therefore, based on the third light input amount and the geometric parameters of the optical channel, the determined second ambient light intensity refers to the ambient light intensity after deducting the interference light intensity from the first ambient light intensity. Since the interference light intensity is removed, the second ambient light intensity is more accurate than the ambient light intensity detected by the front ambient light sensor in the related scheme.
[0245] In some embodiments, the electronic device determines the second ambient light intensity based on the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate, and the first relationship, including: determining a fourth light input amount based on the first light input amount, the optical parameters of the glass cover plate, the geometric parameters of the light channel, and the first relationship, the fourth light input amount being the amount of light input lost when the ambient light passes through the light channel after being refracted by the glass cover plate; summing the first light input amount and the fourth light input amount to obtain a fifth light input amount; and determining the second ambient light intensity based on the fifth light input amount and the geometric parameters of the light channel.
[0246] It should be understood that the second ambient light intensity in the embodiment of the present application is the ambient light intensity obtained by adding the loss light intensity to the first ambient light intensity.
[0247] In implementation, after the electronic device determines the first amount of light entering, it can substitute the first amount of light entering, the radius of the light channel, the refractive index and reflectivity of the glass cover, and the first relationship into Formula 9 in the above embodiment to obtain the fourth amount of light entering. Then, the first amount of light entering and the fourth amount of light entering are substituted into Formula 2.3 to obtain the fifth amount of light entering. Then, the fifth amount of light entering and the diameter of the light channel are substituted into Formula 1 to obtain the second ambient light intensity.
[0248] In the embodiment of the present application, the fourth light input amount determined based on the first light input amount, the optical parameters of the glass cover plate, the geometric parameters of the optical channel and the first relationship is the light input amount lost when the ambient light passes through the optical channel after being refracted by the glass cover plate, the first light input amount is the light input amount corresponding to the first ambient light intensity detected by the front ambient light sensor, and the electronic device sums the first light input amount and the fourth light input amount, and the fifth light input amount obtained is the light input amount after compensating for the light input amount lost when the ambient light passes through the optical channel after being refracted by the glass cover plate in the first light input amount. Therefore, based on the fifth light input amount and the geometric parameters of the optical channel, the second ambient light intensity determined refers to the ambient light intensity after the lost light intensity is added to the first ambient light intensity. The second ambient light intensity is more accurate than the ambient light intensity detected by the front ambient light sensor in the related scheme due to the addition of the lost light intensity.
[0249] In some embodiments, the electronic device determines the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover, and the first relationship, including:
[0250] The electronic device determines a second amount of light input based on the optical parameters of the glass cover plate, the geometric parameters of the optical channel and the first relationship, the second amount of light input being the amount of light input when the screen light is refracted through the glass cover plate and illuminates the front ambient light sensor through the optical channel; determines a sixth amount of light input based on the first amount of light input, the second amount of light input and the optical parameters of the glass cover plate, the sixth amount of light input being the amount of light input obtained by subtracting the amount of light input when the screen light is refracted through the glass cover plate and illuminates the front ambient light sensor through the optical channel from the first amount of light input, and the amount of light input lost when the ambient light is refracted through the glass cover plate and passes through the optical channel; determines a second ambient light intensity based on the sixth amount of light input and the geometric parameters of the optical channel.
[0251] It should be understood that in the embodiment of the present application, the second ambient light intensity is the ambient light intensity obtained by removing the interference light intensity and adding the loss light intensity from the first ambient light intensity.
[0252] In implementation, after obtaining the first amount of light input, the electronic device can substitute the refractive index and reflectivity of the glass cover plate, the radius of the light channel and the first relationship into Formula 3 in the above embodiment to obtain the second amount of light input. Then, the electronic device can substitute the first amount of light input, the second amount of light input, the refractive index and reflectivity of the glass cover plate into the above Formula 6 to obtain the sixth amount of light input, and then substitute the sixth amount of light input and the diameter of the light channel into Formula 1 to obtain the second ambient light intensity.
[0253] In the embodiment of the present application, due to the first light input amount, the second light input amount and the optical parameters of the glass cover plate, the determined sixth light input amount is the light input amount obtained by deducting the screen light that is refracted by the glass cover plate and then irradiated on the front ambient light sensor through the optical channel, and the light input amount lost when the ambient light is refracted by the glass cover plate and then passes through the optical channel from the first light input amount. Therefore, based on the sixth light input amount and the geometric parameters of the optical channel, the determined second ambient light intensity refers to the ambient light intensity after deducting the interference light intensity and adding the loss light intensity from the first ambient light intensity. The second ambient light intensity is more accurate than the ambient light intensity detected by the front ambient light sensor in the related scheme because the interference light intensity is removed and the loss light intensity is added.
[0254] In some embodiments, the second ambient light intensity is the ambient light intensity obtained by the first ambient light intensity detected by the front ambient light sensor for the i-th time, where i is an integer greater than 1; and the method further includes:
[0255] When determining that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, the electronic device adjusts the temperature or color temperature of the screen.
[0256] Regarding the meanings of the i-th time and the i-1-th time, please refer to the above embodiments and will not be repeated here.
[0257] In implementation, when the electronic device determines that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, the temperature or color temperature of the screen can be adjusted according to the second ambient light intensity obtained by the front ambient light sensor for the i-th time.
[0258] In some embodiments, the electronic device further includes a first ambient light sensor; and when the electronic device determines that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, adjusting the temperature or color temperature of the screen includes:
[0259] When it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the i-1th time, adjust the temperature or color temperature of the screen.
[0260] It should be understood that the first ambient light sensor may be Fig.11 In some embodiments, the first ambient light sensor may also be a front ambient light sensor, and the front ambient light sensor is installed at a different position in the electronic device than the front ambient light sensor in the above embodiments.
[0261] It is also understandable that when the front ambient light sensor mentioned in the above embodiment is temporarily blocked by an obstruction, the front ambient light sensor will think that the ambient light intensity has changed, but the ambient light intensity in the current environment has not changed, so the electronic device will also adjust the color temperature or brightness of the screen to a color temperature or brightness that does not match the ambient light intensity in the surrounding environment. In order to avoid the above situation, the embodiment of the present application can use multiple sensors to collaboratively determine whether the change in the value of the front ambient light sensor is caused by a change in the ambient light intensity of the current environment or because the front ambient light sensor is temporarily blocked by an obstruction.
[0262] In implementation, when the electronic device determines that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the i-1th time, and determines that the third ambient light intensity obtained by the first ambient light sensor for the i-1th time is different from the third ambient light intensity obtained by the first ambient light sensor for the i-1th time, at this time, it is determined that the change in the second ambient light intensity obtained by the front ambient light sensor is caused by a change in the ambient light intensity of the current environment, rather than by the front ambient light sensor being temporarily blocked by an obstruction. At this time, the electronic device can adjust the temperature or color temperature of the screen based on the second ambient light intensity obtained by the front ambient light sensor for the i-th time.
[0263] In some embodiments, when the electronic device determines that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the (i-1)th time, the electronic device adjusts the temperature or color temperature of the screen, including:
[0264] The electronic device adjusts the temperature or color temperature of the screen when it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time and the second ambient light intensity obtained by the front ambient light sensor for the i-th time meet a first condition, and the first condition is used to indicate that the front ambient light sensor is not blocked.
[0265] It should be understood that the first condition is that the third ambient light intensity obtained by the first ambient light sensor for the ith time has a linear relationship with the second ambient light intensity obtained by the front ambient light sensor for the ith time. Exemplarily, the first condition can refer to condition 1 in the above embodiment.
[0266] In implementation, when the electronic device determines that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time and the second ambient light intensity obtained by the front ambient light sensor for the i-th time meet the first condition, then it is determined that the change in the second ambient light intensity obtained by the front ambient light sensor is caused by a change in the ambient light intensity of the current environment, rather than by the front ambient light sensor being temporarily blocked by an obstruction. At this time, the electronic device can adjust the temperature or color temperature of the screen based on the second ambient light intensity obtained by the front ambient light sensor for the i-th time.
[0267] In the embodiment of the present application, the electronic device can accurately determine whether the ambient light intensity in the current environment has changed, and accurately determine whether the front ambient light sensor is blocked, based on the values detected by the front ambient light sensor and the first ambient light sensor. When the ambient light intensity in the current environment changes, the brightness or color temperature of the screen is adjusted according to the value detected by the front ambient light sensor, thereby avoiding adjusting the brightness or color temperature of the screen when the front ambient light sensor is blocked but the ambient light intensity in the current environment has not changed, thereby improving the user experience.
[0268] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0269] The embodiment of the present application provides a computer program product, when the computer program product is run on an electronic device, the electronic device executes the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above method-related embodiments, and will not be repeated here.
[0270] The embodiment of the present application provides a readable storage medium, the readable storage medium contains instructions, when the instructions are executed in an electronic device, the electronic device executes the technical solution of the above embodiment. The implementation principle and technical effect are similar, and will not be repeated here.
[0271] The embodiment of the present application provides a chip, the chip is used to execute instructions, when the chip is running, the technical solution in the above embodiment is executed. The implementation principle and technical effect are similar, and will not be repeated here.
[0272] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0273] It should be understood that the "embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0274] A person skilled in the art may understand that the various numerical numbers such as first and second involved in the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application, and also indicate the order of precedence.
[0275] In this application, elements expressed in the singular are intended to mean "one or more" rather than "one and only one", unless otherwise specified. In this application, "at least one" is intended to mean "one or more", and "more than one" is intended to mean "two or more", unless otherwise specified.
[0276] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. A can be singular or plural, and B can be singular or plural.
[0277] In this document, the term "at least one of..." means all or any combination of the listed items. For example, "at least one of A, B and C" may mean: A exists alone, B exists alone, C exists alone, A and B exist at the same time, B and C exist at the same time, and A, B and C exist at the same time. A may be singular or plural, B may be singular or plural, and C may be singular or plural.
[0278] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0279] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0280] The same or similar parts between the various embodiments in this application can refer to each other. In the various embodiments in this application, and the various implementation methods / implementation methods / implementation methods in each embodiment, if there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The above-described implementation methods of this application do not constitute a limitation on the scope of protection of this application.
[0281] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims. In short, the above is only a preferred embodiment of the technical solution of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for detecting ambient light intensity, applied to an electronic device, wherein the electronic device comprises a glass cover plate, a screen and a front ambient light sensor arranged in sequence along the thickness direction of the electronic device, wherein the screen is provided with an optical channel, and the ambient light and screen light refracted by the glass cover plate can be irradiated on the front ambient light sensor through the optical channel, the method comprising: In response to a trigger event, detecting a first ambient light intensity by the front ambient light sensor; Based on a first relationship between geometric parameters of the light channel, optical parameters of the glass cover plate, and screen light intensity of current screen light, the first ambient light intensity is processed to obtain a second ambient light intensity; Among them, the second ambient light intensity is the ambient light intensity after removing the interference light intensity and / or adding the loss light intensity from the first ambient light intensity, the interference light intensity is the ambient light intensity of the screen light after being refracted by the glass cover plate and irradiated on the front ambient light sensor through the optical channel, and the loss light intensity is the ambient light intensity lost when the ambient light is refracted by the glass cover plate and passes through the optical channel, and the first relationship includes a correspondence between multiple first distances and multiple first screen light intensities, the first distance is the distance between the position where the screen light enters the optical channel through the glass cover plate and the center position of the optical channel, one first distance corresponds to one first screen light intensity, and when the first distance is the radius of the optical channel, the first screen light intensity is the screen light intensity of the current screen light.
2. The method according to claim 1, characterized in that The processing of the first ambient light intensity based on the first relationship between the geometric parameters of the light channel, the optical parameters of the glass cover plate, and the screen light intensity of the current screen light to obtain the second ambient light intensity includes: Determining a first light input amount of the front ambient light sensor based on the first ambient light intensity and a geometric parameter of the optical channel; The second ambient light intensity is determined according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate and the first relationship.
3. The method according to claim 2, characterized in that The second ambient light intensity is the ambient light intensity obtained by removing the interfering light intensity from the first ambient light intensity; and determining the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate and the first relationship, comprises: Determine a second amount of light input based on the optical parameters of the glass cover plate, the geometric parameters of the light channel, and the first relationship, where the second amount of light input is the amount of light input that the screen light refracts through the glass cover plate and irradiates the front ambient light sensor through the light channel; Performing difference processing on the first light input amount and the second light input amount to obtain a third light input amount; The second ambient light intensity is determined based on the third incoming light quantity and the geometric parameters of the light channel.
4. The method according to claim 2, characterized in that: The second ambient light intensity is the ambient light intensity obtained by adding the loss light intensity to the first ambient light intensity; and determining the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate and the first relationship, comprises: Determine a fourth light intake amount based on the first light intake amount, the optical parameters of the glass cover plate, the geometric parameters of the light channel, and the first relationship, where the fourth light intake amount is the amount of light intake lost when the ambient light passes through the light channel after being refracted by the glass cover plate; The first light input amount and the fourth light input amount are summed to obtain a fifth light input amount; The second ambient light intensity is determined based on the fifth incoming light quantity and the geometric parameters of the light channel.
5. The method according to claim 2, characterized in that: The second ambient light intensity is the ambient light intensity obtained by removing the interference light intensity and adding the loss light intensity from the first ambient light intensity; and determining the second ambient light intensity according to the first light input amount, the geometric parameters of the light channel, the optical parameters of the glass cover plate and the first relationship, comprises: Determine a second amount of light input based on the optical parameters of the glass cover plate, the geometric parameters of the light channel, and the first relationship, where the second amount of light input is the amount of light input that the screen light refracts through the glass cover plate and irradiates the front ambient light sensor through the light channel; Based on the first light intake amount, the second light intake amount and the optical parameters of the glass cover plate, a sixth light intake amount is determined, where the sixth light intake amount is obtained by removing the light intake amount of the screen light refracted by the glass cover plate and irradiated on the front ambient light sensor through the optical channel, and the light intake amount of the ambient light lost when refracted by the glass cover plate and passing through the optical channel from the first light intake amount; The second ambient light intensity is determined based on the sixth incoming light quantity and the geometric parameters of the light channel.
6. The method according to any one of claims 1 to 5, characterized in that: The geometric parameters of the light channel include the radius of the light channel, and the optical parameters of the glass cover plate include the refractive index and reflectivity of the glass cover plate.
7. The method according to any one of claims 1 to 6, characterized in that: The second ambient light intensity is the ambient light intensity obtained by the first ambient light intensity detected by the front ambient light sensor for the i-th time, where i is an integer greater than 1; and the method further includes: When it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, the temperature or color temperature of the screen is adjusted.
8. The method according to claim 7, characterized in that The electronic device further includes a first ambient light sensor; and, in a case where it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the (i-1)th time, adjusting the temperature or color temperature of the screen includes: When it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the i-1th time, adjust the temperature or color temperature of the screen.
9. The method according to claim 8, characterized in that The method of adjusting the temperature or color temperature of the screen when it is determined that the second ambient light intensity obtained by the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by the first ambient light sensor for the i-1th time, comprises: When it is determined that the second ambient light intensity obtained by passing through the front ambient light sensor for the i-th time is different from the second ambient light intensity obtained by passing through the front ambient light sensor for the i-1th time, and the third ambient light intensity obtained by passing through the first ambient light sensor for the i-th time is different from the third ambient light intensity obtained by passing through the first ambient light sensor for the i-1th time, and the third ambient light intensity obtained by passing through the first ambient light sensor for the i-th time and the second ambient light intensity obtained by passing through the front ambient light sensor for the i-th time meet a first condition, the temperature or color temperature of the screen is adjusted, and the first condition is used to indicate that the front ambient light sensor is not blocked.
10. The method according to claim 9, characterized in that The first condition is that the third ambient light intensity obtained by the first ambient light sensor for the i-th time has a linear relationship with the second ambient light intensity obtained by the front ambient light sensor for the i-th time.
11. The method according to any one of claims 8 to 10, characterized in that The first ambient light sensor is a rear ambient light sensor.
12. An electronic device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the electronic device to perform the method as claimed in any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 11.
14. A chip, characterized in that: The chip comprises: A memory for storing instructions; A processor, configured to call and execute the instructions from the memory, so that an electronic device equipped with the chip executes the method as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Environment light detection method and device and electronic equipment
CN108051370A
Terminal, lampshade and ambient light approaching module
CN110753140A
Ambient light brightness calibration method of electronic equipment and electronic equipment
CN112017615A
Screen light detection model training method and device and ambient light detection method and device
CN113887599A
Terminal device with ambient light detection function and ambient light detection method
CN115705788A
