Gray scale adjusting method of lamp, lamp, readable storage medium and program product
By determining the current and target grayscale in the lamp and selecting the hybrid adjustment mode based on the preset grayscale threshold, the resistance value and PWM pulse duty cycle are adjusted, and the design difficulty and power consumption of the lamp when improving the refresh rate is solved. Problem, efficient grayscale adjustment and refresh rate improvement have been achieved.
Patent Information
- Application Number
- CN202411359246.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-11-22
AI Technical Summary
When existing lamps increase the refresh rate, they will lead to problems such as increased design difficulty, poor anti-interference ability, misdecoding and large power consumption, making it difficult to meet the needs of high refresh rate.
By determining the current and target grayscale of the lamp, selecting a hybrid adjustment mode based on the preset grayscale threshold matching result, adjusting the resistance value and PWM pulse duty cycle to achieve grayscale adjustment, so as to not change the clock frequency without changing the clock frequency Improve refresh rate.
While ensuring the grayscale adjustment effect, it reduces the time for processing each PWM pulse cycle, improves the refresh rate of the lamp, reduces power consumption, and enhances anti-interference ability.
Smart Images

Figure CN119012450A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of grayscale adjustment, and in particular to a grayscale adjustment method for a lamp, a lamp, a readable storage medium, and a program product. Background Art
[0002] With the rapid development of electronic technology and control technology, grayscale adjustment technology for lamps has emerged. Moreover, with the continuous improvement of people's living standards, lamps now have a very high penetration rate in various application fields.
[0003] However, the market currently has higher and higher requirements for the refresh rate of lamps. If the refresh rate of lamps is increased by simply increasing the clock frequency in the grayscale adjustment system of the lamps, it will not only increase the difficulty of designing lamp products, but also lead to problems such as poor anti-interference ability, miscoding, high power consumption, etc., which is undoubtedly a challenge for lamp products. Summary of the invention
[0004] Based on this, it is necessary to provide a grayscale adjustment method, device, lamp, computer-readable storage medium and computer program product for the lamp, which can improve the refresh rate of the lamp, in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a grayscale adjustment method for a lamp, comprising:
[0006] Determine the current grayscale and target grayscale of the lamp;
[0007] Determine a matching result between a target grayscale and a preset grayscale threshold;
[0008] Based on the matching result, determining a hybrid adjustment mode for the lamp; the hybrid adjustment mode is a first hybrid adjustment mode or a second hybrid adjustment mode;
[0009] Based on the mixed adjustment mode, the resistance value and the PWM pulse duty cycle are adjusted respectively to adjust the lamp from the current grayscale to the target grayscale.
[0010] In a second aspect, the present application further provides a grayscale adjustment device for a lamp, comprising:
[0011] A first determination module, used to determine the current grayscale and target grayscale of the lamp;
[0012] A second determination module is used to determine a matching result between a target grayscale and a preset grayscale threshold;
[0013] A third determination module is used to determine a hybrid adjustment mode for the lamp based on the matching result; the hybrid adjustment mode is the first hybrid adjustment mode or the second hybrid adjustment mode;
[0014] The regulating module is used to respectively regulate the resistance value and the PWM pulse duty cycle based on the mixed regulating mode, so as to regulate the lamp from the current gray scale to the target gray scale.
[0015] In a third aspect, the present application further provides a lamp, wherein the lamp comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, part or all of the steps described in any method of the first aspect of the present application are implemented.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps described in any method of the first aspect of the present application.
[0017] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements part or all of the steps described in any method of the first aspect of the embodiment of the present application.
[0018] The grayscale adjustment method, device, lamp, computer-readable storage medium and computer program product of the above-mentioned lamp determine the current grayscale and target grayscale of the lamp; determine the matching result between the target grayscale and the preset grayscale threshold; determine the hybrid adjustment mode for the lamp based on the matching result; the hybrid adjustment mode is the first hybrid adjustment mode or the second hybrid adjustment mode; and adjust the resistance value and the PWM pulse duty cycle respectively based on the hybrid adjustment mode to adjust the lamp from the current grayscale to the target grayscale. The grayscale adjustment method of the lamp provided in the present application matches the target grayscale of the lamp and the preset grayscale threshold to obtain a matching result, and then determines how to adjust the resistance value and the PWM pulse duty cycle respectively based on the matching result, thereby, the PWM pulse duty cycle can be flexibly adjusted by flexibly setting the preset grayscale threshold, and further, while ensuring the grayscale adjustment effect of the lamp, the refresh rate of the lamp can be improved by reducing the time for processing each PWM pulse cycle without changing the clock frequency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] FIG1 is a diagram showing an application environment of a grayscale adjustment method for a lamp in one embodiment;
[0021] FIG2 is a schematic flow chart of a grayscale adjustment method for a lamp in one embodiment;
[0022] FIG3 is a schematic flow chart of a grayscale adjustment method for a lamp in another embodiment;
[0023] FIG4 is a structural block diagram of a grayscale adjustment device for a lamp in one embodiment;
[0024] FIG5 is a diagram showing the internal structure of a computer device in one embodiment;
[0025] FIG. 6 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0027] The grayscale adjustment method for a lamp provided in the embodiment of the present application can be applied to the lamp driver chip 102 as shown in FIG1 . By setting the lamp driver chip 102 to which the grayscale adjustment method for a lamp provided in the embodiment of the present application is applied in the lamp 10, the grayscale of the lamp 10 can be adjusted based on the grayscale adjustment method for a lamp provided in the embodiment of the present application.
[0028] In an exemplary embodiment, as shown in FIG2 , a grayscale adjustment method for a lamp is provided, and the method is described by taking the lamp driver chip in FIG1 as an example, and includes the following steps 202 to 206 . Among them:
[0029] Step 202: determine the current grayscale and target grayscale of the lamp.
[0030] The lamp can realize grayscale adjustment function. Optionally, the lamp can be an LED lamp.
[0031] The grayscale of a lamp refers to the brightness of the lamp, that is, the degree of change in the brightness of the pixel light. The grayscale of a lamp is positively correlated with the brightness of the lamp light, that is, the greater the grayscale of the lamp, the greater the brightness presented in the visual effect. The grayscale level of a lamp depends on the number of digital-to-analog conversion bits of the lamp. For example, when the digital-to-analog conversion bit is 8 bits, there are 256 grayscale levels; when the digital-to-analog conversion bit is 10 bits, there are 1024 grayscale levels. The larger the grayscale range of a lamp, the higher the grayscale level that the lamp can correspond to, and the higher the grayscale level, the more delicate color details the lamp can show.
[0032] The current grayscale of a lamp refers to the brightness of the current light of the lamp. The target grayscale of a lamp refers to the brightness of the light that needs to be adjusted.
[0033] In an exemplary embodiment, the above-mentioned determining the current grayscale and the target grayscale of the lamp includes: receiving a control signal for the lamp; parsing the control signal to determine the target grayscale of the lamp, and determining the current grayscale of the lamp.
[0034] The control signal may be initiated by the user for the lamp to adjust the grayscale of the lamp. For example, the lamp may be provided with a grayscale adjustment button, so that the user may perform an interactive action based on the grayscale adjustment button to initiate a control signal for the lamp.
[0035] Step 204: Determine a matching result between the target grayscale and a preset grayscale threshold.
[0036] The preset grayscale threshold is within the grayscale range of the lamp. For example, when the grayscale range of the lamp is 1-256, the preset grayscale threshold is between 1-256.
[0037] The matching result between the target grayscale and the preset grayscale threshold can represent the size comparison result between the target grayscale and the preset grayscale threshold; exemplarily, when the matching result represents the size comparison result between the target grayscale and the preset grayscale threshold, the matching result can be that the target grayscale is less than or equal to the preset grayscale threshold or the target grayscale is greater than the preset grayscale threshold.
[0038] Optionally, the preset grayscale threshold may be manually pre-set or determined based on a target refresh rate of the lamp, and the target refresh rate of the lamp may be positively correlated with the preset grayscale threshold. Further optionally, the target refresh rate of the lamp may be manually pre-set or determined based on a refresh rate change signal initiated by a user to the lamp, and the refresh rate change signal is a signal initiated by the user to the lamp for adjusting the refresh rate to change the refresh rate of the lamp.
[0039] Step 206: determine a hybrid adjustment mode for the lamp based on the matching result; the hybrid adjustment mode is the first hybrid adjustment mode or the second hybrid adjustment mode.
[0040] Among them, the mixed adjustment mode is a working mode in which at least two grayscale adjustment modes are used to jointly adjust the grayscale of the lamp. Correspondingly, the first mixed adjustment mode and the second mixed adjustment mode are both working modes in which at least two grayscale adjustment modes are used to jointly adjust the grayscale of the lamp, and each grayscale adjustment mode has a contribution degree to the grayscale adjustment process of the lamp. The contribution degrees of different grayscale adjustment modes in different mixed adjustment modes are different, that is, the common point of the first mixed adjustment mode and the second mixed adjustment mode is that the grayscale of the lamp is jointly adjusted by the same at least two grayscale adjustment modes, and the difference between the first mixed adjustment mode and the second mixed adjustment mode is that the contribution degrees of each grayscale adjustment mode are different. It is easy to understand that the different grayscale adjustment modes in the mixed adjustment mode are achieved by adjusting different physical parameters to adjust the grayscale of the lamp.
[0041] Exemplarily, the first mixed adjustment mode and the second mixed adjustment mode are both adjusted by the grayscale adjustment mode 1 and the grayscale adjustment mode 2 to adjust the grayscale of the lamp together, wherein the contribution degree of the grayscale adjustment mode 1 in the first mixed adjustment mode and the second mixed adjustment mode is different, similarly, the contribution degree of the grayscale adjustment mode 2 in the first mixed adjustment mode and the second mixed adjustment mode is also different, but the grayscale adjustment mode 1 and the grayscale adjustment mode 2 have a certain contribution degree in the first mixed adjustment mode and the second mixed adjustment mode respectively, wherein the grayscale adjustment mode 1 and the grayscale adjustment mode 2 respectively achieve grayscale adjustment of the lamp by adjusting the physical parameters 1 and the physical parameters 2.
[0042] Step 208: adjusting the resistance value and the PWM pulse duty cycle respectively based on the hybrid adjustment mode to adjust the lamp from the current grayscale to the target grayscale.
[0043] Among them, the resistance value is adjusted to obtain the corresponding current, so as to adjust the lamp from the current grayscale to the target grayscale based on the corresponding current; the PWM pulse duty cycle is adjusted to obtain the ratio between the duration of the PWM pulse maintained in the high level state and the PWM period, so as to adjust the lamp from the current grayscale to the target grayscale based on the duration of the PWM pulse maintained in the high level state.
[0044] Since the resistance value is a physical parameter in the analog regulation mode and the PWM pulse duty cycle is a physical parameter in the PWM pulse regulation mode, the hybrid regulation mode can be understood as a grayscale regulation mode that is hybridly regulated based on the analog regulation mode and the PWM pulse regulation mode.
[0045] Since the hybrid adjustment mode is the first hybrid adjustment mode or the second hybrid adjustment mode, the first hybrid adjustment mode and the second hybrid adjustment mode will respectively adjust the resistance value and the PWM pulse duty cycle to different degrees to adjust the lamp from the current grayscale to the target grayscale.
[0046] In the grayscale adjustment method of the above-mentioned lamp, the current grayscale and the target grayscale of the lamp are determined; the matching result between the target grayscale and the preset grayscale threshold is determined; based on the matching result, the hybrid adjustment mode for the lamp is determined; the hybrid adjustment mode is the first hybrid adjustment mode or the second hybrid adjustment mode; based on the hybrid adjustment mode, the resistance value and the PWM pulse duty cycle are adjusted respectively to adjust the lamp from the current grayscale to the target grayscale. The grayscale adjustment method of the lamp provided in the present application is obtained by matching the target grayscale of the lamp with the preset grayscale threshold to obtain a matching result, and then determining how to adjust the resistance value and the PWM pulse duty cycle respectively based on the matching result, thereby, the PWM pulse duty cycle can be flexibly adjusted by flexibly setting the preset grayscale threshold, and further, while ensuring the grayscale adjustment effect of the lamp, the refresh rate of the lamp can be improved by reducing the time for processing each PWM pulse cycle without changing the clock frequency.
[0047] In an exemplary embodiment, the above-mentioned hybrid adjustment mode is based on respectively adjusting the resistance value and the PWM pulse duty cycle to adjust the lamp from the current grayscale to the target grayscale, including:
[0048] Based on the hybrid adjustment mode, the resistance value and the PWM pulse duty cycle are adjusted respectively to obtain a first adjustment signal and a second adjustment signal respectively;
[0049] Based on the first adjustment signal and the second adjustment signal, a mixed adjustment signal is obtained;
[0050] Based on the mixed adjustment signal, the lamp is adjusted from the current grayscale to the target grayscale.
[0051] Among them, the first adjustment signal is obtained based on the corresponding resistance value in the corresponding hybrid adjustment mode, which can be understood as the first adjustment signal is an analog adjustment signal in the hybrid adjustment mode; the second adjustment signal is obtained based on the corresponding PWM pulse duty cycle in the corresponding hybrid adjustment mode, which can be understood as the second adjustment signal is a PWM pulse adjustment signal in the hybrid adjustment mode. The first adjustment signal is used to adjust the lamp from the current grayscale to the target grayscale.
[0052] In the present embodiment, the mixed adjustment signal for adjusting the lamp from the current grayscale to the target grayscale is obtained based on the first adjustment signal obtained by adjusting the resistance value and the second adjustment signal obtained by adjusting the PWM pulse duty cycle. Thus, the mixed adjustment signal can simultaneously perform analog adjustment and PWM adjustment on the lamp to achieve the target grayscale adjustment, thereby ensuring the grayscale adjustment effect of the lamp.
[0053] In an exemplary embodiment, the above-mentioned determining the hybrid adjustment mode for the lamp based on the matching result includes:
[0054] When the matching result is that the target grayscale is less than or equal to the preset grayscale threshold, determining that the hybrid adjustment mode for the lamp is the first hybrid adjustment mode;
[0055] When the matching result is that the target grayscale is greater than the preset grayscale threshold, it is determined that the hybrid adjustment mode for the lamp is the second hybrid adjustment mode.
[0056] Optionally, the first hybrid adjustment mode in this embodiment can be a hybrid adjustment mode with analog adjustment mode as the main mode and PWM adjustment mode as the auxiliary mode. Therefore, when the target grayscale is less than or equal to the preset grayscale threshold, that is, when the grayscale of the lamp is low, the analog adjustment mode is used as the main adjustment mode, and by increasing the contribution of the analog adjustment mode in the grayscale adjustment process, the power consumption of the lamp can be reduced when the visual effect of the light is required to be low.
[0057] Optionally, the second hybrid adjustment mode in this embodiment can be a hybrid adjustment mode with PWM adjustment mode as the main mode and analog adjustment mode as the auxiliary mode. Therefore, when the target grayscale is greater than the preset grayscale threshold, that is, when the grayscale of the lamp is high, the PWM adjustment mode is used as the main adjustment mode, and by increasing the contribution of the PWM adjustment mode in the grayscale adjustment process, it is possible to ensure a high grayscale accuracy and smooth grayscale transition display effect of the lamp when the visual effect of the light is required to be high.
[0058] Optionally, in the case where the second hybrid regulation mode is a hybrid regulation mode with PWM regulation mode as the main mode and analog regulation mode as the auxiliary mode, the preset grayscale threshold can be set to a smaller value. For example, the preset grayscale threshold can be smaller than the median of the grayscale level range. That is to say, assuming that the grayscale level range of the lamp is 1-256 levels, the value range of the preset grayscale threshold can be [1, 128). Therefore, when the preset grayscale threshold is smaller, the grayscale regulation effect of the lamp can be significantly improved. At the same time, the contribution of the analog regulation mode in the grayscale regulation process can be reduced to reduce the circuit cost required to be invested in the analog regulation mode, thereby saving power consumption and cost.
[0059] In the present embodiment, when the matching result is that the target grayscale is less than or equal to the preset grayscale threshold, the hybrid adjustment mode for the lamp is mainly based on the analog adjustment mode and supplemented by the PWM adjustment mode. Thus, when the visual effect requirements for the light emitted by the lamp are low, the power consumption of the lamp can be reduced through the analog adjustment mode; when the matching result is that the target grayscale is greater than the preset grayscale threshold, the hybrid adjustment mode for the lamp is mainly based on the PWM adjustment mode and supplemented by the analog adjustment mode. Thus, when the visual effect requirements for the light emitted by the lamp are high, the PWM adjustment mode can be used to ensure that the grayscale adjustment process of the lamp has better transition smoothness, and at the same time, the grayscale adjustment process of the lamp will also have higher accuracy.
[0060] In an exemplary embodiment, the above-mentioned hybrid adjustment mode is used to adjust the resistance value and the PWM pulse duty cycle respectively to obtain the first adjustment signal and the second adjustment signal respectively, including:
[0061] When the hybrid regulation mode is the first hybrid regulation mode, the PWM pulse duty cycle is fixed to the minimum duty cycle of the PWM pulse to obtain a second regulation signal;
[0062] Based on the current grayscale and the target grayscale, the resistance value is adjusted to obtain a first adjustment signal.
[0063] The minimum duty cycle of the PWM pulse refers to the shortest high-level duration of the PWM pulse signal that can maintain the normal operation of the lamp within one cycle. The shortest high-level duration corresponding to the minimum duty cycle is very short, so that the lamp appears to be continuously emitting light instead of flickering in the eyes of the human eye. Specifically, the minimum duty cycle of the PWM pulse ensures that the lamp receives enough current to emit light in the PWM regulation mode even at very low grayscale settings, while also avoiding the flickering phenomenon of the lamp caused by too little current.
[0064] Optionally, the minimum duty cycle of the PWM pulse may be determined according to the response time requirement and power consumption requirement of the lamp.
[0065] Specifically, the terminal adjusts the resistance value based on the current grayscale and the target grayscale to obtain the first adjustment signal.
[0066] In the present embodiment, when the hybrid regulation mode is the first hybrid regulation mode, the PWM pulse duty cycle is fixed to the minimum duty cycle of the PWM pulse, so that in the first hybrid regulation mode where the target grayscale is less than or equal to the preset grayscale threshold, the contribution of the analog regulation mode can be increased without increasing the contribution of the PWM regulation mode, thereby avoiding the undesirable situation where an excessively large PWM pulse duty cycle consumes too much power in a low-grayscale situation where the visual effect of the light emitted by the lamp is not required, and significantly reducing the power consumption of the lamp.
[0067] In an exemplary embodiment, the above-mentioned adjusting the resistance value based on the current grayscale and the target grayscale to obtain the first adjustment signal includes:
[0068] Determine the grayscale difference after subtracting the current grayscale from the target grayscale;
[0069] When the grayscale difference is positive, a resistance value reduction signal is generated based on the grayscale difference, and the resistance value is adjusted based on the resistance value reduction signal to obtain a first adjustment signal; the grayscale difference is positively correlated with the reduction amplitude of the resistance value by the resistance value reduction signal;
[0070] When the grayscale difference is negative, a resistance increase signal is generated based on the grayscale difference, and the resistance value is adjusted based on the resistance increase signal to obtain a first adjustment signal; the grayscale difference is positively correlated with the increase in resistance value by the resistance increase signal.
[0071] Among them, grayscale difference = target grayscale - current grayscale.
[0072] When the grayscale difference is a positive value, it indicates that the target grayscale is greater than or equal to the current grayscale. At this time, it is necessary to increase the current flowing through the lamp to increase the grayscale of the lamp. Therefore, a resistance value reduction signal is generated based on the grayscale difference to reduce the resistance value. Therefore, a first adjustment signal for reducing the resistance value is obtained to increase the current flowing through the lamp. Moreover, the greater the grayscale difference is, the greater the degree of increase in the current should be. Therefore, the grayscale difference is positively correlated with the degree of reduction in the resistance value by the resistance value reduction signal.
[0073] When the grayscale difference is a negative value, it indicates that the target grayscale is smaller than the current grayscale. At this time, it is necessary to reduce the current flowing through the lamp to reduce the grayscale of the lamp. Therefore, a resistance value increase signal is generated based on the size of the grayscale difference to increase the resistance value. Therefore, a first adjustment signal for increasing the resistance value is obtained to reduce the current flowing through the lamp. Moreover, the greater the grayscale difference is, the greater the degree of reduction in the current should be. Therefore, the size of the grayscale difference is positively correlated with the increase in the resistance value by the resistance value increase signal.
[0074] Specifically, the resistance value is adjusted to obtain the first adjustment signal by determining the resistance values of multiple resistors and determining the change in the resistance value based on the directionality and size of the grayscale difference, so as to select at least one target resistor from the multiple resistors for parallel connection, and obtain the first adjustment signal based on the resistance value after parallel connection.
[0075] In an exemplary embodiment, the above-mentioned hybrid adjustment mode is used to adjust the resistance value and the PWM pulse duty cycle respectively to obtain the first adjustment signal and the second adjustment signal respectively, including:
[0076] When the hybrid regulation mode is the second hybrid regulation mode, fixing the resistance value to the minimum resistance value to obtain the first regulation signal;
[0077] Based on the current grayscale and the target grayscale, the PWM pulse duty cycle is adjusted to obtain a second adjustment signal.
[0078] Among them, the minimum value of the resistance is the resistance value corresponding to when the target grayscale is equal to the preset grayscale threshold. It is easy to understand that when the target grayscale is less than or equal to the preset grayscale threshold, as the target grayscale increases, the current flowing through the lamp also needs to increase. Therefore, in the process of the target grayscale approaching the preset grayscale threshold, the resistance value will continue to decrease, and when the target grayscale is greater than the preset grayscale threshold, the contribution of the PWM regulation mode will be increased instead of the contribution of the analog regulation mode. Therefore, when the target grayscale is equal to the preset grayscale threshold, the resistance value will be fixed, and the size of the resistance value at this time is the minimum value of the resistance value. In other words, when the mixed regulation mode is the second mixed regulation mode, the resistance value will be fixed to the minimum value in the optional range of the resistance value.
[0079] Specifically, based on the current grayscale and the target grayscale, the size of the PWM pulse duty cycle is adjusted to obtain the second adjustment signal.
[0080] In the present embodiment, when the hybrid adjustment mode is the second hybrid adjustment mode, the resistance value is fixed to the minimum value in the optional range of resistance values corresponding to the target grayscale being equal to the preset grayscale threshold value, so that in the second hybrid adjustment mode in which the target grayscale is greater than the preset grayscale threshold value, the contribution of the PWM adjustment mode can be increased without increasing the contribution of the analog adjustment mode, and by fixing the resistance value to the minimum resistance value, the grayscale of the lamp can have a smooth transition when the target grayscale is adjusted near the preset grayscale threshold value, thereby ensuring that the grayscale accuracy of the lamp is high, and at the same time, in the case of hybrid adjustment, it can also be ensured that the grayscale display effect can transition smoothly, thereby improving the visual effect of the lamp for the human eye.
[0081] In an exemplary embodiment, the above-mentioned adjusting the PWM pulse duty cycle based on the current grayscale and the target grayscale to obtain the second adjustment signal includes:
[0082] Determine the grayscale difference after subtracting the current grayscale from the target grayscale;
[0083] When the grayscale difference is a positive value, a PWM pulse duty cycle increase signal is generated based on the grayscale difference, and the PWM pulse duty cycle is adjusted based on the PWM pulse duty cycle increase signal to obtain a second adjustment signal; the grayscale difference is positively correlated with the increase of the PWM pulse duty cycle by the PWM pulse duty cycle increase signal;
[0084] When the grayscale difference is a negative value, a PWM pulse duty cycle reduction signal is generated based on the size of the grayscale difference, and the PWM pulse duty cycle is adjusted based on the PWM pulse duty cycle reduction signal to obtain a second adjustment signal; the size of the grayscale difference is positively correlated with the reduction amplitude of the PWM pulse duty cycle by the PWM pulse duty cycle reduction signal.
[0085] Among them, when the grayscale difference is a positive value, it indicates that the target grayscale is greater than or equal to the current grayscale. At this time, it is necessary to increase the PWM pulse duty cycle to increase the grayscale of the lamp. Therefore, a PWM pulse duty cycle increase signal is generated based on the size of the grayscale difference to adjust the PWM pulse duty cycle. Therefore, a first adjustment signal for increasing the PWM pulse duty cycle is obtained to increase the grayscale of the lamp. Moreover, at this time, the larger the grayscale difference is, the greater the degree of improvement of the PWM pulse duty cycle should be. Therefore, the size of the grayscale difference is positively correlated with the increase in the PWM pulse duty cycle by the PWM pulse duty cycle increase signal.
[0086] When the grayscale difference is a negative value, it indicates that the target grayscale is smaller than the current grayscale. At this time, the PWM pulse duty cycle needs to be reduced to reduce the grayscale of the lamp. Therefore, a PWM pulse duty cycle reduction signal is generated based on the size of the grayscale difference to adjust the PWM pulse duty cycle. Therefore, a first adjustment signal for reducing the PWM pulse duty cycle is obtained to reduce the grayscale of the lamp. Moreover, the larger the grayscale difference is at this time, the greater the degree of reduction in the PWM pulse duty cycle should be. Therefore, the size of the grayscale difference is positively correlated with the reduction amplitude of the PWM pulse duty cycle by the PWM pulse duty cycle reduction signal.
[0087] It can be seen that the PWM pulse duty cycle will be increased or decreased only when the target grayscale is greater than the preset grayscale threshold, and when the target grayscale is less than or equal to the preset grayscale threshold, the PWM pulse duty cycle only needs to be maintained at the minimum duty cycle of the PWM pulse. Therefore, when the clock frequency does not need to be changed, the adjustment process of the PWM pulse duty cycle requires the corresponding grayscale level to be reduced relative to the complete grayscale level range in the prior art. For example, when the adjustment process of the PWM pulse duty cycle in the prior art needs to correspond to 256 grayscale levels, assuming that the preset grayscale threshold is 60, the adjustment process of the PWM pulse duty cycle in this embodiment only needs to adjust 256-60=196 grayscale levels. Furthermore, it can be seen that the time required to process each PWM cycle in this embodiment is reduced, and the number of PWM cycles that can be processed in the same time is increased. Therefore, this embodiment improves the refresh rate of the lamp based on the existence of the preset grayscale threshold, and the size of the preset grayscale threshold can be appropriately increased in the scene where the refresh rate of the lamp is high. That is to say, there is a positive correlation between the refresh rate of the lamp and the preset grayscale threshold.
[0088] In this embodiment, when the target grayscale is less than or equal to the preset grayscale threshold, the PWM pulse duty cycle is fixed to the minimum duty cycle of the PWM pulse, which can reduce the power consumption generated by the PWM pulse as much as possible when the visual effect of the light emitted by the lamp is required to be low; and when the target grayscale is greater than the preset grayscale threshold, the PWM pulse duty cycle is increased or decreased, which can improve the fineness of the light in the grayscale adjustment process when the visual effect is required to be high, ensure that the transition of the grayscale change of the lamp in the grayscale adjustment process is better, and the change of the grayscale display effect is smoother for the human eye. At the same time, based on this, in this embodiment, due to the existence of the preset grayscale threshold, and because the PWM pulse duty cycle needs to be increased or decreased only when the target grayscale is greater than the preset grayscale threshold, it can be seen that the number of grayscale levels that need to be adjusted for the PWM pulse duty cycle is reduced, that is, the time required to process each PWM cycle is also reduced, so when the clock frequency is not changed, the PWM cycle that can be processed in the same time is increased, so the grayscale adjustment method of the lamp provided in the embodiment of the present application can improve the refresh rate of the lamp.
[0089] In an exemplary embodiment, the method further includes:
[0090] The ambient light sensor is used to obtain the light intensity of the environment around the lamp, and the light intensity is converted into analog to digital to determine the ambient light intensity;
[0091] When the ambient light intensity is greater than a preset intensity, generating a grayscale threshold reduction signal based on a difference between the ambient light intensity and the preset intensity;
[0092] Based on the gray threshold reduction signal, the preset gray threshold is reduced to obtain the reduced preset gray threshold; the difference between the ambient light intensity and the preset intensity is positively correlated with the reduction amplitude of the preset gray threshold by the gray threshold reduction signal;
[0093] The above determination of the matching result between the target grayscale and the preset grayscale threshold includes:
[0094] Determine a matching result between a target grayscale and a reduced preset grayscale threshold;
[0095] When the ambient light intensity is less than or equal to the preset intensity, generating a grayscale threshold increase signal based on the difference between the ambient light intensity and the preset intensity;
[0096] The preset gray threshold is increased based on the gray threshold increase signal to obtain the increased preset gray threshold; the difference between the ambient light intensity and the preset intensity is positively correlated with the increase of the preset gray threshold by the gray threshold increase signal;
[0097] The above determination of the matching result between the target grayscale and the preset grayscale threshold includes:
[0098] A matching result between the target grayscale and the increased preset grayscale threshold is determined.
[0099] The ambient light sensor may be a photoresistor, a photodiode or other device capable of sensing the light intensity of the surrounding environment.
[0100] In the present embodiment, when the ambient light intensity is high, the grayscale of the lamp will be weaker for the visual effect of the human eye, that is, it will be more difficult for the human eye to notice the display effect of the lamp. Therefore, at this time, the preset grayscale threshold can be appropriately reduced. While ensuring the most basic display effect of the lamp, the power consumption of the lamp can be saved by appropriately reducing the refresh rate of the lamp. When the ambient light intensity is low, the human eye will rely more on the light of the lamp. Therefore, the grayscale of the lamp will play a more important role in the visual effect of the human eye. Therefore, at this time, the preset grayscale threshold can be appropriately increased. The display effect of the lamp can be ensured by appropriately increasing the refresh rate of the lamp.
[0101] In an exemplary embodiment, the method further includes:
[0102] The ambient light sensor is used to obtain the light intensity of the environment around the lamp and determine the brightness ratio between the brightest part and the darkest part of the environment around the lamp;
[0103] When the brightness ratio is less than or equal to a preset brightness ratio, generating a gray threshold reduction signal based on a difference between the brightness ratio and the preset brightness ratio;
[0104] Based on the gray threshold reduction signal, the preset gray threshold is reduced to obtain the reduced preset gray threshold; the difference between the brightness ratio and the preset brightness ratio is positively correlated with the reduction amplitude of the preset gray threshold by the gray threshold reduction signal;
[0105] The above-mentioned determining the matching result between the target grayscale and the preset grayscale threshold includes: determining the matching result between the target grayscale and the reduced preset grayscale threshold;
[0106] When the brightness ratio is greater than a preset brightness ratio, generating a grayscale threshold increase signal based on a difference between the brightness ratio and the preset brightness ratio;
[0107] The preset gray threshold is increased based on the gray threshold increase signal to obtain the increased preset gray threshold; the difference between the brightness ratio and the preset brightness ratio is positively correlated with the increase of the preset gray threshold by the gray threshold increase signal;
[0108] The above-mentioned determining the matching result between the target grayscale and the preset grayscale threshold includes: determining the matching result between the target grayscale and the increased preset grayscale threshold.
[0109] In the present embodiment, when the brightness ratio between the brightest part and the darkest part of the environment surrounding the lamp is small, it indicates that the lamp has a greater probability of being in a static scene, and thus, the refresh rate requirement for the lamp is relatively not so high at this time. Therefore, the preset grayscale threshold can be appropriately reduced to reduce the power consumption of the lamp by reducing the refresh rate of the lamp; when the brightness ratio between the brightest part and the darkest part of the environment surrounding the lamp is large, it indicates that the lamp has a greater probability of being in a scene with high dynamic range characteristics, and thus, the refresh rate of the lamp has a higher requirement at this time. Therefore, the preset grayscale threshold can be appropriately increased to increase the refresh rate of the lamp so that the light of the lamp has a better display effect, making the lamp more suitable for the scene where the lamp is located.
[0110] The application process of the grayscale adjustment method of the above-mentioned lamp is described below in conjunction with a detailed embodiment. As shown in FIG3 , the grayscale adjustment method of the lamp provided in this embodiment is applied to a lamp driver chip 30. The lamp driver chip 30 is connected to a lamp 32. The lamp driver chip 30 includes an input module 302, a grayscale display module 304, a PWM adjustment module 306, an ISET current adjustment module 308, and a constant current drive output module 310. The ISET current adjustment module 308 includes a plurality of resistors, which are as follows:
[0111] (1) The process of determining the current grayscale and the target grayscale
[0112] receiving a control signal for the lamp through the input module 302, so that the input module 302 analyzes the control signal to determine a target grayscale of the lamp 32 and determines a current grayscale of the lamp 32;
[0113] The current grayscale and the target grayscale of the lamp 32 are sent to the grayscale level display module 304 through the input module 302 .
[0114] (2) Process of determining matching results
[0115] The gray level display module 304 determines the matching result between the target gray level and the preset gray level threshold.
[0116] (3) Determination process of hybrid regulation mode
[0117] When the matching result is that the target grayscale is less than or equal to the preset grayscale threshold, the grayscale level display module 304 determines that the hybrid adjustment mode for the lamp is the first hybrid adjustment mode;
[0118] When the matching result is that the target grayscale is greater than the preset grayscale threshold, the grayscale level display module 304 determines that the hybrid adjustment mode for the lamp is the second hybrid adjustment mode.
[0119] (4) Process of obtaining the first adjustment signal and the second adjustment signal
[0120] The grayscale display module 304 drives the ISET current adjustment module 308 and the PWM adjustment module 306 to adjust the resistance value and the PWM pulse duty cycle based on the mixed adjustment mode, and obtains a first adjustment signal and a second adjustment signal respectively;
[0121] When the hybrid regulation mode is the first hybrid regulation mode, the PWM pulse duty cycle is fixed to the minimum duty cycle of the PWM pulse through the PWM regulation module 306 to obtain a second regulation signal; the grayscale difference after the target grayscale is subtracted from the current grayscale is determined through the grayscale display module 304; when the grayscale difference is a positive value, the grayscale display module 304 generates a resistance value reduction signal based on the grayscale difference, and sends the resistance value reduction signal to the ISET current regulation module 308, so that the ISET current regulation module 308 connects the multiple resistors based on the resistance value reduction signal The method is used to determine the resistance value to be adjusted to obtain the first adjustment signal; the grayscale difference is positively correlated with the reduction range of the resistance value by the resistance value reduction signal; when the grayscale difference is a negative value, the grayscale level display module 304 generates a resistance value increase signal based on the grayscale difference, and sends the resistance value reduction signal to the ISET current adjustment module 308, so that the ISET current adjustment module 308 adjusts the resistance value based on the resistance value increase signal to obtain the first adjustment signal; the grayscale difference is positively correlated with the increase range of the resistance value by the resistance value increase signal;
[0122] When the hybrid regulation mode is the second hybrid regulation mode, the resistance value is fixed to the minimum value of the resistance through the ISET current regulation module 308 to obtain the first regulation signal; the grayscale difference after the target grayscale is subtracted from the current grayscale is determined through the grayscale level display module 304; when the grayscale difference is a positive value, the grayscale level display module 304 generates a PWM pulse duty cycle increase signal based on the grayscale difference, and sends the PWM pulse duty cycle increase signal to the PWM regulation module 306, so that the PWM regulation module 306 adjusts the PWM pulse duty cycle based on the PWM pulse duty cycle increase signal to obtain the second regulation signal. The grayscale difference is positively correlated with the increase of the PWM pulse duty cycle by the PWM pulse duty cycle increase signal; when the grayscale difference is a negative value, the grayscale level display module 304 generates a PWM pulse duty cycle reduction signal based on the grayscale difference, and sends the PWM pulse duty cycle increase signal to the PWM regulation module 306, so that the PWM regulation module 306 adjusts the PWM pulse duty cycle based on the PWM pulse duty cycle reduction signal to obtain a second adjustment signal; the grayscale difference is positively correlated with the decrease of the PWM pulse duty cycle by the PWM pulse duty cycle reduction signal;
[0123] The second adjustment signal and the first adjustment signal are sent to the constant current drive output module 310 through the PWM adjustment module 306 and the ISET current adjustment module 308 respectively.
[0124] (5) Target grayscale adjustment process
[0125] Obtaining a mixed adjustment signal based on the first adjustment signal and the second adjustment signal through the constant current drive output module 310;
[0126] The constant current driving output module 310 performs grayscale adjustment on the lamp 32 based on the mixed adjustment signal, so as to adjust the lamp 32 from the current grayscale to the target grayscale.
[0127] In this embodiment, by determining the matching result between the target grayscale and the preset grayscale threshold, and determining the hybrid adjustment mode for the lamp as the first hybrid adjustment mode or the second hybrid adjustment mode based on the matching result, when the target grayscale is less than or equal to the preset grayscale threshold, when the hybrid adjustment mode is the first hybrid adjustment mode, the PWM pulse duty cycle is fixed to the minimum duty cycle of the PWM pulse to obtain the second adjustment signal, and based on the current grayscale and the target grayscale, the resistance value is adjusted to obtain the first adjustment signal, thereby reducing the contribution of the PWM adjustment mode in the low grayscale stage, and the contribution of the analog adjustment mode is mainly provided. The grayscale of the lamp is adjusted by the formula, so that the energy consumption of the lamp can be reduced when the grayscale accuracy requirement is not high; on the contrary, when the mixed adjustment mode is the second mixed adjustment mode, the resistance value is fixed to the minimum value of the resistance to obtain the first adjustment signal, and the PWM pulse duty cycle is adjusted based on the current grayscale and the target grayscale to obtain the second adjustment signal, thereby increasing the contribution of the PWM adjustment mode in the high grayscale stage, and maintaining the contribution of the analog adjustment at the maximum value, so that when the grayscale accuracy requirement is high, it can be ensured that the lamp has a grayscale adjustment effect with high accuracy and smooth transition in visual perception. Based on this, it can be seen that since the grayscale level that needs to be adjusted in the PWM adjustment mode is reduced, the time required to process each PWM cycle is also reduced. Then, when the clock frequency is not changed, the PWM cycle that can be processed in the same time is increased. Therefore, the grayscale adjustment method of the lamp provided in the embodiment of the present application can improve the refresh rate of the lamp.
[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0129] Based on the same inventive concept, the embodiment of the present application also provides a grayscale adjustment device for a lamp for implementing the grayscale adjustment method of the lamp involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the grayscale adjustment device for one or more lamps provided below can refer to the limitations of the grayscale adjustment method for the lamp above, and will not be repeated here.
[0130] In an exemplary embodiment, as shown in FIG. 4 , a grayscale adjustment device for a lamp is provided, comprising: a first determination module 402 , a second determination module 404 , a third determination module 406 and an adjustment module 408 , wherein:
[0131] A first determination module 402, used to determine the current grayscale and target grayscale of the lamp;
[0132] A second determination module 404 is used to determine a matching result between a target grayscale and a preset grayscale threshold;
[0133] The third determination module 406 is used to determine a hybrid adjustment mode for the lamp based on the matching result; the hybrid adjustment mode is the first hybrid adjustment mode or the second hybrid adjustment mode;
[0134] The adjustment module 408 is used to adjust the resistance value and the PWM pulse duty cycle respectively based on the mixed adjustment mode, so as to adjust the lamp from the current grayscale to the target grayscale.
[0135] In an exemplary embodiment, the above-mentioned adjustment module 408 is also used to adjust the resistance value and the PWM pulse duty cycle respectively based on the hybrid adjustment mode to obtain the first adjustment signal and the second adjustment signal respectively; based on the first adjustment signal and the second adjustment signal, a hybrid adjustment signal is obtained; based on the hybrid adjustment signal, the lamp is adjusted from the current grayscale to the target grayscale.
[0136] In an exemplary embodiment, the above-mentioned third determination module 406 is also used to determine that the hybrid adjustment mode for the lamp is the first hybrid adjustment mode when the matching result is that the target grayscale is less than or equal to the preset grayscale threshold; when the matching result is that the target grayscale is greater than the preset grayscale threshold, determine that the hybrid adjustment mode for the lamp is the second hybrid adjustment mode.
[0137] In an exemplary embodiment, the above-mentioned adjustment module 408 is also used to fix the PWM pulse duty cycle to the minimum duty cycle of the PWM pulse to obtain a second adjustment signal when the hybrid adjustment mode is the first hybrid adjustment mode; based on the current grayscale and the target grayscale, the resistance value is adjusted to obtain the first adjustment signal.
[0138] In an exemplary embodiment, the adjustment module 408 is also used to determine the grayscale difference after subtracting the current grayscale from the target grayscale; when the grayscale difference is a positive value, a resistance value reduction signal is generated based on the size of the grayscale difference, and the resistance value is adjusted based on the resistance value reduction signal to obtain a first adjustment signal; the size of the grayscale difference is positively correlated with the reduction amplitude of the resistance value by the resistance value reduction signal; when the grayscale difference is a negative value, a resistance value increase signal is generated based on the size of the grayscale difference, and the resistance value is adjusted based on the resistance value increase signal to obtain a first adjustment signal; the size of the grayscale difference is positively correlated with the increase amplitude of the resistance value by the resistance value increase signal.
[0139] In an exemplary embodiment, the above-mentioned adjustment module 408 is also used to fix the resistance value to the minimum value of the resistance to obtain a first adjustment signal when the hybrid adjustment mode is the second hybrid adjustment mode; based on the current grayscale and the target grayscale, the PWM pulse duty cycle is adjusted to obtain a second adjustment signal.
[0140] In an exemplary embodiment, the above-mentioned adjustment module 408 is also used to determine the grayscale difference after subtracting the current grayscale from the target grayscale; when the grayscale difference is a positive value, a PWM pulse duty cycle increase signal is generated based on the size of the grayscale difference, and the PWM pulse duty cycle is adjusted based on the PWM pulse duty cycle increase signal to obtain a second adjustment signal; the size of the grayscale difference is positively correlated with the increase amplitude of the PWM pulse duty cycle by the PWM pulse duty cycle increase signal; when the grayscale difference is a negative value, a PWM pulse duty cycle decrease signal is generated based on the size of the grayscale difference, and the PWM pulse duty cycle is adjusted based on the PWM pulse duty cycle decrease signal to obtain a second adjustment signal; the size of the grayscale difference is positively correlated with the decrease amplitude of the PWM pulse duty cycle by the PWM pulse duty cycle decrease signal.
[0141] Each module in the grayscale adjustment device of the above-mentioned lamp can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0142] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store grayscale data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a grayscale adjustment method of a lamp is implemented.
[0143] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a grayscale adjustment method of a lamp is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0144] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0145] In an exemplary embodiment, a lamp is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0146] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0147] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0148] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0149] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0150] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0151] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A grayscale adjustment method for a lamp, characterized in that: The method comprises: Determine the current grayscale and target grayscale of the lamp; Determine a matching result between the target grayscale and a preset grayscale threshold; Based on the matching result, determining a hybrid adjustment mode for the lamp; the hybrid adjustment mode is a first hybrid adjustment mode or a second hybrid adjustment mode; Based on the mixed adjustment mode, the resistance value and the PWM pulse duty cycle are adjusted respectively to adjust the lamp from the current grayscale to the target grayscale.
2. The method according to claim 1, characterized in that The step of adjusting the resistance value and the PWM pulse duty cycle based on the hybrid adjustment mode to adjust the lamp from the current grayscale to the target grayscale includes: Based on the hybrid adjustment mode, the resistance value and the PWM pulse duty cycle are adjusted respectively to obtain a first adjustment signal and a second adjustment signal respectively; Based on the first adjustment signal and the second adjustment signal, obtaining a mixed adjustment signal; Based on the mixed adjustment signal, the lamp is adjusted from the current grayscale to the target grayscale.
3. The method according to claim 2, characterized in that The step of determining a mixed adjustment mode for the lamp based on the matching result includes: When the matching result is that the target grayscale is less than or equal to the preset grayscale threshold, determining that the hybrid adjustment mode for the lamp is the first hybrid adjustment mode; When the matching result is that the target grayscale is greater than the preset grayscale threshold, it is determined that the hybrid adjustment mode for the lamp is the second hybrid adjustment mode.
4. The method according to claim 3, characterized in that: The step of adjusting the resistance value and the PWM pulse duty cycle based on the hybrid adjustment mode to obtain a first adjustment signal and a second adjustment signal respectively includes: When the hybrid regulation mode is the first hybrid regulation mode, fixing the PWM pulse duty cycle to a minimum duty cycle of the PWM pulse to obtain the second regulation signal; Based on the current grayscale and the target grayscale, the resistance value is adjusted to obtain the first adjustment signal.
5. The method according to claim 4, characterized in that The step of adjusting the resistance value based on the current grayscale and the target grayscale to obtain the first adjustment signal includes: Determine a grayscale difference value after subtracting the current grayscale from the target grayscale; When the grayscale difference is a positive value, a resistance value reduction signal is generated based on the grayscale difference, and the resistance value is adjusted based on the resistance value reduction signal to obtain the first adjustment signal; the grayscale difference is positively correlated with the reduction amplitude of the resistance value by the resistance value reduction signal; When the grayscale difference is a negative value, a resistance value increasing signal is generated based on the size of the grayscale difference, and the resistance value is adjusted based on the resistance value increasing signal to obtain the first adjustment signal; the size of the grayscale difference is positively correlated with the increase in the resistance value caused by the resistance value increasing signal.
6. The method according to claim 3, characterized in that The step of adjusting the resistance value and the PWM pulse duty cycle based on the hybrid adjustment mode to obtain a first adjustment signal and a second adjustment signal respectively includes: When the hybrid regulation mode is the second hybrid regulation mode, fixing the resistance value to a minimum resistance value to obtain the first regulation signal; Based on the current grayscale and the target grayscale, the PWM pulse duty cycle is adjusted to obtain the second adjustment signal.
7. The method according to claim 6, characterized in that The step of adjusting the PWM pulse duty cycle based on the current grayscale and the target grayscale to obtain the second adjustment signal includes: Determine a grayscale difference value after subtracting the current grayscale from the target grayscale; When the grayscale difference is a positive value, a PWM pulse duty cycle increase signal is generated based on the grayscale difference, and the PWM pulse duty cycle is adjusted based on the PWM pulse duty cycle increase signal to obtain the second adjustment signal; the grayscale difference is positively correlated with the increase of the PWM pulse duty cycle by the PWM pulse duty cycle increase signal; When the grayscale difference is a negative value, a PWM pulse duty cycle reduction signal is generated based on the size of the grayscale difference, and the PWM pulse duty cycle is adjusted based on the PWM pulse duty cycle reduction signal to obtain the second adjustment signal; the size of the grayscale difference is positively correlated with the reduction amplitude of the PWM pulse duty cycle by the PWM pulse duty cycle reduction signal.
8. A lamp, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
