CN113823245B - Display screen brightness control method, control device and readable storage medium - Google Patents

Display screen brightness control method, control device and readable storage medium Download PDF

Info

Publication number
CN113823245B
CN113823245B CN202111052024.8A CN202111052024A CN113823245B CN 113823245 B CN113823245 B CN 113823245B CN 202111052024 A CN202111052024 A CN 202111052024A CN 113823245 B CN113823245 B CN 113823245B
Authority
CN
China
Prior art keywords
frequency
display screen
frequencies
target frequency
pwm signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111052024.8A
Other languages
Chinese (zh)
Other versions
CN113823245A (en
Inventor
侯嘉封
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fawer Automotive Parts Co Ltd
Fulscience Automotive Electronics Co Ltd
Original Assignee
Fawer Automotive Parts Co Ltd
Fulscience Automotive Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fawer Automotive Parts Co Ltd, Fulscience Automotive Electronics Co Ltd filed Critical Fawer Automotive Parts Co Ltd
Priority to CN202111052024.8A priority Critical patent/CN113823245B/en
Publication of CN113823245A publication Critical patent/CN113823245A/en
Application granted granted Critical
Publication of CN113823245B publication Critical patent/CN113823245B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/10Intensity circuits
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0626Adjustment of display parameters for control of overall brightness

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Control Of Indicators Other Than Cathode Ray Tubes (AREA)
  • Liquid Crystal (AREA)

Abstract

The application provides a control method, a control device and a readable storage medium for display screen brightness, wherein the control method for the display screen brightness comprises the following steps: acquiring a Pulse Width Modulation (PWM) signal of first preset time sent by a host; determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal; screening out a target frequency from the determined multiple frequencies of the PWM signal; calculating the duty ratio of the PWM signal according to the target frequency; and controlling the brightness of the display screen according to the duty ratio. According to the method and the device for controlling the brightness of the display screen, the problem that PWM signals with different frequencies have large influence on the brightness of the display screen is solved, effective target frequency (namely reliable frequency) can be screened out from the received PWM signals, the duty ratio is calculated through the obtained target frequency, and the requirement of adapting to the PWM signals with different frequencies to control the brightness of the display screen is met.

Description

Display screen brightness control method, control device and readable storage medium
Technical Field
The present disclosure relates to the field of communication electronic circuit technologies, and in particular, to a method and a device for controlling brightness of a display screen and a readable storage medium.
Background
With the continuous deepening of screen display technology, adaptive adjustment and control of display screen brightness gradually receives attention of people, generally, the control of the display screen brightness is realized according to a fixed-period PWM signal sent by a host, and in the subsequent display screen brightness control process, signal sampling and duty ratio calculation of the fixed period are performed according to the fixed period of the PWM signal obtained during starting, so as to control the display screen brightness.
At present, in the existing display screen brightness control system, when the duty ratio of the PWM signal is 100%, a signal sending party may cause irregular low-level glitches to appear in the PWM signal during the process of sending the PWM signal for various reasons, and the calculated duty ratio is not accurate due to the low-level glitches, so that the brightness of the display screen cannot be accurately controlled, and the abnormal control situation occurs.
Disclosure of Invention
In view of this, an object of the embodiments of the present application is to provide a method, a device and a readable storage medium for controlling brightness of a display screen, which can screen out an effective target frequency (i.e., a reliable frequency) from a received PWM signal, and calculate a duty ratio through the obtained target frequency, so as to meet a requirement of adapting to PWM signals with different frequencies to control the brightness of the display screen.
The embodiment of the application provides a method for controlling the brightness of a display screen, which comprises the following steps:
(A) acquiring a Pulse Width Modulation (PWM) signal of first preset time sent by a host;
(B) determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal;
(C) screening out a target frequency from the determined multiple frequencies of the PWM signal;
(D) calculating the duty ratio of the PWM signal according to the target frequency;
(E) and controlling the brightness of the display screen according to the duty ratio.
In one possible embodiment, the step (C) comprises:
(C1) screening out a first frequency from the determined plurality of frequencies of the PWM signal;
(C2) and determining a target frequency according to the first frequency.
In one possible embodiment, the step (C1) includes:
calculating a variance of the plurality of frequencies;
aiming at each frequency, comparing the frequency with the variance to obtain a first comparison value corresponding to the frequency;
determining a frequency corresponding to a first comparison value smaller than a first threshold in the first comparison value as a first frequency;
in one possible embodiment, the step (C2) includes:
acquiring the absolute value of the difference value of any two first frequencies in all the first frequencies;
when the ratio of the number of the absolute values of the difference values larger than the second threshold value to the total number of the absolute values of the difference values is smaller than a third threshold value, acquiring the average value of the first frequency;
determining an average of the first frequencies as a target frequency.
In one possible embodiment, the step (D) comprises:
determining a sampling section according to the target frequency;
carrying out equal-interval sampling on the high and low levels in the sampling section in a preset number to obtain a sampling result; the sampling result comprises the number of high levels and the number of low levels;
and determining the duty ratio according to the ratio of the number of the high levels to the number of the sampling points with the preset number in the sampling result.
In one possible embodiment, the step (a) comprises:
the method comprises the steps of obtaining a PWM signal of a first preset time period sent by a host computer every other preset period, or obtaining a PWM signal of a first preset time period sent by the host computer when a display screen is started.
In one possible embodiment, the control method further includes:
(F) after the target frequency is screened out, storing the target frequency in a storage device;
the step (C2) further comprises:
and when the ratio of the number of the absolute values of the difference values larger than the second threshold to the total number of the absolute values of the difference values is not smaller than a third threshold, determining the target frequency of the current time from the target frequency which is stored in the storage device most recently.
The embodiment of the present application further provides a control device for display screen brightness, where the control device includes:
the acquisition module is used for acquiring a Pulse Width Modulation (PWM) signal of first preset time sent by a host;
the determining module is used for determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal;
the screening module is used for screening a target frequency from the determined multiple frequencies of the PWM signal;
the calculating module is used for calculating the duty ratio of the PWM signal according to the target frequency;
and the control module is used for controlling the brightness of the display screen according to the duty ratio.
In one embodiment, the screening module is configured to:
screening out a first frequency from the determined plurality of frequencies of the PWM signal;
and determining a target frequency according to the first frequency.
In one embodiment, the screening module is configured to:
calculating a variance of the plurality of frequencies;
aiming at each frequency, comparing the frequency with the variance to obtain a first comparison value corresponding to the frequency;
and determining a frequency corresponding to a first comparison value smaller than a first threshold value in the first comparison value as a first frequency.
In one embodiment, the screening module is configured to:
acquiring an absolute value of a difference value of any two first frequencies in all the first frequencies;
when the ratio of the number of the absolute values of the difference values larger than the second threshold value to the total number of the absolute values of the difference values is smaller than a third threshold value, acquiring an average value of the first frequency;
determining an average of the first frequencies as a target frequency.
In one embodiment, the calculation module is configured to:
determining a sampling section according to the target frequency;
carrying out equal-interval sampling on the high and low levels in the sampling section in a preset number to obtain a sampling result; the sampling result comprises the number of high levels and the number of low levels;
and determining the duty ratio according to the ratio of the number of the high levels to the number of the sampling points with the preset number in the sampling result.
In one embodiment, the obtaining module is configured to:
the method comprises the steps of obtaining a PWM signal of a first preset time period sent by a host computer every other preset period, or obtaining the PWM signal of the first preset time period sent by the host computer when a display screen is started.
In one embodiment, the control apparatus further comprises the storage module configured to:
after the target frequency is screened out, the target frequency is stored in a storage device.
The screening module is used for:
and when the ratio of the number of the absolute values of the difference values larger than the second threshold to the total number of the absolute values of the difference values is not smaller than a third threshold, determining the target frequency which is stored in the storage device most recently as the current target frequency.
An embodiment of the present application further provides an electronic device, including: the display screen brightness control method comprises a processor, a memory and a bus, wherein the memory stores machine readable instructions executable by the processor, when the electronic device runs, the processor and the memory are communicated through the bus, and the processor executes the machine readable instructions to execute the steps of the display screen brightness control method.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for controlling brightness of a display screen are performed as described above.
According to the control method, the control device and the readable storage medium for the brightness of the display screen, firstly, a Pulse Width Modulation (PWM) signal of first preset time sent by a host is obtained; then, according to the rising edge of the PWM signal, determining a plurality of frequencies of the PWM signal; then, screening out a target frequency from the determined multiple frequencies of the PWM signal; then, calculating the duty ratio of the PWM signal according to the target frequency; and then, controlling the brightness of the display screen according to the duty ratio. Therefore, effective target frequency (namely reliable frequency) is screened out from the received PWM signals, and the duty ratio is calculated through the acquired target frequency, so that the requirement of adapting to PWM signals with different frequencies to control the brightness of the display screen is met.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart illustrating a method for controlling brightness of a display screen according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating the steps of screening target frequencies provided by an embodiment of the present application;
FIG. 3 is a flow chart illustrating another method for controlling the brightness of a display screen according to an embodiment of the present disclosure;
fig. 4 shows one of the structural schematic diagrams of a device for controlling the brightness of a display screen according to an embodiment of the present application;
fig. 5 is a second schematic structural diagram illustrating a display screen brightness control apparatus according to an embodiment of the present disclosure;
fig. 6 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
At present, in the existing display screen brightness control system, when the duty ratio of the PWM signal is 100%, a signal sending party may cause irregular low-level burrs to appear on the PWM signal in the process of sending the PWM signal due to various reasons, and the calculated duty ratio is not accurate due to the low-level burrs, so that the brightness of the display screen cannot be accurately controlled, and the abnormal control situation occurs.
Based on the above problems, the embodiments of the present application provide a method for controlling brightness of a display screen, which can accurately calculate a duty ratio, thereby improving reliability of brightness control of the display screen.
The technical solutions in the present application will be described clearly and completely with reference to the drawings in the present application, and it should be understood that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the present application, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Referring to fig. 1, fig. 1 is a flowchart of a method for controlling brightness of a display screen according to an embodiment of the present application, where the method includes the following steps:
s101, acquiring a Pulse Width Modulation (PWM) signal in a preset time period sent by a host.
Here, the predetermined period is a preset acquisition period of the pulse width modulation PWM signal. After the computer is started, the host computer sends a PWM signal to the display screen controller, and the preset time period is that after the computer is started, the display screen controller collects the first rising edge of the PWM signal sent by the host computer as the starting time, and the time when the preset number of frequencies are obtained is used as the ending time.
In this step, a Pulse Width Modulation (PWM) signal sent by the host in a first predetermined time period is obtained, and the PWM signal obtained in the first predetermined time period includes a preset number of sub-period signals. Each sub-period is the time period between every two adjacent rising edges and each sub-period signal is the signal between every two adjacent rising edges. The sub-periodic signals are used to determine the plurality of frequencies. Here, when the controlled host of the display screen is replaced; or when the PWM frequency changes in the development of different projects; or when the frequency is changed due to interference of signals, the adaptive capacity of the display screen brightness control system is not strong, and the display screen brightness control system cannot dynamically adapt to the change of the PWM frequency in the operation process.
Therefore, in order to avoid the problem of modifying the software of the signal acquisition process each time the host computer is replaced, in an embodiment, in step S101, the PWM signal of the first predetermined time sent by the host computer may be periodically acquired once, so as to recalibrate the frequency of the PWM signal in each acquisition period, thereby implementing dynamic adaptation of the PWM signal.
Here, the period is artificially set according to actual needs, and preferably, the period may be 100 ms. Here, it should be noted that the above-mentioned period of 100ms is only an example, and the period may also be other time periods, and the present application is not limited in any way herein.
After the display screen controller starts up, firstly acquiring a Pulse Width Modulation (PWM) signal sent by a host, timing from the first rising edge of the PWM signal, acquiring a plurality of frequencies, wherein the time for acquiring the plurality of frequencies is far less than the period, after the plurality of frequencies are acquired, namely after the preset time period, the display screen controller has an idle time period, and after the total time of the preset time period and the idle time period reaches the period, the display screen controller acquires the PWM signal sent by the host again.
And S102, determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal.
Here, a signal between every two adjacent rising edges may be determined as a sub-signal in the PWM signal, a time period that the sub-signal has elapsed may be determined as a sub-signal period, and a frequency may be obtained by inverting the obtained sub-signal period, so that a plurality of frequencies may be calculated from a plurality of sub-signal periods in the PWM signal.
Here, the first frequency may be a time counted from a first rising edge of the PWM signal collected by the display screen controller to an end of a second rising edge, and the plurality of frequencies may be frequencies of the PWM signal collected sequentially every two adjacent rising edges from the first rising edge.
The number of the plurality of frequencies is set according to actual conditions.
S103, screening out a target frequency from the determined multiple frequencies of the PWM signal.
In this step, the plurality of frequencies determined in step S102 are screened, and a target frequency for calculating the duty ratio of the PWM signal is determined, so that the calculated target frequency can be screened out from an effective target frequency in the display screen control system, thereby accurately calculating the duty ratio and improving the reliability of the display screen brightness control.
In one implementation, as shown in fig. 2, fig. 2 is a schematic diagram of a frequency screening process provided in an embodiment of the present application. As shown in fig. 2, step S103 includes:
and S1031, screening out a first frequency from the plurality of determined frequencies of the PWM signal.
In the step, because the acquired PWM signals have unreliable frequencies caused by low-level burrs or other reasons, the multiple frequencies of the acquired PWM signals are preliminarily screened, and the reliable frequencies, namely the first frequencies, are screened from the multiple frequencies of the PWM signals, so that the duty ratio can be accurately calculated in the subsequent process.
In one embodiment, step S1031 includes: calculating a variance of the plurality of frequencies; aiming at each frequency, comparing the frequency with the variance to obtain a first comparison value corresponding to the frequency; and determining a frequency corresponding to a first comparison value smaller than a first threshold in the first comparison value as a first frequency.
In the step, firstly, calculating the variance of all frequencies obtained by a display screen controller; and then, comparing each determined frequency with the variance to obtain a first comparison value of each frequency, wherein the number of the first comparison values is consistent with that of the plurality of determined frequencies, each first comparison value corresponds to each frequency, then, comparing each first comparison value with a first threshold once, and if the first comparison value is greater than or equal to the threshold, indicating that the frequency corresponding to the first comparison value is an unreliable frequency, excluding the frequency and not participating in subsequent calculation. If the first comparison value is smaller than the threshold, it is determined that the frequency corresponding to the first comparison value is a reliable frequency, and needs to be reserved to participate in the following calculation. Wherein, the first threshold is set manually according to actual needs.
Illustratively, assuming that 10 frequencies are screened out from the PWM signal, a variance of the 10 frequencies is calculated, each frequency is compared with the variance to obtain 10 first comparison values, each first comparison value is compared with a set first threshold value, if 7 first comparison values out of the 10 first comparison values are smaller than the set first threshold value, the frequencies corresponding to the 7 first comparison values are determined to be reliable frequencies, the 7 frequencies corresponding to the 7 first comparison values are retained for subsequent calculation, and the remaining frequencies corresponding to the 3 first comparison values are excluded and not involved in subsequent calculation.
S1032, determining a target frequency according to the first frequency.
In this step, it may be judged whether or not the obtained first frequency is an effective frequency according to the dispersion, so that the target frequency may be determined according to the effective frequency. If the dispersion is large, the obtained first frequency is not valid; if the dispersion is small, the obtained first frequency is effective, and the target frequency can be determined according to the effective first frequency, so that the duty ratio is accurately calculated, and the reliability of the brightness control of the display screen is improved.
Specifically, in step S1032, the following steps may be included:
acquiring the absolute value of the difference value of any two first frequencies in all the first frequencies; when the ratio of the number of the absolute values of the difference values larger than the second threshold value to the total number of the absolute values of the difference values is smaller than a third threshold value, acquiring an average value of the first frequency; determining an average of the first frequencies as a target frequency.
The second threshold is set according to actual needs, and the third threshold is also set according to actual needs, and preferably, the third threshold may be 80%. Here, it should be noted that the above-mentioned third threshold of 80% is only an example, and the third threshold may also be any percentage set in advance, and the application is not limited in any way here.
For example, assuming that the number of all the first frequencies is 7, subtracting two of the 7 first frequencies, and taking an absolute value of each result to obtain absolute values of 7 differences, assuming that n of the absolute values of the 7 differences are greater than a second threshold, when n is any one of 5, 4, 3, 2, and 1, it is indicated that the absolute value of the difference less than 80% is greater than the second threshold, at this time, the dispersion of the first frequency is small and the first frequency is an effective frequency, calculating an average value of the first frequencies corresponding to the absolute values of the 7 differences, and the average value of the first frequencies corresponding to the absolute values of the 7 differences is a target frequency.
In one embodiment, after the target frequency is screened out, the target frequency is stored in a storage device.
Wherein, the storage device can be a charged erasable programmable read-only memory EEPROM.
In this step, after a target frequency is acquired in each cycle, the target frequency is stored in the storage device EEPROM, and the target frequency stored this time is used to cover the target frequency stored last time.
Here, only one target frequency is stored in the EEPROM in each cycle.
By the method, even if the frequency detection fails in the starting process, namely the target frequency cannot be determined, the target frequency obtained by the last frequency detection which is stored in advance can be used as the target frequency value of the starting process, the frequency failure result cannot be caused, and the reliability of the brightness control of the display screen is improved.
In another embodiment, the S1032 further includes: and when the ratio of the number of the absolute values of the difference values larger than the second threshold to the total number of the absolute values of the difference values is not smaller than a third threshold, determining the target frequency which is stored in the storage device most recently as the current target frequency.
In this step, when the ratio of the number of absolute values of the difference greater than the second threshold to the total number of absolute values of the difference is not less than the third threshold, it is indicated that the first frequency is not an effective frequency, and then the target frequency does not need to be obtained using the first frequency.
Further, the first frequency that is not valid needs to be stored in the memory device EEPROM as a fault record.
Here, the storage device EEPROM stores therein a target frequency and a number of first frequencies, which is determined by screening a number of first frequencies from the determined plurality of frequencies of the PWM signal according to the step, that is, the number of first frequencies stored in the EEPROM is a number of reliable frequencies screened.
And S104, calculating the duty ratio of the PWM signal according to the target frequency.
Here, after the target frequency is obtained, the duty ratio can be calculated from the fixed target frequency, the calculation method is simple, the unknown variable is small, and the reliability of the calculated duty ratio is high.
Specifically, in this step, the following steps are included: determining a sampling section according to the target frequency; carrying out equal-interval sampling on the high and low levels in the sampling section in a preset number to obtain a sampling result; the sampling result comprises the number of high levels and the number of low levels; and determining the duty ratio according to the proportion of the number of the high levels to the number of the sampling points with the preset number in the sampling result.
As an example, the sampling section is a period determined according to the target frequency, and for example, the target period may be determined by taking the inverse of the target frequency and determining the target period as the sampling section.
And equally dividing the sampling section by a preset number to obtain the number of sampling points of the preset number, detecting the level value at each sampling point to obtain the number of high levels and the number of low levels, and determining the duty ratio according to the ratio of the number of high levels to the number of sampling points of the preset number. Preferably, the predetermined number is 100 sampling points, and it should be noted that the predetermined number of 100 sampling points is only an example, and the predetermined number may be other values, and the application is not limited in any way herein.
Illustratively, after the computer is started, the target frequency is screened out, a sampling section is determined, the sampling section is equally divided into 100 sampling points, the level value is detected at each sampling point, if 60 sampling points are high level and 40 sampling points are low level, the duty ratio is the ratio of the number 60 of high level to the number 100 of sampling points, namely the duty ratio is 0.6.
And S105, controlling the brightness of the display screen according to the duty ratio.
In this step, the duty ratio calculated in S104 is used as an input value for controlling the brightness of the display screen, and then the control value of the brightness of the display screen is calculated according to the brightness limit determined by the current temperature of the display screen, so as to control the brightness of the display screen.
Here, the input value for controlling the luminance of the display screen will be described as the maximum luminance input value when the duty ratio is 100%, and as the minimum luminance input value when the duty ratio is 0%.
By way of example, referring to fig. 3 for explanation, fig. 3 is a schematic diagram of a screen brightness control process provided in an embodiment of the present application. Step S301: starting; step 302: acquiring a Pulse Width Modulation (PWM) signal of first preset time sent by a host; step S303: determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal; step 304: whether the target frequency can be screened out according to the plurality of frequencies is judged, if yes, step S305 is executed; if not, go to step S309; s305: storing the target frequency in a storage device; s306: judging whether the first preset time reaches a preset period or not; if not, go to step S307; if yes, go to step S311; s307: calculating a duty ratio according to the target frequency; s308: controlling the brightness of the display screen according to the duty ratio; step S309: calculating the duty ratio by taking the target frequency stored last time as the target frequency of this time; step S310: storing the failure frequency in a storage device; step S311: the multiple frequencies of the PWM signal are reacquired.
The method for controlling the brightness of the display screen, provided by the embodiment of the application, comprises the steps of obtaining a Pulse Width Modulation (PWM) signal of first preset time sent by a host; determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal; screening a target frequency from the determined multiple frequencies of the PWM signal; calculating the duty ratio of the PWM signal according to the target frequency; and controlling the brightness of the display screen according to the duty ratio. Therefore, an effective target frequency (namely, a reliable frequency) can be screened out from the received PWM signals, and the duty ratio is calculated through the obtained target frequency, so that the requirement of adapting to PWM signals with different frequencies to control the brightness of the display screen is met.
Referring to fig. 4 and 5, fig. 4 is a first schematic structural diagram of a display screen brightness control device according to an embodiment of the present application, and fig. 5 is a second schematic structural diagram of a display screen brightness control device according to an embodiment of the present application. As shown in fig. 4, the control device 400 includes:
an obtaining module 410, configured to obtain a Pulse Width Modulation (PWM) signal sent by a host at a first predetermined time;
a determining module 420, configured to determine multiple frequencies of the PWM signal according to a rising edge of the PWM signal;
a screening module 430, configured to screen a target frequency from the determined multiple frequencies of the PWM signal;
a calculating module 440, configured to calculate a duty ratio of the PWM signal according to the target frequency;
and a control module 450, configured to control the brightness of the display screen according to the duty ratio.
Further, as shown in fig. 5, the control device further includes a storage module 460, where the storage module 460 is configured to: after the target frequency is screened out, the target frequency is stored in a storage device.
Further, the screening module 430 is configured to:
screening out a first frequency from the determined plurality of frequencies of the PWM signal; and determining a target frequency according to the first frequency.
Further, the screening module 430 is configured to:
calculating a variance of the plurality of frequencies; aiming at each frequency, comparing the frequency with the variance to obtain a first comparison value corresponding to the frequency; and determining a frequency corresponding to a first comparison value smaller than a first threshold in the first comparison value as a first frequency.
Further, the screening module 430 is configured to: acquiring the absolute value of the difference value of any two first frequencies in all the first frequencies; when the ratio of the number of the absolute values of the difference values larger than the second threshold value to the total number of the absolute values of the difference values is smaller than a third threshold value, acquiring the average value of the first frequency; determining an average of the first frequencies as a target frequency.
Further, the calculation module 440 is configured to: determining a sampling section according to the target frequency; carrying out equal-interval sampling on the high and low levels in the sampling section in a preset number to obtain a sampling result; the sampling result comprises the number of high levels and the number of low levels; and determining the duty ratio according to the ratio of the number of the high levels to the number of the sampling points with the preset number in the sampling result.
Further, the obtaining module 410 is configured to: the method comprises the steps of obtaining a PWM signal of a first preset time period sent by a host computer every other preset period, or obtaining a PWM signal of a first preset time period sent by the host computer when a display screen is started.
Further, the screening module 430 is configured to: and when the ratio of the number of the absolute values of the difference values larger than the second threshold to the total number of the absolute values of the difference values is not smaller than a third threshold, determining the target frequency which is stored in the storage device most recently as the current target frequency.
The control device for the brightness of the display screen, provided by the embodiment of the application, acquires a Pulse Width Modulation (PWM) signal of first preset time sent by a host; determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal; screening out a target frequency from the determined multiple frequencies of the PWM signal; calculating the duty ratio of the PWM signal according to the target frequency; and controlling the brightness of the display screen according to the duty ratio. Therefore, an effective target frequency (namely, a reliable frequency) can be screened out from the received PWM signals, and the duty ratio is calculated through the obtained target frequency, so that the requirement of adapting to PWM signals with different frequencies to control the brightness of the display screen is met. Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 6, the electronic device 600 includes a processor 610, a memory 620, and a bus 630.
The memory 620 stores machine-readable instructions executable by the processor 610, when the electronic device 600 runs, the processor 610 communicates with the memory 620 through the bus 630, and when the machine-readable instructions are executed by the processor 610, the steps of the method for controlling the brightness of the display screen in the method embodiments shown in fig. 1 and fig. 2 may be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for controlling the brightness of the display screen in the method embodiment shown in fig. 1 and fig. 2 are executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one position, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A control method for the brightness of a display screen is characterized by comprising the following steps:
(A) acquiring a Pulse Width Modulation (PWM) signal in a preset time period sent by a host;
(B) determining a plurality of frequencies of the PWM signal according to the rising edge of the PWM signal;
(C) screening out a target frequency from the determined multiple frequencies of the PWM signal;
(D) calculating the duty ratio of the PWM signal according to the target frequency;
(E) controlling the brightness of the display screen according to the duty ratio;
the step (C) includes:
(C1) screening out a first frequency from the determined plurality of frequencies of the PWM signal;
(C2) determining a target frequency according to the first frequency;
the step (C1) includes:
calculating a variance of the plurality of frequencies;
aiming at each frequency, comparing the frequency with the variance to obtain a first comparison value corresponding to the frequency;
and determining a frequency corresponding to a first comparison value smaller than a first threshold in the first comparison value as a first frequency.
2. The control method according to claim 1, wherein the step (C2) includes:
acquiring the absolute value of the difference value of any two first frequencies in all the first frequencies;
when the ratio of the number of the absolute values of the difference values larger than the second threshold value to the total number of the absolute values of the difference values is smaller than a third threshold value, acquiring the average value of the first frequency;
determining an average of the first frequencies as a target frequency.
3. The control method according to claim 1, wherein the step (D) includes:
determining a sampling section according to the target frequency;
carrying out equal-interval sampling on the high and low levels in the sampling section in a preset number to obtain a sampling result; the sampling result comprises the number of high levels and the number of low levels;
and determining the duty ratio according to the ratio of the number of the high levels to the number of the sampling points with the preset number in the sampling result.
4. The control method according to claim 1, characterized in that the step (a) includes:
the method comprises the steps of obtaining a PWM signal of a first preset time period sent by a host computer every other preset period, or obtaining a PWM signal of a first preset time period sent by the host computer when a display screen is started.
5. The control method according to claim 2, characterized by further comprising:
(F) after the target frequency is screened out, storing the target frequency in a storage device;
the step (C2) further comprises:
and when the ratio of the number of the absolute values of the difference values larger than the second threshold to the total number of the absolute values of the difference values is not smaller than a third threshold, determining the target frequency which is stored in the storage device most recently as the current target frequency.
6. A control device for controlling the brightness of a display screen, the control device comprising:
the acquisition module is used for acquiring a Pulse Width Modulation (PWM) signal of first preset time sent by a host;
the determining module is used for determining a plurality of frequencies of the PWM signals according to the rising edges of the PWM signals;
the screening module is used for screening a target frequency from the determined multiple frequencies of the PWM signal;
the calculating module is used for calculating the duty ratio of the PWM signal according to the target frequency;
the control module is used for controlling the brightness of the display screen according to the duty ratio;
the screening module comprises: a screening submodule and a determining submodule;
the screening submodule is used for: screening out a first frequency from the determined plurality of frequencies of the PWM signal;
the determination submodule is configured to: determining a target frequency according to the first frequency;
the screening submodule is specifically configured to:
calculating a variance of the plurality of frequencies;
aiming at each frequency, comparing the frequency with the variance to obtain a first comparison value corresponding to the frequency;
and determining a frequency corresponding to a first comparison value smaller than a first threshold in the first comparison value as a first frequency.
7. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine readable instructions being executed by the processor to perform the steps of the method for controlling the brightness of a display screen according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, performs the steps of the method for controlling the brightness of a display screen according to any one of claims 1 to 5.
CN202111052024.8A 2021-09-08 2021-09-08 Display screen brightness control method, control device and readable storage medium Active CN113823245B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111052024.8A CN113823245B (en) 2021-09-08 2021-09-08 Display screen brightness control method, control device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111052024.8A CN113823245B (en) 2021-09-08 2021-09-08 Display screen brightness control method, control device and readable storage medium

Publications (2)

Publication Number Publication Date
CN113823245A CN113823245A (en) 2021-12-21
CN113823245B true CN113823245B (en) 2022-09-30

Family

ID=78914244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111052024.8A Active CN113823245B (en) 2021-09-08 2021-09-08 Display screen brightness control method, control device and readable storage medium

Country Status (1)

Country Link
CN (1) CN113823245B (en)

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06208407A (en) * 1992-09-01 1994-07-26 T I Ii:Kk Interface circuit for controller
KR100537680B1 (en) * 2003-05-29 2005-12-20 엘지전자 주식회사 Apparatus and method controlling invertor pulse width modulation frequency in LCD
KR101108173B1 (en) * 2010-04-28 2012-02-09 삼성모바일디스플레이주식회사 A liquid crystal display, and an apparatus and a method for driving the same
CN101902861B (en) * 2010-08-10 2013-09-11 友达光电股份有限公司 LED driving method and LED driving circuit
JP5644385B2 (en) * 2010-11-05 2014-12-24 船井電機株式会社 Display device
US20140219401A1 (en) * 2013-02-04 2014-08-07 Koby Finkelstein Rfi mitigation via duty cycle control
CN105245203B (en) * 2015-11-13 2018-09-04 绍兴光大芯业微电子有限公司 High-precision low-speed clock duty ratio detecting system and method
CN106569032B (en) * 2016-10-17 2019-05-31 长沙开元仪器股份有限公司 A kind of detection method of signal frequency and duty ratio based on embedded microcontroller
TWI668453B (en) * 2018-12-26 2019-08-11 致茂電子股份有限公司 Circuit and method for measuring signal period
CN112382228A (en) * 2020-12-02 2021-02-19 深圳市华星光电半导体显示技术有限公司 Driving method and driving device of display panel

Also Published As

Publication number Publication date
CN113823245A (en) 2021-12-21

Similar Documents

Publication Publication Date Title
CN106648747B (en) Process preloading processing method and device
CN112988303B (en) Electronic ink screen refreshing method and device, electronic equipment and storage medium
CN113759628A (en) Electrochromic device gear shifting control method and device and electrochromic device
CN105390088B (en) Backlight control method and electronic equipment
CN107148072B (en) Method and system for acquiring target resource parameters of intelligent terminal application
CN104378406B (en) Information-pushing method and device
CN107402851B (en) Data recovery control method and device
CN111681125B (en) Top plate pressure calculation method, storage medium, and electronic apparatus
EP3952003B1 (en) Battery residual value display device
CN113823245B (en) Display screen brightness control method, control device and readable storage medium
CN113704698B (en) Event detection method and system for non-intrusive load identification
CN115016444A (en) Vehicle remote diagnosis method and related components
CN113051014A (en) Eye protection prompting method and device, storage medium and computer equipment
CN108014499B (en) Application parameter adjusting method and device
CN114801868A (en) Method, device, equipment and medium for dynamically correcting available power of battery
CN109710285B (en) Equipment upgrading method and system
CN107990929B (en) Method and device for controlling filter time constant, computer device and storage medium
CN111351972B (en) Method and device for detecting idle-state sleep current of terminal
CN108984330B (en) Method and device for controlling storage equipment and electronic equipment
CN112865753B (en) Filter coefficient adjusting method and device, storage medium and filter
US10712375B2 (en) Data processing device, data processing method, and non-transitory storage medium
CN113032232B (en) Correlation method, correlation device and equipment for performance detection of equipment
CN113810743A (en) Live broadcast room flow monitoring method and device
CN112614453B (en) Method and device for diagnosing response time abnormity of liquid crystal display panel
CN114841431A (en) Method for predicting power consumption of equipment and related components thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant