Ambient light detection method, electronic device, and storage medium

By determining the location of the ambient light sensor and the target display area, and combining analog image processing and linear fitting algorithms, the problem of interference from the display screen to the ambient light sensor was solved, thereby improving the accuracy and efficiency of ambient light detection.

CN116136432BActive Publication Date: 2026-01-02HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111363891.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2026-01-02
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

When the ambient light sensor is located below the display screen, it is affected by the light emitted from the display screen, resulting in unreliable light intensity data and affecting the accuracy of ambient light detection.

Method used

By determining the position information of the ambient light sensor relative to the display screen, the target display area is identified, and simulated image processing is performed to obtain the target display parameters. The ambient light intensity value is calculated using a linear fitting algorithm, and the interference light intensity value of the display screen is subtracted to improve the detection accuracy.

Benefits of technology

It effectively avoids interference from the display screen's brightness on the ambient light sensor, improves the accuracy and efficiency of ambient light detection, and ensures the reliability of brightness data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116136432B_ABST
    Figure CN116136432B_ABST
Patent Text Reader

Abstract

The application provides an ambient light detection method, an electronic device and a storage medium, and relates to the technical field of terminals. The method is applied to an electronic device with a display screen and an ambient light sensor. The method comprises the following steps: acquiring an image to be displayed on the display screen; determining a target region image on the image based on a target display region corresponding to the ambient light sensor on the display screen; performing simulation image processing on image parameters of the target region image according to currently used display settings to obtain target display parameters; and determining an ambient light intensity value according to detection data collected by the ambient light sensor when the display screen displays the image and the target display parameters. According to the embodiments of the application, the accuracy of ambient light detection can be improved, and the detected light intensity value is reliable.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminal, and particularly relates to an ambient light detection method, an electronic device and a storage medium. BACKGROUND

[0002] In order to improve the visual experience, an all-screen industry design (ID) has become a design trend of portable electronic devices such as mobile phones. The frame width of the all-screen is greatly reduced, and the internal components of the mobile phone need to be rearranged. For example, an ambient light sensor (ALS) is usually placed below the display area of the display screen to detect the ambient light intensity. However, placing the ambient light sensor below the display area of the display screen will cause the ambient light sensor to be disturbed by the display screen display light when collecting ambient light information, so that the detected light brightness data is unreliable. SUMMARY

[0003] In view of the above, it is necessary to provide an ambient light detection method, an electronic device and a storage medium to improve the accuracy of ambient light detection and make the detected light intensity value reliable.

[0004] In a first aspect, an ambient light detection method is provided, which is applied to an electronic device with a display screen and an ambient light sensor, the ambient light sensor is located below the display screen, and the method comprises: acquiring an image to be displayed on the display screen; determining a target region image on the image based on a target display area corresponding to the ambient light sensor on the display screen; performing image parameter simulation processing on the target region image according to the current display setting to obtain target display parameters; and determining an ambient light intensity value according to the detection data collected by the ambient light sensor when the display screen displays the image and the target display parameters.

[0005] Through the above technical solution, the screen light of the display screen can be avoided to interfere with the ambient light sensor, and the situation that the detected light brightness value is unreliable can be avoided, so that the accuracy of ambient light detection can be improved.

[0006] In an implementation manner, the method further comprises: determining a display area on the display screen directly opposite to the ambient light sensor as the target display area. Through the above technical solution, the efficiency of determining the target display area can be improved.

[0007] In an implementation manner, the determining the display region on the display screen corresponding to the detection range of the ambient light sensor as the target display region comprises: determining the detection range corresponding to the ambient light sensor; and determining the display region on the display screen corresponding to the detection range of the ambient light sensor as the target display region. By the above technical solution, the display region on the display screen corresponding to the detection range of the ambient light sensor is determined as the target display region, the accuracy of determining the target display region is improved, the situation that the interference value of the screen light on the ambient light sensor calculated is inaccurate due to the target display region being too large or too small is avoided, meanwhile, the accuracy of the interference value of the screen light on the ambient light sensor calculated is ensured, and the accuracy of the ambient light detection is further improved.

[0008] In an implementation manner, the simulating image processing on the image parameters of the target region image according to the currently used display setting to obtain the target display parameter comprises: performing data conversion on the image parameters of the target region image to obtain converted image parameters; performing simulating image processing on the converted image parameters based on the display setting to obtain simulated processed image parameters; and performing data inverse conversion on the simulated processed image parameters to obtain the target display parameter. By the above technical solution, the image parameters are converted into a format suitable for simulating image processing when simulating image processing, and the simulated processed image parameters are restored into the previous data format after simulating image processing, the situation that the simulating processing effect is poor due to the data format mismatch is avoided, and the accuracy of simulating image processing is improved.

[0009] In an implementation manner, the detection data comprises detection RGB values, and the determining the ambient light intensity value according to the detection data collected by the ambient light sensor when the display screen displays the image and the target display parameter comprises: determining image RGB values corresponding to the detection RGB values and the target display parameter; and determining the ambient light intensity value according to the detection RGB values and the image RGB values.

[0010] In an implementation manner, the determining the ambient light intensity value according to the detection RGB values and the image RGB values comprises: subtracting the image RGB values from the detection RGB values to obtain actual RGB values; and converting the actual RGB values into corresponding light intensity values based on a linear fitting algorithm to obtain the ambient light intensity value. By the above technical solution, the accuracy of calculating the ambient light intensity value is improved by utilizing the linear relationship between the RGB values and the light intensity values.

[0011] In an implementation manner, the detection data includes a detection light intensity value, and determining the ambient light intensity value according to the detection data collected by the ambient light sensor when the display screen displays the image and the target display parameter includes: converting the image RGB value corresponding to the target display parameter into a corresponding image light intensity value based on a linear fitting algorithm; and subtracting the image light intensity value from the detection light intensity value to obtain the ambient light intensity value. According to the linear relationship between the light intensity value and the RGB value, the above technical solution can determine the interference value of the screen bright light on the ambient light sensor, and can improve the accuracy of determining the interference value of the screen bright light on the ambient light sensor.

[0012] In an implementation manner, the obtaining the image to be displayed on the display screen includes: determining a plurality of display layers constituting the image.

