Method, medium, and apparatus for synchronizing states of lighting devices

文档序号:614235 发布日期:2021-05-07 浏览:17次 中文

阅读说明:本技术 照明设备的状态同步方法、介质及装置 (Method, medium, and apparatus for synchronizing states of lighting devices ) 是由 陈伟民 杨乃军 洪海鹏 陈国林 于 2021-01-11 设计创作,主要内容包括:本发明公开了一种照明设备的状态同步方法及装置,方法包括:根据外部输入的电源获取交流信号特征,作为待状态同步的每个照明设备对应的脉冲信号,使得所述待状态同步的每个照明设备对应的脉冲信号均相同,并将所述脉冲信号半周期作为计时的单位时间基数;当接收到模式欲同步的信号时,根据所述模式欲同步的信号对应的功能模式的周期时间和所述脉冲信号计算所述功能模式对应的周期脉冲个数;将计算周期脉冲个数的缓存清零,并根据所述功能模式对应的周期脉冲个数重新开始循环计数,以便根据所述模式欲同步的信号控制所述待状态同步的每个照明设备在所述功能模式下进行状态同步;从而能够在低成本、高可靠性的前提下提高照明设备状态同步的效果。(The invention discloses a state synchronization method and a state synchronization device for lighting equipment, wherein the method comprises the following steps: acquiring alternating current signal characteristics according to an externally input power supply, using the alternating current signal characteristics as a pulse signal corresponding to each lighting device to be state-synchronized, enabling the pulse signals corresponding to each lighting device to be state-synchronized to be identical, and using a half period of the pulse signal as a unit time base for timing; when a signal to be synchronized in a mode is received, calculating the number of periodic pulses corresponding to a functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal; clearing the cache for calculating the number of the periodic pulses, and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signal to be synchronized in the mode; therefore, the effect of state synchronization of the lighting equipment can be improved on the premise of low cost and high reliability.)

1. A method of status synchronization of a lighting device, comprising the steps of:

acquiring alternating current signal characteristics according to an externally input power supply, using the alternating current signal characteristics as a pulse signal corresponding to each lighting device to be state-synchronized, enabling the pulse signals corresponding to each lighting device to be state-synchronized to be identical, and using a half period of the pulse signal as a unit time base for timing;

when a signal to be synchronized in a mode is received, calculating the number of periodic pulses corresponding to a functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal;

and clearing the cache for calculating the number of the periodic pulses, and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signal to be synchronized in the mode.

2. The method for synchronizing the states of lighting devices according to claim 1, wherein each lighting device to be state-synchronized is connected to a power grid, and the ac voltage output from the power grid is divided by resistors connected in series to obtain the pulse signal corresponding to each lighting device to be state-synchronized.

3. The method for synchronizing states of lighting devices according to claim 1, wherein when receiving a signal to be synchronized in a mode, calculating the number of periodic pulses corresponding to a functional mode according to the pulse signal and the periodic time of the functional mode corresponding to the signal to be synchronized in the mode, comprises:

acquiring corresponding half-period time according to the pulse signal, and taking the half-period time as a unit time base for timing, wherein the unit time base is uniquely corresponding to the frequency of an external alternating current signal;

according to the unit time base number corresponding to the pulse signal, the number of periodic pulses corresponding to the periodic time of the functional mode corresponding to the signal to be synchronized in each mode is calculated and set in advance;

when a signal to be synchronized in a mode is received, dividing the cycle time of a functional mode corresponding to the signal to be synchronized in the mode by a unit time base number of timing corresponding to the pulse signal to obtain the number of cycle pulses required by the cycle time of the functional mode.

4. The method as claimed in claim 3, wherein the preset cycle time of the functional mode corresponding to the signal to be synchronized in each mode satisfies that the calculated number of the periodic pulses corresponding to the functional mode is a positive integer, i.e. the cycle time of the mode and the unit time base form a positive integral relationship.

