Ambient Light Reporting Method, Terminal Device, and Storage Medium

The gain adjustment function of the ambient light sensor is monitored through the SCP processor and the ambient light lux value is reported immediately when the adjustment is completed, which solves the problem of too long brightness adjustment time of terminal equipment and improves the user experience.

CN119254883BActive Publication Date: 2025-08-05HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410040090.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-09
Publication Date
2025-08-05
Estimated Expiration
2044-01-09

AI Technical Summary

Technical Problem

Existing terminal devices need to go through a long start dimming stage when ambient light changes, resulting in too long brightness adjustment time and affecting the user experience.

Method used

The gain adjustment function of the ambient light sensor is monitored through the SCP processor of the terminal device, set the end flag, and immediately report the ambient light lux value when the adjustment is completed, cancel the median filtering process, and directly send the noise-free ambient light value to the application processor to reduce the waiting time.

Benefits of technology

It shortens the time for brightness adjustment after ambient light changes, improves the user experience, and reduces the delay in reporting ambient light lux value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254883B_ABST
    Figure CN119254883B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to an ambient light reporting method, a terminal device, and a storage medium. The SCP processor of the terminal device determines to turn on the gain adjustment function based on the acquired ambient light value, and sets the end flag of the gain adjustment function when the gain adjustment function is completed. The application processor of the terminal device performs denoising on the ambient light value generated by the SCP processor to obtain a noise-free ambient light value, and sends the noise-free ambient light value to the SCP processor. The SCP processor calculates the ambient light lux value based on the noise-free ambient light value, and reports the ambient light lux value to the application processor in response to the end flag of the gain adjustment function. The SCP processor in the present application can immediately report the calculated ambient light lux value based on the end flag of the gain adjustment function, without waiting for the ambient light sensor to integrate the ambient light data collected in the next preset period before reporting, thereby reducing the time consumed by the SCP processor to report the ambient light lux value.
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 equipment, and in particular to an ambient light reporting method, a terminal equipment and a storage medium. Background Art

[0002] Current terminal devices (such as smartphones) are equipped with ambient light sensors to measure the light intensity of the surrounding environment in order to automatically adjust the brightness of the terminal device. When the ambient light changes, the ambient light value detected by the ambient light sensor will fluctuate greatly, and brightness adjustment will be turned on. For example, when a user carries a terminal device from a bright environment to a dark environment, the ambient light sensor of the terminal device can detect that the light intensity in the dark environment is insufficient, and automatically turn on brightness adjustment to increase the screen brightness so that the user can see the content on the display screen. However, when the ambient light changes, the terminal device needs to go through a startup dimming stage before it can start the brightness adjustment process. The startup dimming stage refers to the time period from the change in ambient light to the start of dimming. The startup dimming stage of existing terminal devices is too long, resulting in the terminal device taking a long time to achieve brightness adjustment, affecting the user experience. Summary of the Invention

[0003] In view of the above, it is necessary to provide an ambient light reporting method, a terminal device and a storage medium to solve the technical problem that the terminal device takes too long to start the dimming stage.

[0004] In a first aspect, an embodiment of the present application provides an ambient light reporting method, which is applied to a terminal device, the method comprising: a sensor of the terminal device cooperates with an SCP processor to obtain ambient light data according to a preset period, and obtains an ambient light value based on the ambient light data; if the SCP processor determines to turn on the gain adjustment function based on the ambient light value, when it detects that the gain adjustment function is completed, the end flag of the gain adjustment function is set; the SCP processor reports the ambient light value to an application processor of the terminal device; the application processor denoises the ambient light value and obtains a noise-free ambient light value, and sends the noise-free ambient light value to the SCP processor; the SCP processor calculates an ambient light illuminance lux value based on the noise-free ambient light value; the SCP processor responds to the end flag of the gain adjustment function and reports the ambient light lux value to the application processor. When the above technical solution detects that the ambient light sensor has turned on the gain adjustment function, the SCP processor monitors the action of the gain adjustment function. When the gain adjustment function ends, the SCP processor can immediately report the noise-free ambient light value returned by the AP processor based on the end flag of the gain adjustment function. There is no need to wait for the ambient light sensor to integrate the ambient light data collected in the next preset period before reporting, further reducing the time consumed by the SCP processor to report the ambient light lux value.

[0005] In one embodiment of the present application, after determining to enable the gain adjustment function, the method further includes: the SCP processor sending a notification message to the application processor, the notification message being used to instruct the SCP processor to enable the gain adjustment function; and the application processor canceling the median filtering process based on the notification message. The median filtering process is to sort all the ambient light lux values input into the noise memory of the terminal device and select the ambient light reported value in the middle position for output. In the above technology, when it is detected that the ambient light sensor has enabled the gain adjustment function, the SCP processor notifies the AP processor to cancel the median filtering process. This ensures that the ambient light lux value of the first frame of ambient light data reported by the SCP processor received by the AP processor will not be filtered by the median filtering process, thereby further reducing the time consumed by the SCP processor to report the ambient light lux value.

[0006] In one embodiment of the present application, canceling the median filtering process includes: clearing the value in the noise memory. The above technical solution can cancel the median filtering of the ambient light lux value by clearing the value in the noise memory.

[0007] In one embodiment of the present application, an application processor performs denoising on an ambient light value to obtain a noise-free ambient light value, including: the application processor calls a noise algorithm library to perform denoising on the ambient light value and removes image noise and backlight noise from the ambient light value to obtain a noise-free ambient light value. In this technical solution, the application processor calls a noise algorithm library to perform denoising on the ambient light value and removes image noise and backlight noise from the ambient light value, thereby eliminating the impact of the terminal device's screen being on.

