Brightness adjusting method and device, storage medium and terminal

文档序号:663995 发布日期:2021-04-27 浏览:17次 中文

阅读说明:本技术 亮度调节方法、装置、存储介质及终端 (Brightness adjusting method and device, storage medium and terminal ) 是由 曹奕松 许泽 陈冠军 于 2020-12-17 设计创作,主要内容包括:本申请实施例公开了一种亮度调节方法、装置、存储介质及终端,属于计算机技术领域。所述方法包括:终端通过光线传感器测量当前环境的第一光线强度值,光线传感器位于显示单元的同侧,在第一光线强度值与历史光线强度值的差值大于差值阈值时,通过后置摄像头测量当前环境的第二光线强度值,历史光线强度值为光线传感器在预设时间段内采集到的光线强度平均值,后置摄像头位于所述显示单元的另一侧,在第一光线强度值小于第二光线强度值时,基于第二光线强度值调节显示单元的亮度值,通过终端后置摄像头辅助调节显示单元亮度值的方式,实现在光线强度值变化较大的环境下准确调节显示单元的亮度值,以满足用户对终端显示单元的亮度要求。(The embodiment of the application discloses a brightness adjusting method, a brightness adjusting device, a storage medium and a terminal, and belongs to the technical field of computers. The method comprises the following steps: the terminal measures a first light intensity value of the current environment through the light sensor, the light sensor is located on the same side of the display unit, when a difference value between the first light intensity value and a historical light intensity value is larger than a difference threshold value, a second light intensity value of the current environment is measured through the rear camera, the historical light intensity value is a light intensity average value collected by the light sensor in a preset time period, the rear camera is located on the other side of the display unit, when the first light intensity value is smaller than the second light intensity value, the brightness value of the display unit is adjusted based on the second light intensity value, and the brightness value of the display unit is adjusted in an auxiliary mode through the rear camera, so that the brightness value of the display unit can be accurately adjusted under the environment with large light intensity value change, and the brightness requirement of a user on the display unit of the terminal is.)

1. A method of adjusting brightness, the method comprising:

measuring a first light intensity value of the current environment through a light sensor; the light sensor is positioned on the same side of the display unit;

when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, measuring a second light intensity value of the current environment through a rear camera; the historical light intensity value is a light intensity average value collected by the light sensor within a preset time period, and the rear camera is positioned on the other side of the display unit;

and when the first light intensity value is smaller than the second light intensity value, adjusting the brightness value of the display unit based on the second light intensity value.

2. The method of claim 1, wherein said adjusting a brightness value of said display unit based on said second light intensity value comprises:

calculating to obtain a first brightness reference value based on the first light intensity value;

calculating to obtain a first brightness adjusting value according to the second light intensity value and the first brightness reference value;

adjusting a brightness value of the display unit based on the first brightness adjustment value.

3. The method of claim 1, wherein measuring a second light intensity value of the current environment with a rear-facing camera comprises:

starting a rear camera;

acquiring a current environment image through the rear camera;

analyzing the environment image to obtain an exposure parameter; wherein the exposure parameters include: exposure time and exposure level;

and calculating a second light intensity value based on the exposure parameters.

4. The method of claim 1, further comprising:

when the first light intensity value is greater than or equal to the second light intensity value, calculating to obtain a second brightness adjusting value according to the first light intensity value;

adjusting a brightness value of the display unit based on the second brightness adjustment value.

5. The method of claim 4, wherein said adjusting the brightness value of the display unit based on the second brightness adjustment value comprises:

measuring a third light intensity value of the current environment through the front camera; the front camera is positioned on the same side of the display unit;

adjusting the brightness value of the display unit based on the third light intensity value and the second brightness adjustment value.

6. The method of claim 5, wherein adjusting the brightness value of the display unit based on the third light intensity value and the second brightness adjustment value comprises:

calculating a second brightness reference value based on the third light intensity value;

and calculating to obtain a third brightness adjusting value according to the second brightness adjusting value and the second brightness reference value, and adjusting the brightness value of the display unit based on the third brightness adjusting value.

7. The method of claim 1, further comprising:

when the difference value between the first light intensity value and the historical light intensity value is smaller than or equal to a difference threshold value, calculating to obtain a second brightness adjusting value according to the first light intensity value;

adjusting a brightness value of the display unit based on the second brightness adjustment value.

8. A luminance adjustment apparatus, characterized in that the apparatus comprises:

the first measurement module is used for measuring a first light intensity value of the current environment through the light sensor; the light sensor is positioned on the same side of the display unit;

the second measurement module is used for measuring a second light intensity value of the current environment through the rear camera when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value; the historical light intensity value is a light intensity average value collected by the light sensor within a preset time period, and the rear camera is positioned on the other side of the display unit;