5. The method for synchronizing states of illumination apparatuses according to claim 1, wherein a buffer variable for counting the number of periodic pulses is cleared when a signal to synchronize the pattern is received.

6. The method as claimed in claim 5, wherein the lighting device continuously accumulates the buffer variables for counting the number of pulses in the period according to the rising edge and the falling edge of the pulse signal after receiving the signal to be synchronized in the mode.

7. The method according to claim 6, wherein when the number of the buffer variables for calculating the number of the periodic pulses in the lighting apparatuses connected to the same power grid is accumulated to be equal to the number of the periodic pulses corresponding to the functional mode, the number of the buffer variables for calculating the number of the periodic pulses is automatically cleared and accumulated again, and the cycle is continued.

8. The method according to claim 1, wherein the lighting device status is synchronized with the signal to be synchronized through the corresponding mode during the period of accumulating the buffer variables of the number of periodic pulses, so that the plurality of lighting devices synchronously display the status corresponding to the functional mode.

9. A computer-readable storage medium, characterized in that a state synchronization program of a lighting device is stored thereon, which when executed by a processor implements the state synchronization method of the lighting device according to any one of claims 1 to 8.

10. A state synchronization apparatus for a lighting device, comprising:

the acquisition module is used for acquiring alternating current signal characteristics according to an externally input power supply, using the alternating current signal characteristics as a pulse signal corresponding to each lighting device to be synchronized in a state, enabling the pulse signals corresponding to each lighting device to be synchronized in the state to be the same, and using a half period of the pulse signal as a unit time base of timing;

the calculation module is used for calculating the number of periodic pulses corresponding to the functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal when the signal to be synchronized in the mode is received;

and the state synchronization module is used for clearing the cache for calculating the number of the periodic pulses and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signal to be synchronized in the mode.

11. The status synchronization apparatus for lighting devices according to claim 10, wherein each lighting device to be status-synchronized is connected to a power grid, and the ac voltage output from the power grid is divided by resistors connected in series to obtain the pulse signal corresponding to each lighting device to be status-synchronized.

12. The status synchronization apparatus of lighting devices of claim 10, wherein the calculation module is further configured to,

acquiring corresponding half-period time according to the pulse signal, wherein the half-period time is used as a unit time base for timing, and the unit time base is uniquely corresponding to the frequency of the pulse signal;

according to the unit time base number corresponding to the pulse signal, the number of periodic pulses corresponding to the periodic time of the functional mode corresponding to the signal to be synchronized in each mode is calculated and set in advance;

when a signal to be synchronized in a mode is received, dividing the cycle time of a functional mode corresponding to the signal to be synchronized in the mode by a unit time base number of timing corresponding to the pulse signal to obtain the number of cycle pulses required by the cycle time of the functional mode.

13. The apparatus for synchronizing statuses of illumination apparatuses according to claim 9, wherein the preset cycle time of the functional mode corresponding to the signal to be synchronized in each mode satisfies that the calculated number of the periodic pulses corresponding to the functional mode is a positive integer, i.e. the cycle time of the mode and the unit time base form a positive integral relationship.

Technical Field

The present invention relates to the field of lighting device technologies, and in particular, to a method for synchronizing states of a lighting device, a computer-readable storage medium, and a device for synchronizing states of a lighting device.

Background

In the related art, a plurality of lighting devices with periodicity usually rely on the MCU to realize state synchronization from the internal crystal oscillator, because the problem that the light source generates heat, the deviation of the MCU internal crystal oscillator is aggravated by the difference of the temperature of each lighting device MCU working environment, therefore, along with the lapse of time, the deviation of the MCU internal crystal oscillator is bigger and bigger, so that the periodic states of the lighting devices become asynchronous.

Disclosure of Invention

The present application is based on the recognition and study of the following problems by the inventors:

in order to solve the problem that the periodic state synchronization effect of a plurality of lighting devices is poor due to the heating of a light source, the first method can improve the synchronization of the MCU by means of an external crystal oscillator, but the external crystal oscillator with high precision of 5PPM can improve the inconsistent error of the state synchronization of the plurality of lighting devices in a short time, but the inconsistent synchronization error exists in the time exceeding 30 minutes or more in the actual test, and the adoption of the high-precision external crystal oscillator undoubtedly increases the cost of hardware; the second mode is that wired or wireless two-way communication can be added to a plurality of lighting devices, so that the respective lighting devices can know the state of the lighting devices, transmit the state of the lighting devices to other devices and acquire the states of the other devices to adjust the synchronization effect; however, the wired communication is adopted, so that the plurality of lighting devices are not independent, and the plurality of lighting devices need to be bound through communication lines when in use, thereby increasing the difficulty of daily use; in addition, the above-mentioned disadvantages of bundling can be solved by using wireless two-way communication (such as 433, 315, bluetooth, WIFI, zigbee, etc.), but the cost is increased by using wireless two-way transmission, which is not advantageous for products with winning price, and the wireless communication capacity is limited, which cannot meet the requirement of synchronizing a large number of lighting devices, which is not the best solution.

The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide a method for synchronizing states of lighting devices, which can improve the effect of state synchronization at low cost and with high reliability by using the consistency of ac signals of a power grid, extracting the periodic characteristics of the ac signals as a time base for timing, and using the periodic characteristics as periodic counts in different modes of a plurality of lighting devices.

A second object of the invention is to propose a computer-readable storage medium.

A third object of the present invention is to provide a state synchronization device for a lighting apparatus.

To achieve the above object, a first embodiment of the present invention provides a method for synchronizing states of lighting devices, where the method includes: acquiring alternating current signal characteristics according to an externally input power supply, using the alternating current signal characteristics as a pulse signal corresponding to each lighting device to be state-synchronized, enabling the pulse signals corresponding to each lighting device to be state-synchronized to be identical, and using a half period of the pulse signal as a unit time base for timing; when a signal to be synchronized in a mode is received, calculating the number of periodic pulses corresponding to a functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal; and clearing the cache for calculating the number of the periodic pulses, and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signal to be synchronized in the mode.

According to the state synchronization method of the lighting equipment, firstly, alternating current signal characteristics are obtained according to an externally input power supply and are used as pulse signals corresponding to each lighting equipment to be state-synchronized, so that the pulse signals corresponding to each lighting equipment to be state-synchronized are the same, and the half period of each pulse signal is used as a unit time base number for timing; when a signal to be synchronized in a mode is received, calculating the number of periodic pulses corresponding to a functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal; and clearing the cache for calculating the number of the periodic pulses, and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signal to be synchronized in the mode.

In addition, the state synchronization method for the lighting device proposed according to the above embodiment of the present invention may further have the following additional technical features:

optionally, each lighting device to be state-synchronized is connected to a power grid, and the alternating-current voltage output by the power grid is subjected to voltage division processing through a resistor connected in series, so as to obtain a pulse signal corresponding to each lighting device to be state-synchronized.

Optionally, when a signal to be synchronized in a mode is received, calculating the number of periodic pulses corresponding to the functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal, including: acquiring corresponding half-period time according to the pulse signal, and taking the half-period time as a unit time base for timing, wherein the unit time base is uniquely corresponding to the frequency of an external alternating current signal; according to the unit time base number corresponding to the pulse signal, the number of periodic pulses corresponding to the periodic time of the functional mode corresponding to the signal to be synchronized in each mode is calculated and set in advance; when a signal to be synchronized in a mode is received, dividing the cycle time of a functional mode corresponding to the signal to be synchronized in the mode by a unit time base number of timing corresponding to the pulse signal to obtain the number of cycle pulses required by the cycle time of the functional mode.

