Lamp dimming method, storage medium and computer

By calculating the product of the lamp gear current curve and the preset reference value and gradually adjusting the current value, the problem of unsatisfactory light changes during the lamp adjustment process is solved and the user experience is improved.

CN115643657BActive Publication Date: 2024-09-03SHENZHEN TOPBAND CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211228381.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-08
Publication Date
2024-09-03
Estimated Expiration
2042-10-08

AI Technical Summary

Technical Problem

It is difficult for existing lamps to meet the changing needs of light during the adjustment process, causing users to feel uncomfortable and excessive dimming may occur.

Method used

By constructing a lamp dimming method, the target current value is calculated by using the product of the gear current curve and the preset reference value, and the current value is adjusted according to the difference to achieve a reasonable dimming effect. The method includes steps: after receiving the gear adjustment instruction, obtain the current percentage of the current current value and the gear current curve, calculate the target current value, and gradually adjust the current value if the difference value is satisfied.

Benefits of technology

By adjusting the current value proportionally, the dimming results are more reasonable, meeting user needs and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115643657B
    Figure CN115643657B
Patent Text Reader

Abstract

The present invention relates to a lamp dimming method, a storage medium and a computer. The method comprises the following steps: step S1, outputting current according to a selected gear current curve, the gear current curve being a curve of current value changing with time, and each gear corresponding to a gear current curve; step S2, obtaining the current current value after receiving a gear adjustment instruction, and calculating the current percentage of the current value and the preset reference value of the current gear current curve; step S3, taking the product of the preset reference value and the current percentage of the gear current curve corresponding to the gear adjustment instruction as the target current value; step S4, starting from the target current value to execute the gear current curve corresponding to the gear adjustment instruction. The present invention makes the target current value more reasonable through proportional adjustment, so that the dimming result meets the user's needs and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of lamps, and more particularly to a lamp dimming method, a storage medium and a computer. Background Art

[0002] Some lamps have multiple gears, each corresponding to a different brightness, and the brightness of the same gear is constantly changing, that is, the working current of the same gear changes over time. In the process of adjusting the gear, it is necessary to meet the lighting change requirements so that users can feel the dimming results; at the same time, it is necessary to avoid over-dimming, which makes users feel uncomfortable, so appropriate dimming logic is a problem that needs to be solved. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a lamp dimming method, a storage medium and a computer.

[0004] The technical solution adopted by the present invention to solve the technical problem is: constructing a lamp dimming method, comprising the following steps:

[0005] Step S1, outputting current according to a selected gear current curve, wherein the gear current curve is a curve showing the change of current value over time, and each gear corresponds to a gear current curve;

[0006] Step S2, after receiving the gear shift instruction, obtaining the current current value, and calculating the current percentage of the current current value and the preset reference value of the current gear current curve;

[0007] Step S3, taking the product of the preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage as the target current value;

[0008] Step S4, executing the gear current curve corresponding to the gear adjustment instruction starting from the target current value.

[0009] Furthermore, in the lamp dimming method described in the present invention, the gear current curve is obtained by multiplying a preset reference value and a preset change algorithm, the preset change algorithm is a change trend of the preset reference value over time, and each gear current curve corresponds to a preset reference value.

[0010] Furthermore, in the lamp dimming method of the present invention, step S1 comprises:

[0011] Step S111, after the lamp is turned on, the preset reference value is read, and the output current is output according to the product of the preset reference value and the preset change algorithm; or

[0012] Step S112, after the lamp is turned on, the preset reference value stored when it was last turned off is read, and the output current is output according to the product of the preset reference value and the preset change algorithm; or

[0013] Step S113, after the lamp is turned on, the preset reference value corresponding to the current gear is read, and the output current is output according to the product of the preset reference value and the preset change algorithm; or

[0014] Step S114: After the lamp is turned on, a gear selection instruction is received, a preset reference value corresponding to the gear selection instruction is read, and an output current is obtained by multiplying the preset reference value and a preset change algorithm.

[0015] Furthermore, in the lamp dimming method of the present invention, the gear current curve is a corresponding table of current value and time, each gear corresponds to a table, and each table contains a preset reference value.

[0016] Furthermore, in the lamp dimming method of the present invention, step S1 comprises:

[0017] Step S121, after the lamp is turned on, a preset gear current curve is read, and current is output according to the gear current curve; or