[0013] The determining the target region image on the image based on the target display region includes: determining at least one target layer in the plurality of display layers based on the target display region; determining a target layer region on the target layer according to the target display region; if there is only one target layer region, determining the target layer region as the target region image; and if there are a plurality of target layer regions, performing synthesis processing on the plurality of target layer regions to obtain the target region image.

[0014] Through the above technical solution, the non-target layer can be avoided to be processed, so that the determined target region image is more accurate, and the accuracy of the target region image is improved.

[0015] In an implementation manner, the obtaining the image to be displayed on the display screen includes: obtaining a plurality of display layers constituting the image, and synthesizing the plurality of display layers into the image. Through the above technical solution, the image after the synthesis of the plurality of display layers is obtained, and the target region image is determined in the synthesized image, so that the omission of information in the target region image is avoided, and the efficiency of determining the target region image can be improved.

[0016] In an implementation manner, before the simulating image processing on the image parameter of the target region image according to the currently used display setting to obtain the target display parameter, the method further includes: calculating a difference value between the target region image and a target region image corresponding to a previous frame image; and judging whether the difference value is less than a preset difference threshold.

[0017] The simulating image processing on the image parameter of the target region image according to the currently used display setting to obtain the target display parameter includes: if the difference value is not less than the preset difference threshold, simulating image processing on the image parameter of the target region image according to the currently used display setting to obtain the target display parameter.

[0018] The technical solution has the advantages that by comparing the difference value with the preset difference threshold, when the difference value is less than the preset difference threshold, the subsequent steps are stopped from being executed, thereby avoiding waste of computing power caused by simulating image processing on the target region image of each frame of image in the dynamic effect, and reducing data overhead.

[0019] In an implementation manner, the display setting includes one or more of a brightness setting, a display mode setting, a color adjustment, and a color temperature setting, wherein the display mode setting includes a dark mode and / or an eye protection mode.

[0020] In a second aspect, an electronic device is provided, which includes a memory and a processor; the memory is configured to store program instructions; and the processor is configured to read the program instructions stored in the memory to implement the ambient light detection method as described above.

[0021] In a third aspect, a computer readable storage medium is provided, which stores computer readable instructions, and the computer readable instructions are executed by a processor to implement the ambient light detection method as described above.

[0022] In addition, the technical effects brought by the second aspect and the third aspect can be referred to the descriptions of the methods in the method part, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 FIG. 1 is a schematic diagram of a part of an electronic device.

[0024] Figure 2 FIG. 6 is a flowchart of an image sending and screen displaying method provided by an embodiment of the present application.

[0025] Figure 3 FIG. 7 is a schematic diagram of a display screen displaying an image, provided by an embodiment of the present application.

[0026] Figure 4 FIG. 10 is a flowchart of an ambient light detection method provided by an embodiment of the present application.

[0027] Figure 5 FIG. 13 is a planar schematic diagram of an electronic device, provided by an embodiment of the present application.

[0028] Figure 6 FIG. 15 is a flowchart of a method for calculating an ambient light intensity value, provided by an embodiment of the present application.

[0029] Figure 7 FIG. 16 is another flowchart of a method for calculating an ambient light intensity value, provided by an embodiment of the present application.

[0030] Figure 8A schematic diagram of a display screen is provided for an embodiment of the present application.

[0031] Figure 9 A flowchart of determining a target region image is provided for an embodiment of the present application.

[0032] Figure 10 Another flowchart of determining a target region image is provided for an embodiment of the present application.

[0033] Figure 11 A flowchart of another ambient light detection method is provided for an embodiment of the present application.

[0034] Figure 12 A structural schematic diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0035] Hereinafter, the terms "first", "second", "third", etc. are used only for the purpose of description, and should not be understood as indicating or implying relative importance or implying that a specified number of technical features is indicated. Therefore, the features defined with "first", "second", etc. can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the words "exemplary", "or", "for example", etc. are used to mean an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the use of "exemplary", "or", "for example" and the like is intended to present the relevant concept in a specific manner.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the specification of the present application is only for the purpose of describing specific embodiments and is not intended to limit the present application. It should be understood that, unless otherwise specified, " / " in the present application means "or". For example, A / B can mean A or B. "And / or" in the present application is only a description of the relationship between the associated objects, which means that there can be three relationships. For example, A and / or B can mean: A alone, A and B together, B alone. "At least one" means one or more. "Multiple" means two or more. For example, at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c, a, b and c, seven cases.

[0037] Figure 1 A partial structural schematic diagram of an electronic device, Figure 1 The partial structure shown is a schematic diagram after cutting along a direction perpendicular to the display screen of the electronic device, and only part of the components are shown in the schematic diagram. In actual applications, more components can be included, and it is not limited toFigure 1 As shown in the figure, the electronic device can include a glass cover plate 101, a display screen 102, an ambient light sensor 103, and a shell 104. The display screen 102 can include a display panel, which can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), etc. Since the LCD itself is transparent and does not emit light, it needs to rely on the backlight panel set behind it to emit light, so the display screen 102 can also include a backlight panel, which can be a lighting emitting diode (LED). Figure 1 As shown in the figure, the electronic device can include a glass cover plate 101, a display screen 102, an ambient light sensor 103, and a shell 104. The display screen 102 can include a display panel, which can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), etc. Since the LCD itself is transparent and does not emit light, it needs to rely on the backlight panel set behind it to emit light, so the display screen 102 can also include a backlight panel, which can be a lighting emitting diode (LED).

[0038] In order to realize full-screen display, the ambient light sensor 103 is placed below the display screen, as shown in the figure. Figure 1 As shown in the figure, the ambient light sensor 103 is arranged below the glass cover plate 101 and the display screen 102, so the light detected by the ambient light sensor 103 includes not only the light in the external environment, but also the light generated by the display screen 102 when the screen is bright. Therefore, the brightness of the light collected by the ambient light sensor 103 will be greater than the actual ambient light brightness, resulting in unreliable detected light brightness data, which cannot accurately reflect the brightness of the external environment. In addition, it will further affect the effect of display screen brightness adjustment based on the ambient light detected by the ambient light sensor.

