Screen brightness adjustment method, terminal device, and storage medium

By building a cross-processor communication channel in the terminal device, the backlight adjustment module can obtain the ambient light brightness value in a timely manner, which solves the problem of mismatch between display brightness and ambient light brightness and improves the user experience.

CN119252193BActive Publication Date: 2025-11-28HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410045822.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2025-11-28
Estimated Expiration
2044-01-10

AI Technical Summary

Technical Problem

The brightness of the terminal device's display screen does not match the actual ambient light brightness, causing the display screen to brighten first and then dim or dim first and then brighten, which affects the user experience.

Method used

By building a cross-processor communication channel in the terminal device, and using multiple preset interfaces to achieve direct communication between the backlight adjustment module and the ambient light sensor, the ambient light brightness value is obtained within an effective time, and the brightness value of the first frame that matches the actual ambient light brightness is determined.

Benefits of technology

It effectively avoids noticeable brightness changes when the display is on, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119252193B_ABST
    Figure CN119252193B_ABST
Patent Text Reader

Abstract

The application provides a screen brightness adjusting method, a terminal device and a storage medium, and relates to the technical field of terminals. The method comprises the following steps: in response to a screen-on event, a backlight module sends a brightness value acquisition request to a first interface; in response to the brightness value acquisition request, the first interface sends a first instruction to a second interface; the second interface generates a second instruction according to the first instruction and sends the second instruction to an ambient light sensor driver; the ambient light sensor driver sends a target ambient light brightness value to the adjusting backlight module through the second interface and the first interface in sequence in response to the second instruction; and the adjusting backlight module determines a first frame brightness value according to the target ambient light brightness value, so that a display driver controls a display screen to turn on the screen according to the first frame brightness value. The above method can make each brightness value acquisition request sent by the adjusting backlight module receive a returned ambient light brightness value, and ensure that the adjusting backlight module can acquire the ambient light brightness value within an effective time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of terminals, and particularly relates to a screen brightness adjustment method, a terminal device and a storage medium. BACKGROUND

[0002] A terminal device can be installed with an ambient light sensor. The ambient light sensor is used to detect ambient light in an environment where the terminal device is located, and determine actual ambient light brightness corresponding to the terminal device. The actual ambient light brightness plays a very key role in the use of the terminal device. For example, the display brightness of the display screen of the terminal device can be determined according to the actual ambient light brightness. An application in the terminal device can register an ambient light service in a sensor manager (sensormanager), so that a sensor hub (Sensor Hub) can determine the ambient light brightness at a preset time interval.

[0003] The sensormanager sends a registration signal corresponding to the ambient light service to the Sensor Hub at a preset time interval, so that the Sensor Hub realizes the timing update of the ambient light brightness. However, in the related art, when the sensormanager receives multiple ambient light services, the received services are screened and some services are filtered out. After the ambient light service is filtered out, the sensormanager does not generate a registration signal corresponding to the service, so the Sensor Hub cannot receive the registration signal corresponding to the service, and cannot update the ambient light brightness. The matching relationship between the brightness of the display screen when the display screen is turned on and the actual ambient light brightness is extremely important for the experience of a user. For example, when the display screen is turned on and displays, if the Sensor Hub cannot generate the actual ambient light brightness in time, the display engine may not be able to determine the actual ambient light brightness in time, resulting in that the brightness set when the display screen is turned on is not appropriate, and even the display screen may appear to be first bright and then dark, or first dark and then bright. SUMMARY

[0004] The embodiments of the application disclose a screen brightness adjustment method, a terminal device and a storage medium, which can avoid the situation that the brightness of the display screen when the display screen is turned on does not match the current ambient light brightness due to the filtering of the sensormanager on the ambient light service and the failure of the Sensor Hub to send the ambient light brightness value to the backlight adjustment module in time.

[0005] The first aspect of the application discloses a screen brightness adjusting method applied to a terminal device, wherein the terminal device comprises an application processor and a sensor coprocessor, the application processor comprises a framework layer, a kernel layer and a hardware abstraction layer, and the sensor coprocessor comprises a co-driver layer and a co-hardware layer, and the method comprises the following steps: in response to a screen-on event, a brightness value acquisition request is sent from an adjusting backlight module of the framework layer to a first interface of the framework layer; in response to the received brightness value acquisition request, a first instruction is sent from the first interface to a second interface in the hardware abstraction layer; the second interface generates a second instruction according to the received first instruction, and sends the second instruction to an ambient light sensor driver in the co-driver layer; the ambient light sensor driver sends a target ambient light brightness value uploaded by an ambient light sensor in the co-hardware layer to the adjusting backlight module through the second interface and the first interface in sequence in response to the received second instruction; the adjusting backlight module determines a first frame brightness value according to the target ambient light brightness value, and sends the first frame brightness value to a display driver in the kernel layer; and the display driver controls a display screen of the terminal device to turn on the screen according to the first frame brightness value. The above method establishes a transmission channel for the adjusting backlight module in the AP processor to acquire the ambient light brightness value of the ambient light sensor in the SCP processor through a plurality of preset interfaces, facilitates the adjusting backlight module to acquire the ambient light data from the ambient light sensor driver, and moreover, the plurality of preset interfaces do not filter the brightness value acquisition request sent by the adjusting backlight module, the brightness value acquisition request is converted into a first instruction through the first interface, the first instruction is converted into a second instruction based on the second interface, the second instruction is sent to the ambient light sensor driver, so that the ambient light sensor driver can return the ambient light brightness value based on each brightness value acquisition request sent by the adjusting backlight module, thereby ensuring that the adjusting backlight module can acquire the ambient light brightness value within an effective time, so that the adjusting backlight module can determine the first frame brightness value matched with the actual ambient light brightness based on the acquired ambient light brightness value, and the technical problem that the display screen appears to be bright first and then dark or dark first and then bright when turning on the screen is avoided.

[0006] In some optional embodiments, the first interface comprises an Android Interface Definition Language interface, and the second interface comprises a Qualcomm interface. The above method can realize cross-process communication through the first interface and cross-processor inter-process communication through the second interface.

[0007] In some optional implementations, the second interface generates a second instruction based on the received first instruction, including: the second interface determining whether the first instruction is an instruction requesting to obtain a brightness value; if the first instruction is an instruction requesting to obtain a brightness value, the second interface generates a second instruction based on the received first instruction. This method, by performing instruction type determination on the second interface for the first instruction, only performs command conversion operations and generates a second instruction when the first instruction is an instruction requesting to obtain a brightness value. This reduces the need for conversion of other instruction types, effectively saves system resources, accelerates the conversion efficiency of instructions requesting to obtain brightness values, and thus improves the rate of obtaining ambient light brightness values.

[0008] In some optional implementations, the second instruction is a CMD instruction. The above method, by generating a CMD instruction based on the first instruction, can improve the speed at which the ambient light sensor driver reads the CMD instruction, thereby effectively increasing the speed at which the ambient light sensor driver returns the ambient light brightness value.

[0009] In some optional implementations, before the first interface sends the first instruction to the second interface in the hardware abstraction layer, the method further includes: in response to the received brightness value acquisition request, the first interface generates the first instruction based on the communication protocol corresponding to the second interface. The above method generates the first instruction based on the communication protocol of the second interface, allowing the second interface to directly read the first instruction without further parsing.

[0010] In some optional implementations, before the target ambient light brightness value uploaded by the ambient light sensor in the cooperating hardware layer is sequentially sent to the backlight adjustment module through the second interface and the first interface, the method further includes: the ambient light sensor periodically sending ambient light brightness values ​​to the ambient light sensor driver according to a preset sampling period; and the ambient light sensor driver determining the target ambient light brightness value from the received ambient light brightness values. This method enables the ambient light sensor to periodically generate and report ambient light brightness values.