Optionally, the preset cycle time of the functional mode corresponding to the signal to be synchronized in each mode satisfies that the calculated number of the periodic pulses corresponding to the functional mode is a positive integer, that is, the cycle time of the mode and the unit time base form a positive integer relationship.

Optionally, the buffer variable used for counting the number of periodic pulses is cleared when a signal to be synchronized in the mode is received.

Optionally, after receiving the signal to be synchronized in the mode, the lighting device continuously accumulates the buffer variables for calculating the number of pulses in the period according to the rising edge and the falling edge of the pulse signal.

Optionally, when the number of the buffer variables for calculating the number of the periodic pulses in the lighting devices connected to the same power grid is accumulated to be equal to the number of the periodic pulses corresponding to the functional mode, the number of the buffer variables for calculating the number of the periodic pulses is automatically cleared and accumulated again, and the cycle is continued.

Optionally, the states of the lighting devices are synchronized through corresponding mode synchronization signals during the period of the accumulation of the buffer variables of the number of periodic pulses, so that the plurality of lighting devices synchronously present the states corresponding to the functional modes.

To achieve the above object, a second aspect of the present invention provides a computer-readable storage medium, on which a state synchronization program of a lighting device is stored, which when executed by a processor implements the state synchronization method of the lighting device as described above.

According to the computer-readable storage medium of the embodiment of the invention, by storing the state synchronization program of the lighting device, when the state synchronization program of the lighting device is executed by the processor, the state synchronization method of the lighting device is realized, so that the state synchronization effect can be improved on the premise of low cost and high reliability.

To achieve the above object, a third embodiment of the present invention provides a state synchronization apparatus for a lighting device, including: the acquisition module is used for acquiring alternating current signal characteristics according to an externally input power supply, using the alternating current signal characteristics as a pulse signal corresponding to each lighting device to be synchronized in a state, enabling the pulse signals corresponding to each lighting device to be synchronized in the state to be the same, and using a half period of the pulse signal as a unit time base of timing; the calculation module is used for calculating the number of periodic pulses corresponding to the functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal when the signal to be synchronized in the mode is received; and the state synchronization module is used for clearing the cache for calculating the number of the periodic pulses and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signal to be synchronized in the mode.

According to the state synchronization device of the lighting equipment, the acquisition module acquires the characteristics of the alternating current signal according to the externally input power supply to be used as the pulse signal corresponding to each lighting equipment to be state-synchronized, so that the pulse signals corresponding to each lighting equipment to be state-synchronized are the same, and the half period of the pulse signal is used as the unit time base of timing, when the calculating module receives the signal to be synchronized, calculating the number of periodic pulses corresponding to the functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal, clearing the buffer for calculating the number of the periodic pulses through the state synchronization module, restarting the cycle counting according to the number of the periodic pulses corresponding to the functional mode, so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the mode signal to be synchronized; therefore, the effect of state synchronization can be improved on the premise of low cost and high reliability.

In addition, the state synchronization device of the lighting apparatus proposed according to the above embodiment of the present invention may further have the following additional technical features:

optionally, each lighting device to be state-synchronized is connected to a power grid, and the alternating-current voltage output by the power grid is subjected to voltage division processing through a resistor connected in series, so as to obtain a pulse signal corresponding to each lighting device to be state-synchronized.

Optionally, when a signal to be synchronized in a mode is received, calculating the number of periodic pulses corresponding to the functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal, including: acquiring corresponding half-period time according to the pulse signal, and taking the half-period time as a unit time base for timing, wherein the unit time base is uniquely corresponding to the frequency of an external alternating current signal; according to the unit time base number corresponding to the pulse signal, the number of periodic pulses corresponding to the periodic time of the functional mode corresponding to the signal to be synchronized in each mode is calculated and set in advance; when a signal to be synchronized in a mode is received, dividing the cycle time of a functional mode corresponding to the signal to be synchronized in the mode by a unit time base number of timing corresponding to the pulse signal to obtain the number of cycle pulses required by the cycle time of the functional mode.