[0039] To solve the technical problem that placing the ambient light sensor below the display screen display area will interfere with the display screen display when the ambient light sensor collects ambient light information, resulting in unreliable detected light brightness data, the embodiments of the present application provide an ambient light detection method to improve the accuracy of ambient light detection.

[0040] In order to more conveniently understand the specific implementation of the ambient light detection method provided by the embodiments of the present application, before introducing the specific implementation of the ambient light detection method, the process of image sending and displaying on the screen is first summarized.

[0041] Figure 2 A flowchart of the image sending and displaying on the screen provided by the embodiments of the present application is shown in the figure. Figure 2As shown, the image to be displayed on the display screen includes three display layers, layer 1, layer 2 and layer 3.

[0042] 11, Hardware Abstraction Layer (HAL) implements the composition of the three display layers, layer 1, layer 2 and layer 3, to obtain the composed image. The HAL layer can control the hardware to perform the specified action, and provide hardware support for the SurfaceFlinger service, and jointly implement the composition of the display layer with the SurfaceFlinger service. The SurfaceFlinger service is a system service for composing layers, and is used for composing display layers. Specifically, the HAL layer includes an hwcomposer (HWC) module and a Graphics Processing Unit (GPU) module, and the HAL layer can control the HWC module and / or the GPU module to jointly implement the composition of the three layers, layer 1, layer 2 and layer 3, with the SurfaceFlinger service.

[0043] In the composition of the display layer, the color of different display layers can be superimposed, and the final color can be obtained by multiplying the value (referred to as RGB value) on the color three channels (Red Green Blue) of the display layer by the display degree corresponding to the display layer. The display degree is used to represent the transparency of the layer, and the smaller the display degree, the higher the transparency of the layer. For example, there are two layers (layer A and layer B), where layer A is (255, 0, 0) and layer B is (0, 255, 0). If the display degree of layer A is 100% and the display degree of layer B is 0%, the superimposed and composed image is red, and the RGB value is (255, 0, 0). If the display degree of layer A is 100% and the display degree of layer B is 100%, the superimposed and composed image is yellow, and the RGB value is (255, 255, 0).

[0044] As shown in FIG. 1, Figure 3 As shown in FIG. 1, Figure 3 is a schematic diagram of a display screen displaying an image provided by an embodiment of the present application. As shown in FIG. 1, Figure 3As shown, the display screen is located in a three-dimensional coordinate system, in which the Z axis points from inside the display screen to outside the display screen. The image displayed on the display screen is generated by superimposition of three display layers, Layer 1, Layer 2 and Layer 3. Each display layer includes corresponding attributes to represent the display state of the display layer. The attributes can include display parameters and display positions, where the display parameters can include, but are not limited to, color parameters and transparency parameters; the display positions are the positions of the display layer in the image to be displayed, such as the positions in the XYZ coordinate system of the display screen. The HAL layer and the SurfaceFlinger service can implement the composition of the display layers based on the corresponding attributes of the display layers.

[0045] 12. The display processing module performs image processing on the composed image according to the display settings corresponding to the electronic device, so that the processed image conforms to the display settings corresponding to the electronic device. The display processing module can be a hardware module, such as a chip, etc., for implementing image processing. The display settings of the electronic device can be used to adjust the display effect of the image, and the display settings can include brightness settings, display mode settings, color adjustment settings and / or color temperature settings, etc., where the display mode settings can include a dark mode and an eye-care mode, etc. The corresponding image parameters of the same image will also change accordingly in different display settings, and the image parameters include RGB parameters.

[0046] The image processing can include, but is not limited to, adjusting the color temperature, color gamut mapping (color space mapping), adjusting the saturation, which can be achieved by adjusting the original image parameters. The image processing performed by the display processing module on the composed image includes adjusting the original RGB parameter values of the image according to the display settings. For example, the eye-care mode is used to adjust the color temperature of the image to reduce the blue light generated by the image. During the image processing, the blue light generated by the image can be reduced by reducing the Blue (B) value in the original RGB parameter values of the image, so that the processed image conforms to the eye-care mode of the display screen. For another example, color adjustment is used to adjust the vividness of the image, also known as saturation adjustment. Increasing the saturation can make the image colors more vivid, and decreasing the saturation can make the image colors more dull. During the image processing, the saturation of the image can be adjusted by adjusting the original RGB parameter values of the image, so that the processed image conforms to the color adjustment settings of the display screen.

[0047] After the image processing by the display processing module, the RGB parameter values of the composed image will change, which are different from the RGB parameter values of the image before processing.

[0048] 13. The display screen displays the processed image.

[0049] For ease of understanding, the three image-related parameters (image parameters, display parameters, and target display parameters) involved in the embodiments of this application will be explained first. Image parameters, display parameters, and target display parameters are all parameters used to reflect image characteristics, and can be, but are not limited to, RGB parameters. RGB parameters are used to specify the relative depth of red, green, and blue; different RGB parameters will produce different colors. Image parameters can be the original RGB parameter values ​​of the image. Display parameters can be the RGB parameter values ​​of the image after image processing by the display processing module during the process of sending the image to the screen; that is, the RGB parameter values ​​of the image when displayed on the screen. The image processing process performed by the display processing module can be referred to the corresponding description in section 12. Target display parameters are parameters calculated by simulating the image processing process of the display processing module on the image, specifically by simulating the image processing of the image parameters (original RGB parameter values). The values ​​of display parameters and target display parameters are consistent; display parameters are RGB values ​​obtained through the actual image processing process, while target display parameters are RGB values ​​obtained through the simulated image processing process.

[0050] refer to Figure 4 The diagram shows a flowchart of an ambient light detection method provided in an embodiment of this application. The ambient light detection method is applied to electronic devices with displays. These electronic devices can be mobile phones, tablets, desktop computers, laptops, handheld computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, and / or smart city devices, etc., all electronic devices with displays. The method specifically includes:

[0051] 31. Determine the position information of the ambient light sensor relative to the display screen.