[0011] In some optional implementations, the ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness values, including: the ambient light sensor driver determines the most recently uploaded ambient light brightness value from the ambient light sensor as the target ambient light brightness value. This method, by determining the most recently uploaded ambient light brightness value from the ambient light sensor as the target ambient light brightness value, can speed up the determination of the target ambient light brightness value, thereby shortening the time required for the backlight adjustment module to acquire the ambient light brightness value.

[0012] In some optional embodiments, the adjusting backlight module determines the first frame brightness value according to the target ambient light brightness value, including: the adjusting backlight module determines a display screen brightness value corresponding to the target ambient light brightness value according to a preset mapping relationship between ambient light brightness values and display screen brightness values, and determines the display screen brightness value corresponding to the target ambient light brightness value as the first frame brightness value. Through the mapping relationship between the ambient light brightness value and the display screen brightness value, the first frame brightness value can be accurately determined based on the target ambient light brightness value according to the above method.

[0013] The second aspect of the present application discloses a terminal device, the terminal device includes a processor and a memory, the memory is used for storing instructions, the processor is used for calling the instructions in the memory, so that the terminal device executes the screen brightness adjustment method as described in the first aspect.

[0014] The third aspect of the present application discloses a computer readable storage medium, including computer instructions, when the computer instructions run on the terminal device, so that the terminal device executes the screen brightness adjustment method as described in the first aspect.

[0015] It should be understood that the terminal device of the second aspect provided above, the computer readable storage medium of the third aspect, correspond to the method of the first aspect described above, and therefore, the beneficial effects that can be achieved are referred to the beneficial effects of the corresponding method provided above, which will not be described here. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 The front position relationship diagram of the display screen and the ambient light sensor in the terminal device provided by the embodiment of the present application.

[0017] Figure 2 The schematic diagram of a screen lighting method provided by the embodiment of the present application.

[0018] Figure 3 The schematic diagram of a batch command issuing method provided by the present application.

[0019] Figure 4 The architecture schematic diagram of the screen brightness adjustment provided by the embodiment of the present application.

[0020] Figure 5 The flowchart schematic diagram of a screen brightness adjustment method provided by the embodiment of the present application.

[0021] Figure 6 The architecture schematic diagram of the ambient light data transmission provided by the embodiment of the present application.

[0022] Figure 7 The structure schematic diagram of a terminal device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0023] The terms "first", "second", etc. are used only for the purpose of description and are not to be interpreted as indicating or implying relative importance or a specific number of technical features indicated. Thus, features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the words "exemplary", "or", "for example" are used to mean an example, an instance, or an illustration. Any embodiment or design presented as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or advantageous than other embodiments or design solutions. Rather, use of the words "exemplary", "or", "for example" is intended to present concepts in a particular way.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It is to be understood that the use of "or" herein is meant to encompass both a and b individually as well as a or b. For example, A or B can mean A or B. "And / or" as used in the application herein is to be taken as a descriptive way of saying that there are three ways to combine the items. For example, A and / or B can mean A alone, A and B together, or B alone. "At least one" means one or more. "Multiple" means two or more. For example, at least one of a, b, or c can mean a, b, c, a and b, a and c, b and c, or a, b, and c. It is to be understood that the order of steps in the flow charts shown herein can be changed, and some can be omitted.

[0025] In order to better understand the embodiments of the present application, the screen brightness adjustment method provided by the embodiments of the present application will be described below with reference to the accompanying drawings. The following specific embodiments can be implemented independently, or can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments.

[0026] With the development of terminal products in technology, in order to pursue the ultimate screen ratio to expand the area of the display screen, the ambient light sensor on the terminal device can be arranged below the display screen of the terminal device, for example, when the display screen is an OLED (Organic Light-Emitting Diode) screen, it can be arranged below the OLED screen. The embodiments of the present application take the ambient light sensor arranged below the OLED screen of the terminal device as an example for illustration. Figure 1 The front position relationship diagram of the display screen and the ambient light sensor in the terminal device provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the ambient light sensor is arranged below the display screen of the terminal device. Figure 1As shown in FIG. 1, the projection of the ambient light sensor on the display screen of the terminal device is located in the upper half of the display screen of the terminal device. When the user holds the terminal device, the ambient light sensor located in the upper half of the terminal device can detect the light intensity and color temperature of the environment in front of the terminal device (the orientation of the display screen in the terminal device). According to the light intensity and color temperature, the brightness and color temperature of the display screen of the terminal device can be adjusted, so that a better visual effect can be achieved. For example, the display screen will not be too bright to cause dazzling in a dark environment, and the display screen will not be too dark to cause unclear vision in a bright environment.

[0027] In an embodiment of the present application, the processor of the terminal device can be a multi-core processor. In the following, a multi-core processor will be described by taking a terminal device as an example. Figure 2 A schematic diagram of a screen lighting method provided by an embodiment of the present application is described.

[0028] As shown in FIG. 2, the processor in the terminal device is a multi-core processor, which can include an application (AP) processor and a sensor coprocessor (SCP). The AP processor is an application processor in the terminal device, and the operating system, user interface and application program can run on the AP processor. The SCP processor is a coprocessor, which can assist the AP processor in matters related to sensors (for example, ambient light sensors) and the like. Figure 2 Figure 2 In the actual application, the multi-core processor can further include other processors. For example, when the terminal device is a mobile phone, the multi-core processor can further include a baseband (BP) processor running mobile phone radio communication control software and responsible for sending and receiving data.

[0029] Figure 2 The AP processor in FIG. 2 only shows the content related to the embodiments of the present application, and the implementation of the embodiments of the present application needs to rely on the following in the AP processor: application layer (Application), framework layer (Framework), hardware abstraction layer (HAL), kernel layer (kernel) and hardware layer (hardware). The application layer of the AP processor has multiple application programs and / or application services, and for the sake of simplicity of the diagram, the application layer is not shown in FIG. 2. Figure 2 ​The framework layer can include a Power Manger, a Display engine, and a sensor manager. The Power Manger can be used to implement the on / off screen state switching and management. The Display engine can be used for brightness setting. The sensor manager is used to obtain the ambient light brightness. The hardware abstraction layer can include a sensor HAL (sensor HAL) and a HWC (Hardware composer HAL). The sensor HAL is a dynamic library, and the sensor HAL library is dynamically loaded each time the sensor service is started. Different dynamic libraries are loaded according to different modules, so that the sensor service can automatically match the corresponding HAL layer. The HAL layer communicates with the bottom layer driver. Exemplarily, the sensor HAL loads the dynamic library of the sensor driver, and the sensor HAL can communicate with the sensor driver and the sensor. The role of the sensor HAL is to encapsulate the communication interface of the bottom layer device and provide a unified interface upward. The sensor HAL includes interfaces for communicating with different types of sensors. As shown in Figure 2 , the sensor HAL can include an ambient light sensor interface. The ambient light sensor interface can be used to implement communication with the ambient light sensor to obtain the ambient light brightness. For example, the sensor HAL can also include an acceleration sensor interface for implementing communication of the acceleration sensor to obtain acceleration data, and the acceleration sensor interface is not shown in Figure 2 .

[0030] The HWC is a module for interface synthesis and display in the system, and provides hardware support for the surface Flinger service. The HWC can send an on screen instruction to the OLED driver, so that the OLED driver controls the OLED device of the terminal device to emit light to realize the on screen. The kernel layer can include an OLED driver. The OLED driver is used to drive the OLED device to emit light according to the determined display brightness value, that is, to control the display screen to emit light according to the brightness value.