Optionally, the preset cycle time of the functional mode corresponding to the signal to be synchronized in each mode satisfies that the calculated number of the periodic pulses corresponding to the functional mode is a positive integer, that is, the cycle time of the mode and the unit time base form a positive integral multiple relationship.

Optionally, the buffer variable used for counting the number of periodic pulses is cleared when a signal to be synchronized in the mode is received.

Optionally, after receiving the signal to be synchronized in the mode, the lighting device continuously accumulates the buffer variables for calculating the number of pulses in the period according to the rising edge and the falling edge of the pulse signal.

Optionally, when the number of the buffer variables for calculating the number of the periodic pulses in the lighting devices connected to the same power grid is accumulated to be equal to the number of the periodic pulses corresponding to the functional mode, the number of the buffer variables for calculating the number of the periodic pulses is automatically cleared and accumulated again, and the cycle is continued.

Optionally, the states of the lighting devices are synchronized through corresponding mode synchronization signals during the period of the accumulation of the buffer variables of the number of periodic pulses, so that the plurality of lighting devices synchronously present the states corresponding to the functional modes.

Drawings

Fig. 1 is a flow chart illustrating a method for synchronizing states of a lighting device according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a circuit for acquiring a pulse signal according to an embodiment of the present invention;

FIG. 3 is a diagram of various signals of a lighting device according to an embodiment of the present invention;

fig. 4 is a block diagram illustrating a state synchronization apparatus of a lighting device according to an embodiment of the present invention.

Detailed Description

Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.

In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.

Fig. 1 is a flowchart illustrating a method for synchronizing states of lighting devices according to an embodiment of the present invention. As shown in fig. 1, the method for synchronizing the states of the lighting devices according to the embodiment of the present invention includes the following steps:

step 101, acquiring characteristics of an alternating current signal according to an externally input power supply, using the characteristics as a pulse signal corresponding to each lighting device to be state-synchronized, enabling the pulse signals corresponding to each lighting device to be state-synchronized to be the same, and using a half period of the pulse signal as a unit time base for timing.

As an example, each lighting device to be state-synchronized is connected to a power grid, and an alternating-current voltage output by the power grid is subjected to voltage division processing through a resistor connected in series, so as to obtain a pulse signal corresponding to each lighting device to be state-synchronized.

As a specific embodiment, as shown in fig. 2, each lighting device reduces a 120V/220V alternating current signal input by a mains supply into a 3-5V voltage pulse signal that can be recognized by an MCU through a first resistor and a second resistor, and due to the consistency of the power grid alternating current signals, corresponding pulse signals acquired by each lighting device to be state-synchronized are the same.

It should be noted that each lighting device to be state-synchronized needs to be connected to the same power grid, for example, there are 10 lighting devices to be state-synchronized in total, and the 10 lighting devices to be state-synchronized may be plugged into the same socket and connected to the power grid, so as to ensure that the ac signals received by the 10 lighting devices to be state-synchronized are the same.

Step 102, when the signal to be synchronized in the mode is received, calculating the number of periodic pulses corresponding to the functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal.

It should be noted that, the infrared remote controller may simultaneously send the signal to be synchronized in the corresponding mode to each lighting apparatus to be state-synchronized.

As an example, the corresponding half period time is obtained according to the pulse signal, and is used as a unit time base for timing, and the unit time base is uniquely corresponding to the frequency of the external alternating current signal; according to the unit time base number corresponding to the pulse signal, the number of periodic pulses corresponding to the period time of the functional mode corresponding to the signal to be synchronized in each mode is calculated and set in advance; when a signal to be synchronized in a mode is received, dividing the cycle time of a functional mode corresponding to the signal to be synchronized in the mode by a unit time base number of timing corresponding to the pulse signal to obtain the number of cycle pulses required by the cycle time of the functional mode.