[0052] To achieve ultra-large or full-screen displays on electronic devices, an ambient light sensor is placed below the display screen. To facilitate understanding of the corresponding positional information, it is combined with... Figure 5 To explain, Figure 5 This is a plan view of an electronic device provided in an embodiment of this application. Figure 5 The electronic device shown is situated in a three-dimensional coordinate system, where the Z-axis is perpendicular to the display screen and points from inside the display screen to outside. An ambient light sensor is stacked on top of the display screen along the Z-axis, with the ambient light sensor positioned below the display screen. Figure 5The position information of the ambient light sensor relative to the display screen is position information of the ambient light sensor relative to the display screen in the Z-axis direction of the three-dimensional coordinate system in which the electronic device is located.

[0053] In some embodiments of the present application, the position information of the ambient light sensor relative to the display screen can be determined based on device information of the electronic device. The device information can include device structure information. Determining the position information of the ambient light sensor relative to the display screen based on the device information of the electronic device can improve the accuracy of determining the position information.

[0054] 32, determining a target display area on the display screen based on the position information.

[0055] In an embodiment of the present application, the display area on the display screen that will interfere with the light detection of the ambient light sensor after the display screen is brightened is determined as the target display area.

[0056] According to the position information of the ambient light sensor relative to the display screen, the display area on the display screen opposite the ambient light sensor is determined as the target display area. The display area on the display screen directly opposite the ambient light sensor can be determined as the target display area. For example, as shown in FIG. 1C, the display area on the display screen that coincides with the projection of the dashed line box (ambient sensor) can be determined as the target display area. Figure 5

[0057] In addition, in another embodiment of the present application, the corresponding target display area can be determined according to the detection range corresponding to the ambient light sensor, wherein the range on the display screen in which light that can be detected by the ambient light sensor can form is determined as the detection range. For example, as shown in FIG. 1D, in the Z-axis direction, part of the light can enter the sensor and be detected by the sensor, and the range on the display screen in which light that can be detected by the ambient light sensor can form is determined as the corresponding detection range. Figure 5

[0058] ​​Some ambient light sensors have a detection range that is larger or smaller than the display area on the display screen opposite the ambient light sensor. When the detection range of the ambient light sensor is larger than the display area on the display screen opposite the ambient light sensor, if only the display area on the display screen opposite the ambient light sensor is determined as the target display area, the calculated interference value of the screen light on the ambient light sensor will be smaller than the actual value, resulting in a detected light brightness value that is too large. When the detection range of the ambient light sensor is smaller than the display area on the display screen opposite the ambient light sensor, determining the display area on the display screen opposite the ambient light sensor as the target display area will result in a calculated interference value of the screen light on the ambient light sensor that is larger than the actual value, resulting in a detected light brightness value that is too small. Therefore, in some embodiments of the present application, the detection range of the ambient light sensor can be determined, and the display area on the display screen corresponding to the detection range of the ambient light sensor can be determined as the target display area.

[0059] In the above embodiments, the target display area is determined based on the detection range of the ambient light sensor, which improves the accuracy of determining the target display area, can avoid the situation that the calculated interference value of the screen light on the ambient light sensor is inaccurate due to the target display area being too large or too small, and at the same time ensures the accuracy of the calculated interference value of the screen light on the ambient light sensor, which further improves the accuracy of ambient light detection.

[0060] 33, determining an image to be displayed on the display screen. For example, the image to be displayed can be an image already in the gallery, and when a user clicks on a small icon of an image in the gallery, the image corresponding to the clicked small icon can be regarded as the image to be displayed.

[0061] 34, determining a target area image on the image based on the target display area.

[0062] The target area image is the image corresponding to the display on the target display area on the display screen, and the target area image is a part of the image to be displayed.

[0063] 35, determining a currently used display setting.

[0064] The display setting currently used by the electronic device is used to adjust the display effect of the image. The description of the display setting can refer to the corresponding description of step 12 of method 1000 in the above, and will not be repeated here. Figure 2

[0065] 36, performing simulated image processing on the image parameters of the target area image according to the display setting to obtain target display parameters.

[0066] Performing simulated image processing on the image parameters of the target area image according to the display setting is to​Figure 2 The display processing module in step 12 shown in the figure simulates the image processing process of the image output by the HAL layer according to the display settings corresponding to the display screen. The simulated image processing is used to achieve the same image processing effect as the display processing module image processing. For example, the display processing module performs image processing on the image parameters of the target region image to obtain display parameters according to the display settings corresponding to the display screen. The processor performs simulated image processing on the image parameters of the target region image to obtain target display parameters according to the display settings. The values of the display parameters and the target display parameters are consistent.

[0067] The simulated image processing can include simulated adjustment of color temperature, simulated color gamut mapping (simulated color space mapping), simulated adjustment of saturation, etc. The simulated image processing can be implemented by pre-programmed software code or by using the functions of existing image processing software. For example, the process of simulated adjustment of color temperature and simulated color gamut mapping can be implemented by using the desktop photo editing software Adobe Photoshop Lightroom, and the process of simulated color gamut mapping and simulated adjustment of saturation can be implemented by using a three-dimensional display lookup table (3-Dimensional Look-Up-Table, 3DLUT).

[0068] In some embodiments of the present application, the simulated image processing on the image parameters of the target region image according to the display settings to obtain target display parameters can specifically include: performing data conversion on the image parameters of the target region image to obtain converted image parameters; performing simulated image processing on the converted image parameters based on the display settings to obtain simulated processed image parameters; and performing data inverse conversion on the simulated processed image parameters to obtain the target display parameters. The data conversion / data inverse conversion includes linear conversion and non-linear conversion, etc., and can be implemented by a gamma (Gamma) function. The specific implementation process of the Gamma function for data conversion / data inverse conversion can refer to the related content of Gamma correction in the prior art.

[0069] By performing data conversion on the image parameters of the target region image, the non-linear image parameters are converted to converted linear parameters, which facilitates subsequent simulated image processing. Then, the linear parameters after simulated image processing are converted back to non-linear data to obtain non-linear target display parameters, which facilitates subsequent analysis. Through two times of data conversion, the image parameters are converted to a format suitable for simulated image processing during simulated image processing, and the simulated processed image parameters are restored to the previous data format after simulated image processing, avoiding the occurrence of poor simulated processing effect due to data format mismatch, and improving the accuracy of simulated image processing.

