Screen brightness adjusting method, terminal equipment and storage medium

By building multiple interfaces between the AP processor and the SCP processor in the terminal device, it is ensured that the adjustment backlight module can effectively obtain the brightness value of the ambient light sensor, and solves the problem of display brightness mismatch caused by ambient light sensor service filtering. Improves brightness acquisition rate and accuracy and improves user experience.

CN119252193AActive Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The ambient light sensor service filtering in terminal devices causes Sensor Hub to be unable to update the ambient light brightness in time, resulting in the display brightness that does not match the actual ambient light brightness, and the problem of light first and then dark first and then light up.

Method used

By building multiple interfaces between the AP processor and the SCP processor, it is ensured that the adjustment backlight module can effectively obtain the brightness value of the ambient light sensor, including the Android interface definition language interface and the Qualcomm information interface, cross-process and cross-processor communication, and generate And send appropriate instructions to obtain the ambient light brightness value to ensure that the display brightness matches the ambient light brightness.

Benefits of technology

It effectively avoids the problem of brightness mismatch when the display is bright, improves the rate and accuracy of ambient light brightness values, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119252193A_ABST
    Figure CN119252193A_ABST
Patent Text Reader

Abstract

The invention provides a screen brightness adjusting method, terminal equipment 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, adjusting a backlight module to send 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 the second interface; the second interface generates a second instruction according to the first instruction and sends the second instruction to the ambient light sensor driver; the ambient light sensor driver responds to the second instruction and sends the target ambient light brightness value to the backlight adjusting module through the second interface and the first interface in sequence; and adjusting a backlight module to determine a first frame brightness value according to the target ambient light brightness value, so that a display driver controls a display screen to light up according to the first frame brightness value. According to the method, the returned ambient light brightness value can be received on the basis of each brightness value acquisition request sent by the backlight adjustment module, and the condition that the backlight adjustment module can acquire the ambient light brightness value within the effective time is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of terminal technology, and in particular relates to a screen brightness adjustment method, a terminal device and a storage medium. Background Art

[0002] The terminal device can be equipped with an ambient light sensor. The ambient light sensor is used to detect the ambient light in the environment where the terminal device is located and determine the actual ambient light brightness corresponding to the terminal device. The actual ambient light brightness plays a critical role in the use of the terminal device. For example, the display brightness of the terminal device display can be determined based on the actual ambient light brightness. The application in the terminal device can register the ambient light service in the sensor manager (sensormanager) so that the sensor control center (Sensor Hub) can determine the ambient light brightness at preset time intervals.

[0003] The Sensormanager sends the registration signal corresponding to the ambient light service to the Sensor Hub at a preset time interval, so that the Sensor Hub can achieve a regular update of the ambient light brightness. However, in the related art, when the sensormanager receives multiple ambient light services, it will screen the received services and filter out some of the services. After the ambient light service is filtered out, the sensormanager will not generate its corresponding registration signal, so the Sensor Hub cannot receive the registration signal corresponding to the service, and it cannot update the ambient light brightness. The matching relationship between the brightness of the display screen when the screen is on and the actual ambient light brightness is extremely important to the user experience. For example, when the display screen is on, 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 an inappropriate brightness setting when the display screen is turned on, and may even cause the display screen to appear bright first and then dark or dark first and then bright. Summary of the invention

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

[0005] The first aspect of the present application discloses a screen brightness adjustment method, which is applied to a terminal device, wherein the terminal device includes an application processor and a sensor coprocessor, wherein the application processor includes a framework layer, a kernel layer and a hardware abstraction layer, and the sensor coprocessor includes a co-driver layer and a co-hardware layer. The method includes: in response to a screen-on event, a backlight adjustment module of the framework layer sends a brightness value acquisition request to a first interface of the framework layer; in response to the received brightness value acquisition request, the first interface sends a first instruction 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; in response to the received second instruction, the ambient light sensor driver sends the target ambient light brightness value uploaded by the ambient light sensor in the co-hardware layer to the backlight adjustment module through the second interface and the first interface in sequence; the backlight adjustment 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 the display screen of the terminal device to light up the screen according to the first frame brightness value. The above method, through multiple preset interfaces, constructs a transmission channel for the backlight adjustment module in the AP processor to obtain the ambient light brightness value of the ambient light sensor in the SCP processor, which facilitates the backlight adjustment module to obtain ambient light data from the ambient light sensor driver, and the multiple preset interfaces will not filter the brightness value acquisition request sent by the backlight adjustment module, convert the brightness value acquisition request into a first instruction through the first interface, and convert the first instruction into a second instruction based on the second interface, and send the second instruction 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 backlight adjustment module, thereby ensuring that the backlight adjustment module can obtain the ambient light brightness value within the effective time, so that the backlight adjustment module can determine the 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 display screen first lighting up and then darkening, or first lighting up and then darkening when the screen is turned on.

[0006] In some optional implementations, the first interface includes an Android interface definition language interface; the second interface includes a Qualcomm information interface. The above method can realize cross-process communication through the first interface, and can realize cross-process communication through the second interface.

[0007] In some optional embodiments, the second interface generates a second instruction according to the received first instruction: the second interface determines whether the first instruction is an instruction for requesting to obtain a brightness value; if the first instruction is an instruction for requesting to obtain a brightness value, the second interface generates a second instruction according to the received first instruction. The above method can reduce the conversion of instructions of other instruction types by executing the instruction type judgment of the first instruction on the second interface, and only executes the command conversion operation and generates the second instruction when the first instruction is an instruction for requesting to obtain a brightness value; effectively saves system resources, speeds up the conversion efficiency of instructions for requesting to obtain a brightness value, and thereby improves the rate of obtaining the brightness value of the ambient light.