That is, the cycle time of the functional mode corresponding to the signal to be synchronized in each mode is set in advance in the MCU, for example, there are 4 modes in total, the cycle time corresponding to the first mode is 4S, the cycle time corresponding to the second mode is 6S, the cycle time corresponding to the third mode is 10S, and the cycle time corresponding to the fourth mode is 0.5S; if the alternating current signal accessed by each lighting device to be state-synchronized is 220V/50HZ, the frequency corresponding to the half-cycle time is 100HZ, and if the alternating current signal accessed by each lighting device to be state-synchronized is 120V/60HZ, the frequency corresponding to the half-cycle time is 120 HZ; assuming that the MCU receives the signal to be synchronized in the mode sent by the infrared remote controller in the third mode and waits for the synchronizationThe ac signal accessed by each lighting device with synchronous state is 220V/50HZ, and the number of the periodic pulses corresponding to the functional mode obtained by the MCU through calculation is:

it should be noted that, according to the periodic characteristics of the ac signal, the synchronization accuracy can be improved by using the half period as the time base of the timing; in addition, when the preset cycle time of the functional mode corresponding to the signal to be synchronized in each mode is set, the state synchronization of a plurality of devices can be realized without any error as long as the number of the calculated cycle pulses corresponding to the functional mode is a positive integer; the respective signal diagrams of a specific lighting device are shown in fig. 3.

And 103, clearing the cache for calculating the number of the periodic pulses, and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signals to be synchronized in the mode.

As an example, the buffer variable used to count the number of periodic pulses is cleared when a signal that the pattern is to be synchronized is received.

That is, each time the power is turned on again or a signal to be synchronized in the mode is received, the buffer for calculating the number of the periodic pulses is cleared, so that each lighting device to be synchronized in the state is at the same starting point when receiving the signal to be synchronized in the mode, after the signal to be synchronized in the mode is received, the device continuously accumulates the buffer variables for calculating the number of the periodic pulses according to the pulse rising edge and the pulse falling edge of the pulse signal, and when the buffer variables for calculating the number of the periodic pulses in the device connected to the same power grid are accumulated to be equal to the number of the periodic pulses corresponding to the functional mode, the buffer variables for calculating the number of the periodic pulses are automatically cleared and accumulated again, and the cycle is continuously performed. The lighting device state exhibits a corresponding state defined by the corresponding mode synchronization signal during the period of accumulation of the buffered variables of the number of periodic pulses, which results in a visual effect of synchronization of the plurality of devices. Therefore, the consistency of state synchronization is kept, and the problem of periodic state asynchronism caused by crystal oscillator deviation in the MCU is solved.

In summary, according to the state synchronization method for the lighting devices in the embodiments of the present invention, firstly, the characteristics of the alternating current signal are obtained according to the externally input power source, and the obtained characteristics are used as the pulse signal corresponding to each lighting device to be state-synchronized, so that the pulse signals corresponding to each lighting device to be state-synchronized are the same, and the half period of the pulse signal is used as the unit time base for timing; then when receiving the signal to be synchronized, calculating the number of periodic pulses corresponding to the functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized and the pulse signal; and then, clearing the cache for calculating the number of the periodic pulses, and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signals to be synchronized in the mode.

In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a state synchronization program of a lighting apparatus is stored, which, when executed by a processor, implements the state synchronization method of the lighting apparatus as described above.

According to the computer-readable storage medium of the embodiment of the invention, by storing the state synchronization program of the lighting device, when the state synchronization program of the lighting device is executed by the processor, the state synchronization method of the lighting device is realized, so that the state synchronization effect can be improved on the premise of low cost and high reliability.

Fig. 4 is a block diagram illustrating a state synchronization apparatus of a lighting device according to an embodiment of the present invention. As shown in fig. 4, the state synchronization apparatus of the lighting device includes an acquisition module 201, a calculation module 202, and a state synchronization module 203.