[0031] Figure 2The SCP processor in the foregoing can be understood as a sensor hub, which can control the sensor and process the related data of the sensor. The implementation of the embodiments of the present application needs to rely on the following in the SCP processor: a hub application layer (Hub APK), a hub framework layer (Hub FWK), a hub driver layer (Hub DRV), and a hub hardware layer (Hub hardware). The hub application layer includes an ambient light sensor application. The hub driver layer includes an ambient light sensor driver. The hub hardware layer includes an ambient light sensor. The ambient light sensor driver is used to control the ambient light sensor. The ambient light sensor application can call the interface provided by the ambient light sensor driver to trigger the ambient light sensor to collect ambient light at a preset sampling period.

[0032] As shown in Figure 2 The screen lighting method provided by the embodiments of the present application can include the following flow. According to different needs, the order of the steps in the use diagram can be changed, and some steps can be omitted. As shown in Figure 2 The method includes the following steps.

[0033] In step S201, the power management module sends a screen-on event to the adjusting backlight module of the display engine, so that the adjusting backlight module determines a first frame brightness value.

[0034] The screen-on event is an event of turning on the display screen of the terminal device from the screen-off state to the screen-on state. In an embodiment of the present application, the power management module can generate a screen-on event in response to the received notification information. For example, the screen-on event is generated in response to receiving the information such as short message, incoming call, and the like sent by other terminal devices, or the information such as notification of each installed application received by the terminal device. In an embodiment of the present application, the power management module can generate a screen-on event based on the state change of the target sensor. The target sensor can include a Hall sensor, a pressure sensor, and the like. The Hall sensor is a magnetic element, which can be arranged in the terminal device to support the cover function. When the terminal device is equipped with a flip cover, the terminal device can detect the open and close state of the flip cover by using the Hall sensor. The open and close state includes the open state of the cover or the close state of the cover. When the Hall sensor in the terminal device and the magnetic element in the cover are in contact or away from each other, the terminal device is in the open process state of the cover. In an embodiment of the present application, when it is determined that the cover changes from the close (or buckling) state to the open state according to the state change of the Hall sensor, the power management module generates a screen-on event. The pressure sensor is located below the display screen of the terminal device, and the state change of the pressure sensor can be used to determine the touch operation performed by the user on the display screen. In an embodiment of the present application, when it is determined that the user performs a target operation on the display screen based on the state change of the pressure sensor, a screen-on event is generated. In an embodiment of the present application, the screen-on event can be generated based on the pressing operation of the user on the physical key, such as the pressing operation of the switch key.

[0035] The adjusting backlight module, which can also be referred to as an automatic dimming module, can automatically adjust the screen brightness of the terminal device according to the ambient brightness value, and is used to determine the screen brightness value of the display screen. For example, the larger the ambient brightness value, the larger the screen brightness of the terminal device set by the adjusting backlight module; the smaller the ambient brightness value, the smaller the screen brightness of the terminal device set by the adjusting backlight module.

[0036] The display screen of the terminal device displays the content in the form of an image. In an embodiment of the present application, the first frame image displayed after the display screen is switched from the screen-off state to the screen-on state is referred to as the first frame image, and the first frame brightness value is used as the display brightness value corresponding to the first frame image.

[0037] In step S202, the adjusting backlight module registers the ambient light service with the sensor manager.

[0038] The ambient light service is used to obtain the ambient light brightness value uploaded by the ambient light sensor. By registering the ambient light service on the sensor manager, the adjusting backlight module can make the sensor manager return the ambient light brightness value collected by the ambient light sensor.

[0039] Step S203, in response to the registered ambient light service of adjusting the backlight module, the sensor manager issues a batch command to the ambient light sensor interface.

[0040] In an embodiment of the present application, the batch command, which can also be referred to as a batch event or a first frame command, is used to instruct the ambient light luminance value to be returned within a valid time.

[0041] Step S204, the ambient light sensor interface sends the batch command to the ambient light sensor driver in the SCP processor.

[0042] Step S205, after the ambient light sensor driver listens to the batch command, the target ambient light luminance value uploaded by the ambient light sensor is sent to the ambient light sensor interface.

[0043] In an embodiment of the present application, the ambient light sensor samples the ambient light luminance value according to a preset sampling period. For example, the ambient light sensor obtains at least one ambient light luminance value in each sampling period. The ambient light sensor reports an ambient light luminance value to the ambient light sensor driver every other sampling period. The ambient light sensor driver records the received sensor manager. In an embodiment of the present application, after listening to the batch command, the ambient light sensor driver determines the most recent recorded ambient light luminance value as the target ambient light luminance value and sends it to the ambient light sensor interface. For some specific implementations of determining the target ambient light luminance value, please refer to the relevant description below, such as the relevant description of the target ambient light luminance value. Figure 5

[0044] The sampling period can be set according to actual needs, such as 200ms, 350ms, etc., and the sampling period is greater than the valid time. The value of the sampling period is not limited in the embodiments of the present application. In order to facilitate the description, the sampling period is taken as 350ms in the following example.

[0045] In an embodiment of the present application, after the ambient light sensor driver receives the ambient light luminance value reported by the ambient light sensor, it records the received ambient light luminance value. In an embodiment of the present application, when the ambient light luminance value sent by the ambient light sensor is received, the ambient light sensor driver can delete the historically recorded ambient light luminance value and record the currently received ambient light luminance value. This method can make the ambient light sensor driver retain the most recent ambient light luminance value reported by the ambient light sensor, avoid storing too many ambient light luminance values in the ambient light sensor driver, and avoid occupying too much storage space.

[0046] ​In an embodiment of the present application, the ambient light sensor interface can send the batch command to the ambient light sensor driver through an ambient light sensor application in the cooperation application layer. The ambient light sensor application will receive the batch command and send it to the ambient light sensor driver. The ambient light sensor driver will send the target ambient light brightness value uploaded by the ambient light sensor to the ambient light sensor application in response to listening to the batch command. The ambient light sensor application will report the received target ambient light brightness value to the ambient light sensor interface after receiving the target ambient light brightness value.

[0047] In step S206, the ambient light sensor interface reports the target ambient light brightness value to the adjusting backlight module through the sensor manager.

[0048] In step S207, the adjusting backlight module determines the first frame brightness value according to the received target ambient light brightness value and sends the determined first frame brightness value to the OLED driver.

[0049] In an embodiment of the present application, after the adjusting backlight module registers the ambient light service with the sensor manager, the adjusting backlight module can determine the first frame brightness value based on the target ambient light brightness value returned by the sensor manager. In an embodiment of the present application, when the adjusting backlight module issues the registration of the ambient light service, the adjusting backlight module starts timing. If the adjusting backlight module obtains the target ambient light brightness value returned by the sensor manager within the valid time, the adjusting backlight module determines the brightness value of the display screen when the display screen is bright according to the target ambient light brightness value, i.e., determines the first frame brightness value of the display screen. The valid time can be set based on actual needs and can be set to any time length that meets the actual needs, such as 200 ms or 300 ms. The value of the valid time is not limited in the embodiment of the present application. For ease of description, the valid time is taken as 200 ms in the following description.

[0050] In an embodiment of the present application, the mapping relationship between the ambient light brightness value and the display screen brightness value can be set in advance, and one ambient light brightness value can correspond to one display screen brightness value. Based on the preset mapping relationship, the display screen brightness value corresponding to the target ambient light brightness value returned by the sensor manager is determined, and the display screen brightness value corresponding to the target ambient light brightness value is determined as the first frame brightness value. The first frame brightness value corresponding to the target ambient light brightness value can also be determined based on other manners. In the embodiment of the present application, the manner of determining the first frame brightness value based on the target ambient light brightness value returned by the sensor manager is not limited.