[0008] In one embodiment of the present application, the SCP processor determines to turn on the gain adjustment function based on the ambient light value, including: if the ambient light value is greater than or equal to a first preset ambient light threshold, determining to turn on the gain adjustment function; if the ambient light value is less than the first preset ambient light threshold, determining not to turn on the gain adjustment function.

[0009] In one embodiment of the present application, after determining to enable the gain adjustment function, the method further includes: the SCP processor enabling the gain adjustment function to adjust the ambient light value. In the above technical solution, the SCP processor enabling the gain adjustment function to adjust the ambient light value can quickly adjust the ambient light value output by the ambient light sensor when the ambient light changes.

[0010] In one embodiment of the present application, the SCP processor enabling the gain adjustment function to adjust the ambient light value includes: the SCP processor determining a gain value based on the ambient light value, adjusting the ambient light value based on the gain value, and integrating the adjusted ambient light value. In the above technical solution, the SCP processor enabling the gain adjustment function to adjust the ambient light value can quickly adjust the ambient light integrated value output by the ambient light sensor when the ambient light changes.

[0011] In one embodiment of the present application, after reporting the ambient light lux value to the application processor, the method further includes: the SCP processor clearing an end flag of the gain adjustment function. In the above technical solution, the SCP processor clears the end flag of the gain adjustment function so that the lux value of the next ambient light data can be reported.

[0012] In one embodiment of the present application, after the ambient light lux value is reported to the application processor, the method further includes: the application processor performing brightness adjustment according to the ambient light lux value.

[0013] In a second aspect, an embodiment of the present application provides a terminal device, which includes a memory and a processor: the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the terminal device executes the above-mentioned ambient light reporting method.

[0014] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores program instructions. When the program instructions are executed on a terminal device, the terminal device executes the above-mentioned ambient light reporting method.

[0015] In addition, the technical effects brought about by the second to third aspects can be found in the descriptions of the methods of each design in the above method section, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 Schematic diagram of the time consumed by smartphones of different brands during the startup dimming phase.

[0018] Figure 2 A schematic diagram of a process for an ambient light sensor of a terminal device to report an ambient light value provided in one embodiment of the present application.

[0019] Figure 3 A schematic diagram of median filtering processing provided in one embodiment of the present application.

[0020] Figure 4 A schematic diagram of reporting ambient light data provided in an embodiment of the present application.

[0021] Figure 5 This is the technical architecture corresponding to the method for obtaining target ambient light through initial ambient light and content displayed on a display screen provided in an embodiment of the present application.

[0022] Figure 6 This is a flowchart of an ambient light reporting method provided in one embodiment of the present application.

[0023] Figure 7 This is a flowchart of an ambient light reporting method provided in another embodiment of the present application.

[0024] Figure 8 A schematic diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0025] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can mean A or B. "And / or" in this application is merely a way to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. 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.

[0027] Current terminal devices (such as smartphones) are equipped with ambient light sensors to measure the light intensity of the surrounding environment in order to automatically adjust the brightness of the terminal device. When the ambient light changes, the ambient light value detected by the ambient light sensor will fluctuate greatly, turning on the brightness adjustment. For example, when a user carries a terminal device from a bright environment to a dark environment, the ambient light sensor of the terminal device can detect that the light intensity in the dark environment is insufficient, and automatically turns on the brightness adjustment to increase the screen brightness so that the user can see the content on the display screen. However, when the ambient light changes, the terminal device needs to go through a startup dimming stage before it can start the brightness adjustment process. The startup dimming stage refers to the time period from the change in ambient light to the start of dimming. The startup dimming stage of existing terminal devices is too long, resulting in the terminal device taking a long time to achieve brightness adjustment, affecting the user experience.

[0028] Figure 1 The data shows the time spent on the startup dimming phase (i.e., startup dimming time) for smartphones of different brands. Brand A spent 1.36 seconds on this phase, while Brand B spent 1.18 seconds, Brand C spent 1.15 seconds, and Brand D spent 2.51 seconds. This experimental data shows that the startup dimming phase time consumed by smartphones of different brands reaches the second level, a noticeable impact on users and resulting in a poor user experience.

[0029] refer to Figure 2 The figure shows a flow chart of the ambient light sensor of a terminal device reporting ambient light values according to an embodiment of the present application. The processor in the terminal device is a multi-core processor, which includes at least an application processor (AP processor) and a sensor coprocessor (SCP processor). The AP processor is the application processor in the terminal device, and the operating system, user interface, and application programs all run on the AP processor. The SCP processor is a coprocessor that can assist the AP processor in performing tasks related to images, sensors (e.g., ambient light sensors), and the like.

[0030] The following describes the process of the ambient light sensor reporting the ambient light value, taking a smartphone as an example. The ambient light sensor acquires ambient light data and integrates the ambient light data according to a preset period. If the ambient light changes, the ambient light sensor integrates the acquired ambient light data and outputs an integral value greater than a first preset ambient light threshold. Because the integral value is greater than the preset ambient light range, the ambient light sensor's gain adjustment (GAIN) function is activated. The gain adjustment function refers to the ambient light sensor performing gain adjustment on the integral value and integrating the adjusted integral value again. During the gain adjustment period, the integral value output by the ambient light sensor is unstable. Therefore, during this period of gain adjustment, the integral value will not be reported to the SCP processor as the ambient light value. When the gain adjustment function ends or is no longer needed, the ambient light sensor will not immediately report the ambient light value after the ambient light change to the application according to the ambient light reporting period. This mainly causes the following two problems.

[0031] The first problem is that when the gain adjustment function ends or does not need to be adjusted, the SCP processor calculates the ambient light illuminance (lux) value and reports the ambient light lux value to the AP processor. The AP processor will store the ambient light lux value in the noise memory and perform median filtering on the ambient light lux value. Median filtering refers to sorting all the ambient light lux values input into the noise memory, and then selecting the ambient light value reported in the middle position for output. Since the ambient light lux value corresponding to the first frame of ambient light data after the ambient light changes has a large change compared to the ambient light data before the ambient light changes, it cannot occupy the middle position and will be filtered out, resulting in the inability to report the ambient light lux value of the first frame of ambient light data to the application. For example, refer to Figure 3 The three ambient light lux values stored in the noise memory are 1000, 20, and 50, of which 1000 is the ambient light lux value of the first frame of ambient light data. The AP processor sorts the three ambient light lux values stored in the noise memory to get 20, 50, and 1000, and selects the ambient light lux value 50 in the middle position for reporting. As a result, the ambient light lux value 1000 of the first frame of ambient light data cannot be reported. The ambient light lux value of the second frame of ambient light data after an ambient light reporting cycle will be reported after median filtering (refer to Figure 4 ).

[0032] The second problem is that after median filtering the ambient light lux value, the AP processor performs cutout processing on the median filtered ambient light lux value to remove image noise and backlight noise from the ambient light lux value, thereby eliminating the impact of the screen being on on the ambient light, and reports the noise-removed ambient light lux value to the SCP processor for storage. The ambient light lux value after removing image noise and backlight noise will not be calculated and reported until the next ambient light data integration. Therefore, after the ambient light changes, it is necessary to wait until the third frame of ambient light data in the next ambient light reporting cycle to match the current ambient light, and the ambient light lux value of the third frame of ambient light data will be reported to the application. As a result, the smartphone takes too long to start the dimming phase.

[0033] In order to solve the technical problem that the terminal device takes too long to start the dimming stage, the present application provides an ambient light reporting method. The method is applied in the terminal device. Figure 5 The technical architecture corresponding to the method for obtaining target ambient light through initial ambient light and content displayed on a display screen provided in an embodiment of the present application is described.

[0034] like Figure 5 As shown, the processors in the terminal device include an AP processor and an SCP processor. Figure 5 Only the AP processor and SCP processor are shown. In practical applications, the multi-core processor may also include other processors. For example, when the terminal device is a smartphone, the multi-core processor may also include a baseband (BP) processor that runs the smartphone's radio frequency communication control software and is responsible for sending and receiving data.

[0035] Figure 5 The AP processor only shows the content related to the embodiments of the present application. The implementation of the embodiments of the present application needs to rely on the following layers in the AP processor: application layer (Application), java framework layer (Framework Java), native framework layer (Framework native), hardware abstraction layer (HAL), kernel layer (kernel) and hardware layer (hardware).

[0036] Figure 5 The SCP processor in the example can be understood as a sensor hub that can control sensors and process sensor data. The implementation of the present application embodiment relies on the following components in the SCP processor: the Hub APK, the Hub FWK, the Hub DRV, and the Hub hardware.

[0037] There are various applications in the application layer of the AP processor. Figure 5 , application A and application B are shown. Taking application A as an example, after the user starts application A, the display screen will display the interface of application A. Specifically, application A sends the display parameters of the interface to be displayed by application A (for example, the memory address and color of the interface to be displayed) to the display engine service.

[0038] The display engine service in the AP processor sends the received display parameters of the interface to be displayed to the SurfaceFlinger of the native framework layer (Framework native) of the AP processor.

[0039] SurfaceFlinger in the native framework layer (Framework native) of the AP processor is responsible for controlling the fusion of the interface (surface). As an example, the overlapping area of at least two overlapping interfaces is calculated. The interface here may be the interface presented by the status bar, system bar, application itself (the interface to be displayed by application A), wallpaper, background, etc. Therefore, SurfaceFlinger can not only obtain the display parameters of the interface to be displayed by application A, but also obtain the display parameters of other interfaces.

[0040] The hardware abstraction layer (HAL) of the AP processor is called the Hardware Composer (HWC). The HWC is the system's interface synthesis and display module, providing hardware support for the SurfaceFlinger service. In step A1, SurfaceFlinger sends the display parameters (e.g., memory address, color, etc.) of each interface to the HWC through interfaces (e.g., setLayerBuffer, setLayerColor) for interface fusion.

[0041] Typically, when compositing an image (for example, when a terminal device displays an image, it is necessary to combine the status bar, system bar, application itself, and wallpaper background), the HWC obtains the composite image based on the display parameters of each interface through the HWC's underlying hardware (for example, the hardware compositor). The HWC in the hardware abstraction layer of the AP processor sends the image synthesized by the underlying hardware to the OLED driver, see step A2.

[0042] The OLED driver in the AP processor's core layer sends the synthesized image to the display subsystem (DSS) in the AP processor's hardware layer (see step A3). The display subsystem (DSS) in the AP processor's hardware layer can perform secondary processing on the synthesized image (for example, HDR10 processing to enhance image quality), and then send the processed image for display. In actual applications, secondary processing can also be omitted. In this example, the display subsystem in the AP processor's hardware layer sends the synthesized image to the OLED screen for display.

[0043] Taking the startup of application A as an example, the synthesized image displayed on the OLED screen is the interface synthesized from the interface to be displayed by application A and the interface corresponding to the status bar.

[0044] In the above manner, the OLED screen can complete one image refresh and display.

[0045] In an embodiment of the present application, the display subsystem (DSS) can be controlled to store the entire frame image (or an image larger than the target area in the entire frame image, or an image corresponding to the target area in the entire frame image) in the memory of the kernel layer of the AP processor before sending the secondary processed image (or synthesized image) for display. Since this process involves concurrently writing back image frame data, this memory can be referred to as concurrent write back (CWB) memory, see step A4.