[0018] Step S122, after the lamp is turned on, the gear current curve stored when it was last turned off is read, and the current is output according to the gear current curve; or

[0019] Step S123, after the lamp is turned on, the current gear is read, and the current is output according to the gear current curve corresponding to the current gear; or

[0020] Step S124: After the lamp is turned on, the lamp receives a gear selection instruction, and outputs current according to the gear current curve corresponding to the gear selection instruction.

[0021] Furthermore, in the lamp dimming method of the present invention, step S3 comprises:

[0022] The product of a preset reference value of the gear current curve corresponding to the gear shift instruction and the current percentage is calculated, and the sum of the product and the preset adjustment value is used as the target current value, where the preset adjustment value is a positive value or a negative value.

[0023] Furthermore, in the lamp dimming method of the present invention, after step S3 and before step S4, the following steps are further included:

[0024] Step S314, determining whether the absolute value of the difference between the current current value and the target current value is greater than a preset difference value; if so, executing step S4; if not, executing step S324;

[0025] Step S324, adjusting the target current value, and executing step S314 after the adjustment.

[0026] Further, in the lamp dimming method of the present invention, adjusting the target current value in step S324 includes:

[0027] If the gear corresponding to the gear adjustment instruction is higher than the current gear, increasing the target current value;

[0028] If the gear corresponding to the gear adjustment instruction is lower than the current gear, reducing the target current value;

[0029] Among them, at the same time, the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the low gear.

[0030] Further, in the lamp dimming method of the present invention, increasing the target current value includes: increasing the target current value step by step according to a first step;

[0031] The reducing the target current value includes: gradually reducing the target current value according to a second step size.

[0032] Further, in the lamp dimming method of the present invention, the increasing the target current value includes: gradually increasing the current percentage according to a third step length, and the product of a preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage is used as the target current value;

[0033] Reducing the target current value includes: gradually reducing the current percentage according to a fourth step, and taking the product of a preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage as the target current value.

[0034] Furthermore, in the lamp dimming method of the present invention, at the same time, the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the low gear.

[0035] Furthermore, in the lamp dimming method of the present invention, each gear current curve includes at least three working periods, and starting from the starting working period, the gear current curve decreases in a step-by-step manner according to the working period.

[0036] Furthermore, in the lamp dimming method described in the present invention, the preset reference value is an initial current value of the gear current curve.

[0037] Furthermore, in the lamp dimming method described in the present invention, the power supply of the lamp is a power supply battery.

[0038] Furthermore, the lamp dimming method of the present invention further includes the steps of:

[0039] The real-time power supply voltage of the power supply battery is obtained, and the preset reference value is adjusted according to the real-time power supply voltage.

[0040] In addition, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of the above-mentioned lamp dimming method.

[0041] In addition, the present invention further provides a computer, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps of the above-mentioned lamp dimming method by calling the computer program stored in the memory.

[0042] A lamp dimming method, storage medium and computer implementing the present invention have the following beneficial effects: the present invention makes the target current value more reasonable through proportional adjustment, so that the dimming result meets the user's needs and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0044] Figure 1 is a flow chart of a lamp dimming method provided by an embodiment of the present invention;

[0045] Figure 2 is a schematic diagram of a gear current curve of a lamp gear provided by an embodiment of the present invention;

[0046] Figure 3 It is a schematic diagram of the gear current curve of the lamp gear provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.

[0048] In a preferred embodiment, reference Figure 1 and Figure 2 The lamp dimming method of this embodiment is applied to a lamp, and the lamp can be powered by AC mains or a power supply battery, wherein the power supply battery is preferably a rechargeable battery. Specifically, the lamp dimming method includes the following steps:

[0049] Step S1, outputting current according to the selected gear current curve, the gear current curve is a curve showing the change of current value over time, and each gear corresponds to a gear current curve.

[0050] Specifically, the lamp includes at least two gears, each gear corresponds to a gear current curve, and the gear current curve is a curve of current value changing with time. When the lamp starts working, a gear is selected, the gear current curve corresponding to the gear is obtained, and the current is output according to the gear current corresponding to the gear, so that the lamp emits light. Figure 2 In this embodiment, a lamp having three gears is used as an example for illustration, and other numbers of gears may be implemented for reference. Figure 2 It contains three gears, namely high gear, medium gear and low gear. If the user selects medium gear, the gear current curve corresponding to the medium gear is obtained. The lamp starts from the current value L2 and outputs current according to the value of the gear current curve to make the lamp emit light. It can be understood that Figure 2 The gear current curve in the figure is only used to illustrate the working principle of the present embodiment, and is not used to limit the gear current curve of the present embodiment. The gear current curves of other shapes can be implemented with reference to the present embodiment.

