CN113312506A - Lighting device control method, storage medium, and electronic apparatus - Google Patents

Lighting device control method, storage medium, and electronic apparatus Download PDF

Info

Publication number
CN113312506A
CN113312506A CN202110597375.0A CN202110597375A CN113312506A CN 113312506 A CN113312506 A CN 113312506A CN 202110597375 A CN202110597375 A CN 202110597375A CN 113312506 A CN113312506 A CN 113312506A
Authority
CN
China
Prior art keywords
rgb value
lighting device
value
period
timing parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110597375.0A
Other languages
Chinese (zh)
Inventor
刘宇康
张振华
王晓彪
杜超喜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfeng Nissan Passenger Vehicle Co
Original Assignee
Dongfeng Nissan Passenger Vehicle Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dongfeng Nissan Passenger Vehicle Co filed Critical Dongfeng Nissan Passenger Vehicle Co
Priority to CN202110597375.0A priority Critical patent/CN113312506A/en
Publication of CN113312506A publication Critical patent/CN113312506A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Abstract

The invention provides a lighting device control method, a storage medium and an electronic device, wherein the method comprises the following steps: receiving a control instruction for controlling the color of a lighting device to be controlled, and acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 of the lighting device to be controlled according to the control instruction; in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2; and controlling the lighting device by using the current time RGB value. The invention realizes the breathing control of all colors without pre-storing a color index table, only needs to add new colors and corresponding RGB values in the system when needing to realize the breathing control of more colors, has short development period, adapts to the requirement of fast iteration and has good expansibility.

Description