[0046] In this embodiment of the present application, the display subsystem stores an entire frame of image in the CWB memory of the AP processor as an example. After the display subsystem successfully stores the entire frame of image in the CWB memory, the display subsystem can send a storage success signal to the HWC. The entire frame of image corresponding to the image stored in the CWB memory by the display subsystem can be recorded as the image to be refreshed (the image to be refreshed can also be understood as the image after the current refresh). The entire frame of image corresponding to the image stored in the CWB memory by the display subsystem can also be recorded as the first image.

[0047] The AP processor may also be configured to allow the HWC to access the CWB memory. Upon receiving a storage success signal from the display subsystem, the HWC may obtain the target image from the CWB memory, as shown in step A5.

[0048] It should be noted that regardless of whether the CWB memory stores a full-frame image or an image of a partial region within the full-frame image, the HWC can obtain the target image from the CWB memory. The process of the HWC obtaining the target image from the CWB memory can be referred to as the HWC cutting out the image from the CWB memory.

[0049] For ease of description, the image stored in the CWB memory by the display subsystem can also be referred to as the second image. As previously mentioned, the second image can be the first image, the target image, or an image between the target image and the first image. The target image's range can be understood as the size defined by its length and width. The first image's range is the entire frame, and can also be defined by its length and width.

[0050] Continuing with application A as an example, when application A needs to adjust brightness due to switching interfaces, application A sends the brightness to be adjusted to the display engine service.

[0051] The display engine service in the AP processor sends the brightness to be adjusted to the core node in the core layer of the AP processor, so that the relevant hardware can adjust the brightness of the OLED screen according to the brightness to be adjusted stored in the core node.

[0052] According to the above method, the OLED screen can complete one brightness adjustment.

[0053] In the embodiment of the present application, the HWC may be configured to obtain the brightness to be adjusted from the core node, and the brightness to be adjusted may also be recorded as the brightness after this adjustment. For details, see step A5'.

[0054] In a specific implementation, the HWC can monitor whether the data stored in the kernel node changes based on the uevent mechanism. After monitoring the data changes in the kernel node, the HWC obtains the currently stored data from the kernel node, that is, the brightness value to be adjusted (the brightness value to be adjusted is used to adjust the brightness of the display screen, so it can also be recorded as the brightness value of the display screen). After the HWC obtains the target image or the brightness information to be adjusted, it can send the target image or the brightness information to be adjusted to the noise algorithm library of the hardware abstraction layer of the AP processor. See step A6. The noise algorithm library can calculate the fusion noise of the target image refresh moment after each target image is obtained. After each brightness is obtained, the fusion noise of the brightness adjustment moment is calculated. The noise algorithm library stores the calculated fusion noise in the noise memory of the noise algorithm library.

[0055] In practical applications, after the HWC acquires the target image, it can store it and send the target image's storage address to the noise algorithm library. The noise algorithm library can then cache the latest target image frame by recording the address. After acquiring the brightness to be adjusted, the HWC can send the brightness to the noise algorithm library. The noise algorithm library can then cache the latest brightness. For ease of description, the subsequent embodiments of this application will be described as the HWC sending the target image to the noise algorithm library. In practical applications, this can mean that the HWC acquires the target image, stores it, and sends the target image's storage address to the noise algorithm library.

[0056] As an example, after the noise algorithm library receives the storage address of the first frame of the target image, it caches the storage address of the first frame of the target image. Each time a new target image storage address is subsequently received, the storage address of the new target image is used as the storage address of the latest cached target image. Correspondingly, after the noise algorithm library receives the first brightness, it caches the first brightness, and each time a new brightness is subsequently received, the new brightness is used as the latest cached brightness. In the embodiment of the present application, the noise algorithm library caches the acquired target image and brightness value to the data repository. The target image and brightness value stored in the data repository can both be recorded as screen data, that is, the screen data stored in the data repository includes: target image and brightness value.

[0057] In addition, in order to describe the transmission relationship between the target image, the brightness to be adjusted, and other parameters, the embodiment of the present application is described as an example in which the HWC sends the target image, the brightness to be adjusted, and other parameters to the noise algorithm library. In actual application, the relationship between the HWC and the noise algorithm library is that the HWC calls the noise algorithm library. When the HWC calls the noise algorithm library, the HWC inputs the target image (the storage address of the target image) and the brightness to be adjusted as independent variables of the calculation model in the noise algorithm library to the noise algorithm library. Other parameters will not be given as examples one by one.

[0058] Since brightness adjustment and image refresh are two completely independent processes, the image may be refreshed at a certain moment while the brightness remains unchanged. In this case, the target image corresponding to the refreshed image and the current brightness (the brightness value stored in the noise algorithm library before the time indicated by the timestamp of the target image) are used to calculate the fusion noise at this moment. For the sake of convenience, the fusion noise calculated due to image refresh at the image refresh moment can be recorded as the image noise at the image refresh moment. Similarly, if the image is not refreshed at a certain moment but the brightness is adjusted, the fusion noise at this moment is calculated using the adjusted brightness and the current target image (the target image stored in the noise algorithm library before the time indicated by the timestamp of the brightness value). For the sake of convenience, the fusion noise calculated due to brightness adjustment at the brightness adjustment moment can be recorded as the backlight noise at the brightness adjustment moment.