[0051] Step S2, after receiving the gear shift instruction, obtain the current current value, and calculate the current percentage of the current current value and the preset reference value of the current curve of the current gear.

[0052] Specifically, when the lamp is already in a lighting state, that is, when the gear current curve corresponding to a certain gear is being executed, the user can adjust the gear according to the needs. The user can adjust the gear by means of a gear adjustment knob, a gear adjustment button, etc. to generate a gear adjustment instruction. After receiving the gear adjustment instruction, the processor of the lamp obtains the current current value and calculates the current percentage of the current current value to the preset reference value of the current gear current curve. Among them, each gear current curve corresponds to a preset reference value, and the preset reference value corresponding to each gear current curve is different.

[0053] For example Figure 2 The preset reference value of the gear current curve corresponding to the middle and high gears is L1, the preset reference value of the gear current curve corresponding to the middle gear is L2, and the preset reference value of the gear current curve corresponding to the low gear is L3. Assuming that the lamp is currently in the middle gear working state, after receiving the gear adjustment instruction, the current current value a is obtained, that is, point A on the gear current curve corresponding to the middle gear in the figure, and then the current percentage of the current current value and the preset reference value of the current gear current curve is calculated, that is, the current percentage k = a / L2.

[0054] Step S3: taking the product of the preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage as the target current value.

[0055] Specifically, the corresponding gear current curve is obtained according to the gear adjustment instruction, and then the preset reference value of the gear current curve is obtained. Figure 2, if the gear corresponding to the gear shift instruction is high, the gear current curve corresponding to the high gear is obtained, and then the preset reference value L1 of the gear current curve is obtained. After obtaining the preset reference value L1, the product of the preset reference value of the gear current curve corresponding to the gear shift instruction and the current percentage is used as the target current value, that is, the target current value b is L1*k, where k is the current percentage of the current current value and the preset reference value of the current gear current curve.

[0056] Step S4, starting from the target current value, executing the gear current curve corresponding to the gear adjustment instruction.

[0057] Specifically, after obtaining the target current value, find the value on the gear current curve corresponding to the gear adjustment instruction, and start executing the gear current curve corresponding to the gear adjustment instruction from this value. Figure 2 If the target current value b corresponds to point B on the high-speed gear current curve, the gear current curve will be executed starting from point B.

[0058] This embodiment makes the target current value more reasonable through proportional adjustment, so that the dimming result meets the user's needs and improves the user experience.

[0059] In some embodiments of the lamp dimming method, the gear current curve is obtained by multiplying the preset reference value and the preset change algorithm. The preset change algorithm is the change trend of the preset reference value over time, and each gear current curve corresponds to a preset reference value. Further, this embodiment provides four startup methods when the lamp starts working:

[0060] The first starting method: After the lamp is turned on, the preset reference value is read, and the output current is based on the product of the preset reference value and the preset change algorithm.

[0061] The second starting method: the lamp saves the current gear or gear current curve when it is turned off, and reads the preset reference value stored when it was last turned off after the lamp is turned on again, and outputs the current according to the product of the preset reference value and the preset change algorithm.

[0062] The third starting method: After the lamp is turned on, the preset reference value corresponding to the current gear is read, and the output current is based on the product of the preset reference value and the preset change algorithm.

[0063] The fourth starting method: after the lamp is turned on, it receives the gear selection instruction, reads the preset reference value corresponding to the gear selection instruction, and outputs the current by multiplying the preset reference value and the preset change algorithm.

[0064] The above four lamp starting working modes provided in this embodiment can be selected according to needs, can meet the needs of different application scenarios, and meet the diverse needs of users.

[0065] In some embodiments of the lamp dimming method, the gear current curve is a corresponding table of current value and time, each gear corresponds to a table, and each table corresponds to a preset reference value. During the operation of the lamp, the timing starts from the working starting point, and the corresponding current value is read from the table according to the timing length, and the current value is output to make the lamp emit light. It can be understood that the smaller the time interval in the table, the better the continuity of the current and the better the continuity of the output light. Further, this embodiment provides four startup methods when the lamp starts working:

[0066] The first startup method: After the lamp is turned on, it reads the preset gear current curve and outputs current according to the gear current curve.

[0067] The second startup method: After the lamp is turned on, it reads the gear current curve stored when it was last turned off, and outputs current according to the gear current curve.

[0068] The third starting method: After the lamp is turned on, read the current gear and output current according to the gear current curve corresponding to the current gear.

[0069] The fourth starting method: After the lamp is turned on, it receives the gear selection instruction and outputs current according to the gear current curve corresponding to the gear selection instruction.

[0070] The above four lamp starting working modes provided in this embodiment can be selected according to needs, can meet the needs of different application scenarios, and meet the diverse needs of users.

[0071] In some embodiments of the lamp dimming method, in order to meet the diverse needs of users, the target current value of the above embodiments can be further adjusted, that is, a preset adjustment value is set, and after calculating the product of the preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage, the sum of the product and the preset adjustment value is used as the target current value, and the preset adjustment value can be a positive value or a negative value. Figure 3 , the preset adjustment value is m. After calculating the product b of the preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage, you can choose to use (b+m) as the target current value, that is, the output current starts from point B1 on the gear current curve corresponding to the high gear, or (bm) as the target current value, that is, the output current starts from point B2 on the gear current curve corresponding to the high gear.

[0072] In this embodiment, after calculating the target current value according to the percentage, the target current value is further adjusted, and the target current value can be appropriately increased or decreased, thereby changing the user's feeling after dimming and improving the user experience.

[0073] In some embodiments of the lamp dimming method, the user adjusts the light because he is not satisfied with the current light, so the user should be able to feel that the light has changed significantly after the adjustment. If the light changes slightly before and after the adjustment, the user will not notice it, and the user will feel that the adjustment is not successful, which reduces the user experience. Therefore, in order to enable the user to clearly feel the light changes before and after the adjustment, this embodiment sets a preset difference value so that the difference before and after the adjustment is larger. Specifically, this embodiment further includes the steps of:

[0074] Step S314, determine whether the absolute value of the difference between the current current value and the target current value is greater than the preset difference value. If yes, execute step S4. If no, execute step S324.

[0075] Step S324, adjusting the target current value, and executing the step S314 after the adjustment. The principle followed in the adjustment process is: after adjusting the target current value, the absolute value of the difference between the current current value and the target current value is made greater than the preset difference value.

[0076] Specifically, the target current value can be adjusted according to the gear level corresponding to the gear adjustment instruction, wherein the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the low gear at the same time. Figure 2 and Figure 3 At the same time in the figure, the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the middle gear, and the current value of the gear current curve corresponding to the middle gear is greater than the current value of the gear current curve corresponding to the low gear.

[0077] If the gear corresponding to the gear adjustment command is higher than the current gear, the target current value is increased. Figure 2 and Figure 3 If the current gear is the middle gear and the target gear corresponding to the gear adjustment instruction is the high gear, if the absolute value of the difference between the current current value and the target current value calculated by the above embodiment is not greater than the preset difference value, then the target current value is increased.

[0078] If the gear position corresponding to the gear adjustment instruction is lower than the current gear position, the target current value is reduced. Figure 2 and Figure 3 If the current gear is the middle gear and the target gear corresponding to the gear adjustment instruction is the low gear, if the absolute value of the difference between the current current value and the target current value calculated by the above embodiment is not greater than the preset difference value, then the target current value is selected to be reduced.

[0079] This embodiment sets a preset difference value so that there is an obvious difference in the current value before and after the gear adjustment, so that the user can clearly feel the light changes before and after the gear adjustment, thereby improving the user experience.

[0080] In some embodiments of the lamp dimming method, increasing the target current value includes: increasing the target current value step by step according to the first step. Each time the current value is increased, it is determined whether the absolute value of the difference between the current current value and the target current value is greater than a preset difference value. If so, the increase is stopped, and if not, the increase is continued until the absolute value of the difference between the current current value and the target current value is greater than the preset difference value.