[0070] 37, while the display screen displays the image, the ambient light sensor detects ambient light to obtain detection data.

[0071] When the display screen displays the image, the ambient light sensor detects the current ambient light to obtain detection data, i.e., after step 13 shown in the figure, the ambient light sensor detects the current ambient light. The detection data can include, but is not limited to, the detection RGB value and the detection light intensity value detected by the ambient light sensor. Figure 2

[0072] 38, according to the target display parameter and the detection data, the ambient light intensity value is obtained.

[0073] In some embodiments of the present application, the detection data includes the detection RGB value, and the true ambient light intensity value can be obtained according to the image RGB value corresponding to the target display parameter and the detection RGB value. When the display screen displays the image, the RGB value detected by the ambient light sensor is determined as the detection RGB value. For example, the detection RGB value is subtracted from the image RGB value to obtain the RGB difference value, and the true ambient light intensity value is determined according to the RGB difference value.

[0074] Based on the image RGB value and the detection RGB value, the process of obtaining the ambient light intensity value can be as shown in the figure. Figure 6 For example, the detection RGB value is (158, 180, 205), the display image RGB value is (8, 10, 15), and the actual RGB value obtained by subtracting the display image RGB value from the detection RGB value is (150, 170, 190). Based on the linear fitting algorithm, the actual RGB value is converted into the corresponding light intensity value to obtain the ambient light intensity value.

[0075] Wherein, the linear fitting algorithm can be Lux=a×R+b×G+c×B. Wherein, R represents the value on the red channel, G represents the value on the green channel, and B represents the value on the blue channel, a represents the weight value of the red channel, b represents the weight value of the green channel, and c represents the weight value of the blue channel. The greater the weight value on a color channel, the greater the influence degree of the color channel on the light intensity value; the smaller the weight value on a color channel, the smaller the influence degree of the color channel on the light intensity value. The RGB value is substituted into the above linear fitting algorithm to obtain the light intensity value corresponding to the RGB value.

[0076] The values of a, b and c can be determined according to the RGB values detected by the ambient sensor under different light intensity values using the light source light box, and the relationship between the two (for example, the relationship between the light intensity value and the RGB value) is fitted according to the collected multiple groups of RGB values.

[0077] ​The above technical solution improves the accuracy of calculating the ambient light intensity value by using the linear relationship between the RGB value and the light intensity value.

[0078] The light sensing principle of the ambient light sensor is to sample and quantify light through one by one light sensing points. Each light sensing point can only sense one color in RGB to obtain a RAW RGB value. Some ambient light sensors output detection data as RAW RGB values sensed by light sensing points. Each pixel in the RAW RGB value has only one color (one of R, G, and B), while each pixel in the image RGB value corresponding to the target display parameter has three colors (R, G, and B). The RAW RGB value and the image RGB value are different in format.

[0079] Based on the above, in some embodiments of the present application, the real ambient light intensity value is obtained according to the image RGB value corresponding to the target display parameter and the detection RGB value, including: judging whether the detection RGB value meets a preset format; if the detection RGB value does not meet the preset format, performing format processing on the detection RGB value corresponding to the detection data to obtain a standard RGB value, and obtaining the real ambient light intensity value according to the standard RGB value and the image RGB value corresponding to the target display parameter. If the detection RGB value meets the preset format, no format processing is needed, and the real ambient light intensity value is directly obtained according to the detection RGB value and the image RGB value.

[0080] The format processing can include, but is not limited to, interpolation processing. Interpolation processing is used to calculate the values of other colors of a target light sensing point according to the values of the light sensing points around the target light sensing point and complementary to the color of the target light sensing point. For example, the color sensed by a light sensing point is R, and the interpolation processing is to calculate the G and B values of this point according to the values of the G and B light sensing points around this point, so as to restore the RGB value of this sensing point.

[0081] In some embodiments of the present application, the detection data includes a detection light intensity value, the image RGB value corresponding to the target display parameter can be converted into a corresponding image light intensity value based on a linear fitting algorithm; and the ambient light intensity value is obtained according to the detection light intensity value and the image light intensity value. When the display screen displays an image, the light intensity value detected by the ambient light sensor is determined as the detection light intensity value. For example, the real ambient light intensity value is obtained by subtracting the image light intensity value from the detection light intensity value.

[0082] Based on the detection light intensity value and the image light intensity value, the process of obtaining the ambient light intensity value can be as follows: Figure 7As shown, the image RGB value corresponding to the target display parameter is calculated based on a linear fitting algorithm to determine the image light intensity value corresponding to the target region image, and the detection light intensity value corresponding to the detection data is subtracted by the image light intensity value to obtain the ambient light intensity value.

[0083] The linear fitting algorithm can be Lux=a×R+b×G+c×B. For the introduction of the linear fitting algorithm, please refer to the related description in Figure 5 , which will not be repeated here. The image RGB value corresponding to the target display parameter is substituted into Lux=a×R+b×G+c×B to obtain the image light intensity value corresponding to the target region image. The image light intensity value is the light intensity value of the screen light interfering with the ambient light detected by the ambient light sensor when the display screen displays the image. The ambient light intensity value detected by the ambient light sensor is subtracted by the image light intensity value to obtain the real ambient light intensity value.

[0084] According to the linear relationship between the light intensity value and the RGB value, the interference value of the screen light on the ambient light sensor can be determined, which can improve the accuracy of determining the interference value of the screen light on the ambient light sensor.

[0085] The specific implementation of determining the target region image on the image based on the target display region corresponding to the ambient light sensor on the display screen will be introduced below.

[0086] In some embodiments of the present application, the image to be displayed on the display screen includes determining a plurality of display layers constituting the image. Determining the target region image on the image based on the target display region can include determining at least one target layer in the plurality of display layers based on the target display region, and determining a target layer region on the target layer. Each target layer corresponds to a target layer region, and there are multiple target layers, so there are multiple target layer regions. If there is only one target layer region, the target layer region is determined as the target region image, and if there are multiple target layer regions, the multiple target layer regions are synthesized to obtain the target region image.