[0059] The target image and brightness sent by the HWC to the noise algorithm library are both timestamped. Accordingly, the image noise and backlight noise calculated by the noise algorithm library are also timestamped. The image noise timestamp is the same as the target image timestamp, and the backlight noise timestamp is the same as the brightness to be adjusted. The image noise timestamp should strictly be the image refresh time. In practical applications, other time points close to the image refresh time can also be used as the image refresh time. For example, the start time (or end time, or any time between the start and end time) when the HWC executes the cutout operation from the CWB memory to obtain the target image is used as the image refresh time. The backlight noise timestamp should strictly be the backlight adjustment time. In practical applications, other time points close to the backlight adjustment time can also be used as the backlight adjustment time. For example, the start time (or end time, or any time between the start and end time) when the HWC executes the brightness to be adjusted from the core node is used as the brightness adjustment time. The image noise timestamp and backlight noise timestamp facilitate subsequent denoising of the initial ambient light collected by the ambient light sensor over a time span to obtain the target ambient light. The noise algorithm library stores the image noise and backlight noise in the noise memory. When the noise algorithm library stores the image noise, it also stores the timestamp of the image noise. When the noise algorithm library stores the backlight noise, it also stores the timestamp of the backlight noise.

[0060] The ambient light sensor in the hardware layer of the SCP processor collects the initial ambient light at a certain preset period after being started (usually, the ambient light sensor is started after the terminal device is turned on). For example, the ambient light sensor in the hardware layer of the SCP processor enters an integration period, from t0 (t 01) moment. The ambient light sensor of the SCP processor transmits the initial ambient light information to the ambient light sensor driver (ALSDRV) of the hub driver layer (Hub DRV) of the SCP processor, see step E2. In step A1, the image is refreshed at time t0 (t01), and the SurfaceFlinger in the native framework layer of the AP processor sends the display parameters of the interface to the HWC in the hardware abstraction layer of the AP processor. The HWC can send the display parameters of each layer of the interface sent by the received SurfaceFlinger to the hardware at the bottom of the HWC, and the hardware at the bottom of the HWC obtains the composite image of each layer of the interface according to the display parameters of each layer of the interface. The hardware at the bottom of the HWC returns the composite image to the HWC.

[0061] In step A2, the HWC in the hardware abstraction layer of the AP processor sends the synthesized image to the OLED driver in the core layer of the AP processor.

[0062] In step A3, the OLED driver in the kernel layer of the AP processor sends the synthesized image to the display subsystem in the hardware layer of the AP processor.

[0063] In step A4, the display subsystem in the hardware layer of the AP processor stores the image before display in the CWB memory in the core layer of the AP processor.

[0064] In an embodiment of the present application, after the HWC sends the synthesized image to the OLED driver, the HWC will wait for a storage success signal sent by the display subsystem.

[0065] After the display subsystem successfully stores the pre-display image in the CWB memory, it sends a successful storage signal to the HWC. Upon receiving the successful storage signal from the display subsystem, the HWC extracts the target image from the pre-display image stored in the CWB memory in the kernel layer.

[0066] In step A5, the HWC in the hardware abstraction layer of the AP processor obtains the target image by clipping the image before display stored in the CWB memory in the kernel layer.

[0067] In step A6, the HWC in the AP processor's hardware abstraction layer obtains the target image and sends it to the noise algorithm library in this layer. Upon receiving the target image, the noise algorithm library calculates the image noise or backlight noise at time t01 based on the target image and the cached current brightness information. During steps A1 through A6, the ambient light sensor in the SCP processor's hardware coordination layer continues integrating within a preset period.

[0068] In step A7, the noise algorithm library in the hardware abstraction layer in the AP processor sends the image noise or backlight noise at time t01 to the HWC at the same layer.

[0069] In step A8 , after the AP processor calculates and obtains the image noise or backlight noise at time t01 , it sends the image noise or backlight noise at time t01 to the ambient light sensor application of the cooperative application layer of the SCP processor.

[0070] In step E5 , the ambient light sensor application of the co-application layer of the SCP processor sends the image noise at time t01 to the noise memory of the co-driver layer of the SCP processor.

[0071] In step E6, the SCP processor co-drives the denoising module in the layer to retrieve the fused noise from the noise memory of the layer.

[0072] In step E3, the SCP processor co-driver layer obtains the raw values of the four channels of the initial ambient light from the ambient light sensor of this layer.

[0073] In step E4, the SCP processor's co-driver layer calculates the target ambient light based on the raw values of the four channels of the initial ambient light and the image noise and backlight noise that interfere with the initial ambient light. In step E7, the calculation module in the SCP processor's co-driver layer calculates the target ambient light lux value based on the raw values of the four channels of the target ambient light. In step E8, the calculation module in the SCP processor sends the calculated target ambient light lux value to the ambient light sensor application in the co-application layer via the interface of the co-framework layer.

[0074] In step E9, the ambient light sensor application of the cooperative application layer in the SCP processor transmits the target ambient light lux value to the light service (lightservice) of the native framework layer in the AP processor through the second inter-core communication (communication from the SCP processor to the light service of the AP processor).

[0075] The LightService can send the target ambient light lux value to the Display Engine Service. The Display Engine Service can send the target ambient light lux value to the upper layer so that applications in the application layer can determine whether to adjust the brightness. The Display Engine Service can also send the target ambient light lux value to the kernel node so that the relevant hardware can adjust the brightness of the display based on the target ambient light lux value stored in the kernel node.

[0076] The following will be combined Figure 6 The following describes in detail an ambient light reporting method provided by an embodiment of the present application. Figure 6The method of the example includes one or more steps, but does not constitute a limitation of the present application. In addition, the order of the steps of the method is only for example, and the order of the steps can be changed. Additional steps can be added or steps can be reduced without departing from the content disclosed in the application. The method specifically includes the following steps.

[0077] In step S601 , the SCP processor obtains ambient light data according to a preset period, and obtains an ambient light value based on the ambient light data.

[0078] In one embodiment of the present application, the ambient light sensor of the SCP processor collects ambient light data according to a preset period and integrates the ambient light data to obtain an ambient light value. The ambient light sensor transmits the ambient light value to the ambient light sensor driver (ALSDRV) of the hub driver layer (Hub DRV) of the SCP processor.