[0081] In some embodiments of the lamp dimming method, reducing the target current value includes: gradually reducing the target current value according to the second step length. Each time the target current value is reduced, it is determined whether the absolute value of the difference between the current current value and the target current value is greater than a preset difference value, and if so, the reduction is stopped, and if not, the reduction is continued until the absolute value of the difference between the current current value and the target current value is greater than the preset difference value.

[0082] In some embodiments of the lamp dimming method, increasing the target current value includes: gradually increasing the current percentage according to a third step length, and the product of the preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage is used as the target current value. Each time the percentage is increased, it is determined whether the absolute value of the difference between the current current value and the target current value is greater than the preset difference value. If so, the increase is stopped, and if not, the increase is continued until the absolute value of the difference between the current current value and the target current value is greater than the preset difference value.

[0083] In some embodiments of the lamp dimming method, reducing the target current value includes: gradually reducing the current percentage according to a fourth step length, and the product of the preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage is used as the target current value. Each time the percentage is reduced, it is determined whether the absolute value of the difference between the current current value and the target current value is greater than the preset difference value. If so, the reduction is stopped, and if not, the reduction is continued until the absolute value of the difference between the current current value and the target current value is greater than the preset difference value.

[0084] In some embodiments of the lamp dimming method, each gear current curve includes at least three working periods, starting from the starting working period, the gear current curve decreases in steps according to the working period. And at the same time, the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the low gear. Alternatively, the preset reference value is the initial current value of the gear current curve. Reference Figure 2 and Figure 3, each gear current curve includes three working periods. Starting from the starting working period, the gear current curve decreases in steps according to the working period; and at the same time, the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the low gear. It should also be noted that the current value after adjustment of all gears should be less than the maximum value of the gear current curve corresponding to the current gear, and less than the minimum value of the gear current curve corresponding to the current gear. If the adjusted current is greater than the maximum value of the gear current curve corresponding to the current gear, it will run at the maximum value of the gear current curve corresponding to the current gear; if the adjusted current is less than the minimum value of the gear current curve corresponding to the current gear, it will run at the minimum value of the gear current curve corresponding to the current gear.

[0085] In some embodiments of the lamp dimming method, the lamp is powered by a power supply battery, and the power of the power supply battery is constantly decreasing. In order to take into account the lighting brightness and working time of the lamp, the lamp dimming method of this embodiment also includes the steps of:

[0086] The real-time supply voltage of the power supply battery is obtained, and the preset reference value is adjusted according to the real-time supply voltage.

[0087] Specifically, the real-time power supply voltage of the power supply battery is obtained, and the preset reference value of each gear is adjusted according to the real-time power supply voltage, that is, the preset reference value corresponding to each gear current curve is adjusted according to the real-time power supply voltage. As an option, when the real-time voltage is high, it means that the current power of the power supply battery is relatively sufficient, and a larger preset reference value can be selected. On the premise that the preset change algorithm does not change, the power supply current output by the gear current curve is larger and the brightness of the lamp is larger. As an option, when the real-time voltage is low, it means that the current power of the power supply battery is relatively insufficient, and a smaller preset reference value can be selected. On the premise that the preset change algorithm does not change, the power supply current output by the gear current curve is smaller, thereby saving energy and extending the working time of the lamp.

[0088] This embodiment adjusts the preset reference value according to the battery power to adjust the current curve of each gear, thereby adjusting the brightness of the lamp according to the battery power and improving the user experience.

[0089] In a preferred embodiment, the computer-readable storage medium of this embodiment stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of the lamp dimming method of the above embodiment.

[0090] In a preferred embodiment, the computer of this embodiment includes a memory and a processor, the memory stores a computer program, and the processor executes the steps of the lamp dimming method of the above embodiment by calling the computer program stored in the memory.

[0091] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0092] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0093] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0094] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot limit the scope of protection of the present invention. All equivalent changes and modifications made to the scope of the claims of the present invention should fall within the scope of the claims of the present invention.

Claims

1. A lamp dimming method, characterized in that: The steps include: Step S1, outputting current according to a selected gear current curve, wherein the gear current curve is a curve showing the change of current value over time, and each gear corresponds to a gear current curve; Step S2, after receiving the gear shift instruction, obtaining the current current value, and calculating the current percentage of the current current value and the preset reference value of the current gear current curve; Step S3, taking the product of the preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage as the target current value; Step S4, executing the gear current curve corresponding to the gear adjustment instruction starting from the target current value.