[0051] Through the above steps S202 to S207, the backlight adjusting module can determine the first frame brightness value for the display screen being lighted based on the target ambient light brightness value reported by the ambient light sensor driver. Since the first frame brightness value is determined according to the target ambient light brightness value returned by the sensor manager, it matches the actual ambient light brightness corresponding to the current environment, so that the display screen corresponding display brightness is set by using the first frame brightness value, which can realize the effect of displaying the first frame image according to the brightness matching the actual ambient light brightness, and the subsequent image frames are also displayed based on the brightness matching the actual ambient light brightness, so the difference between the display brightness of the first frame image and the subsequent image frames is small, which can avoid the situation that the user feels that the display screen has a significant bright-dark change, thereby improving the user experience.

[0052] OLED driving, also known as display driving, can be used to control the display brightness of the display screen of the terminal device. In an embodiment of the present application, after the backlight adjusting module determines the first frame brightness value, the determined first frame brightness value can be sent to the OLED driving through the HWC. The HWC will send the received first frame brightness value to the OLED driving.

[0053] Step S208, the OLED driving sends the acquired first frame brightness value to the display subsystem.

[0054] After the display subsystem receives the first frame brightness value, the display screen is lighted according to the first frame brightness value, and the brightness value of the display screen is set to the first frame brightness value.

[0055] As can be seen from the above steps S207 and S208, after the HWC acquires the first frame brightness value, the brightness of the terminal device display screen being lighted can be set, so that the brightness of the display screen matches the ambient light brightness, to avoid the problem that the screen has a significant bright-dark change phenomenon after being lighted or there is a significant delay in being lighted, thereby improving the user experience.

[0056] According to the steps S202-S205, the sensor manager can issue a batch command based on the ambient light service registered by the backlight adjustment module. Based on the batch command, the ambient light sensor driver can return the ambient light brightness value within the effective time, so that the backlight adjustment module can obtain the current ambient light brightness value within the effective time, and thus determine the first frame brightness value. However, in the related art, when the sensor manager receives the ambient light service registered by multiple objects, the sensor manager determines a target object from the multiple objects, filters out the services registered by the objects other than the target object, and generates a batch command corresponding to the target object. Therefore, when the sensor manager receives the ambient light service registered by multiple objects, the sensor manager can filter out the ambient light service registered by the backlight adjustment module. If the sensor manager filters out the ambient light service registered by the backlight adjustment module, the sensor manager will not issue a batch command corresponding to the backlight adjustment module. The objects can include an application program or an application service in an application layer (or a framework layer) of the AP processor.

[0057] In an embodiment of the present application, the sensor manager can filter the objects based on the registration frequency of the registered services, and determine an object with a registration frequency greater than or equal to a preset highest registration frequency as a target object. The registration frequency is used to represent the number of attempts to register within a specified time period. The higher the registration frequency, the more attempts to register within the specified time period. The highest registration frequency is the highest registration frequency corresponding to all objects currently registered on the sensor manager. Determining an object with a registration frequency greater than or equal to the highest registration frequency as a target object means determining an object with the highest registration frequency from all objects currently registered on the sensor manager as a target object. Figure 3 A schematic diagram of a batch command issuing method provided in the present application is shown in FIG. 2. As shown in FIG. 2, the sensor manager can receive a registration request of an ambient light service from an object (S201). The object can include an application program or an application service in an application layer (or a framework layer) of the AP processor. Figure 3As shown, the sensor manager receives the registered ambient light services sent by the application A, the application B and the backlight adjusting module. The registration frequency of the application A is 50hz, the registration frequency of the application B is 40hz and the registration frequency of the backlight adjusting module is 30hz. At this time, the highest registration frequency of the registered ambient light services received by the sensor manager is 50hz, the registration frequency of the application A satisfies the condition that the registration frequency is greater than or equal to the highest registration frequency, the application A is determined as the target module, the batch command corresponding to the application A is generated, and the services registered by the application B and the backlight adjusting module are filtered, and the batch command of the application B and the backlight adjusting module is not generated. In an embodiment of the present application, if multiple modules satisfy the condition that the registration frequency is greater than or equal to the highest registration frequency, the target module can be determined according to a preset judgment rule. For example, the judgment rule can be set as determining the module that registers the service first (or last) as the target module, and in actual application, the judgment rule can be flexibly set or modified, and is not limited to the above example. Based on the filtering mechanism of the sensor manager, the ambient light service registered by the backlight adjusting module can be filtered by the sensor manager, and the batch command of the backlight adjusting module can not be generated.

[0058] Therefore, the ambient light sensor driver can not receive the batch command corresponding to the backlight adjusting module, and the ambient light sensor can not return the ambient light brightness value within the effective time without receiving the batch command, so that the backlight adjusting module can not obtain the current ambient light brightness value within the effective time. Since the sampling period of the ambient light sensor is greater than the effective time of the backlight adjusting module, if there is no batch command corresponding to the backlight adjusting module and the effective time does not include the end time of the current sampling period, such as being in the middle of the current sampling period, when the effective time ends, the ambient light sensor also does not obtain the ambient light brightness value of the current sampling period, then the ambient light sensor will not upload the new ambient light brightness value within the effective time. The ambient light sensor driver does not receive the ambient light brightness value uploaded by the ambient light sensor within the effective time, and does not apply the uploaded ambient light brightness value to the ambient light sensor, thereby causing the backlight adjusting module to not receive the ambient light brightness value within the effective time.

[0059] If the backlight adjusting module does not obtain the ambient light brightness value returned by the ambient light sensor within the effective time, the display screen brightness value corresponding to the last image frame stored in the backlight adjusting module is determined as the first frame brightness value. In an embodiment of the present application, the display screen brightness values determined in the history can be cached in the backlight adjusting module, such as the display screen brightness values corresponding to the last preset number of image frames. The preset number can be set according to actual needs, such as caching the display screen brightness value corresponding to the last image frame, or caching the display screen brightness values corresponding to the last three image frames.

[0060] Because the brightness value of the previous image frame in the backlight module may differ significantly from the actual ambient light level of the device, the brightness value might be determined based on the ambient light level when the device is placed face down on a table with the screen on, or when it's placed in a pocket. This brightness value could be close to or equal to zero. Therefore, if the actual ambient light level is high, using the brightness value of the previous image frame to turn on the screen may result in a dim-to-bright display, leading to a poor user experience. Conversely, if the brightness value of the previous image frame was determined based on the ambient light level in a bright environment (i.e., a high brightness value), and the device is currently in a low-light environment (i.e., a low ambient light level), using the brightness value of the previous image frame to turn on the screen may also result in a bright-to-bright display. If the brightness value of the first frame when the terminal device's screen is turned on does not match the brightness of the current environment, it will result in a poor user experience.

[0061] To address the technical problem of the sensor manager filtering out the ambient light service registered by the backlight adjustment module, causing the backlight adjustment module to fail to receive the ambient light brightness value within the effective time, and thus failing to generate a first frame brightness value that matches the actual ambient light brightness, resulting in the screen turning on brightly then dimming or dimming then brightening, this application provides a screen brightness adjustment method. This method enables cross-processor communication between the application processor and the sensor coprocessor through multiple preset interfaces. Specifically, a brightness value acquisition request is converted into a first instruction through a first interface, and the first instruction is converted into a second instruction based on a second interface. This allows the ambient light sensor driver to return the ambient light brightness value based on each brightness value acquisition request sent by the backlight adjustment module, thereby ensuring that the backlight adjustment module can acquire the ambient light brightness value within the effective time. This allows the backlight adjustment module to determine a first frame brightness value that matches the actual ambient light brightness based on the acquired ambient light brightness value, avoiding the technical problem of the screen turning on brightly then dimming or dimming then brightening.