[0079] In step S602, the SCP processor determines whether to enable the gain adjustment function according to the ambient light value. If the gain adjustment function is enabled, step S603 is executed; if not, step S607 is executed.

[0080] In one embodiment of the present application, the SCP processor determines whether to turn on the gain adjustment function based on the ambient light value, including: determining whether the ambient light value is greater than or equal to a first preset ambient light threshold, and if the ambient light value is greater than or equal to the first preset ambient light threshold, determining to turn on the gain adjustment function. If the ambient light value is less than the first preset ambient light threshold, determining not to turn on the gain adjustment function. In one embodiment of the present application, the ambient light value being greater than or equal to the first preset ambient light threshold indicates that the ambient light around the terminal device has undergone a large fluctuation. For example, when the terminal device enters a dark ambient light environment from a bright ambient light environment, the ambient light value fluctuates greatly, resulting in the ambient light value being greater than or equal to the first preset ambient light threshold, and determining that the gain adjustment function needs to be turned on. The first preset ambient light threshold can be set according to actual needs, and the present application does not impose any restrictions on this.

[0081] Step S603: The SCP processor sends a notification message to the AP processor, where the notification message is used to instruct the SCP processor to enable a gain adjustment function.

[0082] In one embodiment of the present application, the notification message may be agreed upon by the SCP processor and the AP processor. For example, the notification message may be agreed upon as a preset error code. The SCP processor sends the error code as a notification message to the AP processor, notifying the AP processor that the SCP processor has enabled the gain adjustment function.

[0083] In step S604, the SCP processor starts a gain adjustment function to adjust the ambient light value.

[0084] In one embodiment of the present application, the SCP processor enabling the gain adjustment function to adjust the ambient light value includes: the SCP processor determining a gain value based on the ambient light value, adjusting the ambient light value based on the gain value, and integrating the adjusted ambient light value to obtain the adjusted ambient light value. In one embodiment of the present application, the SCP processor determines the gain value based on the intensity of the ambient light value.

[0085] In step S605, the SCP processor determines whether the gain adjustment function has been completed based on the adjusted ambient light value. If the gain adjustment function has been completed, step S606 is executed. If the gain adjustment function has not been completed, the process returns to step S604 and the gain adjustment function is called to adjust the ambient light value.

[0086] In one embodiment of the present application, the SCP processor determines whether the adjustment gain function is completed based on the adjusted ambient light value, including: if the adjusted ambient light value is less than the second preset ambient light threshold, determining that the adjustment gain function is completed; if the adjusted ambient light value is greater than or equal to the second preset ambient light threshold, determining that the adjustment gain function is not completed.

[0087] Step S606: The SCP processor sets an end flag of the gain adjustment function.

[0088] In one embodiment of the present application, the SCP processor indicates the end of the gain adjustment function of the ambient light sensor by setting the end flag of the gain adjustment function. The end flag can be a character string, and the character string can include numbers, letters, or a combination of the two.

[0089] In step S607, the SCP processor reports the ambient light value to the AP processor.

[0090] In one embodiment of the present application, the SCP processor reports the ambient light value to the AP processor when the gain adjustment function is not turned on or when the gain adjustment function is completed. In one embodiment of the present application, reporting the ambient light value to the AP processor includes: calculating the ambient light lux value (i.e., the illuminance value of the ambient light) based on the ambient light value, and reporting the ambient light lux value to the AP processor. In one embodiment of the present application, the denoising module in the SCP processor cooperative driving layer reads the fused noise from the noise memory of this layer, obtains the initial (raw) values of the four channels of the ambient light value from the ambient light sensor of this layer, wherein the fused noise includes image noise and backlight noise; calculates the ambient light lux value based on the raw values of the four channels of the ambient light value and the image noise and backlight noise that interfere with the ambient light value; the SCP processor sends the calculated ambient light lux value to the HWC in the AP processor through the interface of the cooperative framework layer.

[0091] In step S608, the AP processor cancels the median filtering process according to the notification message, performs denoising on the ambient light value to obtain a noise-free ambient light value, and sends the noise-free ambient light value to the SCP processor.

[0092] In one embodiment of the present application, the AP processor canceling the median filtering process according to the notification message includes clearing the value in a noise memory in the AP processor. In one embodiment of the present application, the noise memory is a FIFO (First Input First Output) memory. A FIFO memory is a first-in, first-out dual-port buffer, where one port is the input port and the other is the output port.

[0093] In one embodiment of the present application, the HWC in the AP processor calls a noise algorithm library to perform denoising on the ambient light value and remove image noise and backlight noise from the ambient light value to obtain a noise-free ambient light value. In one embodiment of the present application, the noise algorithm library can calculate the image noise and backlight noise at the time the target image is refreshed each time the target image currently displayed by the terminal device is obtained. The HWC in the AP processor calls the noise algorithm library to obtain the image noise and backlight noise at the time the target image is refreshed, and performs denoising on the ambient light value based on the obtained image noise and backlight noise to remove the image noise and backlight noise from the ambient light value and obtain a noise-free ambient light value.

[0094] In step S609 , the SCP processor calculates the corresponding ambient light lux value according to the noise-free ambient light value.

[0095] In one embodiment of the present application, the SCP processor co-driver layer calculates the corresponding ambient light lux value based on the noise-free ambient light value.

[0096] In step S610, the SCP processor reports the ambient light lux value of the noise-free ambient light value to the AP processor in response to the end flag of the gain adjustment function.

[0097] In one embodiment of the present application, the SCP processor sends the calculated noise-free ambient light value of the ambient light lux value to the ambient light sensor application of the cooperative application layer through the interface of the cooperative framework layer, and the ambient light sensor application of the SCP processor transmits the ambient light lux value to the light service (lightservice) of the native framework layer in the AP processor.

