Device control method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202610444670.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-07
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2046-04-07
AI Technical Summary
这种占空比的剧烈跳变,会使得功率器件承受巨大的电流和电压应力(即电应力),不仅可能导致电磁干扰问题,更会显著增加功率开关管过热甚至击穿损坏的风险
[0041]本申请实施例通过接收针对目标发光器件的控制指令,控制指令包括目标发光器件需要达到的目标亮度值;基于目标发光器件的器件类型,确定目标发光器件在目标亮度值下对应的初始最大占空比,初始最大占空比为驱动目标发光器件在参考工作状态参数下达到目标亮度值所需的脉冲信号的最大占空比;根据目标发光器件的工作状态参数,确定目标发光器件对应的至少一种占空比补偿系数;基于占空比补偿系数,对初始最大占空比进行修正处理,得到目标最大占空比;基于目标最大占空比和目标亮度值,对目标发光器件进行驱动。以此,通过根据目标发光器件的器件类型,确定目标发光器件在目标亮度值下对应的初始最大占空比,以及根据目标发光器件实际的工作状态参数,确定至少一种占空比补偿系数,以对初始最大占空比进行修正,得到匹配于目标发光器件的实际工作状态的目标最大占空比,从而基于动态确定的目标最大占空比,可以对目标发光器件进行精确驱动,避免采用固定占空比限值限制了驱动发光器件的控制系统在正常工况下的性能发挥,有效提升了设备控制效率。
Smart Images