[0008] In some optional implementations, the second instruction is a CMD instruction. The above method, generating a CMD instruction based on the first instruction, can increase 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, so that the second interface can 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 cooperative hardware layer is sent to the backlight adjustment module via the second interface and the first interface in sequence, the method further includes: the ambient light sensor periodically sends the 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. The above method can realize that the ambient light sensor generates and reports the ambient light brightness value regularly.

[0011] In some optional embodiments, the ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness value, including: the ambient light sensor driver determines the ambient light brightness value uploaded most recently by the ambient light sensor as the target ambient light brightness value. The above method can speed up the determination of the target ambient light brightness value by determining the ambient light brightness value uploaded most recently by the ambient light sensor as the target ambient light brightness value, thereby shortening the time for adjusting the backlight module to obtain 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 the display screen brightness value corresponding to the target ambient light brightness value according to a preset mapping relationship between the ambient light brightness value and the 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. 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.

[0013] The second aspect of the present application discloses a terminal device, which includes a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the terminal device executes the screen brightness adjustment method 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 are executed on a terminal device, the terminal device executes the screen brightness adjustment method as described in the first aspect.

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

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

[0017] Figure 2 A schematic diagram of a screen lighting method provided in an embodiment of the present application.

[0018] Figure 3 A schematic diagram of a batch command issuing method provided for this application.

[0019] Figure 4 A schematic diagram of the architecture for adjusting screen brightness provided in an embodiment of the present application.

[0020] Figure 5 A flowchart of a method for adjusting screen brightness is provided in an embodiment of the present application.