and the adjusting module is used for adjusting the brightness value of the display unit based on the second light intensity value when the first light intensity value is smaller than the second light intensity value.

9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.

10. A terminal, comprising: a processor, a memory and a display screen; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 7.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a brightness adjustment method, an apparatus, a storage medium, and a terminal.

Background

With the development of mobile terminals, the number of users using mobile terminals is gradually increasing, and more users rely on the use of mobile terminals. Meanwhile, when the user uses the mobile terminal for a long time, the brightness of the display screen of the mobile terminal can cause damage to the eyes of the user to a certain extent. In the related art, the mobile terminal usually collects the light intensity of the environment based on a built-in light sensor, and then adjusts the brightness of the display screen based on the light intensity of the environment, so that the user can adapt to the change of the light intensity in the environment. However, in a scene with a large change in the light intensity of the environment, the problem that the brightness of the display screen cannot be accurately adjusted may exist, so that the brightness of the display screen is too high or too low, and the eyes of a user are injured.

Disclosure of Invention

The embodiment of the application provides a brightness adjusting method, a brightness adjusting device, a storage medium and a terminal, and can solve the problem that the brightness of a display screen cannot be accurately adjusted in the related art. The technical scheme is as follows:

in a first aspect, an embodiment of the present application provides a brightness adjustment method, where the method includes:

measuring a first light intensity value of the current environment through a light sensor; the light sensor is positioned on the same side of the display unit;

when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, measuring a second light intensity value of the current environment through a rear camera; the historical light intensity value is a light intensity average value collected by the light sensor within a preset time period, and the rear camera is positioned on the other side of the display unit;

and when the first light intensity value is smaller than the second light intensity value, adjusting the brightness value of the display unit based on the second light intensity value.

In a second aspect, an embodiment of the present application provides a brightness adjustment apparatus, including:

the first measurement module is used for measuring a first light intensity value of the current environment through the light sensor; the light sensor is positioned on the same side of the display unit;

the second measurement module is used for measuring a second light intensity value of the current environment through the rear camera when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value; the historical light intensity value is a light intensity average value collected by the light sensor within a preset time period, and the rear camera is positioned on the other side of the display unit;

and the adjusting module is used for adjusting the brightness value of the display unit based on the second light intensity value when the first light intensity value is smaller than the second light intensity value.

In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.

In a fourth aspect, an embodiment of the present application provides a terminal, including: a processor, a memory, a display unit; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.

The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:

when the scheme of the embodiment of the application is executed, the terminal measures the first light intensity value of the current environment through the light sensor, the light sensor is positioned at the same side of the display unit, when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, measuring a second light intensity value of the current environment through a rear camera, wherein the historical light intensity value is the average value of the light intensity collected by the light sensor in a preset time period, the rear camera is positioned on the other side of the display unit, when the first light intensity value is smaller than the second light intensity value, the brightness value of the display unit is adjusted based on the second light intensity value, the brightness value of the display unit can be accurately adjusted in the environment with large light intensity value change by means of auxiliary adjustment of the brightness value of the display unit by the rear camera of the terminal, so that the brightness requirement of a user on the display unit of the terminal can be met.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

Fig. 1 is a schematic structural diagram of a terminal provided in an embodiment of the present application;

FIG. 2 is a schematic structural diagram of an operating system and a user space provided in an embodiment of the present application;

FIG. 3 is an architectural diagram of the android operating system of FIG. 1;

FIG. 4 is an architecture diagram of the IOS operating system of FIG. 1;

fig. 5 is a schematic flowchart of a brightness adjustment method provided in an embodiment of the present application;

fig. 6 is another schematic flow chart of a brightness adjustment method provided in the embodiment of the present application;

fig. 7 is a schematic diagram of a brightness adjusting apparatus according to an embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.

When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.

In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.

Referring to fig. 1, a block diagram of a terminal according to an exemplary embodiment of the present application is shown. A terminal in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected by a bus 150.

Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall terminal using various interfaces and lines, performs various functions of the terminal and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-programmable gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.

The Memory 120 may include a Random Access Memory (RAM) or a read-only Memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like, and the operating system may be an Android (Android) system (including a system based on Android system depth development), an IOS system developed by apple inc (including a system based on IOS system depth development), or other systems. The storage data area may also store data created by the terminal in use, such as a phonebook, audio-video data, chat log data, and the like.

Referring to fig. 2, the memory 120 may be divided into an operating system space, in which an operating system runs, and a user space, in which native and third-party applications run. In order to ensure that different third-party application programs can achieve a better operation effect, the operating system allocates corresponding system resources for the different third-party application programs. However, the requirements of different application scenarios in the same third-party application program on system resources are different, for example, in a local resource loading scenario, the third-party application program has a higher requirement on the disk reading speed; in the animation rendering scene, the third-party application program has a high requirement on the performance of the GPU. The operating system and the third-party application program are independent from each other, and the operating system cannot sense the current application scene of the third-party application program in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third-party application program.