Figure CN121985445B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a device control method, apparatus, electronic device, and storage medium. Background Technology
[0002] In drive control systems for light-emitting diodes (LEDs), to achieve fast response performance, the proportional (P) and integral (I) parameters of the PID controller are often set aggressively. This results in the controller calculating a huge control increment within a single cycle when brightness changes abruptly, causing the duty cycle of the pulse width modulation (PWM) signal output to the power switch to increase sharply, even reaching the maximum allowed by the hardware. This drastic change in duty cycle subjectes the power device to enormous current and voltage stress (i.e., electrical stress), which may not only cause electromagnetic interference problems but also significantly increase the risk of overheating or even breakdown of the power switch.
[0003] In existing output limiting protection methods, a fixed upper limit value is usually set for the PWM duty cycle. However, in order to ensure safety under the worst conditions, this upper limit value is usually set conservatively, which limits the performance of the control system under normal operating conditions and results in poor equipment control efficiency. Summary of the Invention
[0004] This application provides a device control method, apparatus, electronic device, and storage medium that can precisely drive a target light-emitting device based on a dynamically determined target maximum duty cycle. This avoids limiting the performance of the control system driving the light-emitting device under normal operating conditions by using a fixed duty cycle limit, and effectively improves device control efficiency.
[0005] This application provides a device control method, including:
[0006] Receive a control command for a target light-emitting device, the control command including a target brightness value that the target light-emitting device needs to achieve;
[0007] Based on the device type of the target light-emitting device, the initial maximum duty cycle corresponding to the target light-emitting device under the target brightness value is determined. The initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under the reference operating state parameters.
[0008] Based on the operating state parameters of the target light-emitting device, at least one duty cycle compensation coefficient corresponding to the target light-emitting device is determined;
[0009] Based on the duty cycle compensation coefficient, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle;
[0010] The target light-emitting device is driven based on the target's maximum duty cycle and the target's brightness value.
[0011] Accordingly, embodiments of this application also provide a device control apparatus, including:
[0012] A receiving unit is configured to receive a control command for a target light-emitting device, the control command including a target brightness value that the target light-emitting device needs to achieve.
[0013] The first determining unit is configured to determine, based on the device type of the target light-emitting device, the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value, wherein the initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters;
[0014] The second determining unit is used to determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating state parameters of the target light-emitting device.
[0015] The correction unit is used to correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle.
[0016] A driving unit is used to drive the target light-emitting device based on the target's maximum duty cycle and the target's brightness value.
[0017] In one embodiment, the driving unit is configured to:
[0018] Based on the target brightness value, calculate the duty cycle control increment corresponding to the target light-emitting device;
[0019] Based on the duty cycle control increment and the first duty cycle of the target light-emitting device in the previous control cycle, the second duty cycle of the target light-emitting device in the current control cycle is calculated;
[0020] When the second duty cycle is not greater than the target maximum duty cycle, the target light-emitting device is driven in the current control cycle based on the second duty cycle;
[0021] If the second duty cycle is greater than the target maximum duty cycle, the target light-emitting device is driven in the current control cycle based on the target maximum duty cycle.
[0022] In one embodiment, the first determining unit is configured to:
[0023] Based on the device type of the target light-emitting device, a target mapping relationship corresponding to the target light-emitting device is determined. The target mapping relationship is used to indicate the maximum duty cycle corresponding to a plurality of preset brightness values achieved by the target light-emitting device under reference operating state parameters. The brightness values include the target brightness value.
[0024] Based on the target mapping relationship, the initial maximum duty cycle of the target light-emitting device under the target brightness value is identified.
[0025] In some embodiments, the operating state parameter has at least one type, and the duty cycle compensation coefficient includes a duty cycle compensation coefficient corresponding to each of the operating state parameters.
[0026] In one embodiment, the operating state parameters include the LED temperature, the duty cycle compensation coefficient includes a first compensation coefficient, and the second determining unit is used for:
[0027] Based on the device type of the target light-emitting device, a first functional relationship is determined, which is used to indicate the first compensation coefficient of the target light-emitting device at different lamp bead temperatures;
[0028] Based on the first functional relationship and the lamp bead temperature of the target light-emitting device, the first compensation coefficient corresponding to the target light-emitting device is calculated.
[0029] In one embodiment, the operating state parameters include ambient temperature, the duty cycle compensation coefficient includes a second compensation coefficient, and the second determining unit is used for:
[0030] Based on the device type of the target light-emitting device, a second functional relationship is determined, which is used to indicate the second compensation coefficient of the target light-emitting device under different ambient temperatures;
[0031] Based on the second functional relationship and the ambient temperature of the target light-emitting device, the second compensation coefficient corresponding to the target light-emitting device is calculated.
[0032] In one embodiment, the operating state parameters include an input voltage, the reference operating state parameters include a reference input voltage, and the duty cycle compensation coefficient includes a third compensation coefficient; the second determining unit is configured to:
[0033] Calculate the voltage difference between the input voltage of the target light-emitting device and the reference input voltage;
[0034] Based on the voltage difference, the reference input voltage, and the initial maximum duty cycle, the third compensation coefficient corresponding to the target light-emitting device is calculated.
[0035] In one embodiment, the operating state parameters include LED temperature, ambient temperature, and input voltage; the duty cycle compensation coefficient includes a first compensation coefficient, a second compensation coefficient, and a third compensation coefficient obtained based on the LED temperature, the ambient temperature, and the input voltage, respectively; and the correction unit is used for:
[0036] The first maximum duty cycle is obtained by calculating the sum of the initial maximum duty cycle and the first compensation coefficient;
[0037] The target maximum duty cycle is obtained by multiplying the first maximum duty cycle, the second compensation coefficient, and the third compensation coefficient.
[0038] Furthermore, embodiments of this application also provide an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the device control methods provided in embodiments of this application.
[0039] Furthermore, embodiments of this application also provide a computer-readable storage medium including a computer program, which, when run on an electronic device, causes the electronic device to perform the steps of any of the device control methods provided in embodiments of this application.
[0040] Furthermore, embodiments of this application also provide a computer program product, including a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of any of the device control methods provided in embodiments of this application.
[0041] This application embodiment receives a control command for a target light-emitting device, the control command including a target brightness value to be achieved by the target light-emitting device; based on the device type of the target light-emitting device, determines the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value, the initial maximum duty cycle being the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters; based on the operating state parameters of the target light-emitting device, determines at least one duty cycle compensation coefficient corresponding to the target light-emitting device; based on the duty cycle compensation coefficient, corrects the initial maximum duty cycle to obtain the target maximum duty cycle; and drives the target light-emitting device based on the target maximum duty cycle and the target brightness value. Therefore, by determining the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, and by determining at least one duty cycle compensation coefficient based on the actual working state parameters of the target light-emitting device, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle that matches the actual working state of the target light-emitting device. Based on the dynamically determined target maximum duty cycle, the target light-emitting device can be precisely driven, avoiding the limitation of the control system driving the light-emitting device under normal working conditions by using a fixed duty cycle limit, and effectively improving the equipment control efficiency. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic diagram illustrating an implementation scenario of a device control method provided in this application embodiment;
[0044] Figure 2 This is a flowchart illustrating a device control method provided in an embodiment of this application;
[0045] Figure 3a This is a schematic diagram of duty cycle compensation for a device control method provided in an embodiment of this application;
[0046] Figure 3b This is a schematic flowchart of a device control method provided in the embodiments of this application;
[0047] Figure 4 This is a schematic diagram of the structure of the device control apparatus provided in the embodiments of this application;
[0048] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] Furthermore, in the description of the embodiments of this application, the terms "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0051] In control systems for driving power supplies of light-emitting diodes (LEDs), incremental PID algorithms are widely used due to their advantages such as simplicity, lack of error accumulation, and ease of achieving seamless switching. Their inherent ability to suppress integral saturation is particularly important in scenarios requiring frequent and rapid dimming. However, in pursuit of extremely fast response performance, the proportional (P) and integral (I) parameters of the PID controller are often set aggressively. This leads to the controller calculating a large control increment within a single cycle when brightness changes abruptly, causing the duty cycle of the pulse width modulation (PWM) signal output to the power switch to increase dramatically, even reaching the maximum allowed by the hardware. This drastic change in duty cycle subjectes the power device to enormous current and voltage stress (i.e., electrical stress), potentially causing electromagnetic interference and significantly increasing the risk of overheating or even breakdown of the power switch. Therefore, limiting and protecting the PWM duty cycle output is necessary. In existing output limiting protection methods, a fixed upper limit value is usually set for the PWM duty cycle. However, in order to ensure safety under the worst conditions, this upper limit value is usually set conservatively, which limits the performance of the control system under normal operating conditions and results in poor equipment control efficiency.
[0052] To address the aforementioned technical issues, this application provides a device control method. This method determines the initial maximum duty cycle of the target light-emitting device at a target brightness value based on its device type, and determines at least one duty cycle compensation coefficient based on the actual operating state parameters of the target light-emitting device. This corrects the initial maximum duty cycle, resulting in a target maximum duty cycle that matches the actual operating state of the target light-emitting device. Based on this dynamically determined target maximum duty cycle, the target light-emitting device can be precisely driven, avoiding the limitation imposed by a fixed duty cycle limit on the performance of the control system driving the light-emitting device under normal operating conditions, thus effectively improving device control efficiency.
[0053] This application provides a device control method, apparatus, electronic device, and storage medium. The device control apparatus can be integrated into an electronic device, which may be a server or a terminal, etc.
[0054] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), big data, and artificial intelligence platforms. The terminal can include, but is not limited to, lighting fixtures, smart projection devices, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, and aircraft. The terminal and server can be directly or indirectly connected via wired or wireless communication; this application does not impose any restrictions on this connection.
[0055] Please see Figure 1 Taking the integration of equipment control devices into electronic devices as an example, Figure 1 This is a schematic diagram illustrating an implementation scenario of the device control method provided in this application. The electronic device can receive control commands for a target light-emitting device, including a target brightness value that the target light-emitting device needs to achieve. Based on the device type of the target light-emitting device, an initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value is determined. The initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters. According to the operating state parameters of the target light-emitting device, at least one duty cycle compensation coefficient corresponding to the target light-emitting device is determined. Based on the duty cycle compensation coefficient, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle. Based on the target maximum duty cycle and the target brightness value, the target light-emitting device is driven.
[0056] It should be noted that, Figure 1The illustrated scenario of the device control method is merely an example. The implementation environment of the device control method described in this application is intended to more clearly illustrate the technical solution of the embodiments of this application and does not constitute a limitation on the technical solution provided in the embodiments of this application. Those skilled in the art will understand that, with the evolution of device control and the emergence of new business scenarios, the technical solution provided in this application is also applicable to similar technical problems.
[0057] The solutions provided in this application are specifically illustrated through the following embodiments. It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0058] This embodiment will be described from the perspective of a device control device, which can be integrated into an electronic device, such as a server or a terminal, and this application does not impose any restrictions on it.
[0059] Please see Figure 2 , Figure 2 This is a schematic flowchart of a device control method provided in an embodiment of this application. This device control method can be applied to a target device and includes:
[0060] In step 101, a control command for the target light-emitting device is received.
[0061] The control command may include the target brightness value that the target light-emitting device needs to achieve.
[0062] The target light-emitting device can be any light-emitting device currently being driven. This device can be an electronic device that converts electrical energy into light energy, such as an LED, laser diode, or organic light-emitting diode (OLED). The control command can be a command used to control the target light-emitting device, for example, to adjust its brightness. The target light-emitting device can be configured in a target device, which can be a lamp, display, interactive smart panel, smart home appliance, or other device equipped with a light-emitting device. The lamp can include film and television lights, photography lights, fill lights, etc. The target brightness value can be the brightness value that the target light-emitting device needs to achieve. This brightness value can be information used to control the luminous intensity of the target light-emitting device, representing the desired brightness level, and can typically be provided by external input (e.g., a dimming knob, application trigger commands, or ambient light sensor feedback). Each brightness value corresponds to a current value, which is the current value required for the light-emitting device to reach that brightness value. The greater the brightness value, the greater the corresponding current value, thus making the light-emitting device emit more light.
[0063] In one embodiment, a user can trigger control commands for a target light-emitting device in a target device in various ways, so that the target device can receive control commands for the target light-emitting device and drive the target light-emitting device based on the target brightness value indicated in the control commands.
[0064] For example, users can adjust the brightness by operating components such as rotation and buttons configured in the target device, thereby triggering control commands for the target light-emitting device in the target device; they can also issue control commands for the target light-emitting device in the target device through a terminal that has established a communication connection with the target device; or they can adjust the brightness of the target light-emitting device through a visual interface configured in the target device, thereby triggering control commands for the target light-emitting device in the target device, etc. The specific method can be set according to the actual situation, and this application embodiment does not limit it.
[0065] In step 102, based on the device type of the target light-emitting device, the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value is determined.
[0066] The initial maximum duty cycle can be the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under the reference operating state parameters.
[0067] The device type can be information indicating the type of the target light-emitting device. The reference operating state parameter can be an operating state parameter under reference conditions. The reference conditions can be the conditions under which the maximum duty cycle corresponding to a light-emitting device of the same type as the target light-emitting device is measured; for example, an ambient temperature of 25 degrees Celsius and the LED temperature of the light-emitting device at thermal equilibrium (e.g., 65 degrees Celsius). The operating state parameter can be a parameter characterizing the operating state of the light-emitting device; for example, it can include parameters such as input voltage, LED temperature, ambient temperature, and forward voltage. The pulse signal can be a pulse width modulation signal; for example, it can be a pulse width modulation (PWM) signal output to a power switch. The power switch can be a device connected to the target light-emitting device, used to efficiently convert input electrical energy into a constant current output suitable for the target light-emitting device to drive it.
[0068] Optionally, the power switch may include power switching devices of the type such as metal-oxide-semiconductor field-effect transistor (MOSFET) and bipolar junction transistor (BJT).
[0069] In one embodiment, the initial maximum duty cycle can be the maximum duty cycle (D_max) of the pulse width modulation signal allowed to be output to the power switch corresponding to the target light-emitting device in order to enable the target light-emitting device to reach the target brightness value under the reference operating state parameters.
[0070] The maximum duty cycle can refer to the maximum duty cycle of the pulse width modulation signal that can be output to the power switch under the premise of preventing system overload, saturation or device damage.
[0071] There are several ways to determine the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device. For example, the target mapping relationship of the target light-emitting device can be determined based on the device type of the target light-emitting device. The target mapping relationship is used to indicate the maximum duty cycle of the target light-emitting device at multiple preset brightness values under the reference working state parameters. The brightness value includes the target brightness value. Based on the target mapping relationship, the initial maximum duty cycle of the target light-emitting device at the target brightness value can be identified.
[0072] The target mapping relationship may include the mapping relationship between multiple brightness values that a light-emitting device of the same type as the target light-emitting device needs to achieve and the maximum duty cycle of the required pulse signal.
[0073] Optionally, this target mapping relationship can be pre-determined experimentally and stored as a lookup table or fitted as a function relationship. The higher the brightness value, the greater the maximum allowable duty cycle D_max, and its growth slope can be controlled to avoid abrupt changes in the duty cycle.
[0074] In one embodiment, for each type of light-emitting device, the maximum duty cycle of the pulse width modulation signal allowed to be output to the power switch when each brightness value is reached under reference operating state parameters can be measured. This allows the acquisition of multiple brightness values corresponding to each type of light-emitting device and the maximum duty cycle corresponding to each brightness value. Furthermore, a mapping relationship corresponding to each type of light-emitting device can be fitted or constructed, which can be used to compensate for changes in drive voltage requirements caused by device differences, thereby compensating for changes in the maximum duty cycle requirements caused by device differences.
[0075] The brightness value may include a target brightness value, or the target brightness value may be within a range of brightness values.
[0076] In step 103, at least one duty cycle compensation coefficient corresponding to the target light-emitting device is determined based on the operating state parameters of the target light-emitting device.
[0077] The duty cycle compensation coefficient can be used to correct the initial maximum duty cycle. The operating state parameters of the target light-emitting device can refer to the current actual operating state parameters of the target light-emitting device. Since the initial maximum duty cycle is the maximum duty cycle of the light-emitting device under the condition of the reference operating state parameters, but in actual use scenarios, the light-emitting device often does not operate based on the reference operating state parameters, in order to accurately determine the maximum duty cycle of the pulse signal corresponding to the light-emitting device, the initial maximum duty cycle can be compensated based on the current actual operating state parameters of the target light-emitting device, thereby improving the control accuracy of the equipment.
[0078] Optionally, the type of the working state parameter can be at least one, and the duty cycle compensation coefficient can include the duty cycle compensation coefficient corresponding to each working state parameter.
[0079] For example, the operating status parameter may include at least one of the lamp temperature, ambient temperature, and input voltage, and the duty cycle compensation coefficient may include at least one of the first compensation coefficient, the second compensation coefficient, and the third compensation coefficient.
[0080] The first compensation coefficient can be a duty cycle compensation coefficient calculated based on the LED temperature, also known as the bias coefficient (K_bias). The second compensation coefficient can be a duty cycle compensation coefficient calculated based on the ambient temperature, also known as the temperature compensation coefficient (K_temp). The third compensation coefficient can be a duty cycle compensation coefficient calculated based on the input voltage, also known as the input compensation coefficient (K_vin).
[0081] There are several ways to determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating state parameters of the target light-emitting device. For example, the operating state parameters may include the lamp bead temperature, and the duty cycle compensation coefficient may include a first compensation coefficient. A first functional relationship may be determined based on the device type of the target light-emitting device, and the first compensation coefficient corresponding to the target light-emitting device may be calculated based on the first functional relationship and the lamp bead temperature of the target light-emitting device.
[0082] The first functional relationship can be used to indicate the first compensation coefficient of the target light-emitting device at different lamp bead temperatures. It can be used to compensate for the difference in forward voltage variation of the same type of light-emitting device at different lamp bead temperatures, and for the difference caused by the maximum allowable duty cycle of the pulse signal. The forward voltage and the duty cycle of the pulse signal are positively correlated. This first compensation coefficient can be a coefficient greater than 0 and can be set according to the batch and type of the light-emitting device or through the initial calibration procedure.
[0083] Optionally, for each type of light-emitting device, the actual duty cycle of the pulse signal required for the light-emitting device to reach the reference brightness value at different lamp temperatures can be measured. The reference brightness value can be the target brightness value or include other brightness values used as references. Then, the first compensation coefficient corresponding to each lamp temperature can be determined based on the actual duty cycle corresponding to each lamp temperature, thereby obtaining the first functional relationship.
[0084] For example, the actual duty cycle corresponding to each LED temperature can be normalized to obtain the first compensation coefficient for each LED temperature. Alternatively, a reference LED temperature can be determined among multiple LED temperatures, and the ratio of the actual duty cycle corresponding to each LED temperature to the actual duty cycle corresponding to the reference LED temperature can be calculated to obtain the first compensation coefficient for each LED temperature.
[0085] In order to ensure the accuracy of compensation, when constructing the first functional relationship, in addition to the lamp bead temperature, other parameters of the light-emitting device measured, such as ambient temperature and input voltage, can be kept consistent with the reference operating state parameters.
[0086] Optionally, to improve the accuracy of compensation for the initial maximum duty cycle, the reference LED temperature can be the LED temperature of the light-emitting device used when measuring the initial maximum duty cycle.
[0087] In one specific embodiment, please refer to Figure 3a , Figure 3a This is a schematic diagram of duty cycle compensation for a device control method provided in this application embodiment. The horizontal axis represents the current value, and the vertical axis represents the output PWM duty cycle. Taking a bias coefficient K_bias of 0.03 as an example, curve B can be a curve indicating the maximum duty cycle of the pulse signal corresponding to each brightness value of the target light-emitting device, i.e., the target mapping relationship. Therefore, each maximum duty cycle can be compensated according to a first compensation coefficient. For example, the first compensation coefficient can be added to each maximum duty cycle to obtain the corrected curve A.
[0088] Optionally, there are multiple ways to determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating state parameters of the target light-emitting device. For example, the operating state parameters may include the current ambient temperature of the target light-emitting device, and the duty cycle compensation coefficient may include a second compensation coefficient. A second functional relationship may be determined based on the device type of the target light-emitting device. The second functional relationship is used to indicate the second compensation coefficient of the target light-emitting device under different ambient temperatures. Based on the second functional relationship and the ambient temperature of the target light-emitting device, the second compensation coefficient corresponding to the target light-emitting device is calculated.
[0089] The second functional relationship can be used to indicate the impact of different ambient temperatures on the duty cycle of the pulse signal. To further improve adaptability to changes in ambient temperature, this application embodiment can introduce a second compensation coefficient (i.e., temperature compensation coefficient K_temp). This temperature compensation coefficient can be related to the real-time acquired ambient temperature T, i.e., K_temp = f(T). The second functional relationship f(T) can be designed such that when the ambient temperature rises and causes the LED forward voltage to drop, K_temp is appropriately reduced, thereby slightly reducing D_max at high temperatures to prevent current overshoot; conversely, D_max can be slightly increased at low temperatures.
[0090] In one embodiment, the second functional relationship f(T) can be preset based on the datasheet of the LED device or related experimental data. For example, based on the difference in the duty cycle requirements of the LED pulse signal under different ambient temperatures, a function with ambient temperature as the independent variable and the second compensation coefficient as the dependent variable can be constructed as the second functional relationship. This embodiment of the application does not limit this.
[0091] Optionally, for each type of light-emitting device, the actual duty cycle of the pulse signal required for the light-emitting device to reach the reference brightness value at different ambient temperatures can be measured. The reference brightness value can be the target brightness value or include other brightness values used as references. Then, the first compensation coefficient corresponding to each ambient temperature can be determined based on the actual duty cycle corresponding to each ambient temperature, thereby obtaining the second functional relationship.
[0092] In order to ensure the accuracy of compensation, when constructing the second function relationship, in addition to the ambient temperature, other parameters of the light-emitting device, such as the temperature of the LED beads and the input voltage, can be kept consistent with the reference operating state parameters.
[0093] Optionally, there are multiple ways to determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating state parameters of the target light-emitting device. For example, the operating state parameters may include the current input voltage of the target light-emitting device, the reference operating state parameters may include the reference input voltage, and the duty cycle compensation coefficient may include a third compensation coefficient. The voltage difference between the input voltage of the target light-emitting device and the reference input voltage can be calculated. Based on the voltage difference, the reference input voltage, and the initial maximum duty cycle, the third compensation coefficient corresponding to the target light-emitting device is calculated.
[0094] There are several ways to calculate the third compensation coefficient corresponding to the target light-emitting device based on the voltage difference, reference input voltage, and initial maximum duty cycle. For example, the third compensation coefficient corresponding to the target light-emitting device can be calculated using the following formula:
[0095] K_vin=1-((1-D_max) / D_max )×((Vin_real-Vin_ref) / Vin_ref)
[0096] Where K_vin can be represented as the third compensation coefficient, D_max can be represented as the initial maximum duty cycle, (Vin_real-Vin_ref) can be represented as the voltage difference, Vin_real can be represented as the actual input voltage of the target light-emitting device, and Vin_ref can be represented as the reference input voltage value when calibrating D_max.
[0097] Therefore, in order to improve the adaptability of the control system for driving the target light-emitting device to the input voltage, this application embodiment introduces an input compensation coefficient, which is related to the real-time acquired input voltage Vin, i.e., K_vin = f(Vin). The function f(VIN) can be designed to appropriately increase K_vin when the input voltage drops, thereby increasing the maximum duty cycle limit at lower input voltages to meet the maximum current requirement; conversely, at higher input Vins, the maximum duty cycle limit can be slightly reduced.
[0098] In step 104, the initial maximum duty cycle is corrected based on the duty cycle compensation coefficient to obtain the target maximum duty cycle.
[0099] The maximum duty cycle of the target can be the maximum duty cycle after correction based on the duty cycle compensation coefficient, which is the corrected maximum duty cycle limit corresponding to the target light-emitting device.
[0100] There are several ways to correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle. For example, the operating state parameters may include the LED temperature, ambient temperature, and input voltage. The duty cycle compensation coefficient includes a first compensation coefficient, a second compensation coefficient, and a third compensation coefficient obtained based on the LED temperature, ambient temperature, and input voltage, respectively. The sum of the initial maximum duty cycle and the first compensation coefficient can be calculated to obtain the first maximum duty cycle. The product of the first maximum duty cycle and the second and third compensation coefficients can be calculated to obtain the target maximum duty cycle.
[0101] For example, the target maximum duty cycle after considering LED temperature, ambient temperature, device calibration, and input voltage compensation can be expressed as D_max_final = (D_max + K_bias) × K_temp × K_vin.
[0102] In step 105, the target light-emitting device is driven based on the target maximum duty cycle and the target brightness value.
[0103] There are several ways to drive the target light-emitting device based on the target maximum duty cycle and the target brightness value. For example, the duty cycle control increment corresponding to the target light-emitting device can be calculated based on the target brightness value; the second duty cycle of the target light-emitting device in the current control cycle can be calculated based on the duty cycle control increment and the first duty cycle of the target light-emitting device in the previous control cycle; if the second duty cycle is not greater than the target maximum duty cycle, the target light-emitting device can be driven based on the second duty cycle in the current control cycle; if the second duty cycle is greater than the target maximum duty cycle, the target light-emitting device can be driven based on the target maximum duty cycle in the current control cycle.
[0104] The duty cycle control increment can be the duty cycle increment calculated based on an incremental PID control algorithm. The first duty cycle can be the duty cycle of the pulse signal required by the target light-emitting device in the previous control cycle. The second duty cycle can be the duty cycle of the pulse signal required in the current control cycle.
[0105] There are several ways to calculate the duty cycle control increment of the target light-emitting device based on the target brightness value. For example, the difference between the current value corresponding to the target brightness value and the current value of the target light-emitting device can be calculated to obtain the current error value e(k). Then, an incremental PID algorithm can be used to calculate the required PWM duty cycle adjustment, i.e., the duty cycle control increment ΔD(k). The calculation formula of the incremental PID algorithm is: ΔD(k) = Kp × [e(k) - e(k-1)] + Ki × e(k) + Kd × [e(k) - 2e(k-1) + e(k-2)], where Kp, Ki, and Kd are the proportional, integral, and derivative gain coefficients, respectively, and e(k), e(k) and e(k-2) are the proportional, integral, and derivative gain coefficients, respectively. 1) e(k) 2) These are the error values for the current control cycle, the previous control cycle, and the control cycle before that, respectively.
[0106] Then, the sum of the duty cycle control increment and the first duty cycle of the target light-emitting device in the previous control cycle can be calculated to obtain the second duty cycle of the target light-emitting device in the current control cycle, D(k)pre = D(k-1) + ΔD(k). Next, D(k)pre can be restricted between 0 and D_max_final to obtain the final duty cycle D(k), and a drive signal is generated and output to the power switch to drive the target light-emitting device.
[0107] Therefore, in terms of software implementation, the incremental PID algorithm, dynamic limiting calculation, and compensation coefficient correction involved in the embodiments of this application can all be embedded in the microcontroller unit (MCU) of the LED driver of the light-emitting device. When the LED driver control system is powered on or the brightness command is updated, the corresponding initial D_max can be indexed according to the new target brightness value. Then, it is sequentially accumulated and multiplied by K_bias read from non-volatile memory, K_temp calculated in real time according to the current ambient temperature, and K_vin calculated in real time according to the currently detected input voltage to obtain D_max_final for the current control cycle. Then, normal incremental PID calculation is performed, and the PWM duty cycle calculation result is limited to the range [0, D_max_final] before being output. Therefore, the adaptive output limiting protection method for incremental PID control of LED driver provided in this application embodiment can calculate the maximum allowable PWM duty cycle based on the control command and the actual working state parameters, instead of using a fixed duty cycle limit. This allows for rapid dimming using incremental PID while dynamically and intelligently limiting the maximum output value of the PWM duty cycle, effectively suppressing the electrical stress of power devices, improving system reliability, and being compatible with different LED devices and temperature changes. This achieves an intelligent protection mechanism that balances rapid response, system safety, and adaptability to different operating conditions.
[0108] In one embodiment, please refer to Figure 3b , Figure 3b This is a schematic flowchart illustrating a device control method provided in this application embodiment. The device control method provided in this application embodiment can be applied to an LED driver control system. This control system may include a temperature sensor and processing circuit, an input voltage acquisition module, a bias coefficient storage unit, a dynamic limiting calculation module, a multiplier and limiter, an incremental PID controller, and a PWM signal generator. Specifically, the incremental PID controller can be used to calculate the duty cycle control increment; the dynamic limiting calculation module can be used to query or calculate the initial D_max based on the target brightness value; the bias coefficient storage unit can be used to store the K_bias value of a specific type of light-emitting device; the temperature sensor and processing circuit can be used to acquire ambient temperature information and calculate K_temp; the input voltage acquisition module can be used to acquire input voltage Vin information and calculate K_vin; the multiplier and limiter can be used to calculate D_max_final and limit the final output PWM duty cycle; and the PWM signal generator can be used to generate a drive signal based on the final limited duty cycle.
[0109] Therefore, the device control method provided in this application can effectively suppress electrical stress and improve reliability. Specifically, by dynamically limiting the duty cycle, it can fundamentally avoid drastic duty cycle jumps caused by aggressive PID parameters, making the switching process of the power switching transistor smoother, significantly reducing the electrical stress it bears, and improving system reliability and lifespan. Furthermore, this application can balance performance and safety; dynamic limiting can replace fixed limiting, allowing the system to fully utilize its performance within a safe range and achieve rapid response without compromising power devices. Next, this application has excellent adaptability; by introducing bias coefficients and temperature compensation coefficients, the system can adapt to the parameter differences of different LED devices and changes in the operating environment temperature, ensuring control accuracy and consistency, and enhancing product versatility. In addition, the PWM duty cycle limiting method provided in this application has low computational complexity and is easily implemented in software in a microcontroller or digital signal processor without increasing hardware costs.
[0110] In one embodiment, the device control method provided in this application can be applied to a target device, which may be configured with a target light-emitting device. Specifically, the target device can receive control commands for the target light-emitting device, determine the initial maximum duty cycle corresponding to the target light-emitting device at a target brightness value based on the device type of the target light-emitting device, then determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device according to the working state parameters of the target light-emitting device, and correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle, thereby driving the target light-emitting device in the target device based on the target maximum duty cycle and the target brightness value.
[0111] As can be seen from the above, the embodiments of this application receive control commands for a target light-emitting device, the control commands including the target brightness value that the target light-emitting device needs to achieve; based on the device type of the target light-emitting device, determine the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value, the initial maximum duty cycle being the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters; determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device according to the operating state parameters of the target light-emitting device; based on the duty cycle compensation coefficient, correct the initial maximum duty cycle to obtain the target maximum duty cycle; and drive the target light-emitting device based on the target maximum duty cycle and the target brightness value. Therefore, by determining the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, and by determining at least one duty cycle compensation coefficient based on the actual working state parameters of the target light-emitting device, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle that matches the actual working state of the target light-emitting device. Based on the dynamically determined target maximum duty cycle, the target light-emitting device can be precisely driven, avoiding the limitation of the control system driving the light-emitting device under normal working conditions by using a fixed duty cycle limit, and effectively improving the equipment control efficiency.
[0112] To better implement the above methods, embodiments of the present invention also provide a device control apparatus that can be integrated into an electronic device.
[0113] For example, such as Figure 4 The diagram shown is a structural schematic of a device control apparatus provided in an embodiment of this application. The device control apparatus may include a receiving unit 201, a first determining unit 202, a second determining unit 203, a correction unit 204, and a driving unit 205, as follows:
[0114] The receiving unit 201 is used to receive control instructions for the target light-emitting device, the control instructions including the target brightness value that the target light-emitting device needs to achieve;
[0115] The first determining unit 202 is used to determine the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device. The initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under the reference working state parameters.
[0116] The second determining unit 203 is used to determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the working state parameters of the target light-emitting device.
[0117] The correction unit 204 is used to correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle.
[0118] The driving unit 205 is used to drive the target light-emitting device based on the target maximum duty cycle and the target brightness value.
[0119] In one embodiment, the driving unit 205 is configured to:
[0120] Based on the target brightness value, calculate the duty cycle control increment corresponding to the target light-emitting device;
[0121] Based on the duty cycle control increment and the first duty cycle of the target light-emitting device in the previous control cycle, the second duty cycle of the target light-emitting device in the current control cycle is calculated.
[0122] If the second duty cycle is not greater than the target maximum duty cycle, the target light-emitting device is driven in the current control cycle based on the second duty cycle;
[0123] If the second duty cycle is greater than the target maximum duty cycle, the target light-emitting device is driven in the current control cycle based on the target maximum duty cycle.
[0124] In one embodiment, the first determining unit 202 is configured to:
[0125] Based on the device type of the target light-emitting device, the target mapping relationship corresponding to the target light-emitting device is determined. The target mapping relationship is used to indicate the maximum duty cycle corresponding to the target light-emitting device reaching multiple preset brightness values under reference working state parameters. The brightness values include the target brightness value.
[0126] Based on the target mapping relationship, the initial maximum duty cycle of the target light-emitting device at the target brightness value is identified.
[0127] In some embodiments, the operating state parameter has at least one type, and the duty cycle compensation coefficient includes a duty cycle compensation coefficient corresponding to each type of operating state parameter.
[0128] In one embodiment, the operating status parameters include the LED temperature, the duty cycle compensation coefficient includes a first compensation coefficient, and the second determining unit 203 is used for:
[0129] Based on the device type of the target light-emitting device, a first functional relationship is determined. The first functional relationship is used to indicate the first compensation coefficient of the target light-emitting device at different lamp bead temperatures.
[0130] Based on the first functional relationship and the lamp bead temperature of the target light-emitting device, the first compensation coefficient corresponding to the target light-emitting device is calculated.
[0131] In one embodiment, the operating state parameters include ambient temperature, the duty cycle compensation coefficient includes a second compensation coefficient, and the second determining unit 203 is used for:
[0132] Based on the device type of the target light-emitting device, a second functional relationship is determined. The second functional relationship is used to indicate the second compensation coefficient of the target light-emitting device under different ambient temperatures.
[0133] Based on the second functional relationship and the ambient temperature of the target light-emitting device, the second compensation coefficient corresponding to the target light-emitting device is calculated.
[0134] In one embodiment, the operating state parameters include the input voltage, the reference operating state parameters include the reference input voltage, and the duty cycle compensation coefficient includes a third compensation coefficient; the second determining unit 203 is used for:
[0135] Calculate the voltage difference between the input voltage of the target light-emitting device and the reference input voltage;
[0136] The third compensation coefficient corresponding to the target light-emitting device is calculated based on the voltage difference, the reference input voltage, and the initial maximum duty cycle.
[0137] In one embodiment, the operating state parameters include LED temperature, ambient temperature, and input voltage. The duty cycle compensation coefficients include a first compensation coefficient, a second compensation coefficient, and a third compensation coefficient obtained based on the LED temperature, ambient temperature, and input voltage, respectively. The correction unit 204 is used for:
[0138] The first maximum duty cycle is obtained by calculating the sum of the initial maximum duty cycle and the first compensation coefficient.
[0139] The target maximum duty cycle is obtained by multiplying the first maximum duty cycle, the second compensation coefficient, and the third compensation coefficient.
[0140] As can be seen from the above, in this embodiment of the application, the receiving unit 201 receives a control command for the target light-emitting device, the control command including the target brightness value that the target light-emitting device needs to achieve; the first determining unit 202 determines the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, the initial maximum duty cycle being the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under the reference working state parameters; the second determining unit 203 determines at least one duty cycle compensation coefficient corresponding to the target light-emitting device according to the working state parameters of the target light-emitting device; the correction unit 204 corrects the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle; and the driving unit 205 drives the target light-emitting device based on the target maximum duty cycle and the target brightness value. Therefore, by determining the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, and by determining at least one duty cycle compensation coefficient based on the actual working state parameters of the target light-emitting device, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle that matches the actual working state of the target light-emitting device. Based on the dynamically determined target maximum duty cycle, the target light-emitting device can be precisely driven, avoiding the limitation of the control system driving the light-emitting device under normal working conditions by using a fixed duty cycle limit, and effectively improving the equipment control efficiency.
[0141] Accordingly, this application also provides an electronic device, which can be a terminal, such as a smart home appliance, smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. Alternatively, the electronic device can be a server.
[0142] like Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 and the memory 302 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0143] The processor 301 is the control center of the electronic device 300. It connects various parts of the electronic device 300 through various interfaces and lines. By running or loading software programs and / or units stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the electronic device 300 and processes data. The processor 301 may be a CPU, GPU, network processor (NP), etc., and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0144] In this embodiment, the processor 301 in the electronic device 300 loads the instructions corresponding to the processes of one or more applications into the memory 302 according to the following steps, and the processor 301 runs the applications stored in the memory 302 to realize various functions, such as:
[0145] The system receives control commands for a target light-emitting device, including a target brightness value that the target light-emitting device needs to achieve. Based on the device type of the target light-emitting device, it determines the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value. The initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters. According to the operating state parameters of the target light-emitting device, it determines at least one duty cycle compensation coefficient corresponding to the target light-emitting device. Based on the duty cycle compensation coefficient, it corrects the initial maximum duty cycle to obtain the target maximum duty cycle. Based on the target maximum duty cycle and the target brightness value, it drives the target light-emitting device.
[0146] This solution can receive control commands for a target light-emitting device, including the target brightness value that the target light-emitting device needs to achieve; determine the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, where the initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters; determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device according to the operating state parameters of the target light-emitting device; correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle; and drive the target light-emitting device based on the target maximum duty cycle and the target brightness value. Therefore, by determining the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, and by determining at least one duty cycle compensation coefficient based on the actual working state parameters of the target light-emitting device, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle that matches the actual working state of the target light-emitting device. Based on the dynamically determined target maximum duty cycle, the target light-emitting device can be precisely driven, avoiding the limitation of the control system driving the light-emitting device under normal working conditions by using a fixed duty cycle limit, and effectively improving the equipment control efficiency.
[0147] Furthermore, the various functions implemented by running the application stored in memory 302 can also be found in the description of the foregoing embodiments, and will not be repeated here.
[0148] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0149] Optional, such as Figure 5 As shown, the electronic device 300 also includes: a touch display screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0150] The touch display screen 303 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301. It can also receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 303 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 303 can also be used as part of the input unit 306 to achieve input functions.
[0151] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.
[0152] Audio circuitry 305 can be used to provide an audio interface between a user and an electronic device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and then processed by processor 301 before being transmitted via radio frequency circuitry 304 to, for example, another electronic device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and electronic devices.
[0153] The input unit 306 can be used to receive input target video and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0154] Power supply 307 is used to supply power to various components of electronic device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0155] although Figure 5 As not shown in the diagram, the electronic device 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0156] In the above embodiments, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be found in the relevant descriptions of other embodiments. It should be noted that the electronic device provided in this application's embodiments and the device control method described in the above embodiments belong to the same concept, and its specific implementation process is detailed in the above method embodiments, and will not be repeated here.
[0157] As can be seen from the above, the electronic device provided in this application embodiment can receive control instructions for a target light-emitting device, the control instructions including a target brightness value to be achieved by the target light-emitting device; determine the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, the initial maximum duty cycle being the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters; determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device according to the operating state parameters of the target light-emitting device; correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle; and drive the target light-emitting device based on the target maximum duty cycle and the target brightness value. Therefore, by determining the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, and by determining at least one duty cycle compensation coefficient based on the actual working state parameters of the target light-emitting device, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle that matches the actual working state of the target light-emitting device. Based on the dynamically determined target maximum duty cycle, the target light-emitting device can be precisely driven, avoiding the limitation of the control system driving the light-emitting device under normal working conditions by using a fixed duty cycle limit, and effectively improving the equipment control efficiency.
[0158] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0159] Therefore, embodiments of this application provide a computer-readable storage medium, including a computer program, which, when run on an electronic device, causes the electronic device to execute any of the device control methods provided in embodiments of this application. For example, the computer program can execute the steps of the following device control method:
[0160] The system receives control commands for a target light-emitting device, including a target brightness value that the target light-emitting device needs to achieve. Based on the device type of the target light-emitting device, it determines the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value. The initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters. According to the operating state parameters of the target light-emitting device, it determines at least one duty cycle compensation coefficient corresponding to the target light-emitting device. Based on the duty cycle compensation coefficient, it corrects the initial maximum duty cycle to obtain the target maximum duty cycle. Based on the target maximum duty cycle and the target brightness value, it drives the target light-emitting device.
[0161] This solution can receive control commands for a target light-emitting device, including the target brightness value that the target light-emitting device needs to achieve; determine the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, where the initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters; determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device according to the operating state parameters of the target light-emitting device; correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle; and drive the target light-emitting device based on the target maximum duty cycle and the target brightness value. Therefore, by determining the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device, and by determining at least one duty cycle compensation coefficient based on the actual working state parameters of the target light-emitting device, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle that matches the actual working state of the target light-emitting device. Based on the dynamically determined target maximum duty cycle, the target light-emitting device can be precisely driven, avoiding the limitation of the control system driving the light-emitting device under normal working conditions by using a fixed duty cycle limit, and effectively improving the equipment control efficiency.
[0162] Furthermore, the detailed steps of the above method can be found in the description of the foregoing embodiments, and will not be repeated here.
[0163] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0164] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0165] Since the computer program stored in the computer-readable storage medium can execute any of the device control methods provided in the embodiments of this application, the beneficial effects that any of the device control methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0166] According to one aspect of this application, a computer program product is also provided, comprising a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the methods provided in various optional implementations of the above embodiments.
[0167] In the above embodiments of the device control apparatus, computer-readable storage medium, electronic device, and computer program product, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes and beneficial effects of the device control apparatus, computer-readable storage medium, computer program product, electronic device, and their corresponding units described above can be referred to the description of the device control method in the above embodiments, and will not be repeated here.
[0168] The foregoing has provided a detailed description of a device control method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A device control method, characterized in that, include: Receive a control command for a target light-emitting device, the control command including a target brightness value that the target light-emitting device needs to achieve; Based on the device type of the target light-emitting device, the initial maximum duty cycle corresponding to the target light-emitting device under the target brightness value is determined. The initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under the reference operating state parameters. Based on the operating state parameters of the target light-emitting device, at least one duty cycle compensation coefficient corresponding to the target light-emitting device is determined; Based on the duty cycle compensation coefficient, the initial maximum duty cycle is corrected to obtain the target maximum duty cycle. The target maximum duty cycle is the maximum duty cycle limit that matches the actual working state of the target light-emitting device after correction based on the duty cycle compensation coefficient. Based on the target brightness value, calculate the duty cycle control increment corresponding to the target light-emitting device; Based on the duty cycle control increment and the first duty cycle of the target light-emitting device in the previous control cycle, the second duty cycle of the target light-emitting device in the current control cycle is calculated; When the second duty cycle is not greater than the target maximum duty cycle, the target light-emitting device is driven in the current control cycle based on the second duty cycle; If the second duty cycle is greater than the target maximum duty cycle, the target light-emitting device is driven in the current control cycle based on the target maximum duty cycle.
2. The equipment control method as described in claim 1, characterized in that, The step of determining the initial maximum duty cycle of the target light-emitting device at the target brightness value based on the device type of the target light-emitting device includes: Based on the device type of the target light-emitting device, a target mapping relationship corresponding to the target light-emitting device is determined. The target mapping relationship is used to indicate the maximum duty cycle corresponding to a plurality of preset brightness values achieved by the target light-emitting device under reference working state parameters. The brightness values include the target brightness value. Based on the target mapping relationship, the initial maximum duty cycle of the target light-emitting device under the target brightness value is identified.
3. The equipment control method according to any one of claims 1 to 2, characterized in that, The operating state parameter has at least one type, and the duty cycle compensation coefficient includes a duty cycle compensation coefficient corresponding to each of the operating state parameters.
4. The equipment control method as described in claim 3, characterized in that, The operating status parameters include the LED temperature, the duty cycle compensation coefficient includes a first compensation coefficient, and determining at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating status parameters of the target light-emitting device includes: Based on the device type of the target light-emitting device, a first functional relationship is determined, which is used to indicate the first compensation coefficient of the target light-emitting device at different lamp bead temperatures; Based on the first functional relationship and the lamp bead temperature of the target light-emitting device, the first compensation coefficient corresponding to the target light-emitting device is calculated.
5. The equipment control method as described in claim 3, characterized in that, The operating status parameters include ambient temperature, the duty cycle compensation coefficient includes a second compensation coefficient, and determining at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating status parameters of the target light-emitting device includes: Based on the device type of the target light-emitting device, a second functional relationship is determined, which is used to indicate the second compensation coefficient of the target light-emitting device under different ambient temperatures; Based on the second functional relationship and the ambient temperature of the target light-emitting device, the second compensation coefficient corresponding to the target light-emitting device is calculated.
6. The equipment control method as described in claim 3, characterized in that, The operating state parameters include the input voltage, the reference operating state parameters include the reference input voltage, and the duty cycle compensation coefficient includes a third compensation coefficient; determining at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating state parameters of the target light-emitting device includes: Calculate the voltage difference between the input voltage of the target light-emitting device and the reference input voltage; Based on the voltage difference, the reference input voltage, and the initial maximum duty cycle, the third compensation coefficient corresponding to the target light-emitting device is calculated.
7. The equipment control method as described in claim 3, characterized in that, The operating status parameters include LED temperature, ambient temperature, and input voltage. The duty cycle compensation coefficient includes a first compensation coefficient, a second compensation coefficient, and a third compensation coefficient obtained based on the LED temperature, the ambient temperature, and the input voltage, respectively. The step of correcting the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle includes: The first maximum duty cycle is obtained by calculating the sum of the initial maximum duty cycle and the first compensation coefficient; The target maximum duty cycle is obtained by multiplying the first maximum duty cycle, the second compensation coefficient, and the third compensation coefficient.
8. A device control apparatus, characterized in that, include: A receiving unit is configured to receive a control command for a target light-emitting device, the control command including a target brightness value that the target light-emitting device needs to achieve. The first determining unit is configured to determine, based on the device type of the target light-emitting device, the initial maximum duty cycle corresponding to the target light-emitting device at the target brightness value, wherein the initial maximum duty cycle is the maximum duty cycle of the pulse signal required to drive the target light-emitting device to reach the target brightness value under reference operating state parameters; The second determining unit is used to determine at least one duty cycle compensation coefficient corresponding to the target light-emitting device based on the operating state parameters of the target light-emitting device. The correction unit is used to correct the initial maximum duty cycle based on the duty cycle compensation coefficient to obtain the target maximum duty cycle, wherein the target maximum duty cycle is the maximum duty cycle limit value that matches the actual working state of the target light-emitting device after correction based on the duty cycle compensation coefficient. The driving unit is configured to calculate the duty cycle control increment corresponding to the target light-emitting device based on the target brightness value, calculate the second duty cycle of the target light-emitting device in the current control cycle based on the duty cycle control increment and the first duty cycle of the target light-emitting device in the previous control cycle, drive the target light-emitting device in the current control cycle based on the second duty cycle if the second duty cycle is not greater than the target maximum duty cycle, and drive the target light-emitting device in the current control cycle based on the target maximum duty cycle if the second duty cycle is greater than the target maximum duty cycle.
9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the device control method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, Includes a computer program, which, when run on an electronic device, causes the electronic device to perform the steps of the device control method of any one of claims 1 to 7.
Citation Information
Patent Citations
Predictive control of power converter for LED driver
CN103188853A
Dimmer control circuit, method and system
CN110300476A