[0087] The plurality of display layers constituting the image to be displayed on the display screen can be obtained during the image sending and displaying on the screen, before the HAL layer synthesizes the plurality of display layers, such as the step 11 shown in Figure 2 .

[0088] The target display region can be determined in the multiple display layers based on the position information of the target display region on the display screen and the position information of the multiple display layers on the image to be displayed. The display layer that overlaps with the target display region can be determined as a target layer, such as the display layer that is displayed in the target display region. Figure 8 As shown in FIG. 7, the display screen is located in a three-dimensional coordinate system, in which the Z axis points from inside the display screen to outside the display screen. The image displayed on the display screen is generated by superimposition of three display layers, layer 1, layer 2 and layer 3. The dashed box represents the target display region. The display layers that overlap with the target display region are layer 2 and layer 3. Layer 2 and layer 3 are determined as target layers. Each target layer includes a corresponding target layer region, which corresponds to the target display region.

[0089] If there are multiple target layer regions, the multiple target layer regions obtained can be synthesized by the SurfaceFlinger service to obtain a target region image.

[0090] For example, as shown in FIG. 8, the image to be displayed on the display screen includes three display layers, layer 1, layer 2 and layer 3. The display layers that overlap with the target display region are layer 1 and layer 2. Layer 1 and layer 2 are determined as target layers. The target layer regions are determined on layer 1 and layer 2 according to the position of the target display region to obtain target layer region 1 and target layer region 2. Target layer region 1 and target layer region 2 are synthesized to obtain a target region image. Figure 9 By determining the display layer that overlaps with the target display region as a target layer, and determining the target layer region in the target layer based on the position of the target display region, and synthesizing the target layer region, a target region image is obtained. The above method can avoid processing non-target layers, so that the target region image determined is more accurate, and the accuracy of the target region image is improved.

[0091] In some embodiments of the present application, the image to be displayed on the display screen is obtained by determining multiple display layers that constitute the image to be displayed on the display screen, and synthesizing the multiple display layers to obtain the image.

[0092] After the multiple display layers are synthesized by the HAL layer in the image sending process, as shown in step 11 of FIG. 9, the synthesized image is obtained as the image to be displayed on the display screen.

[0093] Figure 2 For example, as shown in FIG. 10, the image to be displayed on the display screen includes three display layers, layer 1, layer 2 and layer 3. The display layers that overlap with the target display region are layer 1 and layer 2. Layer 1 and layer 2 are determined as target layers. The target layer regions are determined on layer 1 and layer 2 according to the position of the target display region to obtain target layer region 1 and target layer region 2. Target layer region 1 and target layer region 2 are synthesized to obtain a target region image.

[0094] For example, as shown in FIG. 10, the image to be displayed on the display screen includes three display layers, layer 1, layer 2 and layer 3. The display layers that overlap with the target display region are layer 1 and layer 2. Layer 1 and layer 2 are determined as target layers. The target layer regions are determined on layer 1 and layer 2 according to the position of the target display region to obtain target layer region 1 and target layer region 2. Target layer region 1 and target layer region 2 are synthesized to obtain a target region image. Figure 10 ​As shown, the image to be displayed on the display screen includes three display layers, i.e., layer 1, layer 2 and layer 3. Layer 1, layer 2 and layer 3 are synthesized, and the synthesized image is determined as the image to be displayed on the display screen. According to the position of the target display area, a target area image is determined on the image to be displayed.

[0095] By obtaining the synthesized image of the plurality of display layers and determining the target area image in the synthesized image, omission of information in the target area image is avoided, and the efficiency of determining the target area image can be improved.

[0096] The screen light of the display screen can interfere with the ambient light detected by the ambient light sensor, resulting in unreliable detected light brightness data. By using the ambient light detection method provided in the embodiments of the present application, the interference of the screen light of the display screen with the ambient light sensor and the resulting unreliable detected light brightness data can be avoided, and the accuracy of ambient light detection can be improved.

[0097] Reference Figure 11 As shown, a flowchart of another ambient light detection method provided in the embodiments of the present application. The ambient light detection method is applied to an electronic device with a display screen.

[0098] 40, determining position information of the ambient light sensor relative to the display screen.

[0099] 41, determining a target display area on the display screen based on the position information.

[0100] 42, determining an image to be displayed on the display screen.

[0101] 43, determining a target area image on the image based on the target display area.

[0102] 44, calculating a difference value between the target area image and a target area image corresponding to a previous frame image.