In order to enable the operating system to distinguish a specific application scenario of the third-party application program, data communication between the third-party application program and the operating system needs to be opened, so that the operating system can acquire current scenario information of the third-party application program at any time, and further perform targeted system resource adaptation based on the current scenario.

Taking an operating system as an Android system as an example, programs and data stored in the memory 120 are as shown in fig. 3, and a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360, and an application layer 380 may be stored in the memory 120, where the Linux kernel layer 320, the system runtime library layer 340, and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides underlying drivers for various hardware of the terminal, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, a power management, and the like. The system runtime library layer 340 provides a main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system runtime library layer 340 is an Android runtime library (Android runtime), which mainly provides some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used in building an application, and developers may build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, package management, session management, resource management, and location management. At least one application program runs in the application layer 380, and the application programs may be native application programs carried by the operating system, such as a contact program, a short message program, a clock program, a camera application, and the like; or a third-party application developed by a third-party developer, such as a game-like application, an instant messaging program, a photo beautification program, a shopping program, and the like.

Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 4, and the IOS system includes: a Core operating system Layer 420(Core OS Layer), a Core Services Layer 440(Core Services Layer), a Media Layer 460(Media Layer), and a touchable Layer 480(Cocoa Touch Layer). The kernel operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide functionality closer to hardware for use by program frameworks located in the core services layer 440. The core services layer 440 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, as required by the application. The media layer 460 provides audiovisual related interfaces for applications, such as graphics image related interfaces, audio technology related interfaces, video technology related interfaces, audio video transmission technology wireless playback (AirPlay) interfaces, and the like. Touchable layer 480 provides various common interface-related frameworks for application development, and touchable layer 480 is responsible for user touch interaction operations on the terminal. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.

In the framework shown in FIG. 4, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 440 and a UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.

The Android system can be referred to as a mode and a principle for realizing data communication between the third-party application program and the operating system in the IOS system, and details are not repeated herein.

The input device 130 is used for receiving input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens, i.e., display units, for receiving touch operations of a user on or near the touch display screens using any suitable object, such as a finger, a touch pen, and displaying user interfaces of respective applications. The touch display screen is generally provided at a front panel of the terminal. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.

In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.

In the embodiment of the present application, the main body of execution of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this embodiment of the present application.

In the terminal shown in fig. 1, the processor 110 may be configured to call an application program stored in the memory 120 and specifically execute the brightness adjustment method according to the embodiment of the present application.

In the following method embodiments, for convenience of description, only the main execution body of each step is described as a terminal.

The brightness adjusting method provided by the embodiment of the present application will be described in detail below with reference to fig. 5 to 6.

Fig. 5 is a schematic flow chart of a brightness adjusting method according to an embodiment of the present disclosure. The present embodiment is exemplified by a method for adjusting brightness applied to a terminal, and the method for adjusting brightness may include the following steps:

s501, measuring a first light intensity value of the current environment through a light sensor.

The first light intensity value refers to the light intensity in the environment opposite to the front face of the terminal detected by the light sensor, and the light intensity refers to the luminous flux of the received visible light in unit area and is used for indicating the intensity of the light and the illumination degree of the surface area of the object. The light sensor is located the homonymy of terminal display element, and light sensor can respond to the light intensity in the environment, can adjust terminal display element's luminance according to the bright shade degree in the surrounding environment.

Generally, a light sensor is built in the terminal, and the light sensor can detect the light intensity value in the current environment. The light sensor, i.e. the ambient light sensor, may be composed of a light sensitive element (e.g. a silicon photodiode, a photo resistor) and an analog-to-digital converter, wherein the light irradiates the light sensitive element to generate an analog signal, the current output is converted into a digital signal by the analog-to-digital converter, and the digital signal is compared with a preset value to adjust the brightness of the display unit.

S502, when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, measuring a second light intensity value of the current environment through the rear camera.

The historical light intensity value is an average value of light intensities collected by the light sensor in a preset time period, that is, an average value of light intensities detected by the light sensor in an environment in a previous time period compared with a current time, and the historical light intensity value can be used as a basis for judging whether the light intensity value in the current environment changes suddenly greatly. The difference threshold is a standard for measuring whether the light intensity value in the current environment generates mutation or not; when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, the fact that the light intensity value in the current environment changes suddenly is shown; when the difference value between the first light intensity value and the historical light intensity value is smaller than or equal to the difference threshold value, the fact that the light intensity value in the current environment does not generate a sudden change is indicated. The rear camera is located on the other side of the display unit, i.e. on the different side from the light sensor. The second light intensity value is the illumination intensity in the environment opposite to the back face of the terminal measured by the rear camera, and is distinguished from the first light intensity value. The first light intensity value and the second light intensity value are light intensity values which can be irradiated by the terminal on the front side and the back side of the terminal under the same illumination scene.