[0062] Figure 4 This is a schematic diagram of an architecture for adjusting screen brightness, provided as an embodiment of this application. Figure 4 As shown, the processor in the terminal device to which the screen brightness adjustment method is applied is a multi-core processor, which may include an AP processor and an SCP processor. For a more detailed description of the structure of the AP processor and SCP processor, please refer to the relevant descriptions above, such as... Figure 2 Related descriptions.

[0063] Among them, such as Figure 4 As shown, the framework layer includes the Android Interface Definition Language (AIDL). The backlight adjustment module in the display engine communicates with the HAL sensor through the AIDL interface, sending a brightness value acquisition request to the HAL sensor. Figure 4 As shown, the sensor HAL includes a Qualcomm Message Interface (QMI). The backlight adjustment module sends a brightness value acquisition request to the QMI in the sensor HAL via the AIDL interface. After receiving the brightness value request, the QMI generates a corresponding CMD (command) instruction and sends the CMD instruction to the ambient light sensor driver via IPC communication. The ambient light sensor driver responds to the CMD instruction and, based on IPC communication, sends the target ambient light brightness value reported by the ambient light sensor to the QMI. The QMI then sends the received target ambient light brightness value to the backlight adjustment module via the AIDL interface. The backlight adjustment module can determine the first frame brightness value based on the target ambient light brightness value. The backlight adjustment module can then send the first frame brightness value to the OLED driver, causing the OLED driver to control the terminal device's display to light up according to the first frame brightness value.

[0064] The above architecture constructs a transmission channel through the AIDL and QMI two-layer message passing interfaces to obtain the ambient light brightness value of the ambient light sensor in the SCP processor from the backlight adjustment module in the AP processor. This facilitates the backlight adjustment module to obtain ambient light data from the ambient light sensor driver. The AIDL and QMI two-layer message passing interfaces do not filter the brightness value acquisition requests sent by the backlight adjustment module, allowing the ambient light sensor driver to return the ambient light brightness value based on each brightness value acquisition request sent by the backlight adjustment module. This ensures that the backlight adjustment module can obtain the ambient light brightness value within a valid time. Based on the obtained ambient light brightness value, the backlight adjustment module can determine the first frame brightness value that matches the actual ambient light brightness, avoiding the technical problem of the screen turning on first and then darkening or darkening first and then turning on when the screen is turned on.

[0065] The process of transmitting ambient light data based on the above architecture will be described below. Figure 5 The embodiments provided in this application are based on Figure 4 The diagram illustrates a flowchart of a screen brightness adjustment method implemented using the shown technical architecture. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements. For example... Figure 5 As shown, the method includes:

[0066] In step S501, in response to the screen-on event, the backlight module is adjusted to send a brightness value acquisition request to the first interface of the frame layer.

[0067] A screen-on event is an event that switches the display screen of a control terminal device from a screen-off state to a screen-on state. After generating a screen-on event, the power management module sends the generated screen-on event to the backlight adjustment module. For some specific implementation methods of the power management module generating screen-on events, please refer to the relevant descriptions above, such as... Figure 2 The relevant description is as follows: In response to a received screen-on event, the backlight module adjusts and sends a brightness value acquisition request to the first interface of the frame layer.

[0068] The brightness value acquisition request is used to obtain the ambient light brightness value of the current environment in which the terminal device is located. It can be used to control the first interface to return the ambient light brightness value of the current environment in which the terminal device is located within a valid time period. The valid time period can be set based on actual needs and can be set to any duration that meets the actual requirements, such as 200ms or 300ms. This application embodiment does not limit the value of the valid time period; for ease of explanation, an example of a valid time period of 200ms will be used below for illustration.

[0069] In step S502, in response to the received brightness value acquisition request, the first interface sends a first instruction to the second interface in the hardware abstraction layer.

[0070] In one embodiment of this application, the first instruction can be used to control the second interface to return the ambient light value of the current environment of the terminal device within a valid time. In another embodiment of this application, the first instruction can be generated based on the communication protocol corresponding to the second interface. The above method generates the first instruction based on the communication protocol of the second interface, allowing the second interface to directly read the first instruction without further parsing.

[0071] In one embodiment of this application, the first interface includes an Android Interface Definition Language (AIDL) interface. The AIDL interface can be used to implement inter-process communication. The first interface can also be other interfaces that can be used to implement communication between the framework layer and the hardware abstraction layer.

[0072] In one embodiment of this application, the second interface includes a Qualcomm Message Interface (QMI). The QMI can be used to implement inter-process communication across multiple processors. The second interface can also be other interfaces that can be used for inter-process communication across processors. For example, the second interface may also include a PCIe (PCI-Express) interface.

[0073] In step S503, the second interface generates a second instruction based on the received first instruction and sends the second instruction to the ambient light sensor driver in the co-driving layer.

[0074] In one embodiment of this application, the second instruction is used to control the ambient light sensor to return the ambient light brightness value of the current environment of the terminal device within a valid time.

[0075] In one embodiment of this application, the second instruction is a CMD instruction. CMD instructions are a commonly used command-line tool in terminal devices. Generating a CMD instruction based on the first instruction can improve the speed at which the ambient light sensor driver reads the CMD instruction, thereby effectively increasing the speed at which the ambient light sensor driver returns the ambient light brightness value.

[0076] In one embodiment of this application, the second interface generates a second instruction based on the received first instruction: the second interface determines whether the first instruction is an instruction requesting the acquisition of a brightness value; if the first instruction is an instruction requesting the acquisition of a brightness value, the second interface generates a second instruction based on the received first instruction. If the first instruction is not an instruction requesting the acquisition of a brightness value, the process ends and no second instruction is generated. This method, by performing instruction type judgment on the first instruction in the second interface, only performs command conversion operations and generates a second instruction when the first instruction is an instruction requesting the acquisition of a brightness value. This reduces the conversion of instructions of other instruction types, effectively saves system resources, accelerates the conversion efficiency of instructions requesting the acquisition of brightness values, and thus improves the rate of acquiring ambient light brightness values.

[0077] In one embodiment of this application, the second interface can send a second instruction to the ambient light sensor driver via the ambient light sensor application in the cooperating application layer. The ambient light sensor application receives the second instruction and sends it to the ambient light sensor driver. Upon receiving the second instruction, the ambient light sensor driver sends the target ambient light brightness value uploaded by the ambient light sensor to the ambient light sensor application. After receiving the target ambient light brightness value, the ambient light sensor application reports the received target ambient light brightness value to the second interface. In step S504, after receiving the second instruction, the ambient light sensor driver sends the target ambient light brightness value uploaded by the ambient light sensor in the cooperating hardware layer sequentially through the second interface and the first interface to the backlight adjustment module.

[0078] For example, such as Figure 4 As shown, after receiving the second instruction, the ambient light sensor driver sends the target ambient light brightness value uploaded by the ambient light sensor in the hardware layer to the second interface. Upon receiving the ambient light brightness value, the second interface sends it to the first interface. The first interface then sends the received ambient light brightness value to the backlight adjustment module.

[0079] In an embodiment of the present application, before the target ambient light brightness value uploaded by the ambient light sensor in the co-hardware layer is sent to the backlight adjusting module through the second interface and the first interface in turn, the method further comprises: the ambient light sensor sends an ambient light brightness value to the ambient light sensor driver regularly according to a preset sampling period; and the ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness values.