The acquisition module 201 is configured to acquire characteristics of an alternating current signal according to an externally input power source, and use the characteristics as a pulse signal corresponding to each lighting device to be state-synchronized, so that the pulse signals corresponding to each lighting device to be state-synchronized are the same, and a half period of the pulse signal is used as a unit time base for timing; a calculating module 202, configured to calculate, when a signal to be synchronized in a mode is received, the number of periodic pulses corresponding to a functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal; and the state synchronization module 203 is configured to perform buffer clearing for calculating the number of the periodic pulses, and restart cycle counting according to the number of the periodic pulses corresponding to the functional mode, so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signal to be synchronized in the mode.

As an example, each lighting device to be state-synchronized is connected to a power grid, and an alternating-current voltage output by the power grid is subjected to voltage division processing through a resistor connected in series, so as to obtain a pulse signal corresponding to each lighting device to be state-synchronized.

As an example, when a signal to be synchronized in a mode is received, calculating the number of periodic pulses corresponding to a functional mode according to the periodic time of the functional mode corresponding to the signal to be synchronized in the mode and the pulse signal, including: acquiring corresponding half-period time according to the pulse signal, and taking the half-period time as a unit time base for timing, wherein the unit time base is uniquely corresponding to the frequency of the pulse signal; according to the unit time base number corresponding to the pulse signal, the number of periodic pulses corresponding to the period time of the functional mode corresponding to the signal to be synchronized in each mode is calculated and set in advance; when a signal to be synchronized in a mode is received, dividing the cycle time of the functional mode corresponding to the signal to be synchronized in the mode by the unit time base of the timing corresponding to the pulse signal to obtain the number of the cycle pulses required by the cycle time of the functional mode.

As an example, the preset cycle time of the functional mode corresponding to the signal to be synchronized in each mode satisfies that the calculated number of the periodic pulses corresponding to the functional mode is a positive integer, that is, the cycle time of the mode and the unit time base are in a positive integral relationship.

As an example, the buffer variable used to count the number of periodic pulses is cleared when a signal that the pattern is to be synchronized is received.

As an example, after receiving the signal to be synchronized in the mode, the lighting device calculates the buffer variable of the number of pulses in the period according to the continuous accumulation of the rising edge and the falling edge of the pulse signal.

As an example, when the above-mentioned cache variables for calculating the number of periodic pulses in the longitudinal mode devices connected to the same power grid are accumulated to be equal to the number of periodic pulses corresponding to the functional mode, the cache variables for calculating the number of periodic pulses are automatically cleared and accumulated again, and are continuously cycled.

As an example, the lighting device status exhibits the corresponding status defined by the corresponding mode synchronization signal during the period of accumulation of the buffered variables of the number of periodic pulses, which will result in the visual effect of the synchronization of the plurality of lighting devices described above.

It should be noted that the above explanation on the state synchronization method of the lighting device is also applicable to the state synchronization apparatus of the lighting device in this embodiment, and is not repeated herein.

In summary, according to the state synchronization apparatus for lighting devices in the embodiments of the present invention, the obtaining module obtains characteristics of an alternating current signal according to an externally input power source, and the characteristics are used as pulse signals corresponding to each lighting device to be state-synchronized, so that the pulse signals corresponding to each lighting device to be state-synchronized are the same, a half period of the pulse signals is used as a unit time base for timing, and when the calculating module receives a signal to be mode-synchronized, the calculating module calculates the number of periodic pulses corresponding to a function mode according to a period time of the function mode corresponding to the signal to be mode-synchronized and the pulse signals; clearing the cache for calculating the number of the periodic pulses, and restarting cycle counting according to the number of the periodic pulses corresponding to the functional mode so as to control each lighting device to be state-synchronized to perform state synchronization in the functional mode according to the signals to be synchronized in the mode; therefore, the effect of state synchronization can be improved on the premise of low cost and high reliability.

As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.

It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.

In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.

In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.

In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.

Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种电能表时钟误差故障值的预测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!