2. The lamp dimming method according to claim 1, characterized in that: The gear current curve is obtained by multiplying a preset reference value and a preset change algorithm. The preset change algorithm is a change trend of the preset reference value over time. Each gear current curve corresponds to a preset reference value.

3. The lamp dimming method according to claim 2, characterized in that: The step S1 comprises: Step S111, after the lamp is turned on, the preset reference value is read, and the output current is output according to the product of the preset reference value and the preset change algorithm; or Step S112, after the lamp is turned on, the preset reference value stored when it was last turned off is read, and the output current is output according to the product of the preset reference value and the preset change algorithm; or Step S113, after the lamp is turned on, the preset reference value corresponding to the current gear is read, and the output current is output according to the product of the preset reference value and the preset change algorithm; or Step S114: After the lamp is turned on, a gear selection instruction is received, a preset reference value corresponding to the gear selection instruction is read, and an output current is obtained by multiplying the preset reference value and a preset change algorithm.

4. The lamp dimming method according to claim 1, characterized in that: The gear current curve is a corresponding table of current value and time, each gear corresponds to a table, and each table contains a preset reference value.

5. The lamp dimming method according to claim 4, characterized in that: The step S1 comprises: Step S121, after the lamp is turned on, a preset gear current curve is read, and current is output according to the gear current curve; or Step S122, after the lamp is turned on, the gear current curve stored when it was last turned off is read, and the current is output according to the gear current curve; or Step S123, after the lamp is turned on, the current gear is read, and the current is output according to the gear current curve corresponding to the current gear; or Step S124: After the lamp is turned on, the lamp receives a gear selection instruction, and outputs current according to the gear current curve corresponding to the gear selection instruction.

6. The lamp dimming method according to claim 1, characterized in that: The step S3 comprises: The product of a preset reference value of the gear current curve corresponding to the gear shift instruction and the current percentage is calculated, and the sum of the product and the preset adjustment value is used as the target current value, where the preset adjustment value is a positive value or a negative value.

7. The lamp dimming method according to claim 1, characterized in that: The method further includes the following steps after step S3 and before step S4: Step S314, determining whether the absolute value of the difference between the current current value and the target current value is greater than a preset difference value; if so, executing step S4; if not, executing step S324; Step S324, adjusting the target current value, and executing step S314 after the adjustment.

8. The lamp dimming method according to claim 7, characterized in that: The step S324 of adjusting the target current value includes: If the gear corresponding to the gear adjustment instruction is higher than the current gear, increasing the target current value; If the gear corresponding to the gear adjustment instruction is lower than the current gear, reducing the target current value; Among them, at the same time, the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the low gear.

9. The lamp dimming method according to claim 8, characterized in that: Increasing the target current value comprises: increasing the target current value step by step according to a first step; The reducing the target current value includes: gradually reducing the target current value according to a second step size.

10. The lamp dimming method according to claim 8, characterized in that: Increasing the target current value includes: gradually increasing the current percentage according to a third step length, and taking the product of a preset reference value of the gear current curve corresponding to the gear shift instruction and the current percentage as the target current value; Reducing the target current value includes: gradually reducing the current percentage according to a fourth step, and taking the product of a preset reference value of the gear current curve corresponding to the gear adjustment instruction and the current percentage as the target current value.

11. The lamp dimming method according to claim 1, characterized in that: At the same time, the current value of the gear current curve corresponding to the high gear is greater than the current value of the gear current curve corresponding to the low gear.

12. The lamp dimming method according to claim 11, characterized in that: Each gear current curve includes at least three working periods. Starting from the starting working period, the gear current curve decreases in a step-by-step manner according to the working period.

13. The lamp dimming method according to any one of claims 1 to 12, characterized in that: The preset reference value is the initial current value of the gear current curve.

14. The lamp dimming method according to claim 1, characterized in that: The power supply of the lamp is a power supply battery.

15. The lamp dimming method according to claim 14, characterized in that: Also includes the steps: The real-time power supply voltage of the power supply battery is obtained, and the preset reference value is adjusted according to the real-time power supply voltage.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of the lamp dimming method according to any one of claims 1 to 15.

17. A computer, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps of the lamp dimming method according to any one of claims 1 to 15 by calling the computer program stored in the memory.