Generally, when a user uses a display unit (display screen) of a terminal, a light sensor in the terminal adjusts a brightness value of the display unit based on the intensity of ambient light detected by the light sensor. The intensity of light in the environment in which the terminal is located may remain constant over time or may vary constantly. And taking the current time as a time base point, and calculating the average value of the ambient light intensity values detected in a preset time period before the current time to obtain the historical light intensity value. Whether the light intensity in the current environment generates a sudden change can be determined by comparing the historical light intensity value with the light intensity value in the current environment. When the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, the terminal can determine whether other ways for assisting the light sensor to adjust the brightness value of the display unit are needed according to the light distribution conditions in the environment (the light intensity value on the front side of the terminal and the light intensity value on the back side of the terminal). When the difference value between the first light intensity value and the historical light intensity value is smaller than or equal to the difference threshold value, the fact that the light intensity value in the current environment does not change suddenly is indicated, and the brightness value of the display unit can be adjusted according to the light intensity value detected by the light sensor.

S503, when the first light intensity value is smaller than the second light intensity value, adjusting the brightness value of the display unit based on the second light intensity value.

Generally, when the difference between the first light intensity value and the historical light intensity value is greater than the difference threshold, the terminal may determine whether to adjust the brightness value of the display unit in other ways according to the light distribution in the current environment (the light intensity value on the front side of the terminal and the light intensity value on the back side of the terminal). When the first light intensity value of the terminal in the same scene is smaller than the second light intensity value, it indicates that the light distribution condition in the current environment is: if the intensity of light that can be irradiated on the front side of the terminal is weaker than the intensity of light that can be irradiated on the rear side of the terminal, it can be determined that the terminal cannot adjust the luminance value of the display unit at this time based on only the measurement result of the light sensor, which may result in an inaccurate adjustment of the luminance value of the display unit. Therefore, the brightness value corresponding to the first light intensity value can be inquired in a table look-up mode, the first brightness reference value is obtained through calculation according to the difference value between the current brightness value of the terminal display unit and the brightness value corresponding to the first light intensity value, the brightness value corresponding to the second light intensity value is inquired in a table look-up mode, the first brightness adjusting value is obtained through calculation according to the current brightness value of the terminal display unit, the brightness value corresponding to the second light intensity value and the first brightness reference value, the brightness value of the display unit is adjusted based on the first brightness adjusting value, accurate adjustment of the brightness value of the display unit is achieved, and use experience of a user is improved. When the first light intensity value of the terminal in the same scene is greater than or equal to the second light intensity value, it indicates that the light distribution condition in the current environment is: the intensity of light that can be irradiated on the front side of the terminal is stronger than the intensity of light that can be irradiated on the back side of the terminal, it can be determined that the terminal can accurately adjust the luminance value of the display unit based on the measurement result of the light sensor at this time.

The terminal can calculate a brightness adjusting value according to the obtained brightness value and the current brightness value of the terminal, and adjust the current brightness value of the terminal display unit according to the brightness adjusting value.

For example, the following steps are carried out: a user uses the terminal in a room with a uniform light lamp at night, and at the moment, a light sensor arranged in the terminal can detect that continuous light intensity values in the environment are kept unchanged. However, due to sudden power failure, the user can only turn on the desk lamp to illuminate a room, and the illumination brightness and the illumination range provided by the desk lamp are small, at this time, when the user uses the terminal, the light sensor arranged in the terminal can detect that the light intensity value in the environment changes suddenly, that is, the light intensity value in the current environment is obviously lower than the light intensity value in the environment at the previous moment, and the light sensor may lower the brightness value of the display screen according to the currently detected light intensity value. In the case where the desk lamp can irradiate less light to the front side (side having the display screen) of the terminal and more light can irradiate to the back side (side having the rear camera) of the terminal, the user's eyes may feel extremely uncomfortable with the terminal display screen in terms of the brightness value adjusted only according to the light intensity value detected by the light sensor on the front side of the terminal. At this time, the terminal needs to mutually assist the light sensor to adjust the brightness value of the terminal display unit in a manner that the rear camera detects the light intensity value in the environment.

From the above, the present disclosure provides a brightness adjusting method, in which a terminal measures a first light intensity value of a current environment through a light sensor, the light sensor is located at the same side of a display unit, when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, measuring a second light intensity value of the current environment through a rear camera, wherein the historical light intensity value is the average value of the light intensity collected by the light sensor in a preset time period, the rear camera is positioned on the other side of the display unit, when the first light intensity value is smaller than the second light intensity value, the brightness value of the display unit is adjusted based on the second light intensity value, the brightness value of the display unit can be accurately adjusted in the environment with large light intensity value change by means of auxiliary adjustment of the brightness value of the display unit by the rear camera of the terminal, so that the brightness requirement of a user on the display unit of the terminal can be met.