[0021] Figure 6 A schematic diagram of an architecture for transmitting ambient light data provided in an embodiment of the present application.

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

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

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It should be understood that, unless otherwise specified in the present application, " / " means or. For example, A / B can represent A or B. "And / or" in the present application is only a kind of association relationship describing associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations. It should be understood that the order of the steps shown in the flowchart of this article can be changed, and some can also 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 by way of example in conjunction with the accompanying drawings. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0026] With the development of terminal products in technology, in order to pursue the ultimate screen-to-body ratio and expand the area of ​​the display screen, the ambient light sensor on the terminal device can be set 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 set below the OLED screen. The embodiment of the present application takes the example of setting the ambient light sensor below the OLED screen of the terminal device as an example for explanation. Figure 1 This is a diagram showing the front position relationship between the display screen and the ambient light sensor in the terminal device provided in the embodiment of the present application. Figure 1As shown, 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 front of the terminal device (the direction 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, in a dark environment, the display screen will not be too bright to cause glare, and in a bright environment, the display screen will not be too dark to be unclear.

[0027] In one embodiment of the present application, the processor of the terminal device may be a multi-core processor. Figure 2 A schematic diagram describing a screen lighting method provided in an embodiment of the present application.

[0028] like Figure 2 As shown, the processor in the terminal device is a multi-core processor, which may include: an application processor (AP) processor and a sensor coprocessor (SCP). The AP processor is the application processor in the terminal device, and the operating system, user interface and application program can all run on the AP processor. The SCP processor is a coprocessor that can assist the AP processor in performing matters related to sensors (e.g., ambient light sensors). Figure 2 Only the AP processor and the SCP processor are shown. In practical applications, the multi-core processor may also include other processors. For example, when the terminal device is a mobile phone, the multi-core processor may also include a baseband (BP) processor that runs the mobile phone radio frequency communication control software and is responsible for sending and receiving data.

[0029] Figure 2 The AP processor in the figure only shows the contents related to the embodiments of the present application. The implementation of the embodiments of the present application needs to rely on the following layers in the AP processor: application layer, framework layer, hardware abstraction layer (HAL), kernel layer, and hardware layer. There are multiple applications and / or application services in the application layer of the AP processor. For the sake of simplicity, they are not shown in the figure. Figure 2As shown in . The framework layer may include a power management module (PowerManger), a display engine (Display engine) and a sensormanager. PowerManger can be used to implement screen on / off state switching and management. Display engine can be used to set brightness. Sensormanager is used to obtain ambient light brightness. The hardware abstraction layer may include a sensor HAL (sensorHAL) and HWC (Hardware composerHAL). SensorHAL is a dynamic library. Whenever the sensor service is started, the sensor HAL library is dynamically loaded. 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 underlying 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 underlying device and provide a unified interface to the upper layer. The sensor HAL includes interfaces for communicating with different types of sensors. As Figure 2 As shown, the sensor HAL may include an ambient light sensor interface. The ambient light sensor interface may be used to implement communication with the ambient light sensor to obtain ambient light brightness. For example, the sensor HAL may also include an acceleration sensor interface, which is used to implement communication with the acceleration sensor to obtain acceleration data. The acceleration sensor interface is not shown in FIG. Figure 2 Shown in.

[0030] HWC is a module for interface synthesis and display in the system, and provides hardware support for the surfaceFlinger service. HWC can send a screen-lighting instruction to the OLED driver, so that the OLED driver controls the OLED device of the terminal device to emit light and realize the screen-lighting. The kernel layer may 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 can be understood as a sensor control center (sensor hub), which can control the sensor and process the relevant data of the sensor. The implementation of the embodiment of the present application needs to rely on the following: the cooperative application layer (Hub APK), the cooperative framework layer (Hub FWK), the cooperative driver layer (Hub DRV), and the cooperative hardware layer (Hubhardware) in the SCP processor. Among them, the cooperative application layer includes an ambient light sensor application. The cooperative driver layer includes an ambient light sensor driver. The cooperative 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 with a preset sampling period.

[0032] like Figure 2 As shown, the screen lighting method provided by the embodiment of the present application may include the following process. According to different requirements, the order of the steps in the use diagram can be changed, and some steps can be omitted. Figure 2 As shown, the method includes:

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

[0034] The screen-on event is an event that controls the display screen of the terminal device to switch from the off state to the bright state. In one embodiment of the present application, the power management module can generate a screen-on event in response to the received notification information. For example, a text message, incoming call, and other information sent by other terminal devices are received, or the terminal device receives notifications of various installed applications and other information, and generates a screen-on event. In one 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 may include sensors such as Hall sensors and pressure sensors. The Hall sensor is a magnetic element that can be set in the terminal device to support the leather case function. When the terminal device is equipped with a flip leather case, the terminal device can use the Hall sensor to detect the opening and closing state of the flip leather case. Among them, the opening and closing state includes the leather case open state or the leather case closed state. When the Hall sensor in the terminal device and the magnetic element in the leather case are in contact with each other and away from each other, the terminal device is in the leather case opening process state. In one embodiment of the present application, when it is determined that the leather case changes from a closed (or buckled) state to an 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 touch operation performed by the user on the display screen can be determined based on the state change of the pressure sensor. In one embodiment of the present application, when it is determined that the user has performed a target operation on the display screen based on the state change of the pressure sensor, a screen light event is generated. In one embodiment of the present application, a screen light event can be generated based on the user's pressing operation on a physical button, such as pressing an on / off button.

[0035] The backlight adjustment module, also known as the 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 greater the ambient brightness value, the greater the screen brightness of the terminal device is set by the backlight adjustment module; the smaller the ambient brightness value, the smaller the screen brightness of the terminal device is set by the backlight adjustment module.

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

[0037] Step S202: Adjust the backlight module to register 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 sensor manager can return the ambient light brightness value collected by the ambient light sensor.

[0039] Step S203: In response to adjusting the ambient light service registered by the backlight module, the sensor manager sends a batch command to the ambient light sensor interface.

[0040] In an embodiment of the present application, a batch command, which may also be referred to as a batch event or a first frame command, is used to indicate that the ambient light brightness value is returned within a valid time. Step S204: The ambient light sensor interface sends the batch command to the ambient light sensor driver in the SCP processor.

[0041] Step S205: After the ambient light sensor driver monitors the batch command, the target ambient light brightness value uploaded by the ambient light sensor is sent to the ambient light sensor interface.

[0042] In one embodiment of the present application, the ambient light sensor samples according to a preset sampling period to obtain the ambient light brightness value. For example, the ambient light sensor obtains at least one 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 ambient light sensor driver records the received sensor manager. In one embodiment of the present application, after listening to the batch command, the ambient light sensor driver determines the most recently recorded ambient light brightness value as the target ambient light brightness value and sends it to the ambient light sensor interface. For some specific implementation methods for determining the target ambient light brightness value, please refer to the relevant description below, such as for Figure 5 Related description.

[0043] The sampling period can be set according to actual needs, such as 200ms, 350ms, etc., and the sampling period is greater than the effective time. The present application embodiment does not limit the value of the sampling period. For ease of description, the following takes the sampling period of 350ms as an example for illustration.

[0044] In one embodiment of the present application, after the ambient light sensor driver receives the ambient light brightness value reported by the ambient light sensor, the received ambient light brightness value will be recorded. In one 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 ambient light brightness value recorded in the historical record and record the ambient light brightness value currently received. This method can allow the ambient light sensor driver to retain the ambient light brightness value reported by the ambient light sensor most recently, avoiding storing too many ambient light brightness values ​​in the ambient light sensor driver, and avoiding taking up too much storage space.

[0045] In one embodiment of the present application, the ambient light sensor interface can send a batch command to the ambient light sensor driver through the ambient light sensor application in the cooperative application layer. The ambient light sensor application sends the received batch command to the ambient light sensor driver. After the ambient light sensor driver receives the batch command in response to monitoring, it 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 ambient light sensor interface.

[0046] Step S206: The ambient light sensor interface reports the target ambient light brightness value to the backlight adjustment module through the sensor manager.

[0047] Step S207 , adjusting the backlight module to determine the brightness value of the first frame according to the received target ambient light brightness value, and sending the determined brightness value of the first frame to the OLED driver.

[0048] In one embodiment of the present application, after the adjustment backlight module registers the ambient light service with the sensor manager, the brightness value of the first frame can be determined based on the target ambient light brightness value returned by the sensor manager. In one embodiment of the present application, when the adjustment backlight module sends the registration ambient light service, the adjustment backlight module starts timing. If the adjustment backlight module obtains the target ambient light brightness value returned by the sensor manager within the effective time, the brightness value of the display screen when the screen is on is determined according to the target ambient light brightness value, that is, the brightness value of the first frame of the display screen is determined. The effective time can be set based on actual needs, and can be set to any duration that meets actual needs, such as 200ms or 300ms. The embodiment of the present application does not limit the value of the effective time. For the sake of convenience, the following description takes the effective time of 200ms as an example.

[0049] In one embodiment of the present application, a mapping relationship between ambient light brightness value and 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 first frame brightness value corresponding to the target ambient light brightness value can also be determined based on other methods. In the embodiment of the present application, the method of determining the first frame brightness value based on the target ambient light brightness value returned by the sensor manager is not limited.

[0050] Through the above steps S202 to S207, the backlight module can be adjusted based on the target ambient light brightness value reported by the ambient light sensor driver to determine the brightness value of the first frame when the display screen is lit. Since the brightness value of the first frame is determined based on the target ambient light brightness value returned by the sensor manager, and matches the actual ambient light brightness corresponding to the current environment, the display brightness corresponding to the display screen is set using the brightness value of the first frame, which can achieve the effect of displaying the first frame image at a brightness that matches the actual ambient light brightness. Subsequent image frames are also displayed based on a brightness that matches the actual ambient light brightness, so the difference between the display brightness of the first frame image and subsequent image frames is small, which can avoid the user from feeling a significant change in brightness of the display screen, thereby improving the user experience.

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

[0052] Step S208: The OLED driver sends the acquired brightness value of the first frame to the display subsystem.

[0053] After receiving the brightness value of the first frame, the display subsystem lights up the display screen according to the brightness value of the first frame and sets the brightness value of the display screen to the brightness value of the first frame.

[0054] It can be seen from the above steps S207 and S208 that after the HWC obtains the brightness value of the first frame, the brightness of the terminal device display screen can be set when it is turned on, so that the brightness of the display screen is consistent with the ambient light brightness, so as to avoid significant changes in brightness of the screen after the screen is turned on or obvious delays in turning on the screen, thereby improving the user experience.

[0055] According to the above steps S202 to 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, thereby determining the brightness value of the first frame. However, in the related art, when the sensor manager receives registered ambient light services sent by multiple objects, it will determine the target object among the multiple objects, filter out the services registered by other modules except the target object, and only generate a batch command corresponding to the target object. Therefore, when the sensor manager receives registered ambient light services sent by multiple objects, the sensor manager may 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 batch command corresponding to the backlight adjustment module will not be issued. The above objects may include applications or application services in the application layer (or framework layer) in the AP processor.

[0056] In one embodiment of the present application, the sensor manager may perform screening based on the registration frequency of objects registered for the service, and determine objects whose registration frequency is greater than or equal to a preset maximum registration frequency as target objects. The registration frequency is used to indicate the number of times an object attempts to register within a specified time period. The higher the registration frequency, the more registration attempts are made within the specified time period. The maximum registration frequency is the highest registration frequency corresponding to all objects currently registered for the service on the sensor manager. Determining an object whose registration frequency is greater than or equal to the maximum registration frequency as a target object means that the object with the highest registration frequency among all objects currently registered for the service on the sensor manager is determined as the target object. Figure 3 A schematic diagram of a batch command delivery method provided by this application. Figure 3As shown, the sensor manager receives the registered ambient light service sent by application A, application B and the backlight adjustment module. Among them, the registration frequency of application A is 50hz, the registration frequency of application B is 40hz and the registration frequency of the backlight adjustment module is 30hz. At this time, the highest registration frequency among the registered ambient light services received by the sensor manager is 50hz, and the registration frequency of application A meets the condition that the registration frequency is greater than or equal to the highest registration frequency. Application A is determined as the target module, and the batch command corresponding to application A is generated. The services registered by application B and the backlight adjustment module are filtered, and the batch command of application B and the backlight adjustment module is not generated. In one embodiment of the present application, if multiple modules meet the condition that the registration frequency is greater than or equal to the highest registration frequency, the target module can be determined according to the preset judgment rule. For example, the judgment rule can be set to determine the module that registers the service first (or last) as the target module, which can be flexibly set or modified in actual applications, and is not limited to the above examples. Based on the filtering mechanism of the sensor manager, the sensor manager may filter out the ambient light service registered by the backlight adjustment module, and will not generate a batch command for the backlight adjustment module.

[0057] Therefore, the ambient light sensor driver may not be able to receive the batch command corresponding to the backlight module adjustment. In the case of not receiving the batch command, the ambient light sensor may not be able to return the ambient light brightness value within the effective time, so the backlight module adjustment may not be able to 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 module adjustment, if there is no batch command corresponding to the backlight module adjustment and the effective time does not include the end time of the current sampling period, such as in the middle of the current sampling period, when the effective time ends, the ambient light sensor has not obtained the ambient light brightness value of the current sampling period, then the ambient light sensor will not upload a new ambient light brightness value within the effective time. If the ambient light sensor driver does not receive the ambient light brightness value uploaded by the ambient light sensor within the effective time, it will not upload the ambient light brightness value to the ambient light sensor application, resulting in the backlight module adjustment not receiving the ambient light brightness value within the effective time.

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

[0059] Because the display screen brightness value of the last image frame in the backlight module may be too different from the actual ambient light brightness of the current terminal device. For example, the display screen brightness value of the last image frame in the backlight module may be determined based on the ambient light brightness value collected when the user turns the terminal device upside down on the desktop, or may be determined based on the ambient light brightness value collected when the user puts the terminal device into a pocket without turning off the screen. The display screen brightness value may be a value close to or equal to 0. Therefore, in the case where the actual ambient light brightness value is large, if the display screen brightness value of the last image frame is used to light up the screen, the display screen may appear dark first and then bright when the screen is lit, resulting in a poor user experience. For another example, the display screen brightness value of the last image frame is determined by the ambient light brightness value collected when the terminal device is in a bright environment, that is, the display screen brightness value of the last image frame is large. When the terminal device is currently in a dark environment, that is, when the actual ambient light brightness corresponding to the terminal device is small, if the display screen brightness value of the last image frame is used to light up the screen, the display screen may appear bright first and then dark when the screen is lit. If the brightness value of the first frame when the terminal device turns on the screen does not match the brightness of the current environment of the terminal device, it will result in a poor user experience.

[0060] In order to solve the technical problem that the sensor manager filters out the ambient light service registered by the backlight adjustment module, resulting in the inability of the backlight adjustment module to receive the ambient light brightness value within the effective time, resulting in the inability to generate the first frame brightness value that matches the actual ambient light brightness, thereby causing the display screen to first light up and then darken, or first light up and then darken when the screen is turned on, the embodiment of the present application provides a screen brightness adjustment method, which can realize the cross-processor communication between the application processor and the sensor coprocessor through multiple preset interfaces. Specifically, the brightness value acquisition request is converted into a first instruction through the first interface, and the first instruction is converted into a second instruction based on the second interface, so that the ambient light sensor driver can 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 obtain the ambient light brightness value within the effective time, so that the backlight adjustment module can determine the first frame brightness value that matches the actual ambient light brightness based on the acquired ambient light brightness value, avoiding the technical problem that the display screen first light up and then darken, or first light up and then darken when the screen is turned on.

[0061] Figure 4 This is a schematic diagram of a screen brightness adjustment architecture provided by an embodiment of the present 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 some specific descriptions of the structures in the AP processor and the SCP processor, please refer to the relevant descriptions above, such as Figure 2 Related description.

[0062] Among them, Figure 4 As shown, the framework layer includes an Android interface definition language interface (AIDL). The backlight adjustment module in the display engine communicates with the sensor HAL through the AIDL interface and sends a brightness value acquisition request to the sensor HAL. Figure 4 As shown, the sensor HAL includes a created Qualcomm Message Interface (QMI). The backlight adjustment module sends a brightness value acquisition request to the QMI interface in the sensor HAL through the AIDL interface. After receiving the brightness value request, the QMI interface generates a CMD (command) 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. In response to the CMD instruction, the ambient light sensor driver sends the target ambient light brightness value reported by the ambient light sensor to the QMI interface based on IPC communication. The QMI interface sends the received target ambient light brightness value to the backlight adjustment module through 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 send the first frame brightness value to the OLED driver, so that the OLED driver controls the display screen of the terminal device to light up the screen according to the first frame brightness value.

[0063] The above architecture constructs a transmission channel for the backlight adjustment module in the AP processor to obtain the ambient light brightness value of the ambient light sensor in the SCP processor through the message passing interfaces of the AIDL and QMI layers, which facilitates the backlight adjustment module to obtain ambient light data from the ambient light sensor driver. The message passing interfaces of the AIDL and QMI layers will not filter the brightness value acquisition request sent by the backlight adjustment module, so that the ambient light sensor driver can 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 obtain the ambient light brightness value within the effective time, so that the backlight adjustment module can determine the 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 display screen first lighting up and then darkening, or first lighting up and then darkening when the screen is turned on.

[0064] The following describes the process of transmitting ambient light data based on the above architecture. Figure 5 Based on the embodiments of the present application Figure 4 A flowchart of a method for adjusting screen brightness implemented by the technical architecture shown in FIG. The order of the steps in the flowchart can be changed and some steps can be omitted according to different requirements. Figure 5 As shown, the method includes:

[0065] Step S501, in response to a screen-on event, adjusting the backlight module to send a brightness value acquisition request to the first interface of the framework layer.

[0066] The screen-on event is an event that switches the display screen of the terminal device from the off state to the on state. After the power management module generates the screen-on event, it sends the generated screen-on event to the backlight adjustment module. For some specific implementations of the power management module generating the screen-on event, please refer to the relevant description above, such as Figure 2 In response to the received screen-on event, the backlight module is adjusted to send a brightness value acquisition request to the first interface of the framework layer.

[0067] The brightness value acquisition request is used to obtain the ambient light brightness value of the environment in which the terminal device is currently located, and can be used to control the first interface to return the ambient light brightness value of the environment in which the terminal device is currently located within the valid time. The valid time can be set based on actual needs, and can be set to any duration that meets actual needs, such as 200ms or 300ms. The embodiment of the present application does not limit the value of the valid time. For the sake of convenience, the following example takes the valid time of 200ms as an example for explanation.

[0068] 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.

[0069] In one embodiment of the present application, the first instruction can be used to control the second interface to return the ambient light brightness value of the current environment of the terminal device at the effective time. In one embodiment of the present 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, so that the second interface can directly read the first instruction without further parsing.

[0070] In one embodiment of the present 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.

[0071] In one embodiment of the present application, the second interface includes a Qualcomm Information (QMI) interface. The QMI interface can be used to implement communication between multi-processor processes. The second interface can also be other interfaces that can be used for communication between cross-processor processes. For example, the second interface can also include a PCIe (PCI-Express) interface.

[0072] Step S503: the second interface generates a second instruction according to the received first instruction, and sends the second instruction to the ambient light sensor driver in the cooperative driver layer.

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

[0074] In one embodiment of the present application, the second instruction is a CMD instruction. The CMD instruction is a relatively common command line tool in terminal devices. Generating the CMD instruction based on the first instruction can increase 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.

[0075] In one embodiment of the present 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 for requesting to obtain a brightness value; if the first instruction is an instruction for requesting to obtain a brightness value, the second interface generates a second instruction based on the received first instruction. If the first instruction is not an instruction for requesting to obtain a brightness value, the process ends and the second instruction is not generated. The above method can reduce the conversion of instructions of other instruction types by executing the instruction type judgment of the first instruction on the second interface, and only executing the command conversion operation and generating the second instruction when the first instruction is an instruction for requesting to obtain a brightness value; effectively save system resources, speed up the conversion efficiency of instructions for requesting to obtain brightness values, and thereby improve the rate of obtaining ambient light brightness values.

[0076] In one embodiment of the present application, the second interface can send the second instruction to the ambient light sensor driver through the ambient light sensor application in the cooperative application layer. The ambient light sensor application sends the received second instruction to the ambient light sensor driver. In response to monitoring 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. Step S504, after the ambient light sensor driver responds to the received second instruction, it sends the target ambient light brightness value uploaded by the ambient light sensor in the cooperative hardware layer to the adjusting backlight module through the second interface and the first interface in sequence.

[0077] For example, 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 cooperative hardware layer to the second interface. After receiving the ambient light brightness value, the second interface sends the received ambient light brightness value to the first interface. The first interface sends the received ambient light brightness value to the backlight adjustment module.

[0078] In one embodiment of the present application, before the target ambient light brightness value uploaded by the ambient light sensor in the cooperative hardware layer is sent to the adjusting backlight module via the second interface and the first interface in sequence, the method also includes: the ambient light sensor periodically sends the ambient light brightness value to the ambient light sensor driver 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.

[0079] In one 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 needs, such as being set to 200ms, 350ms, etc., and 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 the ambient light sensor to periodically generate and report the ambient light brightness value. In one embodiment of the present application, the current sampling period of the ambient light sensor can be modified, the sampling period can be extended, or the sampling period can be shortened. For example, the current sampling period can be modified based on the user's operation.

[0080] In one embodiment of the present application, the ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness value, including: the ambient light sensor driver determines the ambient light brightness value uploaded most recently by the ambient light sensor as the target ambient light brightness value. The above method can speed up the determination of the target ambient light brightness value by determining the ambient light brightness value uploaded most recently by the ambient light sensor as the target ambient light brightness value, thereby shortening the time for adjusting the backlight module to obtain the ambient light brightness value.

[0081] In one embodiment of the present application, after the ambient light sensor driver receives the ambient light brightness value reported by the ambient light sensor, the received ambient light brightness value will be recorded, and the ambient light sensor driver can obtain the ambient light brightness value most recently uploaded by the ambient light sensor from the recorded ambient light brightness value. 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 ambient light brightness value recorded in the historical record and record the ambient light brightness value currently received. This method can allow the ambient light sensor driver to retain the ambient light brightness value most recently reported by the ambient light sensor, avoiding storing too many ambient light brightness values ​​in the ambient light sensor driver.

[0082] In one embodiment of the present application, a mapping relationship between ambient light brightness value and 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 ambient light brightness value and display screen brightness value. In the embodiment of the present application, the method for 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 methods.

[0083] In another embodiment of the present application, the ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness value, including: determining the first moment when the ambient light sensor last uploaded the ambient light brightness value; determining the second moment based on the first moment and the sampling period; determining the third moment corresponding to the second instruction; if the time difference between the second moment and the third moment is greater than a preset time threshold and the second moment is earlier than the third moment, determining the ambient light brightness value uploaded by the ambient light sensor at the second moment as the target ambient light brightness value. If the time difference between the second moment and the third moment is less than or equal to the preset time threshold or the second moment is later than the third moment, 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.

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

[0085] The second moment is the predicted moment when the ambient light sensor uploads the ambient light brightness value to the ambient light sensor driver next time. The third moment is the moment determined based on the effective time. In this embodiment, the backlight module needs to be adjusted before the third moment to receive the ambient light brightness value.

[0086] The preset time threshold can be set according to actual needs, and can be determined according to the time required for the ambient light sensor driver to send the ambient light brightness value to the adjusting backlight module through the second interface and the first interface in sequence. When the time difference between the second moment and the third moment is greater than the preset time threshold and the second moment is earlier than the third moment, 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 moment to the adjusting backlight module within the effective time, and the ambient light brightness value uploaded by the ambient light sensor at the second moment 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 moment, the ambient light brightness value is sent to the adjusting backlight module. The adjusting backlight module sometimes needs to generate the first frame brightness value based on the received ambient light brightness value after the effective time ends. Therefore, the above implementation method, when the time difference between the second moment and the third moment is greater than the preset time threshold and the second moment is earlier than the third moment, determines the ambient light brightness value uploaded by the ambient light sensor at the second moment as the target ambient light brightness value, that is, the ambient light brightness value that is not currently generated is determined as the target ambient light brightness value. This can reduce the time difference between the sending time of the target ambient light brightness value sent by the ambient light sensor to the adjusting backlight module and the generation time of the first frame brightness value, thereby making the determined first frame brightness value closer to the actual ambient light brightness value.

[0087] Step S505 : the backlight adjustment 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.

[0088] In one embodiment of the present application, the backlight adjustment module can directly send the first frame brightness value to the display driver. In another embodiment of the present application, the backlight adjustment module can indirectly send the first frame brightness value to the display driver. For example, the backlight adjustment 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 implementations of the HWC sending the received first frame brightness value to the display driver, please refer to the relevant description above, such as Figure 2 Related description.

[0089] Some specific implementations of adjusting the backlight module according to the target ambient light brightness value to determine the brightness value of the first frame can refer to the relevant description above, such as Figure 2 In the description, the brightness value of the first frame is determined according to the brightness value of the ambient light.

[0090] In one embodiment of the present application, after the backlight adjustment module receives the returned ambient light brightness value within the valid time, that is, receives the target ambient light brightness value, the brightness value of the first frame can be immediately determined based on the received target ambient light brightness value, so that the screen can be lit in a faster time, reducing the time the user waits for the screen to light up. In another embodiment of the present application, the backlight adjustment module determines the brightness value of the first frame based on the received returned ambient light brightness value, that is, the target ambient light brightness value, at the end of the valid time. If the backlight adjustment module receives two returned ambient light brightness values ​​at the end of the valid time, the backlight adjustment module can determine the brightness value of the first frame based on the ambient light brightness value received later.

[0091] Step S506: the display driver controls the display screen of the terminal device to light up according to the brightness value of the first frame.

[0092] In one embodiment of the present application, the display driver can be sent to the display subsystem. After the display subsystem receives the brightness value of the first frame, it lights up the display screen according to the brightness value of the first frame, and sets the brightness value of the display screen to the brightness value of the first frame, thereby achieving the effect of lighting up the display screen of the terminal device according to the display driver. In an embodiment of the present application, the specific manner in which the display driver controls the display screen of the terminal device to light up the screen according to the brightness value of the first frame is not limited, and other prior art methods can also be used to control the display screen to light up the screen according to the brightness value of the first frame.

[0093] In the above embodiment, a transmission channel is constructed through a plurality of preset interfaces for the backlight adjustment module in the AP processor to obtain the ambient light brightness value of the ambient light sensor in the SCP processor, which facilitates the backlight adjustment module to obtain ambient light data from the ambient light sensor driver, and the plurality of preset interfaces will not filter the brightness value acquisition request sent by the backlight adjustment module, and the brightness value acquisition request is converted into a first instruction through the first interface, and 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, so that the ambient light sensor driver can 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 obtain the ambient light brightness value within the effective time, so that the backlight adjustment module can determine the first frame brightness value that matches the actual ambient light brightness based on the obtained ambient light brightness value, thereby avoiding the technical problem of the display screen first lighting up and then darkening, or first lighting up and then darkening when the screen is turned on.

[0094] In one embodiment of the present application, after the power management module generates a screen-on event and sends the screen-on event to the backlight adjustment module, in response to the screen-on event, the backlight adjustment module registers the ambient light service with the sensor manager and sends a brightness value acquisition request to the first interface of the framework layer, that is, in response to the screen-on event, the backlight adjustment module executes Figure 2 Step S202 and execute Figure 5 In step S501 of the present application, the backlight module is not adjusted. Figure 2 Step S202 and Figure 5 The backlight module can be adjusted to execute the following steps simultaneously: Figure 2 Step S202 and Figure 5 Step S501 in the above example, or you can first execute Figure 2 Step S202, then execute Figure 5 Step S501 in the above example; you can also first execute Figure 5 Step S501 in step 502, then execute Figure 2 Step S202. When the backlight module is adjusted to perform Figure 5 After step S501 in Figure 5 Steps S502 to S504 are shown to obtain the target ambient light brightness value. Figure 2 After step S202, if the sensor manager does not filter the ambient light service registered by the backlight adjustment module, Figure 2 In step S203 to step S205 shown, the target ambient light brightness value is obtained.

[0095] In this embodiment, when the backlight module is adjusted to perform Figure 2 Step S202 and Figure 5 After step S501 in, 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 target ambient light brightness value from the at least one target ambient light brightness value received, determine the first frame brightness value, and send the determined first frame brightness value to the display driver, so that the display driver controls the display screen of the terminal device to light up the screen 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. For another example, 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 the present application, after the backlight adjustment module receives the returned target ambient light brightness value within the effective time, it can immediately determine the first frame brightness value according to the received target ambient light brightness value, so that the screen can be lit up in a faster time, reducing the time the user waits for the screen to light up.

[0096] Figure 6 This is a schematic diagram of an architecture for ambient light data transmission provided by an embodiment of the present application. Figure 6 As shown, the processor in the terminal device to which the ambient light data transmission method is applied is a multi-core processor, which may include: an AP processor and an SCP processor. For some specific descriptions of the structures in the AP processor and the SCP processor, please refer to the relevant descriptions above, such as Figure 2 Related description.

[0097] Among them, Figure 6 As shown, the framework layer includes the AIDL interface, and the sensor HAL includes the created QMI interface. Figure 6 In the architecture shown, the target object can execute the ambient light data transmission method as follows: the target object can send a brightness value acquisition request to the QMI interface in the sensor HAL through the AIDL interface. After receiving the brightness value request, the QMI interface 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. In response to the CMD instruction, the ambient light sensor driver sends the target ambient light brightness value reported by the ambient light sensor to the QMI interface based on the IPC communication. The QMI interface 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.

[0098] In one embodiment of the present application, the target object may be an application and / or application service in the application layer of the AP processor, or an application and / or application service in the framework layer of the AP processor. Figure 6 As shown, the target object can be an application object for obtaining the ambient light brightness value, such as adjusting the backlight module, application A and application B. Application A can be a face recognition application, and application B can be a fingerprint unlocking application. In one embodiment of the present application, when a preset target event is triggered, the application object sends a brightness value acquisition request to the QMI interface in the sensor HAL through the AIDL interface. The target event corresponding to each application object can be set in advance. An application module can correspond to one or more target events. For example, the screen light event can be determined as the target event corresponding to the backlight module adjustment. 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.

[0099] about Figure 6 For some specific implementation methods of the steps in the process of implementing the ambient light data transmission method for the target object, please refer to the relevant description above, such as Figure 2 , Figure 4 and Figure 5 Related description.

[0100] The above method realizes cross-processor communication between the application processor and the sensor coprocessor through the AIDL interface and the AIDL interface, converts the brightness value acquisition request into a first instruction through the AIDL interface, and converts the first instruction into a second instruction based on the AIDL interface, 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, ensuring that the target object can obtain the ambient light brightness value collected by the ambient light sensor based on the brightness value acquisition request, thereby improving the efficiency of the target object in obtaining the ambient light brightness value.

[0101] Figure 7 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 7 The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0102] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

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

[0104] The processor 110 may 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 may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0105] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I1C) 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.

[0106] The I1C 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 to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. The UART interface is a universal serial data bus 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 generally used to connect the processor 110 and the wireless communication module 160. For example: the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement the Bluetooth function.

[0107] The MIPI interface can be used to connect the processor 110 with 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 via the CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 100.

[0108] 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 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I1C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0109] The USB interface 130 is an interface that complies with the USB standard specification, and specifically 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, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices 100, such as AR devices, etc.

[0110] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

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

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

[0113] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

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

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

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

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

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

[0119] The camera 193 is used to capture still images or videos. The object is projected onto the photosensitive element by generating an optical image through the lens.

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

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

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

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

[0124] The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or listen to hands-free calls through the speaker 170A. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. When the terminal device 100 answers a call or voice message, the voice can be answered by placing the receiver 170B close to the human ear. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 170C with the human mouth to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals, but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

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

[0126] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. The air 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 case. The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). The distance sensor 180F is used to measure the distance. The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.

[0127] The ambient light sensor 180L is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. 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 an embodiment of the present application, the ambient light sensor 180L will sample according to a preset sampling period to obtain the 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.

[0128] The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect temperature. The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The bone conduction sensor 180M can obtain vibration signals.

[0129] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The motor 191 may generate a vibration prompt. The indicator 192 may be an indicator light, which may be used to indicate the charging status, the change of the power, or may be used to indicate messages, missed calls, notifications, etc.