[0080] In an embodiment of the present application, the ambient light sensor samples according to a preset sampling period to obtain an ambient light brightness value. The ambient light sensor obtains an ambient light brightness value in each sampling period. The ambient light sensor reports an ambient light brightness value to the ambient light sensor driver every other sampling period. The sampling period can be set according to actual requirements, such as 200 ms, 350 ms, etc. The sampling period is greater than the effective time. The embodiment of the present application does not limit the value of the sampling period. The above method can realize that the ambient light sensor generates and reports an ambient light brightness value regularly. In an embodiment of the present application, the current sampling period of the ambient light sensor can be modified, and the sampling period can be extended or shortened. For example, the current sampling period can be modified based on the operation of a user.

[0081] In an embodiment of the present application, the ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness values, which comprises: the ambient light sensor driver determines the ambient light brightness value uploaded by the ambient light sensor last time as the target ambient light brightness value. The above method can accelerate the determination of the target ambient light brightness value, thereby shortening the time for the backlight adjusting module to obtain the ambient light brightness value.

[0082] In an embodiment of the present application, after the ambient light sensor driver receives the ambient light brightness value reported by the ambient light sensor, the ambient light sensor driver records the received ambient light brightness value, and can obtain the ambient light brightness value uploaded by the ambient light sensor last time from the recorded ambient light brightness values. In another embodiment of the present application, after receiving the ambient light brightness value sent by the ambient light sensor, the ambient light sensor driver can delete the historically recorded ambient light brightness values and record the currently received ambient light brightness value. This method can keep the ambient light sensor driver to retain the ambient light brightness value reported by the ambient light sensor last time, and avoid storing too many ambient light brightness values in the ambient light sensor driver.

[0083] In an embodiment of the present application, a mapping relationship between the ambient light brightness value and the display screen brightness value can be preset, and one ambient light brightness value can correspond to one display screen brightness value. Based on the preset mapping relationship, the display screen brightness value corresponding to the target ambient light brightness value returned by the sensor manager is determined, and the display screen brightness value corresponding to the target ambient light brightness value is determined as the first frame brightness value. The above method can accurately determine the first frame brightness value based on the target ambient light brightness value based on the mapping relationship between the ambient light brightness value and the display screen brightness value. In the embodiment of the present application, the way of determining the first frame brightness value based on the target ambient light brightness value returned by the sensor manager is not limited, and the first frame brightness value corresponding to the target ambient light brightness value can also be determined based on other ways.

[0084] In another embodiment of the present application, the ambient light sensor driver determines the target ambient light brightness value in the received ambient light brightness value, comprising: determining a first time when the ambient light sensor last uploads an ambient light brightness value; determining a second time based on the first time and the sampling period; determining a third time corresponding to the second instruction; if the time difference between the second time and the third time is greater than a preset time threshold and the second time is earlier than the third time, the ambient light brightness value uploaded by the ambient light sensor at the second time is determined as the target ambient light brightness value. If the time difference between the second time and the third time is less than or equal to the preset time threshold or the second time is later than the third time, the ambient light sensor driver determines the ambient light brightness value uploaded by the ambient light sensor last time as the target ambient light brightness value.

[0085] The first time is the time when the ambient light sensor last uploads an ambient light brightness value to the ambient light sensor driver. In an embodiment of the present application, the ambient light sensor driver receives an ambient light brightness value uploaded by the ambient light sensor, and generates a timestamp of the ambient light brightness value. The first time can be determined based on the timestamp corresponding to the ambient light brightness value uploaded by the ambient light sensor last time. In an embodiment of the present application, the ambient light sensor driver can determine the first time based on the storage time of the ambient light brightness value uploaded by the ambient light sensor last time.

[0086] The second time is the time when the ambient light sensor next uploads an ambient light brightness value to the ambient light sensor driver. The third time is the time determined based on the effective time. In the embodiment, the backlight module needs to receive the ambient light brightness value before the third time.

[0087] The preset time threshold can be set according to actual needs, and can be determined according to a time required for the ambient light sensor driver to send the ambient light brightness value to the backlight adjusting module through the second interface and the first interface in sequence. When the time difference between the second time and the third time is greater than the preset time threshold and the second time is earlier than the third time, it is determined that the ambient light sensor driver can send the ambient light brightness value uploaded by the ambient light sensor at the second time to the backlight adjusting module within the effective time, and the ambient light brightness value uploaded by the ambient light sensor at the second time is determined as the target ambient light brightness value. After obtaining the ambient light brightness value uploaded by the ambient light sensor at the second time, the ambient light brightness value is sent to the backlight adjusting module. Sometimes, the backlight adjusting module needs to generate the first frame brightness value based on the received ambient light brightness value after the end of the effective time. Therefore, in the above implementation method, the ambient light brightness value uploaded by the ambient light sensor at the second time is determined as the target ambient light brightness value in the case that the time difference between the second time and the third time is greater than the preset time threshold and the second time is earlier than the third time, that is, the current generated ambient light brightness value is determined as the target ambient light brightness value, so that the time difference between the sending time of the target ambient light brightness value sent by the ambient light sensor driver to the backlight adjusting module and the generation time of the first frame brightness value is small, and further, the determined first frame brightness value is closer to the actual ambient light brightness value.

[0088] In step S505, the backlight adjusting module determines a first frame brightness value according to the target ambient light brightness value, and sends the first frame brightness value to the display driver.

[0089] In an embodiment of the present application, the backlight adjusting module can directly send the first frame brightness value to the display driver. In another embodiment of the present application, the backlight adjusting module can indirectly send the first frame brightness value to the display driver. For example, the backlight adjusting module sends the first frame brightness value to the HWC. The HWC sends the received first frame brightness value to the display driver. For some specific embodiments of the HWC sending the received first frame brightness value to the display driver, reference can be made to the related description in the foregoing, such as the related description of the HWC sending the received first frame brightness value to the display driver in the foregoing. Figure 2

[0090] Some specific embodiments of the backlight adjusting module determining the first frame brightness value according to the target ambient light brightness value can be referred to the related description in the foregoing, such as the related description of the backlight adjusting module determining the first frame brightness value according to the ambient light brightness value in the foregoing. Figure 2

[0091] ​​In an embodiment of the present application, the adjusting backlight module can determine the first frame brightness value based on the target ambient light brightness value received by the adjusting backlight module immediately after the adjusting backlight module receives the returned ambient light brightness value within the valid time, so that the terminal device can be turned on in a relatively short time, and the user's waiting time for the terminal device to be turned on can be reduced. In another embodiment of the present application, the adjusting backlight module can determine the first frame brightness value based on the target ambient light brightness value received by the adjusting backlight module at the end of the valid time. If the adjusting backlight module receives two returned ambient light brightness values at the end of the valid time, the adjusting backlight module can determine the first frame brightness value based on the ambient light brightness value received later.

[0092] In step S506, the display driver controls the display screen of the terminal device to be turned on according to the first frame brightness value.

[0093] In an embodiment of the present application, the display driver can be a display driver sent to a display subsystem. After the display subsystem receives the first frame brightness value, the display subsystem lights up the display screen according to the first frame brightness value, and sets the brightness value of the display screen to the first frame brightness value, so as to realize the effect that the display screen of the terminal device is turned on according to the display driver. In an embodiment of the present application, the specific way in which the display driver controls the display screen of the terminal device to be turned on according to the first frame brightness value is not limited, and other prior art methods can also be used to control the display screen to be turned on according to the first frame brightness value.

[0094] In the above embodiment, the adjusting backlight module in the AP processor is connected to the ambient light sensor in the SCP processor through the preset plurality of interfaces, so that the adjusting backlight module can obtain the ambient light data from the ambient light sensor driver. In addition, the preset plurality of interfaces do not filter the brightness value acquisition request sent by the adjusting backlight module, the brightness value acquisition request is converted into a first instruction through the first interface, the first instruction is converted into a second instruction based on the second interface, and the second instruction is sent to the ambient light sensor driver. Therefore, the ambient light sensor driver can return the ambient light brightness value based on each brightness value acquisition request sent by the adjusting backlight module, so that the adjusting backlight module can obtain the ambient light brightness value within the valid time, and the adjusting backlight module can determine the first frame brightness value matched with the actual ambient light brightness based on the obtained ambient light brightness value, thereby avoiding the technical problem that the display screen is first bright and then dark or first dark and then bright when the display screen is turned on.

[0095] In an embodiment of the present application, after the power management module generates the turn-on event and sends the turn-on event to the adjusting backlight module, the adjusting backlight module registers the ambient light service to the sensor manager and sends the brightness value acquisition request to the first interface of the framework layer in response to the turn-on event, that is, the adjusting backlight module executes step S202 in FIG. 2 and executes step S204 in FIG. 2. Figure 2 In an embodiment of the present application, after the power management module generates the turn-on event and sends the turn-on event to the adjusting backlight module, the adjusting backlight module registers the ambient light service to the sensor manager and sends the brightness value acquisition request to the first interface of the framework layer in response to the turn-on event, that is, the adjusting backlight module executes step S202 in FIG. 2 and executes step S204 in FIG. 2.Figure 5 Step S501 in the embodiment of this application is not performed on the backlight adjustment module. Figure 2 In step S202 and Figure 5 The order of steps S501 is defined. Adjusting the backlight module can be performed simultaneously. Figure 2 In step S202 and Figure 5 Step S501 in the middle, or you can execute it first. Figure 2 In step S202, execute again. Figure 5 Step S501 in the middle; can also be executed first. Figure 5 Step S501 in the middle is executed again. Figure 2 Step S202. When adjusting the backlight module... Figure 5 After step S501, it can be based on Figure 5 Steps S502 to S504, as shown, yield the target ambient light brightness value. When the backlight module is adjusted... Figure 2 After step S202, if the sensor manager does not filter the ambient light service registered by the backlight module, it can be based on... Figure 2 Steps S203 to S205, as shown, yield the target ambient light value.

[0096] In this embodiment, when the backlight module is adjusted... Figure 2 In step S202 and Figure 5 After step S501, the backlight adjustment module can receive at least one target ambient light brightness value within the effective time. The backlight adjustment module can select any one of the received target ambient light brightness values, determine the first frame brightness value, and send the determined first frame brightness value to the display driver, causing the display driver to control the terminal device's display screen to light up according to the first frame brightness value. For example, the backlight adjustment module can determine the first frame brightness value based on the first target ambient light brightness value returned within the effective time. Alternatively, the backlight adjustment module can determine the first frame brightness value based on the second target ambient light brightness value returned within the effective time. In one embodiment of this application, after receiving the returned target ambient light brightness value within the effective time, the backlight adjustment module can immediately determine the first frame brightness value based on the received target ambient light brightness value, enabling faster screen lighting and reducing the user's waiting time for the screen to light up.

[0097] Figure 6 This is a schematic diagram of an architecture for transmitting ambient light data, provided as an embodiment of this application. Figure 6 As shown, the terminal device using the ambient light data transmission method employs a multi-core processor, which may include an AP processor and an SCP processor. For a more detailed description of the structure of the AP processor and SCP processor, please refer to the relevant descriptions above.Figure 2 The related description of the foregoing.

[0098] As shown in Figure 6 , the AIDL interface is included in the framework layer, and the created QMI is included in the sensor HAL. Based on the architecture as shown in Figure 6 , the target object can perform the ambient light data transmission method as shown below: the target object can send a brightness value acquisition request to the QMI in the sensor HAL through the AIDL interface. After the QMI receives the brightness value request, the QMI generates a CMD instruction corresponding to the brightness value request, and sends the CMD instruction to the ambient light sensor driver corresponding to the ambient light sensor through IPC communication. The ambient light sensor driver responds to the CMD instruction and sends the target ambient light brightness value reported by the ambient light sensor to the QMI based on the IPC communication. The QMI sends the received target ambient light brightness value to the target object through the AIDL interface, so that the target object can receive the target ambient light brightness value reported by the ambient light sensor.

[0099] In an embodiment of the present application, the target object can be an application program and / or an application service in the application layer of the AP processor, or can be an application program and / or an application service in the framework layer of the AP processor. For example, as shown in Figure 6 , the target object can be an application object such as the backlight adjustment module, the application A, and the application B for acquiring the ambient light brightness value. The application A can be a face recognition application, and the application B can be a fingerprint unlocking application. In an embodiment of the present application, when a preset target event is triggered, the application object sends a brightness value acquisition request to the QMI in the sensor HAL through the AIDL interface. The target event corresponding to each application object can be preset. One application module can correspond to one or more target events. For example, the screen-on event can be determined as the target event corresponding to the backlight adjustment module. For another example, the face recognition event can be determined as the target event corresponding to the face recognition application. For another example, the fingerprint unlocking event can be determined as the target event corresponding to the fingerprint unlocking application.

[0100] Some specific implementations of the steps in the process of implementing the ambient light data transmission method by the target object in Figure 6 can be referred to the related description in the foregoing, such as the related description in Figure 2 , Figure 4 and Figure 5 .

[0101] The method realizes the communication between the application processor and the sensor coprocessor through the AIDL interface and the QMI, converts the brightness value acquisition request into the first instruction through the AIDL interface, and converts the first instruction into the second instruction based on the QMI, so that the ambient light sensor driver can return the ambient light brightness value based on each brightness value acquisition request sent by the target object, and it is ensured that the target object can acquire the ambient light brightness value collected by the ambient light sensor based on the brightness value acquisition request, and the efficiency of the target object in acquiring the ambient light brightness value is improved.

[0102] Figure 7 A structural schematic diagram of a terminal device is provided for the embodiments of the present application. Referring to Figure 7 The terminal device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge 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 loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 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 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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.

[0103] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 can include more or fewer components than the illustration, or combine certain components, or split certain components, or different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0104] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors. For example, the processor 110 is configured to perform the screen brightness adjustment method in the embodiments of the present application.

[0105] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0106] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can 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, etc.

[0107] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). The I2S interface can be used for audio communication. 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 through the PCM bus interface. The UART interface is a universal serial data bus used for asynchronous communication. The 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 usually 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 through the UART interface to realize the Bluetooth function.

[0108] The MIPI interface can be used to connect the processor 110 and peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to realize the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate through the DSI interface to realize the display function of the terminal device 100.

[0109] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the 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.

[0110] The USB interface 130 is an interface that meets the USB standard specification, which can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 100, or to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect earphones to play audio through the earphones. The interface can also be used to connect other terminal devices 100, such as AR devices, etc.

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

[0112] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. The power management module 141 is configured to connect the battery 142 and the charging management module 140. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160, etc. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), etc.

[0113] The wireless communication function of the terminal device 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0114] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals.

[0115] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the terminal device 100. The mobile communication module 150 can 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 perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves radiated by the antenna 1.

[0116] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the terminal device 100.

[0117] The terminal device 100 implements display functions through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for service exception reminding, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

[0118] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), etc.

[0119] In some embodiments, the terminal device 100 can include 1 or N display screens 194, N being a positive integer greater than 1. The terminal device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor, etc.