Referring to fig. 6, another flow chart of a brightness adjusting method according to an embodiment of the present application is shown. The present embodiment is exemplified by a method for adjusting brightness applied to a terminal. The brightness adjusting method may include the steps of:

s601, measuring a first light intensity value of the current environment by a light sensor.

Specifically, refer to step S501, which is not described herein.

S602, it is determined whether the difference between the first light intensity value and the historical light intensity value is greater than a difference threshold.

The historical light intensity value is an average value of light intensities collected by the light sensor in a preset time period, that is, an average value of light intensities detected by the light sensor in an environment in a previous time period compared with a current time, and the historical light intensity value can be used as a basis for judging whether the light intensity value in the current environment changes suddenly greatly. The difference threshold is a standard for measuring whether the light intensity value in the current environment generates mutation or not; when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, the fact that the light intensity value in the current environment changes suddenly is shown; when the difference value between the first light intensity value and the historical light intensity value is smaller than or equal to the difference threshold value, the fact that the light intensity value in the current environment does not generate a sudden change is indicated.

S603, when the difference value between the first light intensity value and the historical light intensity value is smaller than or equal to the difference threshold value, a second brightness adjusting value is obtained through calculation according to the first light intensity value.

The second brightness adjustment value is a brightness adjustment value calculated based on a first light intensity value of the current environment measured by the light sensor and the current brightness value of the terminal display unit, and can be used for instructing the terminal to adjust the brightness value of the display unit.

Generally, when a user uses a display unit (display screen) of a terminal, a light sensor in the terminal adjusts a brightness value of the display unit based on the intensity of ambient light detected by the light sensor. The intensity of light in the environment in which the terminal is located may remain constant over time or may vary constantly. And taking the current time as a time base point, and calculating the average value of the ambient light intensity values detected in a preset time period before the current time to obtain the historical light intensity value. Whether the light intensity in the current environment generates a sudden change can be determined by comparing the historical light intensity value with the light intensity value in the current environment. When the difference value between the first light intensity value and the historical light intensity value is smaller than or equal to the difference threshold value, the light intensity value in the current environment is not mutated, the brightness value corresponding to the first light intensity value measured by the light sensor can be inquired in a table look-up mode, the second brightness adjusting value is obtained by calculating the difference value between the brightness value corresponding to the first light intensity value and the current brightness value of the terminal display unit, and the brightness value of the terminal display unit is adjusted based on the second brightness adjusting value.

And S604, adjusting the brightness value of the display unit based on the second brightness adjusting value.

Generally, a certain corresponding relationship exists between a light intensity value and a brightness value of a display unit, a brightness value corresponding to the light intensity value can be obtained usually through a table look-up mode, a light sensor built in a terminal converts a received light signal into an electric signal, the light intensity value of the current environment of the terminal is obtained based on the electric signal, the brightness value corresponding to the light intensity value is inquired according to the light intensity value, the terminal can calculate a brightness adjustment value according to the obtained brightness value and the current brightness value of the terminal, and the current brightness value of the display unit of the terminal is adjusted based on the brightness adjustment value.

And S605, when the difference value between the first light intensity value and the historical light intensity value is larger than the difference threshold value, starting the rear camera, and acquiring the current environment image through the rear camera.

The rear camera is positioned on the other side of the display unit, namely on the different side of the light sensor. The environment image is an image which can show the current environment light intensity and is acquired by a rear camera of the terminal, and can be an environment image which is randomly acquired by the rear camera and is just opposite to the back side of the terminal.

Generally, when the difference value between the first light intensity value and the historical light intensity value is greater than the difference threshold value, which indicates that the light intensity value in the current environment changes suddenly, the terminal may determine whether the light sensor needs to be assisted in adjusting the brightness value of the display unit in other ways according to the light distribution conditions in the environment (the light intensity value on the front side of the terminal and the light intensity value on the back side of the terminal). Therefore, the light intensity value irradiated by the back side of the terminal under the current environment can be measured through the rear camera of the terminal, and the light distribution condition of the terminal in the current environment is determined according to the light intensity value measured by the rear camera and the light intensity value measured by the light sensor, namely according to the first light intensity value and the second light intensity value.

S606, the environment image is analyzed to obtain exposure parameters, and a second light intensity value is obtained through calculation based on the exposure parameters.

Wherein, the exposure parameter refers to the exposure parameter that the image that the camera was gathered corresponds, and the exposure parameter includes: the exposure time and the exposure degree can be correspondingly calculated through the exposure parameters to obtain the current light intensity value. The second light intensity value is the illumination intensity in the environment opposite to the back face of the terminal measured by the rear camera, and is distinguished from the first light intensity value. The first light intensity value and the second light intensity value are light intensity values which can be irradiated by the terminal on the front side and the back side of the terminal under the same illumination scene.

Generally, in different illumination environments, the exposure parameters corresponding to the environment images that can be acquired by the rear camera are also different. Generally, the longer the exposure time is, the larger the exposure value is, and the stronger the corresponding ambient light intensity is; correspondingly, the shorter the exposure time, the smaller the exposure value, and the weaker the corresponding ambient light intensity.

The light intensity value in the current environment can be obtained through corresponding calculation based on the exposure parameters, E represents the ambient light illumination, I represents the ambient light intensity, H represents the exposure value, t represents the exposure time, D represents the distance, and the relationship between the exposure value and the ambient light illumination can be represented as follows: h ═ E × t, the ambient light illuminance is calculated based on the exposure value and the exposure time, and the relationship between the ambient light illuminance and the ambient light intensity can be expressed as: and E is I multiplied by D-2, so that the ambient light intensity can be calculated based on the ambient light illumination.

S607, it is determined whether the first light intensity value is smaller than the second light intensity value.

Generally, when the difference between the first light intensity value and the historical light intensity value is greater than the difference threshold, the terminal may determine whether the brightness value of the display unit needs to be adjusted by using another auxiliary light sensor according to the light distribution condition in the environment (the light intensity value on the front side of the terminal and the light intensity value on the back side of the terminal), that is, the magnitude relationship between the first light intensity value and the second light intensity value needs to be analyzed.

S608, when the first light intensity value is smaller than the second light intensity value, a first brightness reference value corresponding to the first light intensity value is queried.

The first brightness reference value refers to a brightness value corresponding to the first light intensity value measured by the light sensor, which is obtained by querying in a table look-up manner, and the first brightness reference value can be used as a reference adjustment basis for adjusting the brightness value of the display unit.

Generally, when the difference between the first light intensity value and the historical light intensity value is greater than the difference threshold value, and the first light intensity value is smaller than the second light intensity value, it indicates that the brightness value of the display unit needs to be adjusted by the light sensor in an auxiliary manner by turning on the rear camera to measure the light intensity in the current environment according to the light distribution condition in the current environment, that is, the brightness value of the display unit needs to be adjusted by referring to the first light intensity value measured by the light sensor and the second light intensity value measured by the rear camera at the same time.

And S609, calculating to obtain a first brightness adjusting value according to the second light intensity value and the first brightness reference value, and adjusting the brightness value of the display unit based on the first brightness adjusting value.

The first brightness adjustment value is a brightness adjustment value calculated based on a first light intensity value measured by the light sensor, a second light intensity value measured by the rear camera, and a current brightness value of the terminal display unit (i.e., a historical brightness value before the terminal display unit does not adjust the brightness value), and can be used for instructing the terminal to adjust the brightness value of the terminal display unit.

Generally, the brightness value corresponding to the second light intensity value can be searched in a table lookup manner, a first brightness adjustment value is obtained by calculating based on the brightness value corresponding to the second light intensity value, the brightness value (first brightness reference value) corresponding to the first light intensity value and the current brightness value of the terminal display unit, and the current brightness value of the terminal display unit is adjusted based on the brightness adjustment value.

For example, the following steps are carried out: referring to the corresponding relationship between the light intensity value and the brightness value of the display unit in table 1, the difference threshold of the light intensity values is 50, the light sensor measures the first light intensity value in the current environment (the environment opposite to the front side of the terminal, that is, the environment opposite to the display screen of the terminal) as 180, and the current historical light intensity value is 350, it can be known that the difference between the first light intensity value and the historical light intensity value is 170, and the difference is greater than the difference threshold 50, so that the rear camera needs to measure the second light intensity value in the current environment (the environment opposite to the back side of the terminal). The second light intensity value measured by the rear camera is 780, it can be known that the second light intensity value is greater than the first light intensity value, and the brightness value of the display unit corresponding to the first light intensity value is 25, the brightness value of the display unit corresponding to the second light intensity value is 70, and the current brightness value of the terminal display unit (i.e. the historical brightness value before the terminal display unit does not adjust the brightness value) is 55. Therefore, a first difference between the brightness value corresponding to the first light intensity value and the current brightness value of the terminal display unit is calculated to be-30, a second difference between the brightness value corresponding to the second light intensity value and the current brightness value of the terminal display unit is calculated to be 15, and an average value of the first difference and the second difference is calculated to obtain a first brightness adjusting value of-7.5, so that the brightness value of the terminal display unit can be reduced by 7.5 brightness values from the current brightness value 55, and the brightness value of the terminal display unit after adjustment is 47.5.

TABLE 1

S610, when the first light intensity value is greater than or equal to the second light intensity value, a second brightness adjustment value is calculated according to the first light intensity value.

The second brightness adjustment value is a brightness adjustment value calculated based on the first light intensity value measured by the light sensor and the current brightness value of the terminal display unit, and can be used for instructing the terminal to adjust the brightness value of the display unit.

Generally, when the difference between the first light intensity value and the historical light intensity value is greater than the difference threshold value, and the first light intensity value is greater than or equal to the second light intensity value, it indicates that the light intensity in the current environment can be measured by the light sensor according to the light distribution condition in the current environment, the first light intensity value in the environment can be measured, the brightness value corresponding to the first light intensity value can be inquired in a table look-up manner, the second brightness adjustment value is obtained by calculating the difference between the brightness value corresponding to the first light intensity value and the current brightness value of the terminal display unit, and the brightness value of the terminal display unit is adjusted based on the second brightness adjustment value. Meanwhile, the brightness value of the display unit can be adjusted in an auxiliary manner with the light sensor in a manner that the front camera measures the light intensity value irradiated by the front side of the terminal again.

And S611, measuring a third light intensity value of the current environment through the front camera.

The front camera is positioned on the same side of the display unit and opposite to the position of the rear camera. The third light intensity value is the light intensity in the environment opposite to the front side of the terminal measured by the front camera, and is distinguished from the first light intensity value and the second light intensity value. The first light intensity value, the second light intensity value and the third light intensity value are all light intensity values measured under the same illumination scene, the first light intensity value and the third light intensity value are light intensity values which can be irradiated by the front side of the terminal under the same scene, and the second light intensity value is light intensity value which can be irradiated by the back side of the terminal under the same scene.

Generally, the terminal can turn on the front camera, acquire an environment image which is currently over against the front side of the terminal through the front camera, analyze the acquired environment image to obtain an exposure parameter corresponding to the environment image, wherein the exposure parameter comprises exposure time and exposure degree, the terminal can calculate to obtain a third light intensity value through the current exposure parameter, and the terminal can accurately adjust the brightness value of the display unit based on the first light intensity value measured by the light sensor and the third light intensity value measured by the front camera.

And S612, calculating to obtain a second brightness reference value based on the third light intensity value.

The second brightness reference value is a brightness adjustment reference value calculated based on the light intensity value measured by the front camera, and the second brightness reference value can be used as a reference parameter for adjusting the brightness value of the display unit.

Generally, when the difference between the first light intensity value and the historical light intensity value is greater than the difference threshold, but the first light intensity value is greater than or equal to the second light intensity value, it indicates that the brightness value of the display unit needs to be adjusted by turning on a camera to measure the light intensity in the current environment and turning on a light sensor to measure the light intensity in the current environment at the same time according to the light distribution in the current environment.

And S613, calculating a third brightness adjusting value according to the second brightness adjusting value and the second brightness reference value, and adjusting the brightness value of the display unit based on the third brightness adjusting value.

The third brightness adjustment value is a brightness adjustment value calculated based on the first light intensity value measured by the light sensor, the third light intensity value measured by the front camera and the current brightness value of the terminal display unit, and can be used for instructing the terminal to adjust the brightness value of the display unit.

For example, the following steps are carried out: referring to the corresponding relationship between the light intensity values and the brightness values of the display units in table 1, the difference threshold of the light intensity values is 50, the light sensor measures the first light intensity value in the current environment (the environment opposite to the front side of the terminal, that is, the environment opposite to the display screen of the terminal) as 180, the current historical light intensity value is 300, the difference between the first light intensity value and the historical light intensity value is 120, the difference is greater than the difference threshold 50, the rear camera measures the second light intensity value in the current environment (the environment opposite to the back side of the terminal) as 150, and the first light intensity value is greater than the second light intensity value. Therefore, the brightness of the terminal display screen can be adjusted based on the first light intensity value, and the front-facing camera can also be used to measure a third light intensity value in the current environment (the environment opposite to the front side of the terminal), where the measured third light intensity value is 190, and it can be known in a table look-up manner that the brightness value of the display unit corresponding to the first light intensity value is 25, the brightness value of the display unit corresponding to the third light intensity value is 25, and the current brightness value of the terminal display unit (that is, the historical brightness value before the brightness value is not adjusted by the terminal display unit) is 55. Therefore, a first difference between the brightness value corresponding to the first light intensity value and the current brightness value of the terminal display unit is calculated to be-30, a second difference between the brightness value corresponding to the third light intensity value and the current brightness value of the terminal display unit is calculated to be-30, and an average value of the first difference and the second difference is calculated to obtain a first brightness adjustment value of-30, so that the brightness value of the terminal display unit can be reduced by 30 brightness values from the current brightness value 55, and the brightness value of the terminal display unit after adjustment is 25.