[0130] The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. 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 memory cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.

[0131] The embodiment of the present application does not particularly limit the specific structure of the execution subject of a screen brightness adjustment method, as long as the program recording a screen brightness adjustment method of the embodiment of the present application can be run to perform processing according to a screen brightness adjustment method provided by the embodiment of the present application. For example, the execution subject of a screen brightness adjustment method provided by the embodiment of the present application can be a functional module in a terminal device that can call and execute a program, or a communication device applied to a terminal device, such as a chip.

[0132] An embodiment of the present application also provides a chip, in which computer instructions are stored. When the computer instructions are executed on the chip, the chip executes the above-mentioned related method steps to implement the screen brightness adjustment method and ambient light transmission method in the above-mentioned embodiment.

[0133] An embodiment of the present application also provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on the terminal device 100, the terminal device 100 executes the above-mentioned related method steps to implement the screen brightness adjustment method or ambient light transmission method in the above-mentioned embodiment.

[0134] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement the screen brightness adjustment method or ambient light transmission method in the above-mentioned embodiment.

[0135] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor may 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-mentioned method embodiments.

[0136] Among them, the terminal device, computer storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0137] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the module or unit is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of the device or unit, which can be electrical, mechanical or other forms. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0138] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, 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 a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A screen brightness adjustment method, applied to a terminal device, characterized in that: The terminal device includes an application processor and a sensor coprocessor, the application processor includes a framework layer, a kernel layer and a hardware abstraction layer, the sensor coprocessor includes a co-driver layer and a co-hardware layer, and the method includes: In response to a screen-on event, the backlight adjustment module of the framework layer sends a brightness value acquisition request to the first interface of the framework layer; 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; The second interface generates a second instruction according to the received first instruction, and sends the second instruction to the ambient light sensor driver in the cooperative driver layer; The ambient light sensor driver responds to the received second instruction and sends the target ambient light brightness value uploaded by the ambient light sensor in the cooperative hardware layer to the backlight adjustment module through the second interface and the first interface in sequence; The backlight adjustment 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 in the kernel layer; The display driver controls the display screen of the terminal device to light up according to the brightness value of the first frame.

2. The screen brightness adjustment method according to claim 1, characterized in that: The first interface includes an Android interface definition language interface; the second interface includes a Qualcomm information interface.

3. The screen brightness adjustment method according to claim 1, characterized in that: The second interface generates a second instruction according to the received first instruction: The second interface determines whether the first instruction is an instruction for requesting to obtain a brightness value; If the first instruction is an instruction for requesting to obtain a brightness value, the second interface generates a second instruction according to the received first instruction.

4. The screen brightness adjustment method according to claim 1, characterized in that: The second instruction is a CMD instruction.

5. The screen brightness adjustment method according to claim 1, characterized in that: 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.

6. The screen brightness adjustment method according to claim 1, characterized in that: Before sending the target ambient light brightness value uploaded by the ambient light sensor in the cooperative hardware layer to the backlight adjustment module via the second interface and the first interface in sequence, the method further includes: The ambient light sensor periodically sends the 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 values.

7. The screen brightness adjustment method according to claim 6, characterized in that: The ambient light sensor driver determines the target ambient light brightness value from the received ambient light brightness value, including: The ambient light sensor driver determines the ambient light brightness value uploaded most recently by the ambient light sensor as the target ambient light brightness value.

8. The screen brightness adjustment method according to any one of claims 1 to 7, characterized in that: The backlight adjustment module determines the brightness value of the first frame according to the target ambient light brightness value, including: The backlight adjustment module determines the display screen brightness value corresponding to the target ambient light brightness value according to a preset mapping relationship between the ambient light brightness value and the 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.

9. A computer-readable storage medium, characterized in that: It includes computer instructions, which, when executed on a terminal device, enable the terminal device to execute the screen brightness adjustment method as described in any one of claims 1 to 8.

10. A terminal device, characterized in that: The terminal device comprises a processor and a memory, the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the terminal device executes the screen brightness adjustment method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data transmission method for intelligent mobile phone information in Android system

    CN102130995A

  • Method for realizing sharing of Socket communication service on Android platform

    CN102520936A

  • Universal serial device communication module based on Android system

    CN103353839A

  • Method and device for displaying content in same screen, and terminal equipment

    CN104808907A

  • Terminal locking processing method and terminal

    CN107124711A