Lighting device control method, storage medium, and electronic apparatus
Technical Field
The present invention relates to the field of automotive technologies, and in particular, to a lighting device control method, a storage medium, and an electronic device.
Background
The atmosphere lamp is an illuminating lamp with a decorative effect, is usually red, blue, green and the like, and is mainly used for enabling a carriage to be more gorgeous, setting up the atmosphere and creating the indoor mood.
At present, the existing atmosphere lamp breathing control method mainly adopts a color index table, and in each control breathing cycle, an RGB value of each color at each moment needs to be stored in the color index table in advance, as shown in table 1 below, for example, a vermilion color is used, and when the color index table is established, RGB values of the vermilion color at different times and different brightnesses in the day and night need to be stored in advance. When the atmosphere lamp breathing control is carried out, the controller controls the atmosphere lamp to display different brightness and different colors according to the RGB value corresponding to each color by searching the RGB value corresponding to each color stored in the color index table.
TABLE 1
Figure BDA0003090300480000011
However, in the process of implementing the invention, the inventor finds that, in the existing atmosphere lamp breathing control method, because a color index table needs to be established and stored in advance, hundreds of color index tables need to be stored in each breathing control process, the memory occupation is large, the response speed is slow, meanwhile, the atmosphere lamp cannot be controlled to display the effect which is not stored in advance in the color index table, and the color index table needs to be updated again according to the change of the color and the period in the development process. Meanwhile, because the function is externally closed, only the original developer can modify the function effect, the customization cannot be realized, the development period is long, the requirement of quick iteration cannot be met, and the expansibility is poor.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a lighting device control method, a storage medium and electronic equipment, so that the breathing control of all color atmosphere lamps is realized, a color index table does not need to be stored in advance, the development period is short, the requirement of quick iteration can be met, and the expansibility is good.
The technical scheme of the invention provides a lighting device control method, which comprises the following steps:
receiving a control instruction for controlling the color of a lighting device to be controlled, and acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 of the lighting device to be controlled according to the control instruction;
in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2;
and controlling the lighting device by using the current time RGB value.
Further, the obtaining a timing parameter k corresponding to each time within a preset time period, and calculating a current time RGB value corresponding to each time according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1, and the response frequency T2 includes:
updating the timing parameter k when the current time RGB value is calculated once, verifying whether the timing parameter k is in the preset time interval, and stopping calculating the current time RGB value when the timing parameter k exceeds the preset time interval;
the control of the lighting device by using the current time RGB value comprises the following steps:
and controlling the lighting device according to the RGB value at the current moment corresponding to the moment before the first RGB value or the second RGB value or the timing parameter k exceeds the preset time period.
Further, the controlling the lighting device according to the RGB value at the current moment corresponding to the moment before the first RGB value, the second RGB value, or the timing parameter k exceeds the preset time period includes:
and judging the position of the timing parameter k in the function cycle T1 at the previous moment when the timing parameter k exceeds the preset time period, if the timing parameter k is in a first sub-cycle of the function cycle T1, controlling the lighting device by using the first RGB value, and if the timing parameter k is in a second sub-cycle of the function cycle T1, controlling the lighting device by using the second RGB value, where the first sub-cycle is a change cycle from the first color to the second color, and the second sub-cycle is a change cycle from the second color to the first color.
Further, the controlling the lighting device according to the RGB value at the current moment corresponding to the moment before the first RGB value, the second RGB value, or the timing parameter k exceeds the preset time period includes:
and when the timing parameter K exceeds the preset time period, if the difference value between the value of the timing parameter K and the timing parameter K' at the end of the first sub-period is within a preset difference threshold value, controlling the lighting device according to the second RGB value, otherwise, controlling the lighting device according to the first RGB value.
Further, in the first sub-period, the RGB value at the current time is calculated by the following method:
Figure BDA0003090300480000031
wherein, R' is the R value corresponding to the RGB value at the current moment in the first sub-period; g' is a G value corresponding to the RGB value at the current moment in the first sub-period; b' is a B value corresponding to the RGB value at the current moment in the first sub-period; r2The R value is corresponding to the second RBG value; r1The R value is corresponding to the first RBG value; g2The value is the G value corresponding to the second RBG value; g1The value is the G value corresponding to the first RBG value; b is2The value B is corresponding to the second RBG value; b is1The value B is corresponding to the first RBG value; k is the counting parameter; t is1Is the functional cycle; t is2Is the response frequency.
Further, in the second sub-period, the RGB value at the current time is calculated by the following method:
Figure BDA0003090300480000041
wherein, R' is the R value corresponding to the RGB value at the current moment in the second sub-period; g' is a G value corresponding to the RGB value at the current moment in the second sub-period; and B' is the B value corresponding to the RGB value at the current moment in the second sub-period.
Further, the calculating the RGB values at the current time using the first RGB value, the second RGB value, the function period T1 and the response frequency T2 further includes:
and removing floating point numbers of the RGB value at the current moment.
Further, the floating point number removal processing on the RGB value at the current time specifically includes:
and processing the RGB value at the current moment by using integer four operations.
The technical solution of the present invention also provides a storage medium storing computer instructions for executing all the steps of the lighting device control method as described above when a computer executes the computer instructions.
The technical solution of the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
receiving a control instruction for controlling the color of a lighting device to be controlled, and acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 according to the control instruction;
in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2;
and controlling the lighting device by using the current time RGB value.
After adopting above-mentioned technical scheme, have following beneficial effect: when a control instruction for controlling the color of the lighting device to be controlled is received, a first RGB value of a first color, a second RGB value of a second color, a function cycle T1 and a response frequency T2 of the lighting device to be controlled are obtained according to the control instruction, a timing parameter k corresponding to each moment is obtained in a preset time period, a current moment RGB value corresponding to each moment is calculated according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2, the lighting device to be controlled is controlled according to the current moment RGB value, accordingly, breathing control of all color atmosphere lamps is achieved, a color index table does not need to be stored in advance, when breathing control of more color atmosphere lamps is needed, only new colors and corresponding RGB values need to be added in a system, the development cycle is short, the requirement of fast iteration can be met, and expansibility is good.
Drawings
The disclosure of the present invention will become more readily understood by reference to the drawings. It should be understood that: these drawings are for illustrative purposes only and are not intended to limit the scope of the present disclosure. In the figure:
fig. 1 is a flowchart illustrating a method for controlling a lighting device according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for controlling a lighting device according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of a hardware structure of an electronic device for controlling a lighting apparatus according to a fourth embodiment of the present invention.
Detailed Description
The following further describes embodiments of the present invention with reference to the accompanying drawings.
It is easily understood that according to the technical solution of the present invention, those skilled in the art can substitute various structures and implementation manners without changing the spirit of the present invention. Therefore, the following detailed description and the accompanying drawings are merely illustrative of the technical aspects of the present invention, and should not be construed as limiting or restricting the technical aspects of the present invention.
The terms of orientation of up, down, left, right, front, back, top, bottom, and the like referred to or may be referred to in this specification are defined relative to the configuration shown in the drawings, and are relative terms, and thus may be changed correspondingly according to the position and the use state of the device. Therefore, these and other directional terms should not be construed as limiting terms.
Example one
As shown in fig. 1, fig. 1 is a flowchart of a method for controlling an illumination apparatus according to an embodiment of the present invention, including:
step S101: receiving a control instruction for controlling the color of the lighting device to be controlled;
step S102: acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 of the lighting device to be controlled according to the control instruction;
step S103: in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2;
step S104: and controlling the lighting device by using the RGB value at the current moment.
Specifically, when the lighting device needs to be controlled, such as a welcome mode triggered when a vehicle door is opened and a control instruction for controlling the color of the lighting device to be controlled is input by a user, firstly, the controller executes a step S101 of receiving the control instruction input by the user; secondly, the controller executes step S102 to obtain a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 of the lighting device to be controlled according to the control instruction, taking the current color breathing and the breathing process as changing from bright to dark to bright as an example, the current color of the lighting device to be controlled is taken as the first color, the RGB value corresponding to the current color is used as a first RGB value, the current color is extinguished as a second color, the RGB value corresponding to the second color is used as a second RGB value, the color of the lighting device to be controlled and the corresponding RGB value can be stored in the system in advance, the color can be set according to the requirement, for example, the color can be conventional red, orange, yellow, green, cyan, blue, purple seven colors, or the existing popular 64 colors, because the color is directly extracted by the setting interface, therefore, the change of the color setting can be corresponded without modifying the program, and the color index table is not required to be inquired; then, the controller executes step S103 to obtain a timing parameter k corresponding to each time within a preset time period, and calculates a current time RGB value corresponding to each time according to the timing parameter k, the first RGB value, the second RGB value, the function period T1, and the response frequency T2, where the timing parameter k may be used to time the output color according to the response frequency T2 by using a timer, for example, when the response frequency T2 is 0.1S, the timer counts every 0.1S, the timing parameter k is increased by 0.1S, so that the current time RGB value changes with the change of the timing parameter k, thereby obtaining RGB values of all colors; finally, the controller executes step S104 to control the color change of the lighting device to be controlled by using the RGB value at the current moment.
The lighting device to be controlled is an LED lamp, the color control of the lighting device to be controlled can be controlled through the existing LED lamp driving module, the color control method of the lighting device to be controlled is the same as that of the existing LED lamp, and the description is omitted here.
The response frequency refers to the time interval frequency of the color change of the lamp to be controlled, for example, when the control frequency is 0.1s, it means that one color is displayed every 0.1 s. The function period T1 is the time required for the light color to change from the first color to the second color and then back to the first color in equal proportion according to the designated control law, for example, the time required for the welcome mode to be red-black-red when the door of the vehicle is opened is 4s, and the function period T1 is 4 s.
Among them, the controller is preferably an Electronic Control Unit (ECU).
The lighting device control method provided by the invention obtains the first RGB value of the first color, the second RGB value of the second color, the function period T1 and the response frequency T2 of the lighting device to be controlled according to the control instruction when receiving the control instruction for controlling the color of the lighting device to be controlled, obtains the timing parameter k corresponding to each moment in a preset time period, calculates the current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function period T1 and the response frequency T2, controls the lighting device to be controlled according to the current moment RGB value, thereby realizing the breathing control of all color atmosphere lamps, needing no color index table to be stored in advance, only needing to add new colors and corresponding RGB values in the system when needing to realize the breathing control of more color atmosphere lamps, having short development period, being capable of adapting to the requirement of quick iteration, and the expansibility is good.
Example two
As shown in fig. 2, fig. 2 is a flowchart of a control method of an illumination apparatus according to a second embodiment of the present invention, including:
step S201: receiving a control instruction for controlling the color of the lighting device to be controlled;
step S202: acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 of the lighting device to be controlled according to the control instruction;
step S203: in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2;
step S204: updating the timing parameter k when the RGB value at the current moment is calculated every time;
step S205: judging whether the timing parameter k is in a preset time period or not;
step S206: stopping calculating the RGB value at the current moment;
step S207: judging the position of the timing parameter k in the function cycle T1 at the moment before the timing parameter k exceeds the preset time period;
step S208: if the timing parameter k is in the first sub-period of the functional period T1, controlling the lighting device with the first RGB value;
step S209: if the timing parameter k is in the second sub-period of the function period T1, controlling the lighting device with the second RGB value;
step S210: judging whether the difference value between the timing parameter K value and the timing parameter K' at the end of the first sub-period is within a preset difference value threshold value;
step S211: controlling the lighting device according to the second RGB value;
step S212: the lighting device is controlled according to the first RGB values.
Specifically, when the lighting device needs to be controlled, first, the controller executes step 201 to receive a control instruction.
Secondly, the controller executes step S202 to obtain a first RGB value of the first color, a second RGB value of the second color, a function period T1 and a response frequency T2 of the lighting device to be controlled;
next, the controller executes step S203 to obtain a timing parameter k corresponding to each time within a preset time period, and calculates a current time RGB value corresponding to each time according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1, and the response frequency T2. Then, the controller updates the timing parameter k when the controller calculates the RGB value at the current time every time in step S204;
finally, the controller executes step S205 to determine whether the timing parameter k is within the preset time period, if so, executes step S204, otherwise, executes steps S206-S207 to stop calculating the RGB value of the current time, and determines that the timing parameter k exceeds the position of the previous time of the preset time period in the function cycle T1, if the timing parameter k is in the first sub-cycle of the function cycle T1, executes step S208 to control the lighting device with the first RGB value, and if the timing parameter k is in the second sub-cycle of the function cycle T1, executes step S208 to control the lighting device with the second RGB value.
Meanwhile, the controller executes step S210 to determine whether the difference between the timing parameter K and the timing parameter K' at the end of the first sub-period is within a preset difference threshold, if so, execute step S211, otherwise, execute step S212.
The function period T1 includes a first sub-period and a second sub-period, where the first color and the second color controlled by the first sub-period are opposite to the first color and the second color controlled by the second sub-period, for example, when the color controlled by the first sub-period is red-black, the color controlled by the second sub-period is black-red, and the first sub-period and the second sub-period form a complete function period T1. The preset difference threshold is the number of times of responding to the frequency T2 in a complete function period T1. Preferably, the preset difference threshold is ± T1/4T 2.
The lighting device control method provided by the invention obtains the first RGB value of the first color, the second RGB value of the second color, the function period T1 and the response frequency T2 of the lighting device to be controlled according to the control instruction when receiving the control instruction for controlling the color of the lighting device to be controlled, obtains the timing parameter k corresponding to each moment in a preset time period, calculates the current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function period T1 and the response frequency T2, controls the lighting device to be controlled according to the current moment RGB value, thereby realizing the breathing control of all color atmosphere lamps, needing no color index table to be stored in advance, only needing to add new colors and corresponding RGB values in the system when needing to realize the breathing control of more color atmosphere lamps, having short development period, being capable of adapting to the requirement of quick iteration, and the expansibility is good.
In one embodiment, in order to adapt to the linear variation law, when the control law is a linear function, in the first sub-period, the current time RGB value is calculated by using the following formula (1):
Figure BDA0003090300480000101
wherein, R' is the R value corresponding to the RGB value at the current moment in the first sub-period; g' is a G value corresponding to the RGB value at the current moment in the first sub-period; b' is a B value corresponding to the RGB value at the current moment in the first sub-period; r2The R value corresponding to the second RGB value; r1The R value is corresponding to the first RGB value; g2The G value corresponding to the second RGB value; g1A G value corresponding to the first RGB value; b is2The B value is corresponding to the second RGB value; b is1The value B is corresponding to the first RGB value; k is a time meterA parameter; t is1Is a functional cycle; t is2Is the response frequency.
In one embodiment, in order to adapt to the linear variation law, when the control law is a linear function, in the second sub-period, the current time RGB value is calculated by using the following expression (2):
Figure BDA0003090300480000102
wherein, R' is the R value corresponding to the RGB value at the current moment in the second sub-period; g' is a G value corresponding to the RGB value at the current moment in the second sub-period; b' is the B value corresponding to the RGB value at the current moment in the second sub-period.
Preferably, in order to adapt to the non-linear change law, when the control law is a quadratic function, the current time RGB value is calculated by the following expression (3) instead of the expression (1):
Figure BDA0003090300480000111
preferably, in order to adapt to the non-linear change law, when the control law is a quadratic function, the current time RGB value is calculated by the following expression (4) instead of the expression (2):
Figure BDA0003090300480000112
in one embodiment, to improve the operation efficiency, the calculating the RGB values at the current time by using the first RGB value, the second RGB value, the function period T1, and the response frequency T2 further includes:
and removing floating point numbers of the RGB value at the current moment.
In one embodiment, the floating point number removal processing on the RGB value at the current time specifically includes:
and processing the RGB value at the current moment by using integer four-rule operation.
In particular, in the first sub-periodIn the method, the left and right sides of the above expression (1) are simultaneously multiplied by an integer variable which can make the operation result an integer, and the integer variable is preferably cT for improving the operation efficiency1Wherein c is a constant multiplied by the control frequency as an integer, and thus, the above expression (1) is converted to the following expression (5):
Figure BDA0003090300480000121
similarly, in the second sub-period, the left and right sides of the above equation (2) are simultaneously multiplied by an integer variable that can make the operation result an integer, and preferably, in order to improve the operation efficiency, the integer variable is cT1Wherein c is a constant multiplied by the control frequency as an integer, and thus, the above expression (2) is converted to the following expression (6):
Figure BDA0003090300480000122
as can be seen from the above equations (5) and (6), the RGB output values obtained by processing the RGB output values by using the four-rule operation of integers are all integer values, and floating point numbers are eliminated, so that the operation process does not include floating point operation, thereby improving the operation efficiency, being applicable to a general controller, and improving the universality.
Similarly, when the control law is a quadratic function, the floating point removal processing may also be performed on the above equations (3) and (4) by the same method, which is not described herein again.
EXAMPLE III
A third embodiment of the present invention provides a storage medium for storing computer instructions, which, when executed by a computer, are configured to perform all the steps of the lighting device control method in any one of the method embodiments as described above.
Example four
As shown in fig. 3, a hardware structure diagram of an electronic device for controlling a lighting apparatus according to a fourth embodiment of the present invention includes:
at least one processor 301; and the number of the first and second groups,
a memory 302 communicatively coupled to the at least one processor 301; wherein the content of the first and second substances,
the memory 302 stores instructions executable by the at least one processor 301 to cause the at least one processor 301 to:
receiving a control instruction for controlling the color of a lighting device to be controlled, and acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 according to the control instruction;
in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2;
and controlling the lighting device by using the current time RGB value.
In fig. 3, one processor 301 is taken as an example.
The Electronic device is preferably an Electronic Control Unit (ECU).
The electronic device may further include: an input device 303 and an output device 304.
The processor 301, the memory 302, the input device 303, and the output device 304 may be connected by a bus or other means, and are illustrated as being connected by a bus.
The memory 302, which is a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the lighting device control method in the embodiments of the present application, for example, the method flows shown in fig. 1-2. The processor 301 executes various functional applications and data processing by executing nonvolatile software programs, instructions, and modules stored in the memory 302, that is, implements the lighting device control method in the above-described embodiment.
The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the lighting device control method, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 302 optionally includes memory located remotely from the processor 301, and these remote memories may be connected over a network to a device that performs the lighting device control method. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 303 may receive input of user clicks and generate signal inputs related to user settings of the lighting device control method and function control. The output means 304 may comprise a display device such as a display screen.
The lighting device control method in any of the above method embodiments is performed when the one or more modules are stored in the memory 302, when executed by the one or more processors 301.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in the embodiments of the present application.
The electronic device of embodiments of the present invention exists in a variety of forms, including but not limited to:
(1) an Electronic Control Unit (ECU) is also called a "traveling computer" or a "vehicle-mounted computer". The digital signal processor mainly comprises a microprocessor (CPU), a memory (ROM and RAM), an input/output interface (I/O), an analog-to-digital converter (A/D), a shaping circuit, a driving circuit and other large-scale integrated circuits.
(2) Mobile communication devices, which are characterized by mobile communication capabilities and are primarily targeted at providing voice and data communications. Such terminals include smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(3) The ultra-mobile personal computer equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include PDA, MID, and UMPC devices, among others.
(4) Portable entertainment devices such devices may display and play multimedia content. Such devices include audio and video players (e.g., ipods), handheld game consoles, electronic books, as well as smart toys and portable car navigation devices.
(5) The server is similar to a general computer architecture, but has higher requirements on processing capability, stability, reliability, safety, expandability, manageability and the like because of the need of providing highly reliable services.
(6) And other electronic devices with data interaction functions.
Furthermore, the logic instructions in the memory 302 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a mobile terminal (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and not to limit the same; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A lighting device control method, comprising:
receiving a control instruction for controlling the color of a lighting device to be controlled, and acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 of the lighting device to be controlled according to the control instruction;
in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2;
and controlling the lighting device by using the current time RGB value.
2. The method as claimed in claim 1, wherein the obtaining a timing parameter k corresponding to each time within a preset time period, and calculating a current time RGB value corresponding to each time according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2 comprises:
updating the timing parameter k when the current time RGB value is calculated once, verifying whether the timing parameter k is in the preset time interval, and stopping calculating the current time RGB value when the timing parameter k exceeds the preset time interval;
the control of the lighting device by using the current time RGB value comprises the following steps:
and controlling the lighting device according to the RGB value at the current moment corresponding to the moment before the first RGB value or the second RGB value or the timing parameter k exceeds the preset time period.
3. The lighting device control method according to claim 2, wherein the controlling the lighting device with the first RGB value or the second RGB value or the timing parameter k exceeding a current time RGB value corresponding to a previous time of the preset time period comprises:
and judging the position of the timing parameter k in the function cycle T1 at the previous moment when the timing parameter k exceeds the preset time period, if the timing parameter k is in a first sub-cycle of the function cycle T1, controlling the lighting device by using the first RGB value, and if the timing parameter k is in a second sub-cycle of the function cycle T1, controlling the lighting device by using the second RGB value, where the first sub-cycle is a change cycle from the first color to the second color, and the second sub-cycle is a change cycle from the second color to the first color.
4. The lighting device control method according to claim 2, wherein the controlling the lighting device with the first RGB value or the second RGB value or the timing parameter k exceeding a current time RGB value corresponding to a previous time of the preset time period comprises:
and when the timing parameter K exceeds the preset time period, if the difference value between the value of the timing parameter K and the timing parameter K' at the end of the first sub-period is within a preset difference threshold value, controlling the lighting device according to the second RGB value, otherwise, controlling the lighting device according to the first RGB value.
5. The lighting device control method according to claims 1-4, wherein in the first sub-period, the current time RGB value is calculated by:
Figure FDA0003090300470000021
wherein, R' is the R value corresponding to the RGB value at the current moment in the first sub-period; g' is a G value corresponding to the RGB value at the current moment in the first sub-period; b' is a B value corresponding to the RGB value at the current moment in the first sub-period; r2The R value is corresponding to the second RGB value; r1The R value is corresponding to the first RGB value; g2The G value is corresponding to the second RGB value; g1A G value corresponding to the first RGB value; b is2The value B is corresponding to the second RGB value; b is1The value B is corresponding to the first RGB value; k is the timing parameter; t is1Is the functional cycle; t is2Is the response frequency.
6. The lighting device control method according to claim 5, wherein in the second sub-period, the current time RGB value is calculated by:
Figure FDA0003090300470000031
wherein, R' is the R value corresponding to the RGB value at the current moment in the second sub-period; g' is a G value corresponding to the RGB value at the current moment in the second sub-period; and B' is the B value corresponding to the RGB value at the current moment in the second sub-period.
7. The lighting device control method according to claim 6, wherein the calculating of the current-time RGB value using the first RGB value, the second RGB value, the function period T1, and the response frequency T2 further comprises:
and removing floating point numbers of the RGB value at the current moment.
8. The lighting device control method according to claim 7, wherein the floating point number removal processing on the RGB values at the current time specifically includes:
and performing floating point number removal processing on the RGB value at the current moment by using integer four-rule operation.
9. A storage medium characterized in that it stores computer instructions for performing all the steps of the lighting device control method according to any one of claims 1 to 8 when the computer instructions are executed by a computer.
10. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
receiving a control instruction for controlling the color of a lighting device to be controlled, and acquiring a first RGB value of a first color, a second RGB value of a second color, a function period T1 and a response frequency T2 according to the control instruction;
in a preset time period, acquiring a timing parameter k corresponding to each moment, and calculating a current moment RGB value corresponding to each moment according to the timing parameter k, the first RGB value, the second RGB value, the function cycle T1 and the response frequency T2;
and controlling the lighting device by using the current time RGB value.
CN202110597375.0A 2021-05-28 2021-05-28 Lighting device control method, storage medium, and electronic apparatus Pending CN113312506A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110597375.0A CN113312506A (en) 2021-05-28 2021-05-28 Lighting device control method, storage medium, and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110597375.0A CN113312506A (en) 2021-05-28 2021-05-28 Lighting device control method, storage medium, and electronic apparatus

Publications (1)

Publication Number Publication Date
CN113312506A true CN113312506A (en) 2021-08-27

Family

ID=77376162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110597375.0A Pending CN113312506A (en) 2021-05-28 2021-05-28 Lighting device control method, storage medium, and electronic apparatus

Country Status (1)

Country Link
CN (1) CN113312506A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102307413A (en) * 2011-06-07 2012-01-04 青岛海信宽带多媒体技术有限公司 Method and device for displaying any color by using RGB (Red, Green and Blue) three-color indicating lamps
JP2013084519A (en) * 2011-10-12 2013-05-09 Nakano Engineering Co Ltd Dimming controlled led lighting fixture
JP2013218153A (en) * 2012-04-10 2013-10-24 Sharp Corp Illumination control device, control system, and illumination control method
CN108664136A (en) * 2018-05-17 2018-10-16 珠海市学思电子科技有限公司 Keyboard light imitates control method, computer installation and computer readable storage medium
CN108898917A (en) * 2018-06-28 2018-11-27 深圳市乾乾编程科技有限公司 Terminal control method, device and computer equipment based on color identification
WO2019218569A1 (en) * 2018-05-17 2019-11-21 珠海市学思电子科技有限公司 Keyboard light effect control method, computer apparatus and computer-readable storage medium
KR20200117735A (en) * 2019-04-05 2020-10-14 한국과학기술원 User interface for controlling chroma and luminance of multi-color light source
CN111954334A (en) * 2020-08-12 2020-11-17 宁波视睿迪光电有限公司 Control method and device of breathing lamp, electronic equipment and readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102307413A (en) * 2011-06-07 2012-01-04 青岛海信宽带多媒体技术有限公司 Method and device for displaying any color by using RGB (Red, Green and Blue) three-color indicating lamps
JP2013084519A (en) * 2011-10-12 2013-05-09 Nakano Engineering Co Ltd Dimming controlled led lighting fixture
JP2013218153A (en) * 2012-04-10 2013-10-24 Sharp Corp Illumination control device, control system, and illumination control method
CN108664136A (en) * 2018-05-17 2018-10-16 珠海市学思电子科技有限公司 Keyboard light imitates control method, computer installation and computer readable storage medium
WO2019218569A1 (en) * 2018-05-17 2019-11-21 珠海市学思电子科技有限公司 Keyboard light effect control method, computer apparatus and computer-readable storage medium
CN108898917A (en) * 2018-06-28 2018-11-27 深圳市乾乾编程科技有限公司 Terminal control method, device and computer equipment based on color identification
KR20200117735A (en) * 2019-04-05 2020-10-14 한국과학기술원 User interface for controlling chroma and luminance of multi-color light source
CN111954334A (en) * 2020-08-12 2020-11-17 宁波视睿迪光电有限公司 Control method and device of breathing lamp, electronic equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
姚海根;: "RGB编辑", 出版与印刷, no. 02 *

Similar Documents

Publication Publication Date Title
US8878455B2 (en) Systems and methods of controlling the output of a light fixture
CN111800923A (en) Light control method and device, readable storage medium and terminal equipment
CN109476254B (en) Device and method for setting the light distribution of a lamp
CN114051304B (en) Lighting on-off state control method, device, equipment, medium and program product
CN112616225A (en) Color light lamp illumination control method and terminal equipment
CN112672464B (en) Lamp light control method and device of lamp and computer equipment
CN109564751A (en) The automatic adjusting method of user interface
CN105493628B (en) Edge signal counting device and led driver
CN114245528B (en) Vehicle lamplight show control method, device, equipment, medium and program product
CN109637437A (en) Image display control method, device, medium and display screen control system
CN109640464A (en) A kind of pwm signal duty ratio control method and corresponding circuit and LED light
CN113312506A (en) Lighting device control method, storage medium, and electronic apparatus
CN113853047A (en) Light control method and device, storage medium and electronic equipment
CN112040601B (en) Lamp dot matrix control device and method and LED stage lamp
CN103841385B (en) Image dithering process method and device
CN117202446A (en) AI-based self-adaptive light effect control method and system
CN116301534A (en) Method and device for generating lamp effect animation parameters of vehicle exterior lamp
CN114407775A (en) Atmosphere lamp control method, device and system and vehicle
CN114698207A (en) Light adjusting method and device, electronic equipment and storage medium
CN203444653U (en) Story machine
CN112612992A (en) Color temperature optimization method and device, terminal equipment and storage medium
CN110969868A (en) Control method, device and system of traffic signal lamp
CN109152163B (en) Control method and device for breathing lamp in non-real-time system
CN112040600A (en) Lamp control method and device, lamp and storage medium
CN112135402B (en) RGB light path current adjusting method, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination