Screen control method and device of terminal equipment, terminal equipment and storage medium
By acquiring grayscale and backlight brightness information of the terminal device screen and adjusting the light sensitivity value using a light-sensing compensation prediction model, the problem of inaccurate light sensitivity value caused by unstable screen refresh rate is solved, thereby improving the accuracy of screen brightness control and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2022-03-29
- Publication Date
- 2026-06-30
Smart Images

Figure CN116935801B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of electronic equipment technology, and in particular to a screen control method, apparatus, terminal device, and storage medium for a terminal device. Background Technology
[0002] To improve the display performance of terminal devices, the brightness of the terminal screen can be dynamically adjusted based on the light-sensing value obtained by the light sensor in the terminal device, thereby improving the user experience.
[0003] In related technologies, the light sensitivity value of the under-display light sensor is obtained by performing spectrum analysis based on the vertical synchronization (Vsync) signal of the screen. However, due to the unstable refresh rate of the screen, the light sensitivity value of the under-display light sensor obtained from the spectrum analysis is inaccurate. Consequently, the automatic adjustment of the screen brightness of the terminal device based on the light sensitivity value of the light sensor will result in a mismatch between the adjusted screen brightness and the ambient brightness, affecting the user experience. Summary of the Invention
[0004] This disclosure aims to at least partially address one of the technical problems in the related art.
[0005] Therefore, the present disclosure proposes the following technical solution:
[0006] A first aspect of this disclosure provides a screen control method for a terminal device, comprising: acquiring grayscale information of at least one set area of the screen of the terminal device and backlight brightness information of the screen; determining a light-sensing compensation value based on the grayscale information of the at least one set area and the backlight brightness information; compensating the light-sensing value collected by a light sensor based on the light-sensing compensation value to obtain a compensated light-sensing value; and controlling the brightness of the screen of the terminal device based on the compensated light-sensing value.
[0007] A second aspect of this disclosure provides a screen control device for a terminal device, comprising: a first acquisition module for acquiring grayscale information of at least one set area of the screen of the terminal device and backlight brightness information of the screen; a determination module for determining a light-sensing compensation value based on the grayscale information of the at least one set area and the backlight brightness information; a compensation module for compensating the light-sensing value collected by a light sensor based on the light-sensing compensation value to obtain a compensated light-sensing value; and a control module for controlling the brightness of the screen of the terminal device based on the compensated light-sensing value.
[0008] A third aspect of this disclosure provides a terminal device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the screen control method of the terminal device described in the first aspect of this disclosure.
[0009] A fourth aspect of this disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the screen control method of a terminal device as described in the first aspect of this disclosure.
[0010] A fifth aspect of this disclosure provides a computer program product that, when instructions in the computer program product are executed by a processor, performs the screen control method for a terminal device as described in the first aspect of this disclosure.
[0011] The technical solution disclosed herein acquires grayscale information and backlight brightness information of at least one set area of the screen of a terminal device; determines a light-sensing compensation value based on the grayscale information and backlight brightness information of the at least one set area; compensates the light-sensing value collected by the light sensor based on the light-sensing compensation value to obtain a compensated light-sensing value; and controls the brightness of the terminal device screen based on the compensated light-sensing value. Therefore, by determining the light-sensing compensation value based on the grayscale information and backlight brightness information of at least one set area, and compensating the light-sensing value collected by the light sensor based on the light-sensing compensation value, the light-sensing value of the light sensor can be accurately obtained. This avoids the mismatch between the illuminance calculated based on the light-sensing value of the light sensor and the ambient brightness, thereby improving the accuracy of the terminal device screen brightness control and enhancing the user experience.
[0012] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0013] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0014] Figure 1 This is a schematic flowchart of a screen control method for a terminal device provided in an embodiment of the present disclosure;
[0015] Figure 2 This is a schematic diagram of screen area division provided in an embodiment of the present disclosure;
[0016] Figure 3This is a schematic flowchart of a screen control method for a terminal device provided in an embodiment of the present disclosure;
[0017] Figure 4 This is a schematic flowchart of a screen control method for a terminal device provided in an embodiment of the present disclosure;
[0018] Figure 5 This is a schematic diagram of the verification process of the light-sensing compensation prediction model provided in an embodiment of the present disclosure;
[0019] Figure 6 This is a schematic flowchart of a screen control method for a terminal device provided in an embodiment of the present disclosure;
[0020] Figure 7 This is a schematic flowchart of a screen control method for a terminal device provided in an embodiment of the present disclosure;
[0021] Figure 8 This is a schematic diagram of the structure of a screen control device for a terminal device provided in an embodiment of the present disclosure;
[0022] Figure 9 This is a block diagram illustrating a terminal device according to an exemplary embodiment. Detailed Implementation
[0023] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0024] In related technologies, spectrum analysis is performed based on the vertical synchronization (Vsync) signal of the screen to obtain the light sensing value of the under-display light sensor. However, due to the unstable refresh rate of the screen, the light sensing value obtained from the spectrum analysis is inaccurate. Furthermore, when the screen refreshes too quickly, the corresponding spectrum information cannot be accurately obtained, resulting in the inability to accurately obtain the light sensing value of the light sensor based on the spectrum analysis. This leads to a mismatch between the illuminance calculated from the light sensing value and the ambient brightness, affecting the user experience.
[0025] Therefore, in view of the above problems, this disclosure proposes a screen control method, device, terminal device and storage medium for a terminal device.
[0026] The following description, with reference to the accompanying drawings, outlines a screen control method, apparatus, terminal device, and storage medium for embodiments of the present disclosure.
[0027] Figure 1This is a schematic flowchart illustrating a screen control method for a terminal device according to an embodiment of the present disclosure. This embodiment illustrates the method by describing it as being configured within a screen control device of a terminal device. This screen control device can be applied to any terminal device to enable the terminal device to perform screen control functions.
[0028] The terminal device can be any device with computing capabilities, such as a personal computer (PC), mobile terminal, server, etc. The mobile terminal can be a mobile phone, tablet computer, personal digital assistant, wearable device, etc., with various operating systems, touch screens and / or displays.
[0029] like Figure 1 As shown, the screen control method for a terminal device may include the following steps:
[0030] Step 101: Obtain grayscale information and backlight brightness information of at least one set area of the screen of the terminal device.
[0031] In this embodiment of the disclosure, the screen area corresponding to the light-emitting pixel can be divided into at least one predetermined area based on the distance between the light-emitting pixel and the center point of the light-sensitive sensor under the screen. For example, Figure 2 As shown, the screen area corresponding to the light sensor can be divided into region 1, region 2 and region 3 according to the distance between the light-emitting pixel and the center point of the light sensor under the screen.
[0032] As an example, screenshot information can be obtained from a screenshot, and grayscale information of at least one defined area of the screen can be obtained from the screenshot information. The backlight brightness information of the screen can then be determined by reading the screen backlight brightness of the terminal device. It should be noted that each defined area can correspond to grayscale information for each color channel (e.g., grayscale information for the R (red) channel, G (green) channel, and B (blue) channel). The grayscale information for each defined area is the sum of the grayscale information of each color channel of all pixels in the corresponding area. For example, the sum of the grayscale information of the R channel of all pixels in area 1 is used as the grayscale information of the R (red) channel in the grayscale information of area 1. Similarly, the sum of the grayscale information of the G (green) channel of all pixels in area 1 is used as the grayscale information of the G channel in the grayscale information of area 1, and the sum of the grayscale information of the B (green) channel of all pixels in area 1 is used as the grayscale information of the B channel in the grayscale information of area 1.
[0033] Step 102: Determine the light compensation value based on the grayscale information of at least one set area and the backlight brightness information.
[0034] In this embodiment of the disclosure, the grayscale information of at least one set area and the backlight brightness information of the screen can affect the light sensitivity value collected by the light sensor. Therefore, a light sensitivity compensation value for compensating the light sensitivity value collected by the light sensor can be determined based on the grayscale information of at least one set area and the backlight brightness information of the screen.
[0035] Step 103: Based on the light sensing compensation value, compensate the light sensing value collected by the light sensor to obtain the compensated light sensing value.
[0036] In this embodiment, the light-sensing value collected by the light sensor can be compensated according to the light-sensing compensation value to obtain the compensated light-sensing value. For example, the difference between the light-sensing value collected by the light sensor and the light-sensing compensation value can be used as the compensated light-sensing value. It should be noted that the light-sensing value can be a channel value including three color channels (R channel, G channel, and B channel) or a channel value including four color channels (C (transparency) channel, R channel, G channel, and B channel). The light-sensing compensation value can be a channel compensation value of at least one color channel, and the light-sensing compensation value can compensate for the channel value of at least one color channel in the light-sensing value.
[0037] Step 104: Control the brightness of the terminal device screen based on the compensated light sensitivity value.
[0038] Furthermore, based on the compensated light sensitivity value, the illuminance is determined, and the brightness of the terminal device's screen is controlled according to the illuminance. For example, the illuminance can be determined based on the channel values of each color channel in the compensated light sensitivity value.
[0039] It should be noted that the screen brightness of a terminal device is positively correlated with illuminance. When the illuminance is relatively low, the screen brightness is low; when the illuminance is relatively high, the screen brightness is high. Understandably, in this situation, the terminal device will not control the screen brightness based on the currently acquired (or detected) illuminance, but rather on previously stored illuminance data.
[0040] In summary, by acquiring grayscale information and backlight brightness information of at least one set area of the terminal device's screen; determining a light-sensing compensation value based on the grayscale information and backlight brightness information of the at least one set area; compensating the light-sensing value collected by the light sensor based on the light-sensing compensation value to obtain a compensated light-sensing value; and controlling the brightness of the terminal device's screen based on the compensated light-sensing value, the light-sensing value of the light sensor can be accurately obtained. This avoids the mismatch between the illuminance calculated from the light-sensing value of the light sensor and the ambient brightness, thereby improving the accuracy of the terminal device's screen brightness control and enhancing the user experience.
[0041] In order to accurately determine the light compensation value, such as Figure 3 As shown, Figure 3 This is a schematic flowchart illustrating a screen control method for a terminal device according to an embodiment of the present disclosure. In this embodiment, a light-sensing compensation prediction value can be determined using a light-sensing compensation prediction model, and then a light-sensing compensation value can be determined based on the light-sensing compensation prediction value. Figure 3 The illustrated embodiment may include the following steps:
[0042] Step 301: Obtain grayscale information and backlight brightness information of at least one set area of the screen of the terminal device.
[0043] Step 302: Determine the light compensation value based on the grayscale information of at least one set area and the backlight brightness information.
[0044] Step 303: Input the grayscale information and backlight brightness information of at least one set area into the light-sensing compensation prediction model matched with the terminal device to obtain the light-sensing compensation prediction value output by the light-sensing compensation prediction model.
[0045] In this embodiment of the disclosure, a light-sensing compensation prediction model can be pre-trained, and the trained light-sensing compensation prediction model can be verified to determine whether the trained light-sensing compensation prediction model matches the terminal device. If the trained light-sensing compensation prediction model matches the terminal device, the grayscale information and backlight brightness information of at least one set area are input into the trained light-sensing compensation prediction model that matches the terminal device, and the light-sensing compensation prediction model can output a light-sensing compensation prediction value.
[0046] Step 304: Determine the light-sensing compensation value based on the light-sensing compensation prediction value.
[0047] In this embodiment of the disclosure, the training data for training the light-sensing compensation prediction model can be the training data collected by the sample terminal device in a dark room. Since there is a deviation between the terminal device and the sample terminal device, the light-sensing compensation prediction value can be adjusted to obtain a more accurate light-sensing compensation value.
[0048] Step 305: Based on the light sensing compensation value, compensate the light sensing value collected by the light sensing sensor set under the screen to obtain the compensated light sensing value.
[0049] Step 306: Control the brightness of the terminal device's screen based on the compensated light sensitivity value.
[0050] In summary, by inputting the grayscale information and backlight brightness information of at least one set area into a trained light-sensing compensation prediction model matched with the terminal device, the light-sensing compensation prediction value output by the light-sensing compensation prediction model is obtained. Based on the light-sensing compensation prediction value, the light-sensing compensation value is determined. Thus, through the light-sensing compensation prediction model, the light-sensing compensation prediction value can be obtained. By adjusting the light-sensing compensation prediction value, a more accurate light-sensing compensation value can be obtained.
[0051] In order for the light-sensing compensation prediction model to output light-sensing compensation prediction values, such as Figure 4 As shown, Figure 4 This is a flowchart illustrating a screen control method for a terminal device according to an embodiment of the present disclosure. In this embodiment, before inputting grayscale information and backlight brightness information of at least one set area into a trained light-sensing compensation prediction model that matches the terminal device, training data can be used to train the initial light-sensing compensation prediction model, and it can be determined whether the trained light-sensing compensation prediction model matches the terminal device. Figure 4 The illustrated embodiment may include the following steps:
[0052] Step 401: Obtain grayscale information of at least one set area of the screen of the terminal device and the backlight brightness information of the screen.
[0053] Step 402: Obtain the sample backlight brightness information of the screen of the sample terminal device, the sample grayscale information of at least one set area of the sample terminal device, and the light compensation reference value collected by the light sensor of the sample terminal device under the sample backlight brightness information.
[0054] Due to differences in terminal device structure, screen transmittance, and other factors, the impact of screens on light sensitivity varies across different terminal devices. Therefore, the light sensitivity compensation prediction model obtained through training may not be applicable to all terminal devices. To eliminate the differences between terminal devices, the light sensitivity compensation prediction model needs to be validated.
[0055] In this embodiment of the disclosure, the sample backlight brightness information of the screen of the sample terminal device in a dark room, the sample grayscale information of at least one set area of the sample terminal device, and the light compensation reference value collected by the light sensor of the sample terminal device under the corresponding sample backlight brightness information can be obtained.
[0056] Step 403: Use the sample backlight brightness information and sample grayscale information as training data.
[0057] For example, if three regions are defined, the sample backlight brightness information and the grayscale information of each color channel in each region can be used as training data. For instance, the grayscale information corresponding to the three defined regions could be (R1, G1, B1), (R2, G2, B2), and (R3, G3, B3), along with the sample backlight brightness information, which can then be used as training data. It should be noted that multiple different sample backlight brightness information and multiple different sample grayscale information can be obtained, and each sample's backlight brightness information and each sample's grayscale information can be used as training data.
[0058] Step 404: Input the training data into the initial light-sensing compensation prediction model to obtain the light-sensing compensation prediction value output by the initial light-sensing compensation prediction model.
[0059] Furthermore, the training data can be input into the initial light-sensing compensation prediction model, which can output light-sensing compensation prediction values.
[0060] Step 405: Train the initial light-sensing compensation prediction model based on the difference between the light-sensing compensation reference value and the light-sensing compensation predicted value.
[0061] In this embodiment of the disclosure, the difference between the light-sensing compensation reference value and the corresponding light-sensing compensation predicted value can be used to determine the loss function. The initial light-sensing compensation prediction model can be trained based on the loss function. It should be noted that the termination condition for training can be the minimization of the loss function value, the number of training iterations reaching a set number, or the training time reaching a set training time. This disclosure does not make any specific limitations.
[0062] Step 406: Control the terminal device to display the set verification image and obtain the light sensor's light compensation verification value under each screen brightness information in multiple set screen brightness information.
[0063] To further determine whether the trained light-sensing compensation prediction model matches the terminal device, the trained light-sensing compensation prediction model can be validated.
[0064] Optionally, the terminal device can be controlled to display a set verification image (e.g., a white image with RGB values of (255, 255, 255)) and obtain the light compensation verification value collected by the light sensor under each screen brightness information in multiple set screen brightness information.
[0065] Step 407: For each screen brightness information, input the set grayscale information corresponding to the set verification image and the brightness information of each screen into the trained light-sensing compensation prediction model to obtain the light-sensing compensation reference value output by the trained light-sensing compensation prediction model.
[0066] Furthermore, by inputting the set grayscale information corresponding to the set verification image and the screen brightness information from multiple different screen brightness information into the trained light-sensing compensation prediction model, the light-sensing compensation reference value output by the trained light-sensing compensation prediction model can be obtained.
[0067] Step 408: Compare the light-sensing compensation verification value with the corresponding light-sensing compensation reference value to obtain the verification ratio.
[0068] In this embodiment of the disclosure, the light-sensing compensation verification value can be compared with the light-sensing compensation reference value under the corresponding screen brightness information to obtain the verification ratio value under the screen brightness information.
[0069] It should be noted that the light-sensing compensation prediction value can be the channel compensation prediction value of at least one color channel, and the calibration ratio under the screen brightness information can be the calibration ratio of at least one color channel.
[0070] Step 409: Based on the verification ratio, verify the trained light-sensing compensation prediction model to determine whether the trained light-sensing compensation prediction model matches the terminal device.
[0071] As an example, when the check ratio is the check ratio on a color channel, and the check ratio is within the set range, it can be determined that the trained light-sensing compensation prediction model matches the terminal device.
[0072] As another example, when the verification ratio is the verification ratio across multiple color channels, the ratio on each color channel is within the set ratio range, which can determine that the trained light-sensing compensation prediction model matches the terminal device.
[0073] Step 410: Input the grayscale information and backlight brightness information of at least one set area into the light-sensing compensation prediction model matched with the terminal device to obtain the light-sensing compensation prediction value output by the light-sensing compensation prediction model.
[0074] When the trained light-sensing compensation prediction model is matched with the terminal device, the grayscale information and backlight brightness information of at least one set area are input into the trained light-sensing compensation prediction model that is matched with the terminal device, and the light-sensing compensation prediction value output by the light-sensing compensation prediction model can be obtained.
[0075] Step 411: Multiply the light-sensing compensation prediction value by the calibration ratio to obtain the light-sensing compensation value.
[0076] As an example, when the light compensation prediction value is the channel compensation value on a color channel, the channel compensation value can be multiplied by the calibration ratio on that color channel to obtain the light compensation value.
[0077] As another example, when the light compensation prediction value is the channel compensation prediction value on multiple color channels, the channel compensation prediction value on each color channel can be multiplied by the corresponding calibration ratio on the color channel to obtain the channel compensation value on each color channel. The channel compensation value on each color channel can then be used as the light compensation value.
[0078] To illustrate the embodiments of this disclosure more clearly, examples are given below.
[0079] For example, such as Figure 5 As shown, the screen displays a white image. Different backlight settings are applied, and the light sensor's light sensitivity value (light compensation calibration value) is collected. The ratio of this light sensitivity value to the light sensitivity value of the gold-plated device (the terminal device with the best performance indicators, i.e., the terminal device acquiring training data) (i.e., the light compensation reference value output by the light perception prediction model) is calculated and stored in the device file system as an algorithm calibration coefficient. The screen backlight brightness value used for calibration can be a range from the minimum automatic backlight brightness to the maximum screen backlight brightness. For example, if the maximum backlight brightness of the terminal device screen is 500 nits and the minimum backlight brightness is 4 nits, nine backlight brightness values can be selected for calibration, which can be (10, 30, 70, 120, 180, 240, 300, 400, 500).
[0080] Step 412: Based on the light sensing compensation value, compensate the light sensing value collected by the light sensor to obtain the compensated light sensing value.
[0081] Step 413: Control the brightness of the terminal device screen based on the compensated light sensitivity value.
[0082] In summary, the initial light-sensing compensation prediction model can be trained using training data to obtain a trained light-sensing compensation prediction model. Furthermore, the trained light-sensing compensation prediction model is validated to determine whether it matches the terminal device. When the trained light-sensing compensation prediction model matches the terminal device, the light-sensing compensation prediction value is obtained, thereby improving the accuracy of the light-sensing compensation prediction value.
[0083] In order to accurately obtain grayscale information and backlight brightness information of at least one defined area of the terminal device's screen, such as Figure 6 As shown, Figure 6 This is a flowchart illustrating a screen control method for a terminal device according to an embodiment of the present disclosure. In this embodiment, the screen capture cycle of the terminal device can be determined based on the screen refresh rate. When the screen capture cycle is reached, the terminal device is controlled to take a screenshot. Thus, grayscale information of at least one set area can be determined based on the screenshot, and the backlight brightness information of the screen can be determined by reading the backlight brightness of the terminal device. Figure 6 The illustrated embodiment may include the following steps:
[0084] Step 601: Determine the screenshot cycle of the terminal device based on the screen refresh rate of the terminal device.
[0085] It should be understood that in this embodiment of the disclosure, grayscale information of at least one set area is obtained based on the screenshot information. However, frequent screenshots will increase the system power consumption of the terminal device. If the screenshot frequency is too low, the calculated light-sensing compensation value will be delayed, affecting the accuracy of the light-sensing compensation value. When the screen is not refreshed and the image is not updated, there is no need to take a screenshot.
[0086] Therefore, the screenshot cycle of the terminal device can be determined based on the screen refresh rate of the terminal device. For example, the screenshot cycle could be set to ten screen refreshes per period. Figure 1 If the screen refresh rate of the terminal device is 1000 times per second, then the screenshot period is one-hundredth of a second.
[0087] Step 602: When the screenshot cycle is reached, control the terminal device to take a screenshot to obtain screenshot information corresponding to the screenshot cycle.
[0088] Furthermore, when the screenshot cycle is reached, the terminal device can be controlled to take a screenshot, thereby obtaining screenshot information corresponding to the screenshot cycle.
[0089] Step 603: Determine the grayscale information of at least one set area based on the screenshot information.
[0090] In this embodiment of the disclosure, the screen area corresponding to the light-emitting pixel is divided into at least one set area according to the distance between the light-emitting pixel and the center point of the light sensor under the screen. By analyzing the screenshot information corresponding to at least one set area, the grayscale information of at least one set area can be determined.
[0091] Step 604: Read the screen backlight brightness of the terminal device to determine the screen backlight brightness information.
[0092] In this embodiment of the disclosure, the backlight brightness information of the screen can be obtained by reading the screen backlight brightness of the terminal device.
[0093] Step 605: Determine the light compensation value based on the grayscale information of at least one set area and the backlight brightness information.
[0094] Step 606: Based on the light sensing compensation value, compensate the light sensing value collected by the light sensor to obtain the compensated light sensing value.
[0095] Step 607: Control the brightness of the terminal device's screen based on the compensated light sensitivity value.
[0096] In this embodiment of the disclosure, the screenshot period is also updated based on the compensated light sensitivity value.
[0097] It should be noted that the light sensor can detect changes in both ambient brightness and the screen display area. When the light sensor's collected light values are unstable, the screenshot frequency needs to be increased to improve the real-time performance of the light compensation value, making the output compensated light value more accurate. The illuminance corresponding to the compensated light value can determine the current ambient brightness. In low-light environments, the accuracy of screen backlight brightness is more critical, requiring a faster screenshot frequency. When the light sensor's collected light values are relatively stable or the environment is relatively bright, the screenshot frequency can be appropriately reduced.
[0098] In summary, by determining the screen capture cycle through the refresh rate, screen captures can be taken without increasing the power consumption of the terminal device system, and screen capture information can be obtained. Furthermore, based on the screen capture, the grayscale information of at least one set area can be accurately obtained. At the same time, by reading the screen backlight brightness of the terminal device, the screen backlight brightness information can be accurately determined.
[0099] To illustrate the above embodiments more clearly, examples are given below.
[0100] For example, such as Figure 7 As shown, the screen control method of the terminal device in this embodiment of the present disclosure can be divided into the following three parts:
[0101] The first part, the display process, mainly acquires screen refresh information (frame rate); when the screen refreshes, it determines whether it is time to take a screenshot based on the time period reported by the screenshot cycle algorithm of the light sensor control center (sensorhub); after the screenshot time is reached, it notifies the algorithm process to take a screenshot.
[0102] In the second part, after receiving the screenshot notification from the display process, the algorithm takes a screenshot. It calculates the grayscale information of the three primary colors (R1 G1 B1 R2 G2 B2 R3 G3 B3) affecting the three light-sensing regions and obtains the screen backlight brightness information. Then, it inputs (R1 G1 B1 R2 G2 B2 R3 G3 B3) and the screen backlight brightness information into the light-sensing compensation prediction model to obtain the screen light leakage value (light-sensing compensation value) affecting the light sensor.
[0103] The third part involves connecting a light sensor to SensorHub and running the light sensor driver. The light sensor driver periodically reads the register channel values collected by the light sensor, then removes the screen light leakage data sent by the algorithm process, calculates the light sensitivity value, performs median and mean filtering, and outputs the light sensitivity value for use by other algorithms and automatic backlighting in SensorHub. SensorHub also integrates a screenshot periodicity algorithm to control the screenshot frequency during the display process.
[0104] The screen control method for a terminal device according to this disclosure acquires grayscale information of at least one set area of the terminal device's screen and backlight brightness information of the screen; determines a light-sensing compensation value based on the grayscale information of at least one set area and the backlight brightness information; compensates the light-sensing value collected by the light sensor based on the light-sensing compensation value to obtain a compensated light-sensing value; and controls the brightness of the terminal device's screen based on the compensated light-sensing value. Therefore, by determining the light-sensing compensation value based on the grayscale information of at least one set area and the backlight brightness information, and by compensating the light-sensing value collected by the light sensor based on the light-sensing compensation value, the light-sensing value of the light sensor can be accurately obtained. This avoids the situation where the illuminance calculated based on the light-sensing value of the light sensor does not match the ambient brightness, thereby improving the accuracy of the terminal device's screen brightness control and enhancing the user experience.
[0105] To implement the above embodiments, this disclosure also provides a screen control device for a terminal device.
[0106] Figure 8 This is a schematic diagram of the structure of a screen control device for a terminal device provided in an embodiment of the present disclosure.
[0107] like Figure 8As shown, the screen control device 800 of the terminal device includes: a first acquisition module 810, a determination module 820, a compensation module 830, and a control module 840.
[0108] The first acquisition module 810 is used to acquire grayscale information of at least one set area of the screen of the terminal device and backlight brightness information of the screen; the determination module 820 is used to determine a light sensing compensation value based on the grayscale information of the at least one set area and the backlight brightness information; the compensation module 830 is used to compensate the light sensing value collected by the light sensing sensor based on the light sensing compensation value to obtain a compensated light sensing value; and the control module 840 is used to control the brightness of the screen of the terminal device based on the compensated light sensing value.
[0109] As one possible implementation of this disclosure, the determining module 820 is further configured to input grayscale information and backlight brightness information of at least one set area into a light-sensing compensation prediction model matched with the terminal device, so as to obtain the light-sensing compensation prediction value output by the light-sensing compensation prediction model; and determine the light-sensing compensation value based on the light-sensing compensation prediction value.
[0110] As one possible implementation of this disclosure, the screen control device 800 of the terminal device further includes: a second acquisition module, an input module, and a training module.
[0111] The second acquisition module is further configured to acquire sample backlight brightness information of the screen of the sample terminal device, sample grayscale information of at least one set area of the sample terminal device, and light compensation reference value collected by the light sensor of the sample terminal device under the sample backlight brightness information; and use the sample backlight brightness information and sample grayscale information as training data; the input module is further configured to input the training data into the initial light compensation prediction model to obtain the light compensation prediction value output by the initial light compensation prediction model; and the training module is further configured to train the initial light compensation prediction model based on the difference between the light compensation reference value and the light compensation prediction value.
[0112] As one possible implementation of this disclosure, the screen control device 800 of the terminal device further includes: a third acquisition module, a fourth acquisition module, a processing module, and a verification module.
[0113] The third acquisition module is used to control the terminal device to display the set verification image and acquire the light compensation verification value collected by the light sensor under each screen brightness information in multiple set screen brightness information; the fourth acquisition module is used to input the set grayscale information corresponding to the set verification image and each screen brightness information into the trained light compensation prediction model for each screen brightness information to obtain the light compensation reference value output by the trained light compensation prediction model; the processing module is used to compare the light compensation verification value with the corresponding light compensation reference value to obtain the verification ratio; the verification module is used to verify the trained light compensation prediction model according to the verification ratio to determine whether the trained light compensation prediction model matches the terminal device.
[0114] As one possible implementation of this disclosure, the determining module 820 is further configured to multiply the light-sensing compensation prediction value by the verification ratio value to obtain the light-sensing compensation value.
[0115] As one possible implementation of this disclosure, the first acquisition module 810 is further configured to determine the screenshot cycle of the terminal device based on the screen refresh rate of the terminal device; when the screenshot cycle is reached, control the terminal device to take a screenshot to obtain screenshot information corresponding to the screenshot cycle; determine grayscale information of at least one set area based on the screenshot information; and read the screen backlight brightness of the terminal device to determine the screen backlight brightness information.
[0116] As one possible implementation of this disclosure, the screen control device 800 of the terminal device further includes an update module.
[0117] The update module is used to update the screenshot period based on the compensated light sensitivity value.
[0118] The screen control device of the terminal device in this embodiment acquires grayscale information of at least one set area of the terminal device screen and backlight brightness information of the screen; determines a light sensing compensation value based on the grayscale information of at least one set area and backlight brightness information; compensates the light sensing value collected by the light sensor based on the light sensing compensation value to obtain a compensated light sensing value; and controls the brightness of the terminal device screen based on the compensated light sensing value. Therefore, by determining the light sensing compensation value based on the grayscale information of at least one set area and backlight brightness information, and compensating the light sensing value collected by the light sensor based on the light sensing compensation value, the light sensing value of the light sensor can be accurately obtained. This avoids the situation where the illuminance calculated based on the light sensing value of the light sensor does not match the ambient brightness, thereby improving the accuracy of the terminal device screen brightness control and enhancing the user experience.
[0119] To implement the above embodiments, this disclosure also proposes a terminal device. The terminal device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the screen control method of the terminal device described in the above embodiments.
[0120] To implement the above embodiments, this disclosure also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the screen control method of the terminal device described in the above embodiments.
[0121] To implement the above embodiments, this disclosure also proposes a computer program product that, when the instructions in the computer program product are executed by a processor, performs the screen control method of the terminal device described in the above embodiments.
[0122] Figure 9 This is a block diagram illustrating a terminal device according to an exemplary embodiment. For example, the terminal device 900 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0123] Reference Figure 9 The terminal device 900 may include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input / output (I / O) interface 912, sensor component 914, and communication component 916.
[0124] Processing component 902 typically controls the overall operation of terminal device 900, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902.
[0125] Memory 904 is configured to store various types of data to support the operation of terminal device 900. Examples of this data include instructions for any application or method operating on terminal device 900, contact data, phonebook data, messages, pictures, videos, etc. Memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0126] Power supply component 906 provides power to various components of terminal device 900. Power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal device 900.
[0127] Multimedia component 908 includes a screen that provides an output interface between the terminal device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 908 includes a front-facing camera and / or a rear-facing camera. When the terminal device 900 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0128] Audio component 910 is configured to output and / or input audio signals. For example, audio component 910 includes a microphone (MIC) configured to receive external audio signals when terminal device 900 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 904 or transmitted via communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
[0129] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0130] Sensor assembly 914 includes one or more sensors for providing status assessments of various aspects of terminal device 900. For example, sensor assembly 914 can detect the on / off state of terminal device 900, the relative positioning of components such as the display and keypad of terminal device 900, changes in position of terminal device 900 or a component of terminal device 900, the presence or absence of user contact with terminal device 900, orientation or acceleration / deceleration of terminal device 900, and temperature changes of terminal device 900. Sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 914 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0131] Communication component 916 is configured to facilitate wired or wireless communication between terminal device 900 and other devices. Terminal device 900 can access wireless networks based on communication standards, such as WiFi, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 916 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 916 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0132] In an exemplary embodiment, the terminal device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0133] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by a processor 920 of a terminal device 900 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0134] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0135] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0136] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain.
[0137] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0138] It should be understood that various parts of this disclosure can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0139] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0140] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0141] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.
Claims
1. A screen control method for a terminal device, characterized in that, include: Obtain grayscale information of at least one set area of the screen of the terminal device and backlight brightness information of the screen; The light compensation value is determined based on the grayscale information of the at least one set area and the backlight brightness information; The light sensing value collected by the light sensor is compensated according to the light sensing compensation value to obtain the compensated light sensing value. The brightness of the terminal device screen is controlled based on the compensated light sensitivity value. The step of determining the light compensation value based on the grayscale information of the at least one set area and the backlight brightness information includes: The grayscale information of the at least one set area and the backlight brightness information are input into the light-sensing compensation prediction model matched with the terminal device to obtain the light-sensing compensation prediction value output by the light-sensing compensation prediction model. The light-sensing compensation value is determined based on the light-sensing compensation prediction value.
2. The method according to claim 1, characterized in that, Before inputting the grayscale information of the at least one set area and the backlight brightness information into a trained light-sensing compensation prediction model matched with the terminal device to obtain the light-sensing compensation prediction value output by the light-sensing compensation prediction model, the method further includes: The sample backlight brightness information of the screen of the sample terminal device, the sample grayscale information of at least one set area of the sample terminal device, and the light compensation reference value collected by the light sensor of the sample terminal device under the sample backlight brightness information are obtained. The sample backlight brightness information and the sample grayscale information are used as training data; The training data is input into the initial light-sensing compensation prediction model to obtain the light-sensing compensation prediction value output by the initial light-sensing compensation prediction model. The initial light-sensing compensation prediction model is trained based on the difference between the light-sensing compensation reference value and the light-sensing compensation predicted value.
3. The method according to claim 2, characterized in that, The method further includes: The terminal device is controlled to display a set verification image, and the light sensor collects the light compensation verification value under each screen brightness information in multiple set screen brightness information. For each of the screen brightness information, the set grayscale information corresponding to the set verification image and each of the screen brightness information are input into the trained light compensation prediction model to obtain the light compensation reference value output by the trained light compensation prediction model. The light-sensing compensation verification value is compared with the corresponding light-sensing compensation reference value to obtain the verification ratio. The trained light-sensing compensation prediction model is validated based on the validation ratio to determine whether the trained light-sensing compensation prediction model matches the terminal device.
4. The method according to claim 3, characterized in that, Determining the light-sensing compensation value based on the predicted light-sensing compensation value includes: The light-sensing compensation prediction value is multiplied by the calibration ratio to obtain the light-sensing compensation value.
5. The method according to claim 1, characterized in that, The step of acquiring grayscale information of at least one set area of the screen of the terminal device and backlight brightness information of the screen includes: The screenshot period of the terminal device is determined based on the screen refresh rate of the terminal device. When the screenshot cycle is reached, the terminal device is controlled to take a screenshot in order to obtain screenshot information corresponding to the screenshot cycle. Based on the screenshot information, determine the grayscale information of the at least one set area; The screen backlight brightness of the terminal device is read to determine the screen backlight brightness information.
6. The method according to claim 5, characterized in that, The method further includes: The screenshot period is updated based on the compensated light sensitivity value.
7. A screen control device for a terminal device, characterized in that, include: The first acquisition module is used to acquire grayscale information of at least one set area of the screen of the terminal device and backlight brightness information of the screen. The determining module is used to determine the light compensation value based on the grayscale information of the at least one set area and the backlight brightness information; The compensation module is used to compensate the light sensing value collected by the light sensor according to the light sensing compensation value, so as to obtain the compensated light sensing value. The control module is used to control the brightness of the screen of the terminal device according to the compensated light sensing value; The determining module is further configured to: The grayscale information of the at least one set area and the backlight brightness information are input into the light-sensing compensation prediction model matched with the terminal device to obtain the light-sensing compensation prediction value output by the light-sensing compensation prediction model. The light-sensing compensation value is determined based on the light-sensing compensation prediction value.
8. The apparatus according to claim 7, characterized in that, The device further includes: The second acquisition module is used to acquire sample backlight brightness information of the screen of the sample terminal device, sample grayscale information of at least one set area of the sample terminal device, and light compensation reference values collected by the light sensor of the sample terminal device under the sample backlight brightness information; and The sample backlight brightness information and the sample grayscale information are used as training data; The input module is used to input the training data into the initial light-sensing compensation prediction model to obtain the light-sensing compensation prediction value output by the initial light-sensing compensation prediction model. The training module is used to train the initial light-sensing compensation prediction model based on the difference between the light-sensing compensation reference value and the light-sensing compensation prediction value.
9. The apparatus according to claim 8, characterized in that, The device further includes: The third acquisition module is used to control the terminal device to display the set verification image and acquire the light sensor's light compensation verification value under each screen brightness information in multiple set screen brightness information. The fourth acquisition module is used to input the set grayscale information corresponding to the set verification image and the screen brightness information into the trained light-sensing compensation prediction model for each of the screen brightness information, so as to obtain the light-sensing compensation reference value output by the trained light-sensing compensation prediction model. The processing module is used to compare the light-sensing compensation verification value with the corresponding light-sensing compensation reference value to obtain a verification ratio value; The verification module is used to verify the trained light-sensing compensation prediction model according to the verification ratio to determine whether the trained light-sensing compensation prediction model matches the terminal device.
10. The apparatus according to claim 9, characterized in that, The determining module is further configured to: The light-sensing compensation prediction value is multiplied by the calibration ratio to obtain the light-sensing compensation value.
11. The apparatus according to claim 7, characterized in that, The first acquisition module is further configured to: The screenshot period of the terminal device is determined based on the screen refresh rate of the terminal device. When the screenshot cycle is reached, the terminal device is controlled to take a screenshot in order to obtain screenshot information corresponding to the screenshot cycle. Based on the screenshot information, determine the grayscale information of the at least one set area; The screen backlight brightness of the terminal device is read to determine the screen backlight brightness information.
12. The apparatus according to claim 11, characterized in that, The device further includes: The update module is used to update the screenshot period based on the compensated light sensitivity value.
13. A terminal device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the screen control method of the terminal device according to any one of claims 1-6.
14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the screen control method of the terminal device as described in any one of claims 1-6.