[0098] Step S611: The SCP processor clears the end flag of the gain adjustment function.

[0099] In one embodiment of the present application, the SCP processor clears the end flag of the gain adjustment function so as to report the lux value of the next ambient light data.

[0100] In one embodiment of the present application, the method further includes: the AP processor adjusting the brightness according to the ambient light lux value.

[0101] In one embodiment of the present application, the light service in the AP processor sends the ambient light lux value to the display engine service. The display engine service can send the ambient light lux value to an application in the application layer, and the application in the application layer performs brightness adjustment.

[0102] In the embodiment of the present application, when it is detected that the ambient light sensor turns on the gain adjustment function, the SCP processor notifies the AP processor to cancel the median filtering process. This ensures that the ambient light lux value of the first frame of ambient light data reported by the SCP processor received by the AP processor will not be filtered by the median filtering process, thereby reducing the time consumed by the SCP processor to report the ambient light lux value. At the same time, the SCP processor monitors the action of the gain adjustment function, and when the gain adjustment function is completed, the SCP processor can immediately report the noise-free ambient light value returned by the AP processor according to the end flag of the gain adjustment function, without waiting for the ambient light sensor to integrate the ambient light data collected in the next preset period before reporting, further reducing the time consumed by the SCP processor to report the ambient light lux value.

[0103] refer to Figure 7 FIG. 1 is a flow chart of an ambient light reporting method provided by another embodiment of the present application. The method includes the following steps.

[0104] In step S701 , the SCP processor obtains ambient light data according to a preset period, and obtains an ambient light value based on the ambient light data.

[0105] In step S702, the SCP processor determines whether to enable the gain adjustment function based on the ambient light value. If the gain adjustment function is enabled, step S703 is executed. If the gain adjustment function is not enabled, step S704 is executed.

[0106] Steps S701-S702 and Figure 6 Steps S601-S602 are the same, and the specific implementation of steps S701-S702 can be referred to Figure 6 The implementation content of steps S601-S602 will not be repeated here.

[0107] Step S703: Upon detecting completion of the gain adjustment function, an end flag for the gain adjustment function is set. In one embodiment of the present application, after determining to enable the gain adjustment function, the SCP processor enables the gain adjustment function to adjust the ambient light value and detects whether the gain adjustment function has ended. If the gain adjustment function has ended, the end flag for the gain adjustment function is set.

[0108] Step S704: The SCP processor transmits the ambient light value to the AP processor.

[0109] In one embodiment of the present application, the SCP processor reports the ambient light value to the AP processor when the gain adjustment function is not enabled or the gain adjustment function is ended. Figure 6 Step S607 is the same, and the specific implementation content can be referred to Figure 6 Implementation content of step S607.

[0110] Step S705: The AP processor performs denoising on the ambient light value to obtain a noise-free ambient light value, and sends the noise-free ambient light value to the SCP processor.

[0111] In one embodiment of the present application, the HWC in the AP processor invokes a noise algorithm library to perform denoising on the ambient light value to remove image noise and backlight noise from the ambient light value. In one embodiment of the present application, the noise algorithm library can calculate the image noise and backlight noise at the time the target image is refreshed, each time after obtaining the target image currently displayed by the terminal device. The HWC in the AP processor invokes the noise algorithm library to obtain the image noise and backlight noise at the time the target image is refreshed, and then performs denoising on the ambient light value based on the obtained image noise and backlight noise to remove the image noise and backlight noise from the ambient light value, thereby obtaining a noise-free ambient light value.

[0112] In step S706 , the SCP processor calculates the ambient light lux value based on the noise-free ambient light value.

[0113] In step S707, the SCP processor responds to the end flag of the gain adjustment function and reports the ambient light lux value to the AP processor.

[0114] Step S708: The SCP processor clears the end flag of the gain adjustment function.

[0115] Steps S706-S708 and Figure 6 Steps S609-S611 are the same, and the specific implementation of steps S706-S708 can be referred to Figure 6 The implementation content of steps S609-S611 will not be repeated here.

[0116] In the embodiment of the present application, when it is detected that the ambient light sensor turns on the gain adjustment function, the SCP processor monitors the action of the gain adjustment function. When the gain adjustment function ends, the SCP processor can immediately report the noise-free ambient light value returned by the AP processor based on the end flag of the gain adjustment function, without having to wait for the ambient light sensor to integrate the ambient light data collected in the next preset period before reporting, thereby further reducing the time consumed by the SCP processor to report the ambient light lux value.

[0117] The following is an introduction to the terminal devices involved in the embodiments of the present application.

[0118] refer to Figure 8 In this embodiment, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure 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.

[0119] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0120] The processor 110 may include one or more processing units. For example, the processor 110 may 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). The different processing units may be independent devices or integrated into one or more processors.

[0121] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0122] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

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

[0124] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the terminal device 100.

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

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

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

[0128] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the terminal device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the terminal device 100.

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

[0130] The USB interface 130 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the terminal device 100, or to transfer data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect to other terminal devices 100, such as AR devices.

[0131] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.

[0132] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the terminal device 100. While charging the battery 142, the charging management module 140 can also provide power to the terminal device 100 via the power management module 141.

[0133] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0134] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0135] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0136] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

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

[0138] The wireless communication module 160 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. applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0139] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

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

[0141] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, terminal device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0142] The terminal device 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0143] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0144] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the 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 light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0145] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0146] Video codecs are used to compress or decompress digital video. Terminal device 100 may support one or more video codecs. This allows terminal device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0147] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in the terminal device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0148] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0149] Random access memory may 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, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0150] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage cell potential level; universal flash storage (UFS) and embedded multi media card (eMMC) can be divided into UFS and embedded multi media card according to the storage specification.