[0120] The camera 193 is used to capture still images or videos. An object generates an optical image through a lens and projects it to a photosensitive element.

[0121] The internal memory 121 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).

[0122] The external memory interface 120 can be used to connect an external non-volatile memory, realizing the expansion of the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120, realizing the data storage function. For example, saving music, video, etc. files in the external non-volatile memory.

[0123] The terminal device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, and an application processor, etc. For example, music playing, recording, etc.

[0124] The audio module 170 is used to convert digital audio information into analog audio signals output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals.

[0125] The speaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A. The receiver 170B, also known as a "earpiece", is used to convert audio electrical signals into sound signals. When the terminal device 100 answers a call or a voice message, the receiver 170B can be held close to the human ear to listen to the voice. The microphone 170C, also known as a "microphone", "sound transducer", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak into the microphone 170C by holding the human mouth close to the microphone 170C, and the sound signal is input to 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, in addition to collecting sound signals, it can also achieve noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C, to achieve the functions of collecting sound signals, noise reduction, and identifying sound sources, and realizing directional recording function, etc.

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

[0127] The pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals. The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. The barometric pressure sensor 180C is used to measure the air pressure. The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather cover. The acceleration sensor 180E can detect the acceleration of the terminal device 100 in each direction (usually three axes). The distance sensor 180F is used to measure the distance. The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.

[0128] The ambient light sensor 180L is configured to sense ambient light brightness. The terminal device 100 can adaptively adjust the display screen 194 brightness according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket to prevent accidental touch. In the embodiments of the present application, the ambient light sensor 180L will sample according to a preset sampling period to obtain an ambient light brightness value. The ambient light sensor 180L can obtain at least one ambient light brightness value in each sampling period. The ambient light sensor 180L will report an ambient light brightness value to the ambient light sensor driver every other sampling period.

[0129] The fingerprint sensor 180H is configured to collect fingerprints. The temperature sensor 180J is configured to detect temperature. The touch sensor 180K is also referred to as a touch device. The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a touch screen. The bone conduction sensor 180M can obtain vibration signals.

[0130] The keys 190 include a power-on key, a volume key, and the like. The keys 190 can be mechanical keys. They can also be touch keys. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, and the like.

[0131] The SIM card interface 195 is configured to connect a SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 195 to realize contact and separation with the terminal device 100. The terminal device 100 can support one or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. The same SIM card interface 195 can simultaneously insert multiple cards. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external storage cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as calling and data communication. 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.

[0132] The embodiment of the present application does not particularly limit the specific structure of the execution subject of the screen brightness adjustment method, as long as the execution subject can process according to the screen brightness adjustment method provided by the embodiment of the present application by running the program recording the screen brightness adjustment method of the embodiment of the present application. For example, the execution subject of the screen brightness adjustment method provided by the embodiment of the present application can be a functional module capable of calling and executing the program in the terminal device, or a communication device applied to the terminal device, for example, a chip.

[0133] The embodiment of the present application also provides a chip, and the chip stores computer instructions. When the computer instructions run on the chip, the chip executes the related method steps to implement the screen brightness adjustment method and the ambient light transmission method in the above embodiment.

[0134] The embodiment of the present application also provides a computer storage medium, and the computer storage medium stores computer instructions. When the computer instructions run on the terminal device 100, the terminal device 100 executes the related method steps to implement the screen brightness adjustment method or the ambient light transmission method in the above embodiment.

[0135] The embodiment of the present application also provides a computer program product, and when the computer program product runs on the computer, the computer executes the related steps to implement the screen brightness adjustment method or the ambient light transmission method in the above embodiment.

[0136] In addition, the embodiment of the present application also provides a device, which can be a chip, a component or a module. The device can include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip executes the screen brightness adjustment method or the ambient light transmission method in the above method embodiment.

[0137] The terminal device, the computer storage medium, the computer program product or the chip provided by the embodiment of the present application are used to execute the corresponding method provided above, so the beneficial effects achieved thereby can refer to the beneficial effects in the corresponding method provided above, which will not be described herein again. Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0138] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the division of the apparatus embodiments is merely illustrative, and for example, the division of the modules or units can not mean physical division, and for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0139] In addition, each functional unit in the embodiments of the present application can be integrated into one processing unit, or each unit can exist physically as a separate unit, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware, or in the form of software functional units. When the integrated unit is implemented in the form of software functional units and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solutions of the embodiments of the present application essentially, or the part that contributes to the prior art, or all or a part of the technical solutions can be embodied in the form of a software product. The software product is stored in a storage medium, and includes several instructions for causing an apparatus (which can be a single chip, a chip set, or the like) or a processor (processor) to execute all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.

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

Claims

1. A screen brightness adjusting method applied to a terminal device, characterized in that, The terminal device comprises an application processor and a sensor coprocessor, the application processor comprises a framework layer, a kernel layer and a hardware abstraction layer, the sensor coprocessor comprises a co-driver layer and a co-hardware layer, and the method comprises: In response to a screen-on event, an adjusting backlight module of the framework layer sends a brightness value acquisition request to a first interface of the framework layer; the first interface is an Android Interface Definition Language (AIDL) interface; In response to the received brightness value acquisition request, the first interface generates a first instruction based on a communication protocol corresponding to a second interface in the hardware abstraction layer, and sends the first instruction to the second interface; the second interface is a Qualcomm Messaging Interface (QMI); The second interface generates a second instruction according to the received first instruction, and sends the second instruction to an ambient light sensor driver in the co-driver layer; the second instruction is a CMD instruction; The ambient light sensor driver sends a target ambient light brightness value uploaded by an ambient light sensor in the co-hardware layer to the adjusting backlight module through the second interface and the first interface in sequence in response to the received second instruction; The adjusting backlight module determines a first frame brightness value according to the target ambient light brightness value, and sends the first frame brightness value to a display driver in the kernel layer; The display driver controls a display screen of the terminal device to turn on the screen according to the first frame brightness value.

2. The screen brightness adjusting method of claim 1, wherein, The second interface generates a second instruction according to the received first instruction, comprising: The second interface determines whether the first instruction is an instruction for requesting to acquire a brightness value; If the first instruction is an instruction for requesting to acquire a brightness value, the second interface generates a second instruction according to the received first instruction.

3. The screen brightness adjusting method of claim 1, wherein, Before the target ambient light brightness value uploaded by the ambient light sensor in the co-hardware layer is sent to the adjusting backlight module through the second interface and the first interface in sequence, the method further comprises: The ambient light sensor periodically sends an ambient light brightness value to the ambient light sensor driver according to a preset sampling period; The ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness value.

4. The screen brightness adjusting method of claim 3, wherein, The ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness value, comprising: The ambient light sensor driver determines the ambient light brightness value uploaded by the ambient light sensor most recently as the target ambient light brightness value.

5. The screen brightness adjusting method according to any one of claims 1 to 4, wherein The adjusting backlight module determines a first frame brightness value according to the target ambient light brightness value, comprising: The adjusting backlight module determines a display screen brightness value corresponding to the target ambient light brightness value according to a preset mapping relationship between an ambient light brightness value and a display screen brightness value, and determines the display screen brightness value corresponding to the target ambient light brightness value as the first frame brightness value.

6. A computer readable storage medium characterized by, The computer instructions, when executed on a terminal device, cause the terminal device to perform the screen brightness adjustment method of any one of claims 1 to 5.

7. A terminal device, characterized by comprising: The terminal device comprises a processor and a memory, the memory is used for storing instructions, and the processor is used for calling the instructions in the memory, so that the terminal device executes the screen brightness adjustment method as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Screen brightness adjusting method and electronic equipment

    CN114999421A