[0103] When displaying a dynamic effect, the electronic device displays one frame of image after another. Each time a frame of image is displayed, the image sending and display on screen process (as shown in Figure 2 The ambient light detection method shown in Figure 3 The ambient light detection method shown in Figure 3 is a branch process related to the image sending and display on screen process. Therefore, each time a frame of image is displayed, the method shown in

[0104] The difference value between the target region image and the target region image corresponding to the previous frame image can be determined according to the RGB value corresponding to the target region image and the RGB value corresponding to the target region image corresponding to the previous frame image.

[0105] The image is composed of a plurality of pixel points, and each pixel point includes a corresponding RGB value. Since the target region image and the target region image corresponding to the previous frame image have the same image size, the target region image and the target region image corresponding to the previous frame image include the same number of pixel points in consistent order and the same number of RGB values. According to the order of the pixel points, the pixel points of the target region image are compared with the pixel points of the target region image corresponding to the previous frame image, for example, the pixel point in the first row and the first column of the target region image is compared with the pixel point in the first row and the first column of the target region image corresponding to the previous frame image, and the pixel point in the second row and the second column of the target region image is compared with the pixel point in the second row and the second column of the target region image corresponding to the previous frame image.

[0106] According to the RGB value corresponding to the pixel point, the difference pixel point value between the pixel point of the target region image and the pixel point of the target region image corresponding to the previous frame image is determined. If the RGB value of a pixel point in the target region image is different from the RGB value of the corresponding pixel point in the target region image of the previous frame image, the pixel point in the target region image is determined as a difference pixel point. For example, if the RGB value corresponding to the pixel point in the first row and the first column of the target region image is different from the RGB value corresponding to the pixel point in the first row and the first column of the target region image corresponding to the previous frame image, the pixel point in the first row and the first column of the target region image is determined as a difference pixel point.

[0107] The number of difference pixel points can be calculated, and the difference value is obtained by dividing the number of difference pixel points by the number of pixels corresponding to the target region image.

[0108] 45, determining whether the difference value is less than a preset difference threshold.

[0109] If the difference value is less than the preset difference threshold, the flow of the ambient light detection method ends; if the difference value is greater than or equal to the preset difference threshold, 46 is executed.

[0110] If the difference value between a target region image and a target region image corresponding to a previous frame image is less than a preset difference value, it indicates that the target region image has a small change compared with the target region image corresponding to the previous frame image, and the time difference between the two frames is small, so it is not necessary to continue to perform the simulation image processing on the target region image to calculate the current ambient light intensity value. If the difference value between a target region image and a target region image corresponding to a previous frame image is greater than or equal to a preset difference value, it indicates that the target region image has a large change compared with the target region image corresponding to the previous frame image, and the time difference between the two frames is large, so it is necessary to continue to perform the simulation image processing on the target region image to calculate the current ambient light intensity value.

[0111] By comparing the difference value with the preset difference threshold, the subsequent steps can be stopped when the difference value is less than the preset difference threshold, so as to avoid the waste of computing power caused by performing the simulation image processing on the target region image of each frame of image in the dynamic effect, and reduce the data overhead.

[0112] 46, determine the current display setting used.

[0113] 47, perform simulation image processing on the image parameters of the target region image according to the display setting to obtain target display parameters.

[0114] 48, when displaying the image on the display screen, an ambient light sensor detects ambient light to obtain detection data.

[0115] 49, obtain an ambient light intensity value according to the target display parameters and the detection data.

[0116] In some embodiments of the present application, the ambient light detection method is performed at a preset time interval. The preset time interval can be set according to actual conditions, such as 400 ms, which is not limited herein. By setting the preset time interval to perform the ambient light detection method, the waste of computing power caused by continuously performing the ambient detection method is avoided, and the energy consumption is reduced.

[0117] Figure 12 A structural schematic diagram of an electronic device with a display screen is provided for the embodiments of the present application. Referring to Figure 12The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyro sensor 180B, a barometric sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0118] It can be understood that the structure shown in the embodiments 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 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0119] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices, or can be integrated into one or more processors.

[0120] The controller can generate operation control signals according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions. In some embodiments of the present application, the processor 110 can be configured to determine position information of the ambient light sensor 180L relative to the display screen 194, determine a target display area on the display screen 194 based on the position information, determine an image to be displayed on the display screen 194, determine a target area image on the image based on the target display area, determine a display setting of the display screen 194, and perform analog image processing on image parameters of the target area image according to the display setting to obtain target display parameters, and finally obtain a real ambient light intensity value based on the target display parameters and detection data obtained by the ambient light sensor 180L after displaying the image on the display screen 194.

[0121] The processor 110 can couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the electronic device 100. In some embodiments of the present application, the user can adjust the display setting of the display screen 194 based on the touch function, and the display setting is used to adjust the display effect of the image. The display setting can include brightness setting, display mode setting, color adjustment and color temperature setting, etc. The display mode setting can include dark mode and eye protection mode, etc. The corresponding image parameters of the same image are different in different display settings.

[0122] The processor 110 and the display screen 194 communicate through the DSI interface to realize the display function of the electronic device 100. In some embodiments of the present application, the processor 110 controls the display screen 194 to display the image to be displayed through the DSI interface communication.

[0123] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or combinations of multiple interface connection modes in the above embodiments.

[0124] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to a loudspeaker 170A, a receiver 170B, etc.), or displays an image or a video through the display screen 194. In some embodiments of the present application, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110 and be arranged in the same device as the mobile communication module 150 or other functional modules.

[0125] The electronic device 100 implements a display function through a GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is configured to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information. In some embodiments of the present application, the GPU is configured to perform synthesis processing on a plurality of display layers included in an image to be displayed on the display screen to obtain a synthesized display image.

[0126] The display screen 194 is configured to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments of the present application, the electronic device 100 can include one or N display screens 194, N being a positive integer greater than 1, and the display screen 194 is configured to display an image to be displayed.

[0127] The electronic device 100 can implement a photographing function through an ISP, the camera 193, a video codec, a GPU, a display screen 194, and an application processor, etc.

[0128] The camera 193 is used to capture still images or videos. Objects project optical images through a lens to a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to an ISP to convert into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into a standard image signal in RGB, YUV, or the like. In some embodiments of the present application, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.

[0129] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 is in frequency selection, the digital signal processor is used to perform Fourier transform on the frequency energy, etc.

[0130] The internal memory 121 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, such as the fifth generation DDR SDRAM commonly referred to as DDR5 SDRAM), and the like; the non-volatile memory can include magnetic disk storage devices, flash memories. The flash memories can include NOR FLASH, NAND FLASH, 3D NAND FLASH, and the like according to operating principles, and can include single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), and the like according to storage unit potential order, and can include universal flash storage (UFS), embedded multi media Card (eMMC), and the like according to storage specifications.

[0131] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of an operating system or other programs running, and can also be used to store data of users and application programs, and the like.

[0132] The non-volatile memory can also store executable programs and store data of users and application programs, and the like, and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.

[0133] The external memory interface 120 can be used to connect an external nonvolatile memory, to extend the storage capacity of the electronic device 100. The external nonvolatile memory communicates with the processor 110 through the external memory interface 120, to implement a data storage function. For example, files such as music and videos are saved in the external nonvolatile memory.

[0134] The pressure sensor 180A is used to sense a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments of the present application, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments of the present application, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity greater than or equal to a first pressure threshold is applied to a preset area of the display screen 194, it is determined that the user performs an adjustment operation on the display settings of the display screen 194.

[0135] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed brightness of ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent false touch. In some embodiments of the present application, the ambient light sensor 180L is used to perform ambient light detection when the display screen 194 displays an image, to obtain detection data.

[0136] The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locking, fingerprint photographing, fingerprint answering a call, and the like.