[0151] 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 the operating system or other running programs, and can also be used to store user and application data.

[0152] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0153] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory.

[0154] The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 110, the ambient light reporting method in the above embodiment can be executed on the terminal device 100 to implement the ambient light reporting function of the terminal device 100.

[0155] The terminal device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0156] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0157] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0158] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the user can hear the voice by placing the receiver 170B close to the ear.

[0159] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and can also identify the source of sound, realize directional recording function, etc.

[0160] The headphone jack 170D is used to connect a wired headphone and can be a USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

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

[0162] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for shooting anti-shake. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0163] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0164] The magnetic sensor 180D includes a Hall effect sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the terminal device 100 is a flip phone, the terminal device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Furthermore, based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0165] Accelerometer 180E can detect the magnitude of acceleration of the terminal device 100 in all directions (generally three axes). When the terminal device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of the terminal device 100, enabling applications such as switching between landscape and portrait modes and pedometers.

[0166] The distance sensor 180F is used to measure distance. The terminal device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0167] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100. The terminal device 100 can use the proximity light sensor 180G to detect when the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0168] Ambient light sensor 180L is used to sense ambient light brightness. Terminal device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether terminal device 100 is in a pocket to prevent accidental touches.

[0169] The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0170] The temperature sensor 180J is used to detect temperature. In some embodiments, the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to prevent the terminal device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0171] The touch sensor 180K is also called a "touch control device." The touch sensor 180K can be provided on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be provided on the surface of the terminal device 100, at a location different from that of the display screen 194.

[0172] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.

[0173] The buttons 190 include a power button, a volume button, etc. The buttons 190 may be mechanical buttons or touch buttons. The terminal device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 100.

[0174] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0175] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0176] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the terminal device 100 by inserting or removing it from the SIM card interface 195. The terminal device 100 can support one or N SIM card interfaces, where N is a positive integer greater than one. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.

[0177] This embodiment further provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on the terminal device 100, the terminal device 100 executes the above-mentioned related method steps to implement the ambient light reporting method in the above-mentioned embodiment.

[0178] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the ambient light reporting method in the above-mentioned embodiment.

[0179] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the ambient light reporting method in the above-mentioned method embodiments.

[0180] Among them, the terminal device 100, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0181] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0182] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0183] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0184] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0185] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0186] The above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the above preferred embodiments, those skilled in the art should understand that modifications or equivalent replacements of the technical solutions of the present application should not depart from the spirit and scope of the technical solutions of the present application.

Claims

1. A method for reporting ambient light, applied to a terminal device, characterized in that: The method comprises: The sensor co-processor of the terminal device acquires ambient light data according to a preset period, and obtains an ambient light value based on the ambient light data; If the sensor co-processor determines to start the gain adjustment function according to the ambient light value, upon detecting that the gain adjustment function is completed, setting an end flag of the gain adjustment function; The sensor co-processor reports the ambient light value to the application processor of the terminal device; The application processor performs denoising on the ambient light value to obtain a noise-free ambient light value, and sends the noise-free ambient light value to the sensor co-processor; The sensor co-processor calculates an ambient light illumination value according to the noise-free ambient light value; The sensor co-processor reports the ambient light illumination value to the application processor in response to the end flag of the gain adjustment function.

2. The ambient light reporting method according to claim 1, wherein: After determining to enable the gain adjustment function, the method further includes: The sensor co-processor sends a notification message to the application processor, where the notification message is used to instruct the sensor co-processor to enable the gain adjustment function; The application processor cancels the median filtering process according to the notification message. The median filtering process refers to sorting all the ambient light illumination values input into the noise memory of the terminal device and selecting the ambient light report value in the middle position for output.

3. The ambient light reporting method according to claim 2, wherein: The canceling of the median filtering process includes: Clear the value in the noise memory.

4. The ambient light reporting method according to claim 1, wherein: The application processor performs denoising on the ambient light value to obtain a noise-free ambient light value, including: The application processor calls a noise algorithm library to perform denoising on the ambient light value and remove image noise and backlight noise from the ambient light value to obtain the noise-free ambient light value.

5. The ambient light reporting method according to claim 1, wherein: The sensor co-processor determines to start a gain adjustment function according to the ambient light value, including: If the ambient light value is greater than or equal to a first preset ambient light threshold, determining to enable the gain adjustment function; If the ambient light value is less than a first preset ambient light threshold, it is determined not to enable the gain adjustment function.

6. The ambient light reporting method according to claim 1, wherein: After determining to enable the gain adjustment function, the method further includes: The sensor co-processor enables the gain adjustment function to adjust the ambient light value.

7. The ambient light reporting method according to claim 6, wherein: The sensor co-processor enabling the gain adjustment function to adjust the ambient light value includes: The sensor co-processor determines a gain value according to the ambient light value, adjusts the ambient light value according to the gain value, and integrates the adjusted ambient light value.

8. The ambient light reporting method according to claim 1, wherein: After reporting the ambient light illumination value to the application processor, the method further includes: The sensor co-processor clears an end flag of the gain adjustment function.

9. The ambient light reporting method according to claim 1, wherein: After reporting the ambient light illumination value to the application processor, the method further includes: The application processor performs brightness adjustment according to the ambient light illumination value.

10. A terminal device, characterized in that: The terminal device includes a memory and a processor: The memory is used to store program instructions; The processor is configured to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the terminal device executes the ambient light reporting method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program instructions, and when the program instructions are executed on a terminal device, the terminal device executes the ambient light reporting method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Ambient light detection method, electronic equipment and chip system

    CN113804290A

  • Ambient light detection method, electronic equipment, chip system and storage medium

    CN115931115A