Power Adaptive Method, Device, Equipment and Program Product
By gradually increasing the load power and detecting the controller power supply voltage, and determining the maximum operating power as the upper limit of power, the USB interface adapter cannot meet the problem of insufficient power supply for high-power lighting products, improving the reliability and user experience of the equipment.
Patent Information
- Application Number
- CN202510579464.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-05-07
AI Technical Summary
In the prior art, the USB interface adapter cannot meet the power supply needs of high-power lighting products, resulting in insufficient power supply of equipment, problems such as inability to work or frequent restarts, affecting the user experience.
By gradually increasing the load power and detecting the controller's power supply voltage, the maximum operating power is determined based on the preset voltage threshold, and the load operation is controlled as the upper power limit of the equipment to ensure that the controller's power supply voltage is higher than the minimum operating voltage and the operating current is less than the maximum current.
Effectively avoid the equipment being unable to work or restart due to insufficient power supply, improve user experience, and improve the reliability and safety of the equipment.
Smart Images

Figure CN120122776B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power control, and particularly to a power adaptation method, device, equipment, 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 adapter 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 the present application provide a power adaptation method, device, equipment, 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 the present application provides a power adaptation method, which is used for a device with adjustable power. The method includes:
[0007] When the device is connected to a power supply, controlling the device to gradually increase the load power;
[0008] Detecting the supply voltage of the controller of the device, and comparing the controller supply voltage 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;
[0009] When it is first detected that the controller supply voltage is lower than the first voltage threshold, determining the maximum operating power matched by the power supply;
[0010] Control the load to work with the maximum operating power as the power upper limit of the device.
[0011] Combined with the first aspect, in the first possible implementation manner of the first aspect, controlling the load to work with the maximum operating power as the power upper limit of the device includes:
[0012] Receive the power control instruction of the device and determine the expected power of the power control instruction;
[0013] When the expected power is greater than the maximum operating power, determine the target power according to the expected power and a preset attenuation coefficient;
[0014] Control the load to work according to the target power.
[0015] Combined with the first possible implementation manner of the first aspect, in the second possible implementation manner of the first aspect, determining the target power according to the expected power and a preset attenuation coefficient includes:
[0016] Determine the attenuation coefficient according to the ratio of the expected power to the maximum operating power;
[0017] Determine the target power according to the product of the attenuation coefficient and the expected power.
[0018] Combined 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;
[0019] When first detecting that the controller supply voltage is lower than the first voltage threshold, determining the maximum operating power matched by the power supply includes:
[0020] Determine the load power when first detecting that the controller supply voltage is lower than the first voltage threshold as the maximum operating power matched by the power supply.
[0021] Combined with the first aspect, in the fourth possible implementation manner of the first aspect, before detecting the controller supply voltage of the device and comparing the controller supply voltage with a preset first voltage threshold, the method further includes:
[0022] 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;
[0023] Determine the maximum value of the lowest operating voltage of the controller of the device and the minimum controller supply voltage as the first voltage threshold.
[0024] 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:
[0025] When the device is connected to a power supply, determine the preset initial load power as the current load power, and write the current load power to a predetermined first address pointed to by the pointer.
[0026] 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.
[0027] In combination 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:
[0028] Write a predetermined first value to the storage space at a preset second address, where the second address is the previous address of the first address.
[0029] Before determining the preset initial load power as the current load power and writing the current load power to the predetermined first address pointed to by the pointer, the method further includes:
[0030] 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 at the second address, and execute the operation of determining the preset initial load power as the current load power and writing the current load power to the predetermined first address pointed to by the pointer.
[0031] 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.
[0032] In combination 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:
[0033] Determine the third address of the storage space where no data is written yet, which is located after the first address, in the storage space.
[0034] Determine a fourth address that is the previous address of the third address, and determine the overcurrent protection power according to the load power written in the storage space of the fourth address.
[0035] A second aspect of the embodiments of the present application provides a power adaptive device for a device with adjustable power. The device includes:
[0036] A load power control unit for controlling the device to gradually increase the load power when the device is connected to a power supply;
[0037] A voltage comparison unit for detecting the supply voltage of the controller of the device and 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;
[0038] A maximum operating power determination unit for determining 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;
[0039] A load control unit for controlling the load to operate with the maximum operating power as the power upper limit of the device.
[0040] 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.
[0041] 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.
[0042] A fifth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the steps of the method according to any one of the first aspects.
[0043] 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.
[0044] 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 device's controller. The power supply voltage of the device's controller 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0046] Figure 1 FIG. is a schematic diagram of an implementation scenario of a power adaptation method provided by an embodiment of the present application;
[0047] Figure 2 FIG. is a schematic diagram of an implementation process of a power adaptation method provided by an embodiment of the present application;
[0048] Figure 3 FIG. is a schematic diagram of data storage for power adaptation provided by an embodiment of the present application;
[0049] Figure 4 FIG. is a schematic diagram of an implementation process of self-adaptive power adjustment of an LED device provided by an embodiment of the present application;
[0050] Figure 5 FIG. is a schematic diagram of the change in the power supply voltage of the controller of a device and the device current provided by an embodiment of the present application;
[0051] Figure 6 FIG. is a schematic diagram of a power adaptation device provided by an embodiment of the present application;
[0052] Figure 7 FIG. is a schematic diagram of a power adaptation device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0053] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, 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.
[0054] To illustrate the technical solutions described in the present application, the following will be described through specific embodiments.
[0055] 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) into 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 displays.
[0056] The voltage compatibility characteristic of the USB interface enables products to not require a dedicated power supply, thus significantly reducing the production cost of manufacturers, reducing the cumbersome process of different mains plug certifications, and being beneficial to improving the environmental protection of products. However, with the increase in the number of lamp beads and the improvement of brightness requirements in lighting products, traditional USB interface adapters may not be able to meet their power requirements, and higher-power power adapters are needed for power supply, such as 5V3A, 5V5A, or even 5V10A power adapters.
[0057] During the user's use process, if the power of the product does not match the power of the adapter, for example, connecting a high-power product to a low-power USB interface or adapter, the product may have problems such as not being able to work or frequently restarting due to insufficient power supply, which will seriously affect the user's experience.
[0058] To solve the above problems, the embodiments of the present application propose a power self-adaptive method for devices with adjustable power, such as Figure 1 The figure shows a 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 power can be 110V or 220V AC. The adapter can be used to convert the mains power into a voltage VCC1 that conforms to the USB standard, and the corresponding ground voltage is GND1, not limited to Figure 1As shown, it may further include an adapter for outputting other voltages. The device includes a controller and a load. The load may be a lamp load, including lighting fixtures, dot matrix screens, or other devices with adjustable power. The controller can be used to gradually increase the load power, detect the controller supply voltage VVC2 of the load according to the change of the load power, and 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 controller of the device 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 have problems such as inability to work or restart due to insufficient power supply, which is beneficial to improving the user experience.
[0059] Figure 2 The following is a schematic flowchart of the implementation of a power adaptation method provided by an embodiment of the present application:
[0060] In S201, when the device is connected to the power supply, the device is controlled to gradually increase the load power.
[0061] The device in the embodiment of the present application can be a plug-and-play, power-adjustable electronic device. For example, the device may include power-adjustable lighting fixtures or power-adjustable LED displays, etc.
[0062] The power supply in the embodiment of the present application may include an adapter that matches the operating voltage of the device. For example, for electrical devices with a USB interface voltage of 5V, including strip lights, lamp strings, small-sized LED screens, etc.
[0063] Since the rated power of the power supply may vary each time the device is connected to the power supply. For example, when the device is connected to an adapter-style power supply 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 operating at its maximum power, the supply voltage of the device's controller usually does not drop significantly and can generally meet the operating requirements of the device within its full power range. 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 supply voltage of the device's controller drops too much, it will affect the normal operation of the device's 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.
[0064] 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.
[0065] Considering that the initial load power determined according to a single power increase amplitude is relatively small, to improve the adaptation 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.
[0066] 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.
[0067] In the embodiments 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 the LED can be a specific RGB control value or the brightness value of the device.
[0068] 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 are different brightness levels, and 255 is the highest brightness controlled by 100% duty cycle. Different colors of the LED light can be achieved by controlling the lighting of R, G, and B 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 all LED brightness control values 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.
[0069] 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 the brightness of the device is 5% of the maximum brightness.
[0070] When it is necessary to compare powers, the power representation forms need to be unified. 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:
[0071] X = N * 3 * 255 * b / 100.
[0072] Where X is the converted brightness control value, N is the number of RGB lamp bead modules, and b is the brightness value.
[0073] In S202, the supply voltage of the controller of the device is detected and compared with a preset first voltage threshold.
[0074] 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.
[0075] As Figure 1 shown, the controller is connected in parallel with the load, and there is resistance in the wire. For example, Figure 1 shown, the resistance includes the resistance between the positive pole of the power supply and the first detection point of the controller supply voltage represented by R1, and the resistance between the negative pole of the power supply and the second detection point of the controller supply voltage represented by R2. The first detection point is the power supply detection point on the positive line, and the second detection point is the power supply detection point on the ground line.
[0076] 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 controller supply voltage 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.
[0077] 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 controller supply voltage VCC2 - GND2 detected by the controller is smaller. In general, when the load power is greater than the output power of the power supply, the voltage output by the power supply to the detection point of the controller supply voltage will also decrease from 5V to 4.5V or lower. The embodiment of the present application realizes power adaptive control by detecting the change of the controller supply voltage and according to this change.
[0078] 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 controller supply voltage 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 voltage margin design, when it is first detected that the controller supply voltage 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 controller supply voltage caused by increasing the load power by a single time, such as the maximum change in the controller supply voltage caused by increasing the load by 5%.
[0079] In the embodiment 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 get hot, affecting the safety of device use.
[0080] To improve the safety of device use, the embodiment of the present application needs to set the maximum operating current of the device. When the operating current of the device is less than this maximum operating current, the heating can be effectively reduced. The first voltage threshold can be determined in combination with the maximum operating current to determine the corresponding minimum controller supply voltage. The minimum controller supply voltage is the supply voltage of the controller when the device is at the maximum operating current.
[0081] 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 ammeter. For example, by adjusting the load power of the device to gradually increase the operating current of the device, 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, obtain the current controller supply voltage, which is the minimum controller supply voltage.
[0082] When determining the first voltage threshold according to 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-scalding safety considerations is 3.5V, then in combination with the voltage margin, such as the voltage margin is 0.3V, the first voltage threshold can be determined to be 3.8V. Compared with the method of inserting a high-power resistor for testing, since there is no need to insert a high-power resistor, this method will not have the problem of resistor overheating, and can effectively reduce the volume of the circuit board.
[0083] In S203, when the controller supply voltage is first detected to be lower than the first voltage threshold, determine the maximum operating power matched by the power supply.
[0084] 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 controller supply voltage corresponding to the change 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 the controller supply voltage is first detected to be 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 matched by the power supply.
[0085] 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 same as 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).
[0086] In a possible implementation, as the load power of the device increases until the load power reaches the maximum value of the device's load power, such as reaching the rated power of the device, if 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. It can be determined that the maximum operating power matched by the power supply is the maximum value of the device's load power, and the power of the device can be adjusted arbitrarily within the range where the maximum value of the load power is located. For example, the brightness of an LED lamp can be adjusted arbitrarily.
[0087] In S204, control the load to work with the maximum operating power as the power upper limit of the device.
[0088] According to the above description, the maximum operating power may be less than the maximum value of the device's load power or may be equal to the maximum value of the device's load power.
[0089] If the maximum operating power is equal to the maximum value of the device's load power, there is no need 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.
[0090] If the maximum operating power is less than the maximum value of the device's load power, 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 perform an adaptive adjustment on the desired power to determine the target power, and control the load 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.
[0091] 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.
[0092] Without limitation, 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, the desired power is P2, and the rated power of the device is P3, then the target power is: P2*(P2 / P3).
[0093] During the process of adaptively determining the maximum operating power, in order to extend the service life of the memory, in the embodiments 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 can be 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.
[0094] After writing the current load power, that is, the initial load power, into the currently pointed first address, 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 a predetermined power increase amplitude. For example, by increasing the brightness value by 5, the updated load power is 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 continuously 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.
[0095] As Figure 3 As shown in the right figure, after writing 0x5a (corresponding to the decimal value 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.
[0096] By sequentially writing different load powers into the storage spaces of different addresses, the repeated erasure times of the same storage space can be effectively reduced, and the service life of the memory can be extended.
[0097] In addition, considering that some power supplies have overcurrent protection functions. For example, for a power supply with a nominal value of 5V 2A, 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 the 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 may be written to a preset second address space. Wherein, the second address may 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.
[0098] Before performing the adaptive power processing, it may 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.
[0099] 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 an abnormal power-off caused by overcurrent protection. At this time, the overcurrent protection power used to avoid the power supply responding 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.
[0100] Among them, when determining the overcurrent protection power, it can be sequentially checked backward from 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.
[0101] Sequentially check 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 to the storage space of the third address and operating 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.
[0102] To improve the reliability of the 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.
[0103] Figure 4Schematic diagram of the implementation process for adaptive power adjustment of an LED device provided by an embodiment of this application, which is described in detail as follows:
[0104] 401. The device is powered on and the program starts.
[0105] When the device is connected to the power supply, the power supply provides electrical energy for the controller and the load of the device, and the device starts to execute the power adaptation program after being powered on.
[0106] 402. Determine the value at 0x200.
[0107] 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.
[0108] 403. If it is 0x00, erase the flash 0x200 sector to make it all 0xFF, and write 0x5A at flash 0x200.
[0109] If it is the first value 0x00, it means that the adaptive processing has been performed before, and the adaptive processing can be executed, and the first address 0x00 is written with the second value 0x5A to indicate that the adaptive processing has started.
[0110] 404. Set the flash address a = 0x201 and the initial brightness value b = 10.
[0111] Among them, 0x201 is the first address a, and the initial brightness value is the LED brightness value 10.
[0112] 405. Assign the value b to the Flash a address and control the lamp load to be on at b% brightness of white.
[0113] Write the initial brightness value 10 into the storage space corresponding to the first address. An LED brightness of 10 means that the LED is white and the brightness is 10% of the maximum brightness.
[0114] 406. Is ICVCC less than 3.0V?
[0115] 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.
[0116] 407. If it is greater than 3.0V, then determine whether the brightness b = 100?
[0117] 408. The adaptation is completed, rewrite the flash 0x200 to 0x00, 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.
[0118] 0x200 is the second address and 0x00 is the first value.
[0119] 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.
[0120] 409, if the brightness is less than 100, then a = a + 1, b = b + 5.
[0121] 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.
[0122] 410 If it is detected that 0x200 is 0x5a, then set the Flash address d = 0x202.
[0123] Among them, 0x202 is the initial address for finding the overcurrent protection power.
[0124] 411, is the value at the Flash d address 0xFF?
[0125] d represents the address when 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.
[0126] 412, if it is not 0xFF, then the address is incremented by 1, d = d + 1.
[0127] If it is not 0xFF, it means that data has been written, then continue to find the next address.
[0128] 413, if it is 0xFF, then the address is decremented by 1, d = d - 1.
[0129] If it is 0xFF, it means that the load power at the previous address caused overcurrent protection.
[0130] 414, read out the brightness value z at Flash d.
[0131] Read out the brightness value corresponding to the load power at the address where overcurrent protection occurred.
[0132] 415, calculate the sum X1 of all the lights accumulated corresponding to the brightness value z, X1 = N * 3 * 255 * z / 100, N is the number of lights, X = 0.8 * X1.
[0133] Among them, X1 represents the RGB control address corresponding to the brightness value, and X represents the attenuated RGB control value.
[0134] 416, calculate the RGB control values of all the lamp beads according to the normal function preset mode.
[0135] Calculate the RGB control values expected for each LED by the control instruction.
[0136] 417, Calculate the sum of the control values of all LEDs in each frame as Y.
[0137] Obtain the sum value Y of the RGB control values of all LEDs by accumulating and summing the RGB control values of all LEDs in each frame.
[0138] 418, Y <= X?
[0139] 419, If Y is less than or equal to X, output the RGB value of each light to control the corresponding LED.
[0140] 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.
[0141] 420, If Y is greater than X, calculate the attenuation coefficient c = X / Y (rounded to 2 decimal places).
[0142] If Y is greater than X, it is necessary to adaptively adjust the expected power to determine the attenuation coefficient.
[0143] 421, Multiply the R, G, and B control values of all LEDs separately by c.
[0144] After multiplying the R, G, and B control values of all LEDs separately by c, obtain the RGB output value of each LED, and execute 419.
[0145] 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 suitable for 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, and can effectively improve the user experience.
[0146] 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.
[0147] Figure 6Schematic diagram of a power adaptation device provided by an embodiment of the present application. This device is used for equipment with adjustable power, and the device includes:
[0148] A load power control unit 601, configured to control the equipment to gradually increase the load power when the equipment is connected to a power supply;
[0149] A voltage comparison unit 602, configured to detect the power supply voltage of the controller of the equipment, compare the power supply voltage of the controller with a preset first voltage threshold, and the first voltage threshold is determined according to the minimum operating voltage of the controller of the equipment and / or the maximum operating current of the power supply;
[0150] 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 power supply voltage of the controller is lower than the first voltage threshold;
[0151] A load control unit 604, configured to control the load to operate with the maximum operating power as the power upper limit of the equipment.
[0152] Figure 6 The power adaptation device shown corresponds to Figure 2 The power adaptation method shown.
[0153] Figure 7 It 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 operable 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 device embodiments are implemented.
[0154] Exemplarily, the computer program 72 can be divided into one or more modules / units. 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 performing specific functions, and these instruction segments are used to describe the execution process of the computer program 72 in the power adaptation device 7.
[0155] 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 7It is merely 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 those shown, or combine certain components, or different components. For example, the power adaptation device may also include input / output devices, network access devices, buses, etc.
[0156] 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.
[0157] The memory 71 may be an internal storage unit of the power adaptation device 7, such as the hard disk or memory of the power adaptation device 7. The memory 71 may also be an external storage device of the power adaptation device 7, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on the power adaptation device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the power adaptation device 7. The memory 71 is used to store the computer program and other programs and data required by the power adaptation device. The memory 71 may also be used to temporarily store data that has been output or will be output.
[0158] Those skilled in the art can clearly understand that, for the convenience and conciseness 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 can be 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 can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can 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 can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0159] 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 can be made to the relevant descriptions of other embodiments.
[0160] 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 by a combination of computer software and electronic hardware. Whether these functions are executed in the form of hardware or software 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.
[0161] 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 module or unit is only a logical function division. In actual implementation, there can 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 mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0162] The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it can be located in one place, or can be 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.
[0163] In addition, in each embodiment of the present application, the functional units 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 unit can be implemented in the form of hardware or in the form of a software functional unit.
[0164] 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 such an understanding, all or part of the processes in the above-described embodiment methods of the present application 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 capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), 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.
[0165] In addition, the embodiment of the present application also provides a computer program product, which when running on a computer, enables the computer to execute the methods in the above implementation manners.
[0166] The above-described embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present 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 cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A power adaptation method, characterized in that, The method is used for a device with adjustable power, and the method includes: When the device is connected to a power supply, controlling the device to gradually increase the load power, including: when the device is connected to the 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; performing the following steps multiple times: when the controller supply voltage corresponding to the current load power is less than or equal to a first voltage threshold, moving the address pointer to the next address of the currently pointed address, updating the load power according to a predetermined power increase amplitude, and writing 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; Detecting the controller supply voltage of the device, and comparing the controller supply voltage 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 controller supply voltage is lower than the first voltage threshold, determining the maximum operating power matched by the power supply; Controlling the load to work with the maximum operating power as the power upper limit of the device, including: receiving a power control instruction of the device, and determining the desired power of the power control instruction; when the desired power is greater than the maximum operating power, determining a target power according to the desired power and a preset attenuation coefficient, including: determining an attenuation coefficient according to the ratio of the desired power to the maximum operating power; determining the target power according to the product of the attenuation coefficient and the desired power; controlling the load to work according to the target power.
2. The method according to claim 1, wherein The first voltage threshold is greater than the minimum operating voltage of the controller of the device; When it is first detected that the controller supply voltage is lower than the first voltage threshold, determining the maximum operating power matched by the power supply, including: Determining the load power at the time when it is first detected that the controller supply voltage is lower than the first voltage threshold as the maximum operating power matched by the power supply.
3. The method according to claim 1, wherein Before detecting the controller supply voltage of the device and comparing the controller supply voltage with a preset first voltage threshold, the method further includes: Determining the minimum controller supply voltage corresponding to the maximum operating current according to a preset correspondence between the power supply operating current and the controller supply voltage of the device; Determining the maximum value of the minimum operating voltage of the controller of the device and the minimum controller supply voltage as the first voltage threshold.
4. The method according to claim 1, wherein 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 to the storage space of a 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 a predetermined first address currently pointed to by a 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 the second value to the storage space of the second address, and execute the determination 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.
5. The method according to claim 4, wherein Determining the overcurrent protection power for avoiding the overcurrent protection action of the power supply response includes: Determine a third address of the first storage space without written data located after the first address; Determine a fourth address of the address before the third address, and determine the load power written to the storage space of the fourth address as the overcurrent protection power.
6. A power adaptive device, characterized in that, The device is used for a device with adjustable power, and 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 a power supply, including: when the device is connected to the power supply, determine that the preset initial load power is the current load power, and write the current load power to a predetermined first address currently 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; A voltage comparison unit, configured to detect the controller supply voltage of the device and compare the controller supply voltage 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, configured to determine the maximum operating power matched by the power supply when it is first detected that the controller supply voltage is lower than the first voltage threshold; A load control unit, configured to control the load to work with the maximum operating power as the power upper limit of the device, including: receiving a power control instruction of the device and determining the desired power of the power control instruction; when the desired power is greater than the maximum operating power, determine a target power according to the desired power and a preset attenuation coefficient, including: determining an attenuation coefficient according to the ratio of the desired power to the maximum operating power; determining the target power according to the product of the attenuation coefficient and the desired power; controlling the load to work according to the target power.
7. 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 adaptation device is caused to implement the method according to any one of claims 1-5.
8. A computer program product, comprising computer program instructions, characterized in that, When the computer program is run, the method according to any one of claims 1-5 is caused to be executed.
Citation Information
Patent Citations
Adaptive power control method and related device
CN119311073A
Constant-voltage power circuit and electronic equipment incorporating the constant-voltage power circuit
JP2002169618A