[0137] The temperature sensor 180J is configured to detect temperature. In some embodiments of the present application, the electronic device 100 performs temperature handling strategy based on the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In another embodiment, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In other embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0138] The touch sensor 180K is also referred to as a "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch panel". The touch sensor 180K is configured to detect a touch operation acting on or near the touch sensor 180K. The touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, which is different from the position where the display screen 194 is located.

[0139] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments of the present application, the bone conduction sensor 180M can obtain a vibration signal of a human body sound part vibration bone block. The bone conduction sensor 180M can also contact the human body pulse to receive a blood pressure pulsation signal. In some embodiments of the present application, the bone conduction sensor 180M can also be disposed in a headset to form a bone conduction headset. The audio module 170 can analyze a voice signal based on the vibration signal of the sound part vibration bone block obtained by the bone conduction sensor 180M to realize a voice function. The application processor can analyze heart rate information based on the blood pressure pulsation signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0140] The keys 190 include a power-on key, a volume key, and the like. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0141] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompt, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations acting on different regions of the display screen 194. Different application scenarios (such as time reminders, received messages, alarms, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0142] The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, etc.

[0143] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 195 to realize contact and separation with the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. The same SIM card interface 195 can simultaneously insert multiple cards. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external storage cards. The electronic device 100 interacts with a network through the SIM card to realize functions such as calling and data communication. In some embodiments of the present application, the electronic device 100 uses an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0144] The embodiment also provides a computer storage medium, which stores computer instructions. When the computer instructions run on the electronic device 100, the electronic device 100 executes the related method steps to realize the ambient light detection method in the above embodiment.

[0145] The embodiment also provides a computer program product. When the computer program product runs on a computer, the computer executes the related steps to realize the ambient light detection method in the above embodiment.

[0146] In addition, the embodiment of the present application also provides a device, which can be a chip, a component or a module. The device can include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device runs, the processor can execute the computer execution instructions stored in the memory to enable the chip to execute the ambient light detection method in the above method embodiments.

[0147] The electronic device, the computer storage medium, the computer program product or the chip provided in the embodiment are used for executing the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be described here again.

[0148] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0149] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiment described above is only illustrative, for example, the division of the module or unit is only a logical function division, and in actual implementation, another division manner can be used, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0150] The unit described as a separate component can or can not be physically separated, and the component shown as a unit can be one physical unit or a plurality of physical units, that is, can be located in one place, or can be distributed to a plurality of different places. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.

[0151] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0152] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or in other words the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The software product is stored in a storage medium and includes a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. An ambient light detection method applied to an electronic device with a display screen and an ambient light sensor, the ambient light sensor being located below the display screen, characterized in that, The method comprises: acquiring an image to be displayed on the display screen; determining a target region image on the image based on a corresponding target display region of the ambient light sensor on the display screen, calculating a difference value between the target region image and a target region image corresponding to a previous frame image of the image, and judging whether the difference value is less than a preset difference threshold; if the difference value is greater than or equal to the preset difference threshold, performing analog image processing on image parameters of the target region image according to a currently used display setting to obtain target display parameters; determining an ambient light intensity value based on detection data collected by the ambient light sensor when the display screen displays the image and the target display parameters.

2. The ambient light detection method of claim 1, wherein, The method further comprises: determining a display region on the display screen directly opposite the ambient light sensor as the target display region.

3. The ambient light detection method of claim 2, wherein, The determination of the display region on the display screen directly opposite the ambient light sensor as the target display region comprises: determining a detection range corresponding to the ambient light sensor; determining a display region on the display screen corresponding to the detection range of the ambient light sensor as the target display region.

4. The ambient light detection method of claim 1, wherein, The analog image processing on the image parameters of the target region image according to the currently used display setting to obtain the target display parameters comprises: performing data conversion on the image parameters of the target region image to obtain converted image parameters; performing analog image processing on the converted image parameters based on the display setting to obtain analog-processed image parameters; performing inverse data conversion on the analog-processed image parameters to obtain the target display parameters.

5. The ambient light detection method of claim 1, wherein, The detection data comprises detection RGB values, and the determination of the ambient light intensity value based on the detection data collected by the ambient light sensor when the display screen displays the image and the target display parameters comprises: determining image RGB values corresponding to the detection RGB values and the target display parameters; determining an ambient light intensity value based on the detection RGB values and the image RGB values.

6. The ambient light detection method of claim 5, wherein, The determination of the ambient light intensity value based on the detection RGB values and the image RGB values comprises: subtracting the image RGB values from the detection RGB values to obtain actual RGB values; converting the actual RGB values into corresponding light intensity values based on a linear fitting algorithm to obtain the ambient light intensity value.

7. The ambient light detection method of claim 1, wherein, The detection data comprises detection light intensity values, and the determination of the ambient light intensity value based on the detection data collected by the ambient light sensor when the display screen displays the image and the target display parameters comprises: converting image RGB values corresponding to the target display parameters into corresponding image light intensity values based on a linear fitting algorithm; subtracting the image light intensity values from the detection light intensity values to obtain the ambient light intensity value.

8. The ambient light detection method of claim 1, wherein, The acquisition of the image to be displayed on the display screen comprises: determining a plurality of display layers constituting the image; The determination of the target region image on the image based on the target display region comprises: determining at least one target layer in the plurality of display layers based on the target display region; According to the target display area, a target layer area is determined on the target layer; If there is only one target layer area, the target layer area is determined as a target area image, and if there are multiple target layer areas, the multiple target layer areas are subjected to a synthesis process to obtain a target area image.

9. The ambient light detection method of claim 1, wherein, The image to be displayed on the display screen includes: A plurality of display layers constituting the image are obtained, and the plurality of display layers are synthesized into the image.

10. The ambient light detection method according to any one of claims 1 to 9, characterized in that, The display settings include one or more of brightness settings, display mode settings, color adjustment, and color temperature settings, wherein the display mode settings include a dark mode and / or an eye protection mode.

11. An electronic device, comprising: The electronic device includes a memory and a processor; The memory is configured to store program instructions; The processor is configured to read the program instructions stored in the memory to implement the ambient light detection method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by the processor to implement the ambient light detection method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Ambient light detection method, ambient light detection apparatus, terminal device, and storage medium

    WO2021077618A1