As can be seen from the above, in the brightness adjusting method provided in this embodiment, the terminal measures the first light intensity value of the current environment through the light sensor, determines whether a difference between the first light intensity value and the historical light intensity value is greater than a difference threshold, calculates a second brightness adjustment value according to the first light intensity value when the difference between the first light intensity value and the historical light intensity value is less than or equal to the difference threshold, adjusts the brightness value of the display unit based on the second brightness adjustment value, turns on the rear camera when the difference between the first light intensity value and the historical light intensity value is greater than the difference threshold, collects the current environment image through the rear camera, analyzes the environment image to obtain an exposure parameter, calculates a second light intensity value based on the exposure parameter, determines whether the first light intensity value is less than the second light intensity value, when the first light intensity value is less than the second light intensity value, the method comprises the steps of obtaining a first brightness reference value through calculation based on a first light intensity value, obtaining a first brightness adjusting value through calculation according to a second light intensity value and the first brightness reference value, adjusting the brightness value of a display unit based on the first brightness adjusting value, obtaining a second brightness adjusting value through calculation according to the first light intensity value when the first light intensity value is larger than or equal to the second light intensity value, measuring a third light intensity value of the current environment through a front camera, obtaining a second brightness reference value through calculation based on the third light intensity value, obtaining a third brightness adjusting value through calculation according to the second brightness adjusting value and the second brightness reference value, and adjusting the brightness value of the display unit based on the third brightness adjusting value. Through this kind of mode, the leading camera and the rear camera at usable terminal assist light sensor to adjust the luminance value of display element simultaneously for terminal display element can be adjusted to the luminance value that satisfies the user expectation under the illumination environment of difference, has greatly promoted user experience.

The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.

Referring to fig. 7, a schematic structural diagram of a brightness adjusting apparatus provided in an exemplary embodiment of the present application is shown, which is hereinafter referred to as the apparatus 7. The means 7 may be implemented in software, hardware or a combination of both as all or part of a terminal. The device 7 is applied to a terminal, and the device 7 comprises:

a first measuring module 701, configured to measure a first light intensity value of a current environment through a light sensor; the light sensor is positioned on the same side of the display unit;

a second measurement module 702, configured to measure a second light intensity value of the current environment through a rear camera when a difference between the first light intensity value and the historical light intensity value is greater than a difference threshold; the historical light intensity value is a light intensity average value collected by the light sensor within a preset time period, and the rear camera is positioned on the other side of the display unit;

the adjusting module 703 is configured to adjust the brightness value of the display unit based on the second light intensity value when the first light intensity value is smaller than the second light intensity value.

Optionally, the adjusting module 703 includes:

the first calculation unit is used for calculating a first brightness reference value based on the first light intensity value;

the second calculation unit is used for calculating a first brightness adjusting value according to the second light intensity value and the first brightness reference value;

a first adjusting unit for adjusting a brightness value of the display unit based on the first brightness adjustment value.

Optionally, the second measurement module 702 includes:

the opening unit is used for opening the rear camera;

the acquisition unit is used for acquiring a current environment image through the rear camera;

the analysis unit is used for analyzing the environment image to obtain exposure parameters; wherein the exposure parameters include: exposure time and exposure level;

and the third calculating unit is used for calculating the second light intensity value based on the exposure parameters.

Optionally, the apparatus 7 further includes:

the fourth calculating unit is used for calculating a second brightness adjusting value according to the first light intensity value when the first light intensity value is greater than or equal to the second light intensity value;

a second adjusting unit for adjusting the brightness value of the display unit based on the second brightness adjustment value.

Optionally, the apparatus 7 further includes:

the measuring unit is used for measuring a third light intensity value of the current environment through the front camera; the front camera is positioned on the same side of the display unit;

and the third adjusting unit is used for adjusting the brightness value of the display unit based on the third light intensity value and the second brightness adjusting value.

Optionally, the apparatus 7 further includes:

a fifth calculating unit, configured to calculate a second brightness reference value based on the third light intensity value;

and the processing unit is used for calculating a third brightness adjusting value according to the second brightness adjusting value and the second brightness reference value and adjusting the brightness value of the display unit based on the third brightness adjusting value.

Optionally, the apparatus 7 further includes:

a sixth calculating unit, configured to calculate a second brightness adjustment value according to the first light intensity value when a difference between the first light intensity value and the historical light intensity value is smaller than or equal to a difference threshold;

a fourth adjusting unit for adjusting the brightness value of the display unit based on the second brightness adjustment value.

It should be noted that, when the brightness adjusting apparatus provided in the foregoing embodiment executes the brightness adjusting method, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed and completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the brightness adjusting device and the brightness adjusting method provided by the above embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments and are not described herein again.

The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.

Embodiments of the present application also provide a computer storage medium that may store a plurality of instructions adapted to be loaded by a processor and to perform the method steps as described above.

The application also provides a terminal, which comprises a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory or a random access memory.

The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:话务质检方法、装置、存储介质及服务器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类