Power adaptive method, apparatus, device and program product
Through the power adaptive method, the equipment load power is gradually increased and the power supply voltage is detected, and the maximum operating power is determined to control the load operation, which solves the problem that the USB interface adapter cannot meet the high power requirements and improves the stability and user experience of the device.
Patent Information
- Application Number
- CN202510579464.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-05-07
AI Technical Summary
In the prior art, USB interface adapters cannot meet the lighting products with high power requirements, resulting in insufficient power supply, the product cannot work or restart frequently, affecting the user experience.
Through a power adaptive method, the control device gradually increases the load power and detects the controller power supply voltage. When the power supply voltage is lower than the preset first voltage threshold, the maximum operating power matched by the power supply is determined and the load operation is controlled as the power upper limit.
It effectively avoids the inability to work or restart the equipment caused by insufficient power supply, improves the user experience, and ensures that the equipment operates stably under the maximum operating power state.
Smart Images

Figure CN120122776A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power control, and particularly to a power adaptation method, apparatus, device, and program product. Background Art
[0002] With its standardization and plug-and-play characteristics, the USB interface has become a general solution in the field of power supply for electronic devices. Based on the 5V DC power supply standard of this interface, a large number of USB power adapters that convert mains power (110V / 220V) to 5V have been derived and are widely used in small lighting devices such as gift light strips, decorative light strings, curtain lights, and low-power devices such as small-sized LED dot matrix displays.
[0003] Due to the voltage compatibility characteristics of the USB interface, products can be powered without an attached power supply, which can significantly reduce the production costs of manufacturers, reduce the trouble of different mains plug certifications, and is beneficial to improving the environmental protection of products. However, as the number of lights in lighting products increases and the brightness requirements become higher, the USB interface adapters may not be able to meet the product requirements, and other higher-power power adapters are needed, including power adapters such as 5V / 3A, 5V / 5A, and even 5V / 10A for power supply.
[0004] During the use of user products, if the product power does not match the adapter power, for example, a high-power product is connected to a low-power USB interface or adapter, the product may have problems such as not working or restarting due to insufficient power supply, which is not conducive to improving the user experience. Summary of the Invention
[0005] In view of this, embodiments of this application provide a power adaptation method, apparatus, device, and program product to solve the problem that when the product power does not match the adapter power in the prior art, the product may not work or restart, which is not conducive to improving the user experience.
[0006] The first aspect of the embodiments of this application provides a power adaptation method, which is used for a device with adjustable power. The method includes: When the device is connected to a power supply, controlling the device to gradually increase the load power; Detecting the supply voltage of the controller of the device, comparing the supply voltage of the controller with a preset first voltage threshold, where the first voltage threshold is determined according to the minimum operating voltage of the controller of the device and / or the maximum operating current of the power supply; When it is first detected that the supply voltage of the controller is lower than the first voltage threshold, determining the maximum operating power that matches the power supply; Controlling the load to work with the maximum operating power as the power upper limit of the device.
[0007] In combination with the first aspect, in the first possible implementation manner of the first aspect, controlling the load to operate with the maximum operating power as the power upper limit of the device includes: Receiving a power control instruction of the device and determining an expected power of the power control instruction; When the expected power is greater than the maximum operating power, determining a target power according to the expected power and a preset attenuation coefficient; Controlling the load to operate according to the target power.
[0008] In combination with the first possible implementation manner of the first aspect, in the second possible implementation manner of the first aspect, determining a target power according to the expected power and a preset attenuation coefficient includes: Determining an attenuation coefficient according to a ratio of the expected power to the maximum operating power; Determining the target power according to a product of the attenuation coefficient and the expected power.
[0009] In combination with the first possible implementation manner of the first aspect, in the third possible implementation manner of the first aspect, the first voltage threshold is greater than the lowest operating voltage of the controller of the device; When first detecting that the power supply voltage of the controller is lower than the first voltage threshold, determining the maximum operating power matched by the power supply includes: When first detecting the load power when the power supply voltage of the controller is lower than the first voltage threshold, determining the load power as the maximum operating power matched by the power supply.
[0010] In combination with the first aspect, in the fourth possible implementation manner of the first aspect, before detecting the power supply voltage of the controller of the device and comparing the power supply voltage of the controller with a preset first voltage threshold, the method further includes: Determining a minimum controller power supply voltage corresponding to the maximum operating current according to a corresponding relationship between a preset power supply operating current and the power supply voltage of the controller of the device; Determining, as the first voltage threshold, a maximum value of the lowest operating voltage of the controller of the device and the minimum controller power supply voltage.
[0011] In combination with the first aspect, in the fifth possible implementation manner of the first aspect, when the device is connected to a power supply, controlling the device to gradually increase the load power includes: When the device is connected to a power supply, determining a preset initial load power as the current load power and writing the current load power to a predetermined first address pointed to by a pointer; Execute the following steps multiple times: When the controller supply voltage corresponding to the current load power is less than or equal to the first voltage threshold, move the address pointer to the next address of the currently pointed address, update the load power according to a predetermined power increase amplitude, and write the updated load power to the next address until the controller supply voltage corresponding to the current load power is greater than the first voltage threshold, or the updated load power is greater than or equal to the rated power of the device.
[0012] Combined with the fifth possible implementation manner of the first aspect, in the sixth possible implementation manner of the first aspect, after the controller supply voltage corresponding to the current load power is greater than the first voltage threshold, or the updated load power is greater than or equal to the rated power of the device, the method further includes: Write a predetermined first value to the storage space of the preset second address, where the second address is the previous address of the first address; Before determining that the preset initial load power is the current load power and writing the current load power to the predetermined first address currently pointed to by the pointer, the method further includes: When it is detected that the second address is the first value, erase the data in the sector where the first address is located, write a second value to the storage space of the second address, and execute to determine that the preset initial load power is the current load power and write the current load power to the predetermined first address currently pointed to by the pointer; When it is detected that the second address is the second value, determine the overcurrent protection power for avoiding the overcurrent protection action of the power supply response, and control the load to work according to the overcurrent protection power as the power upper limit of the device.
[0013] Combined with the sixth possible implementation manner of the first aspect, in the seventh possible implementation manner of the first aspect, determining the overcurrent protection power for avoiding the overcurrent protection action of the power supply response includes: Determine the third address of the first storage space that has not been written with data after the first address; Determine the fourth address before the third address, and determine the load power written in the storage space of the fourth address as the overcurrent protection power.
[0014] A second aspect of the embodiments of the present application provides a power adaptive device, which is used for a device with adjustable power. The device includes: A load power control unit, configured to control the device to gradually increase the load power when the device is connected to the power supply; A voltage comparison unit for detecting the power supply voltage of the controller of the device, comparing the power supply voltage of the controller with a preset first voltage threshold, where the first voltage threshold is determined according to the minimum operating voltage of the controller of the device and / or the maximum operating current of the power supply; A maximum operating power determination unit for determining the maximum operating power matched by the power supply when it is first detected that the power supply voltage of the controller is lower than the first voltage threshold; A load control unit for controlling the load to operate with the maximum operating power as the power upper limit of the device.
[0015] A third aspect of the embodiments of the present application provides a power adaptive device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the power adaptive device implements the method according to any one of the first aspects.
[0016] A fourth aspect of the embodiments of the present application provides a computer program product, which when running on a computer, causes the computer to execute the method in the above first aspect or its various implementation manners.
[0017] A fifth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of the first aspects are implemented.
[0018] A sixth aspect of the embodiments of the present application provides a chip for implementing the methods in the various implementation manners in the above first aspect. Specifically, the above chip includes: a processor for calling and running a computer program from a memory, so that a device installed with the above chip executes the method in the above first aspect or its various implementation manners.
[0019] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: When the device is connected to the power supply and powered on, the embodiments of the present application control the device to gradually increase the load power and detect the power supply voltage of the controller of the device. The power supply voltage of the controller of the device is compared with a predetermined first voltage threshold. When it is first detected that the power supply voltage of the controller is lower than the first voltage threshold, the maximum operating power is determined, so that in the state of the maximum operating power, the power supply voltage of the controller is higher than the minimum operating voltage of the controller, and / or the operating current is less than the maximum operating current of the power supply, thereby preventing the device from malfunctioning or restarting due to insufficient power supply, which is beneficial to improving the user experience. Description of the Drawings
[0020] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0021] Figure 1 is a schematic diagram of an implementation scenario of a power adaption method provided by an embodiment of the present application; Figure 2 is a schematic diagram of an implementation process of a power adaption method provided by an embodiment of the present application; Figure 3 is a schematic diagram of data storage of a power adaption provided by an embodiment of the present application; Figure 4 is a schematic diagram of an implementation process of adaptively adjusting the power of an LED device provided by an embodiment of the present application; Figure 5 is a schematic diagram of the change of the supply voltage of the controller of a device and the device current provided by an embodiment of the present application; Figure 6 is a schematic diagram of a power adaption device provided by an embodiment of the present application; Figure 7 is a schematic diagram of a power adaption device provided by an embodiment of the present application. Detailed implementation manners
[0022] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are presented to thoroughly understand the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, the detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0023] To illustrate the technical solutions described in the present application, the following will be described through specific embodiments.
[0024] With its standardized and plug-and-play characteristics, the USB interface has become a general solution in the field of power supply for electronic devices. Based on the 5V DC power supply standard of this interface, a large number of USB power adapters that convert mains power (110V / 220V) to 5V have emerged. These adapters are widely used in small lighting devices such as gift light strips, decorative light strings, curtain lights, and low-power devices such as small-sized LED dot matrix screens.
[0025] The voltage compatibility feature of the USB interface enables the product to operate without an additional dedicated power supply, significantly reducing the manufacturer's production costs and streamlining the cumbersome process of different mains plug certifications, which is conducive to enhancing the environmental friendliness of the product. However, with the increasing number of lamp beads and higher brightness requirements in lighting products, traditional USB interface adapters may not be able to meet their power demands, and higher-power power adapters are needed for power supply, such as 5V3A, 5V5A, or even 5V10A power adapters.
[0026] During user operation, if the product power does not match the adapter power, for example, connecting a high-power product to a low-power USB interface or adapter, the product may experience problems such as failure to work or frequent restart due to insufficient power supply, which will seriously affect the user experience.
[0027] To solve the above problems, the embodiments of this application propose a power self-adaptive method for power-adjustable devices, as Figure 1 shown in the schematic diagram of the implementation scenario of this method. The implementation scenario includes a power supply and a device. Among them, the power supply can be a USB adapter, such as the mains-to-5V adapter in the figure. The mains can be 110V or 220V alternating current. The adapter can be used to convert the mains into a voltage VCC1 that conforms to the USB standard, and the corresponding ground voltage is GND1. It is not limited to Figure 1 shown, and it can also include an adapter for outputting other voltages. The device includes a controller and a load. Among them, the load can be a lamp load, including lighting fixtures, dot matrix screens, or other power-adjustable devices. The controller can be used to gradually increase the load power and detect the controller supply voltage VVC2 of the load according to the change of the load power. The corresponding ground voltage is GND2. When the controller supply voltage is lower than a preset first voltage threshold, the maximum operating power of the device is determined, and the load of the device is controlled to work based on this maximum operating power as the power upper limit. Since the first voltage threshold is determined according to the lowest operating voltage of the device's controller and / or the maximum operating current of the power supply, and the first voltage threshold is higher than the lowest operating voltage of the controller, during the operation of the device, the operating voltage of the controller will not be lower than the lowest operating voltage, and / or the operating current is less than the maximum operating current of the power supply, so that the device will not experience problems such as failure to work or restart due to insufficient power supply, which is conducive to enhancing the user experience.
[0028] Figure 2 The following is a schematic diagram of the implementation process of a power self-adaptive method provided by the embodiments of this application: In S201, when the device is connected to the power supply, control the device to gradually increase the load power.
[0029] The device in the embodiments of the present application can be a plug-and-play and power-adjustable electronic device. For example, the device can include a power-adjustable lighting fixture or a power-adjustable LED display screen, etc.
[0030] The power supply in the embodiments of the present application can include an adapter that matches the operating voltage of the device. For example, for an electrical device with a USB interface voltage matching and an operating voltage of 5V, it includes, such as, a light strip, a string of lights, a small-sized LED screen, etc.
[0031] Since the rated power of the power supply may be different each time the device is connected to the power supply. For example, when the device is connected to a power supply in the form of an adapter through a USB interface, the output of the first adapter is (5V, 1A), and the output of the second adapter is (5V, 10A). If the maximum power of the device is 10W, when the device is connected to the second adapter, the maximum output power of the second adapter is 50W. When the device is in the working state of the maximum power, the supply voltage of the device controller generally does not drop significantly and can usually meet the working requirements of the full power range of the device. When the device is connected to the first adapter, when the power of the device is greater than 5W, the load power of the device usually drops significantly. If the drop amplitude of the supply voltage of the device controller is too large, it will affect the normal operation of the device controller and cause the device to operate abnormally. Therefore, when the device is connected to the power supply and the rated power of the power supply is unknown, the embodiments of the present application can determine the maximum operating power allowed by the currently used power supply by gradually increasing the load power. When the device operates at this maximum operating power, the probability of the device not working or restarting can be effectively reduced.
[0032] When gradually increasing the load power in the embodiments of the present application, the initial load power can be determined first. The initial load power can be a relatively small power and can be determined according to the power increase amplitude. For example, if the power increase amplitude is 5% of the maximum power of the device, the initial load power can be 5% of the maximum power of the device.
[0033] Considering that the initial load power determined according to a single power increase amplitude is relatively small, to improve the adaptive efficiency, the embodiments of the present application can determine the initial load power according to the minimum power of the power supplies existing in the market in combination with the power increase amplitude. For example, the initial load power can be determined to be 2 power increase amplitudes (if the power increase amplitude is 5% of the maximum power of the device, 2 power increase amplitudes are 10% of the maximum power of the device), or 3 power increase amplitudes.
[0034] The power increase amplitude in the embodiments of the present application can determine the specific value to be used according to the accuracy requirement of the maximum operating power. Generally, the smaller the power increase amplitude, the higher the accuracy of the determined maximum operating power.
[0035] In an embodiment of the present application, when the device is an LED display device such as a lighting fixture or an LED screen, the load power of the device can be mapped and represented by the sum of the brightness control values of all the LEDs in the device. The brightness control value of an LED can be a specific RGB control value or the brightness value of the device.
[0036] Generally, the color encodings presented by LED lights include color encodings such as RGB565, RGB555, and RGB888. Taking the RGB888 color encoding as an example, the primary colors of R, G, and B have 256 control values from 0 to 255. 0 represents turning off the light, 1 to 255 represent different brightness levels, and 255 represents the highest brightness with 100% duty cycle control. Different colors of the LED light can be achieved by controlling R, G, and B to light up in different proportions. For example, when controlling a certain light to be white at 100% brightness, the corresponding RGB control values are 255, 255, 255; when controlling a certain light to be white at 50% brightness, multiply the three 255 control values by 0.5, and the RGB control values are 128, 128, 128; when controlling a certain light to be purple at 100% brightness, the RGB control values are 255, 0, 255. Therefore, the sum of the brightness control values of all the LEDs in the device can be expressed as: Y = R1 + B1 + G1 + R2 + G2 + B2 … RN + GN + BN, where N is the number of lamp bead modules or pixels, and each lamp bead module or pixel includes three LED lamp beads of R, G, and B.
[0037] The brightness value of the device can be any value within the brightness value range. For example, if the maximum brightness in the brightness range is 100, then a brightness of 5 means that the brightness of the device is 5% of the maximum brightness.
[0038] When it is necessary to compare the power, it is necessary to unify the power representation form. For example, the brightness value can be converted into a brightness control value. For example, if the brightness value is b, when converting it into a brightness control value, it can be expressed as: X = N * 3 * 255 * b / 100.
[0039] Where X is the converted brightness control value, N is the number of RGB lamp bead modules, and b is the brightness value.
[0040] In S202, the power supply voltage of the controller of the device is detected and compared with a preset first voltage threshold.
[0041] Wherein, the first voltage threshold is determined according to the minimum operating voltage of the controller of the device and / or the maximum operating current of the power supply.
[0042] As Figure 1 shown, the controller is connected in parallel with the load, and the wire has resistance. For example Figure 1As shown, the resistor includes the resistance between the positive pole of the power supply represented by R1 and the first detection point of the supply voltage of the controller, and the resistance between the negative pole of the power supply represented by R2 and the second detection point of the supply voltage of the controller. The first detection point is the power supply detection point located on the positive line, and the second detection point is the power supply detection point located on the ground line.
[0043] When the controller controls the device to work and gradually increases the load power, the current passing through R1 and R2 will gradually increase, and the voltage division at R1 and R2 will also become larger and larger. The supply voltage of the controller can be expressed as: VCC2 - GND2 = (VCC1 - GND1) - UR1 - UR2, where UR1 is the voltage across resistor R1 and UR2 is the voltage across resistor R2.
[0044] The higher the load power, the greater the current passing through R1 and R2. According to U = I * R, the voltage drops of UR1 and UR2 will also be greater. Therefore, the supply voltage of the controller detected by the controller, VCC2 - GND2, will be smaller. In general, when the load power of the power supply is greater than its output power, the voltage output by the power supply to the detection point of the supply voltage of the controller will also drop from 5V to 4.5V or lower. In the embodiments of the present application, the change in the supply voltage of the controller is detected, and power adaptive control is achieved based on this change.
[0045] Since the controller usually has a limit on the minimum operating voltage. For example, the minimum operating voltage of the controller is Umin = 2.4V. When the supply voltage applied to the controller is lower than Umin, the controller cannot work. Therefore, when performing adaptive processing, it is necessary to make the supply voltage of the controller greater than the minimum operating voltage Umin. When determining the first voltage threshold based on the minimum operating voltage, the minimum operating voltage can be directly used as the first voltage threshold, or a predetermined voltage margin can be added on the basis of the minimum operating voltage. For example, if the minimum operating voltage of the controller is 2.4V, the first voltage threshold can be set to 3.0V. Through the design of the voltage margin, when it is first detected that the supply voltage of the controller is lower than the first voltage threshold, the current load power can be directly used as the maximum operating power. The magnitude of this voltage margin should be greater than the maximum change in the supply voltage of the controller caused by increasing the load by a single time, such as when increasing the load by 5%.
[0046] In the embodiments of the present application, considering the influence of the power supply current on the contact temperature, since the contact area is small and the current-carrying capacity is small, if a large current is continuously output to the backend load for a long time, the power supply socket (such as a USB socket) will become hot, affecting the safety of device use.
[0047] To improve the safety of device use, the embodiments of this application need to set the maximum operating current of the device. When the operating current of the device is less than this maximum operating current, overheating can be effectively reduced. The corresponding minimum controller supply voltage can be combined with the maximum operating current to determine the first voltage threshold. The minimum controller supply voltage is the supply voltage of the controller when the device is at the maximum operating current.
[0048] When determining the controller supply voltage corresponding to the maximum operating current, an auxiliary measurement can be carried out in combination with a multimeter or an ammeter. For example, by adjusting the load power of the device, the operating current of the device can be gradually increased. An ammeter, a multimeter, or a USB power meter can be connected after the power supply to detect whether the operating current reaches the maximum operating current. When the detected operating current is the maximum operating current, the current controller supply voltage is obtained, which is the minimum controller supply voltage.
[0049] When determining the first voltage threshold based on the minimum controller supply voltage and the lowest operating voltage, the maximum value of the minimum controller supply voltage and the lowest operating voltage can be selected, and the first voltage threshold can be determined in combination with the voltage margin. For example, if the lowest operating voltage determined by adaptive detection is 3.0V and the minimum controller supply voltage determined based on anti-overheating safety considerations is 3.5V, then in combination with the voltage margin, such as the voltage margin being 0.3V, the first voltage threshold can be determined to be 3.8V. Compared with the method of testing by connecting a high-power resistor in series, since there is no need to connect a high-power resistor in series, this method will not have the problem of resistor overheating and can effectively reduce the volume of the circuit board.
[0050] In S203, when it is first detected that the controller supply voltage is lower than the first voltage threshold, the maximum operating power matching the power supply is determined.
[0051] As the load power increases, the controller supply voltage will gradually decrease. Each time the load power of the device changes (for example, each time the load power is increased according to a predetermined power increase amplitude), the corresponding controller supply voltage can be detected and compared with the preset first voltage threshold. When there is a voltage margin in the first voltage threshold, that is, the first voltage threshold is greater than the lowest operating voltage and / or the first voltage threshold is greater than the minimum controller supply voltage. If it is first detected that the controller supply voltage is lower than the first voltage threshold, it indicates that the current operating current has a greater impact on the controller supply voltage. If the load power continues to increase, it may cause the controller to fail to work or restart. The load power corresponding to the current state can be determined as the maximum operating power matching the power supply.
[0052] In a possible implementation, if the first voltage threshold is not set or does not include a voltage margin, that is, the first voltage threshold is the lowest operating voltage or the minimum controller operating voltage, the load power of the previous state of the current state can be used as the maximum operating power matched by the power supply, and the operating power of the device can be adaptively adjusted within the range corresponding to the maximum operating power (0 - maximum operating power).
[0053] In a possible implementation, as the load power of the device increases until the load power increases to the maximum value of the load power of the device, such as increasing to the rated power of the device, and the detected controller supply voltage is less than or equal to the first voltage threshold, it indicates that the power supply can provide a relatively reliable operating voltage for the device, and it can be determined that the maximum operating power matched by the power supply is the maximum value of the load power of the device, and the power of the device can be adjusted arbitrarily within the range where the maximum value of the load power is located, such as arbitrarily adjusting the brightness of the LED lamp.
[0054] In S204, the load is controlled to work with the maximum operating power as the power upper limit of the device.
[0055] According to the above description, the maximum operating power may be less than the maximum value of the load power of the device or may be equal to the maximum value of the load power of the device.
[0056] If the maximum operating power is equal to the maximum value of the load power of the device, it is not necessary to adjust the load power of the device, and the load can be directly controlled to work according to the desired power determined by the power control instruction.
[0057] If the maximum operating power is less than the maximum value of the load power of the device, it is necessary to further determine the desired power of the currently received power control instruction. If the desired power is greater than the maximum operating power, it is necessary to adaptively adjust the desired power to determine the target power, and the load is controlled to work according to the target power. For example, the target power can be determined according to the desired power and a preset attenuation coefficient. The attenuation coefficient can be the ratio of the desired power to the maximum operating power, and the target power is determined according to the product of the attenuation coefficient and the desired power.
[0058] For example, the maximum operating power is P1, and the desired power is P2. If the desired power P2 is greater than the maximum operating power P1, the attenuation coefficient can be expressed as: P1 / P2. According to the product of the attenuation coefficient and the desired power, that is, P2*(P1 / P2)=P1, the desired power greater than the maximum operating power is attenuated to the maximum operating power, and the maximum operating power is used as the target power to control the load to work.
[0059] Not limited thereto, the attenuation coefficient can also be determined according to the ratio of the maximum operating power to the rated power of the device, the desired power is attenuated according to the attenuation coefficient, and the target power is determined according to the product of the attenuation coefficient and the desired power. For example, if the desired power is P2 and the rated power of the device is P3, then the target power is: P2 * (P2 / P3).
[0060] In the process of adaptively determining the maximum operating power, in order to improve the service life of the memory, in the embodiment of the present application, when the device is connected to the power supply, that is, when the controller is powered on, the preset initial load power can be determined as the current load power, and the current load power is written into the predetermined first address pointed to by the pointer. For example Figure 3 As shown, the first address can be 0x201, and the initial load power 0x0a is written at the first address. The decimal value of the initial load power 0x0a is 10, indicating the brightness value mapped by the initial load power of the LED type device.
[0061] After writing the current load power, that is, the initial load power, into the first address pointed to currently, the controller supply voltage corresponding to the current load power is compared with the first voltage threshold. If the controller supply voltage is less than or equal to the first voltage threshold, the load power is updated according to the predetermined power increase amplitude. For example, increasing the brightness value by 5 gives the updated load power of 15, and the updated load power 0x0f (corresponding to the decimal value 15) is written into the next address after the first address. If the controller supply voltage corresponding to the current load power is still less than or equal to the first voltage threshold, the pointer is continued to be moved to the next address of the currently pointed address, the load power is updated according to the predetermined power increase amplitude, and the updated load power is written into the next address until the controller supply voltage corresponding to the load power is greater than the first voltage threshold, or the updated load power is greater than or equal to the rated power of the device.
[0062] As Figure 3 As shown in the right figure, after writing 0x5a (corresponding to the decimal 90) at the address 0x211, the controller supply voltage corresponding to the load power is greater than the first voltage threshold, and the adaptation is completed. If there is a margin voltage in the first voltage threshold, the load power corresponding to the brightness value 80 can be determined as the first power threshold. The brightness value can be converted into the RGB control value of the lamp bead, and the conversion expression can be expressed as: 255 * 3 * N * 80 / 100.
[0063] By writing different load powers into the storage spaces of different addresses in sequence, the number of repeated erasures of the same storage space can be effectively reduced, and the service life of the memory can be improved.
[0064] In addition, considering that some power supplies have overcurrent protection functions. For example, for a power supply rated at 5V2A, its actual output current may start overcurrent protection after reaching 2.2A, automatically cut off the power output for a period of time (10ms to 500ms), and then resume output. In response to this situation, in order to effectively detect the overcurrent protection power corresponding to the overcurrent protection action, after the adaptive processing is completed, that is, when the controller supply voltage corresponding to the current load power is greater than the first voltage threshold, or the updated load power is greater than or equal to the rated power of the device, a predetermined first value can be written into a preset second address space. Among them, the second address can be the previous address of the first address. For example Figure 3 as shown, the first address is 0x201, the second address is 0x200, and the first value written is 0x00.
[0065] Before performing the adaptive power processing, it can be first detected whether the second address is the first value. If it is the first value, the adaptive processing is prepared, and the entire sector where the second address is located is first made all 0xFF, as Figure 3 shown in the left figure, which is used to represent the storage space where no data is written, and the storage space of the second address is written with a second value.
[0066] Before performing the adaptive power processing, if it is detected that the second address is the second value, it means that the adaptive processing has been performed before, and there may be abnormal power off caused by overcurrent protection. At this time, the overcurrent protection power used to avoid the power supply's response to the overcurrent protection action can be determined, and the load is controlled to work based on this overcurrent protection power as the power upper limit of the device.
[0067] Among them, when determining the overcurrent protection power, it can be sequentially checked backward along the first address to determine whether the storage space pointed to by the address is written with data. If no data is written, the value of the storage space is 0xFF. If data is written, the value of the storage space is not 0xFF.
[0068] Check sequentially backward from the first address to determine the third address of the first storage space where no data is written, indicating that after writing the load power in the storage space of the third address and running according to the load, the power supply is cut off due to the overcurrent protection of the power supply, resulting in the failure to complete the adaptive processing. In this case, the load power stored in the previous address of the third address, that is, the fourth address, can be determined as the overcurrent protection power.
[0069] To improve the reliability of overcurrent protection, the load power in the fourth address can be attenuated. For example, according to a predetermined attenuation ratio of 0.8, the load power in the fourth address is attenuated to obtain a more reliable overcurrent protection power.
[0070] Figure 4Schematic diagram of the implementation process for adaptively adjusting the power of an LED device provided by an embodiment of this application, which is described in detail as follows: 401. The device is powered on and the program starts.
[0071] When the device is connected to the power supply, the power supply provides electrical energy for the controller and load of the device. When the device is powered on, the power adaptation program starts to execute.
[0072] 402. Determine the value at 0x200.
[0073] Among them, 0x200 is the second address in the flash memory, 0x00 is the first value, and 0x5a is the second value. The first value is the value written into the second address after the adaptive processing is completed, and the second value is the value written into the second address when the adaptive processing starts to be executed.
[0074] 403. If it is 0x00, erase the flash 0x200 sector to make it all 0xFF, and write 0x5A at flash 0x200.
[0075] If it is the first value 0x00, it means that the adaptive processing has been performed before, the adaptive processing can be executed, and the first address 0x00 is written into the second value 0x5A to indicate that the adaptive processing has started to be executed.
[0076] 404. Set the flash address a = 0x201 and the initial brightness value b = 10.
[0077] Among them, 0x201 is the first address a, and the initial brightness value is the LED brightness value 10.
[0078] 405. Assign the value b to the flash a address and control the lamp load to be on at b% brightness of white.
[0079] Write the initial brightness value 10 into the storage space corresponding to the first address. The LED brightness of 10 means that the LED is white and the brightness is 10% of the maximum brightness.
[0080] 406. Is ICVCC less than 3.0V? ICVCC is the power supply voltage of the controller, and 3.0V is the first voltage threshold. The power supply voltage of the controller can be obtained by the controller through acquisition.
[0081] 407. If it is greater than 3.0V, then determine whether the brightness b = 100? 408. The adaptation is completed. Rewrite 0x200 of the flash to 0x00, and calculate the sum X of all the lamps corresponding to the brightness value b, X = N * 3 * 255 * b / 100, where N is the number of lamps.
[0082] 0x200 is the second address, and 0x00 is the first value.
[0083] The lowest load voltage is the brightness value of the storage space pointed to by the current address, that is, the brightness value 100, corresponding to the rated operating power of the device.
[0084] 409, if the brightness is less than 100, then a = a + 1, b = b + 5.
[0085] It means that if the brightness is less than 100, the address is incremented by 1, the brightness is increased by 5, and 405 is continued to be executed.
[0086] 410 If it is detected that 0x200 is 0x5a, then set the Flash address d = 0x202.
[0087] Among them, 0x202 is the initial address for finding the overcurrent protection power.
[0088] 411, is the value at the Flash d address 0xFF? d represents the address for finding the brightness corresponding to the overcurrent protection power. If it is 0xFF, it means that no data has been written, otherwise it means that data has been written.
[0089] 412, if it is not 0xFF, then the address is incremented by 1, d = d + 1.
[0090] If it is not 0xFF, it means that data has been written, and then continue to find the next address.
[0091] 413, if it is 0xFF, then the address is decremented by 1, d = d - 1.
[0092] If it is 0xFF, it means that the load power at the previous address caused overcurrent protection.
[0093] 414, read out the brightness value z at Flash d.
[0094] Read out the brightness value corresponding to the load power at the address where overcurrent protection occurred.
[0095] 415, calculate the sum X1 of all the lamps corresponding to the brightness value z, X1 = N * 3 * 255 * z / 100, N is the number of lamps, X = 0.8 * X1.
[0096] Among them, X1 represents the RGB control address corresponding to the brightness value, and X represents the attenuated RGB control value.
[0097] 416, calculate the RGB control values of all the lamp beads according to the normal function preset mode.
[0098] Calculate the RGB control value of each lamp bead expected by the control instruction.
[0099] 417. Calculate the sum of all bead control values for each frame as Y.
[0100] Obtain the sum value Y of the RGB control values of all beads by accumulating and summing the RGB control values of all beads in each frame.
[0101] 418. Y <= X? 419. If Y is less than or equal to X, output the RGB values of each lamp to control the corresponding beads.
[0102] If Y is less than or equal to X, it means that the current expected power does not exceed the first power threshold, and the control can be directly performed according to the RGB output value corresponding to the expected power.
[0103] 420. If Y is greater than X, calculate the attenuation coefficient c = X / Y (rounded to 2 decimal places).
[0104] If Y is greater than X, the expected power needs to be adaptively adjusted to determine the attenuation coefficient.
[0105] 421. Multiply the R, G, and B control values of all beads by c separately.
[0106] After multiplying the R, G, and B control values of all beads by c separately, obtain the RGB output value of each bead, and execute 419.
[0107] According to the above description, according to the power adaptation method in the embodiments of the present application, the supply voltage of the device controller and the device current change as Figure 5 shown. When the device is powered on, since the device load power is small, at this time, the supply voltage V of the controller and the device current I remain stable. As the load power further increases, the device current I gradually increases, and the supply voltage V of the controller gradually decreases. When it is first detected that the supply voltage V of the controller is lower than the first voltage threshold, determine the maximum operating power adapted by the power supply. When controlling the load to work according to the maximum operating power, the supply voltage V of the controller rises by a certain amplitude and remains stable output, and the device current I decreases by a certain amplitude and then remains stable. In this state, the device usually does not have problems of not working or restarting, which can effectively improve the user experience.
[0108] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0109] Figure 6 The following is a schematic diagram of a power adaptation device provided by an embodiment of the present application. This device is used for a device with adjustable power. The device includes: A load power control unit 601, configured to control the device to gradually increase the load power when the device is connected to a power supply; A voltage comparison unit 602, configured to detect the supply voltage of the controller of the device, compare the supply voltage of the controller with a preset first voltage threshold, where the first voltage threshold is determined according to the minimum operating voltage of the controller of the device and / or the maximum operating current of the power supply; A maximum operating power determination unit 603, configured to determine the maximum operating power matched by the power supply when it is first detected that the supply voltage of the controller is lower than the first voltage threshold; A load control unit 604, configured to control the load to operate with the maximum operating power as the power upper limit of the device.
[0110] Figure 6 The power adaptation device shown is corresponding to Figure 2 the power adaptation method shown.
[0111] Figure 7 is a schematic diagram of a power adaptation device provided by an embodiment of the present application. As Figure 7 shown, the power adaptation device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70, such as a power adaptation program. When the processor 70 executes the computer program 72, the steps in the above-mentioned various power adaptation method embodiments are implemented. Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned various device embodiments are implemented.
[0112] Exemplarily, the computer program 72 can be divided into one or more modules / units, and the one or more modules / units are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 72 in the power adaptation device 7.
[0113] The power adaptation device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art can understand that Figure 7 this is only an example of a power adaptation device 7, and does not constitute a limitation on the power adaptation device 7. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the power adaptation device may further include input / output devices, network access devices, buses, etc.
[0114] The so-called processor 70 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0115] The memory 71 may be an internal storage unit of the power adaptive device 7, such as the hard disk or memory of the power adaptive device 7. The memory 71 may also be an external storage device of the power adaptive device 7, such as a plug-in hard disk equipped on the power adaptive device 7, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 71 may also include both the internal storage unit of the power adaptive device 7 and the external storage device. The memory 71 is used to store the computer program and other programs and data required by the power adaptive device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system may refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0117] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0118] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0119] In the embodiments provided in this application, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / terminal device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be electrical, mechanical or other forms.
[0120] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0121] In addition, the functional units in each embodiment of this application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0122] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, it can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0123] In addition, the embodiment of this application also provides a computer program product. When it runs on a computer, it enables the computer to execute the methods in the above implementation manners.
[0124] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included in the protection scope of this application.
Claims
1. A power adaptation method, characterized in that: The method is used for a power-adjustable device, and the method comprises: When the device is connected to a power source, controlling the device to gradually increase the load power; Detecting a controller power supply voltage of the device, and comparing the controller power supply voltage with a preset first voltage threshold, where the first voltage threshold is determined according to a minimum operating voltage of the controller of the device and / or a maximum operating current of the power supply; When it is detected for the first time that the controller power supply voltage is lower than the first voltage threshold, determining the maximum operating power matched by the power supply; The load operation is controlled by taking the maximum operating power as the power upper limit of the device.
2. The method according to claim 1, characterized in that Controlling the load operation by using the maximum operating power as the power upper limit of the device includes: receiving a power control instruction of the device, and determining an expected power of the power control instruction; When the expected power is greater than the maximum operating power, determining the target power according to the expected power and a preset attenuation coefficient; The load is controlled to operate according to the target power.
3. The method according to claim 2, characterized in that Determining a target power according to the expected power and a preset attenuation coefficient includes: determining an attenuation coefficient according to a ratio of the expected power to the maximum operating power; The target power is determined according to the product of the attenuation coefficient and the expected power.
4. The method according to claim 2, characterized in that: The first voltage threshold is greater than a minimum operating voltage of a controller of the device; When it is detected for the first time that the controller power supply voltage is lower than the first voltage threshold, determining the maximum operating power matched by the power supply includes: When the load power is detected for the first time when the controller supply voltage is lower than the first voltage threshold, the load power is determined to be the maximum operating power matched by the power supply.
5. The method according to claim 1, characterized in that Before detecting the controller power supply voltage of the device and comparing the controller power supply voltage with a preset first voltage threshold, the method further includes: Determine the minimum controller supply voltage corresponding to the maximum operating current according to the corresponding relationship between the preset power supply operating current and the controller supply voltage of the device; The first voltage threshold is determined according to the minimum operating voltage of the controller of the device and the maximum value of the minimum controller supply voltage.
6. The method according to claim 1, characterized in that When the device is connected to a power source, controlling the device to gradually increase the load power includes: When the device is connected to a power source, determining a preset initial load power as a current load power, and writing the current load power into a predetermined first address currently pointed to by the pointer; The following steps are performed multiple times: when the controller supply voltage corresponding to the current load power is less than or equal to the first voltage threshold, the address pointer is moved to the next address of the currently pointed address, and the load power is updated according to a predetermined power increase amplitude, and the updated load power is written to the next address until the controller supply voltage corresponding to the current load power is greater than the first voltage threshold, or the updated load power is greater than or equal to the rated power of the device.
7. The method according to claim 6, characterized in that After the controller supply voltage corresponding to the current load power is greater than the first voltage threshold, or the updated load power is greater than or equal to the rated power of the device, the method further includes: Writing a predetermined first value into a storage space at a preset second address, where the second address is a previous address of the first address; Before determining that the preset initial load power is the current load power and writing the current load power into the predetermined first address currently pointed to by the pointer, the method further includes: When it is detected that the second address is the first value, the data of the sector where the first address is located is erased, and the second value is written into the storage space of the second address, and the preset initial load power is determined to be the current load power, and the current load power is written into the predetermined first address currently pointed to by the pointer; When it is detected that the second address is the second value, an overcurrent protection power for preventing the power supply from responding to an overcurrent protection action is determined, and the load operation is controlled based on the overcurrent protection power as the power upper limit of the device.
8. The method according to claim 7, characterized in that Determining an overcurrent protection power for preventing the power supply from responding to an overcurrent protection action comprises: Determine a third address of a first storage space in which no data is written in the storage space after the first address; A fourth address located at a previous address of the third address is determined, and the load power written into the storage space of the fourth address is determined as the overcurrent protection power.
9. A power adaptive device, characterized in that: The device is used for power-adjustable equipment, and the device comprises: A load power control unit, used to control the device to gradually increase the load power when the device is connected to a power source; a voltage comparison unit, configured to detect a power supply voltage of a controller of the device, and compare the power supply voltage of the controller with a preset first voltage threshold, wherein the first voltage threshold is determined according to a minimum operating voltage of the controller of the device and / or a maximum operating current of the power supply; a maximum operating power determination unit, configured to determine a maximum operating power matched by the power supply when it is first detected that the controller power supply voltage is lower than the first voltage threshold; A load control unit is used to control the operation of the load by taking the maximum operating power as the power upper limit of the device.
10. A power adaptive device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the power adaptive device implements the method according to any one of claims 1 to 8.
11. A computer program product comprising computer program instructions, characterized in that When the computer program is executed, the method according to any one of claims 1 to 8 is performed.
Citation Information
Patent Citations
Frequency control method and device, radio frequency system and communication equipment
CN112469112A
Adaptive power control method and related device
CN119311073A
Constant-voltage power circuit and electronic equipment incorporating the constant-voltage power circuit
JP2002169618A
Power extractor detecting a power change
US20080179949A1