CN108668415B - Mode switching method and device of intelligent lighting equipment - Google Patents

Mode switching method and device of intelligent lighting equipment Download PDF

Info

Publication number
CN108668415B
CN108668415B CN201710193098.0A CN201710193098A CN108668415B CN 108668415 B CN108668415 B CN 108668415B CN 201710193098 A CN201710193098 A CN 201710193098A CN 108668415 B CN108668415 B CN 108668415B
Authority
CN
China
Prior art keywords
reading
average value
preset
sampling
electric signal
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.)
Active
Application number
CN201710193098.0A
Other languages
Chinese (zh)
Other versions
CN108668415A (en
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201710193098.0A priority Critical patent/CN108668415B/en
Publication of CN108668415A publication Critical patent/CN108668415A/en
Application granted granted Critical
Publication of CN108668415B publication Critical patent/CN108668415B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention discloses a mode switching method and device of intelligent lighting equipment, and belongs to the technical field of intelligent equipment. The method comprises the following steps: reading the electric signal sampling values in a built-in buffer at specified time intervals, counting the reading times, determining the average value of all the electric signal sampling values read within the specified reading times if the reading times reach the specified reading times, resetting the reading times, and switching the modes based on the determined average value. Since the specified time interval is determined by the sampling theorem according to the frequency of the ripple signal, it is ensured that the read sampling value of the electrical signal can more completely interpret the characteristics of the ripple signal. In addition, because the specified reading times are determined according to the frequency of the ripple signal and the specified time interval, the read electric signal sampling value can be ensured to be the ripple signal in the complete period, and the influence of the ripple on the sampling result is eliminated.

Description

Mode switching method and device of intelligent lighting equipment
Technical Field
The invention relates to the technical field of intelligent equipment, in particular to a mode switching method and device of intelligent lighting equipment.
Background
With the rapid development of intelligent devices, some intelligent lighting devices such as intelligent fill-in lamps are widely used. This type of smart device is generally used in outdoor scenes and is generally susceptible to external environmental factors, thereby causing excessive current or voltage, for example, when the connected cable is broken and encounters water, the current or voltage is easily caused to be excessive. When the current or the voltage is continuously too large, an abnormal condition is shown, and at the moment, the intelligent lighting equipment is easily damaged. Or, in some cases, the current or voltage may be too small due to a problem of the hardware itself, and thus, when the current or voltage is too small, it indicates that the intelligent lighting device may also have an abnormal condition.
In general, a smart lighting device includes an operational mode and a protection mode. In order to prevent the damage, during the operation, the intelligent lighting device may sample the electrical signal through an ADC (Analog to Digital Converter), and determine whether an abnormal condition occurs currently according to the sampling result, so as to further determine whether to perform the mode switching. For example, when it is determined that an abnormal condition occurs, the mode is automatically switched to the protection mode. Wherein the electrical signals include current and voltage.
However, in practical application scenarios, such intelligent lighting devices are generally powered by mains supply, and the mains supply generally provides ac power, and after the ac power is converted into dc power through links such as rectification and voltage stabilization, the dc power inevitably has an ac component, so that the dc power has sine or cosine characteristics. The ac component superimposed on the dc power is commonly referred to as a ripple, and for convenience of description, the dc power with the ripple is referred to as a ripple signal. For ripple signals, how to eliminate the influence of ripples on sampling results to obtain accurate dc sampling values and determine whether to perform mode switching according to the sampling values becomes a hot point of research.
Disclosure of Invention
In order to solve the problem in the prior art that how to eliminate the influence of ripples on a sampling result to obtain an accurate direct current sampling value and judge whether to perform mode switching according to the sampling value, the embodiment of the invention provides a mode switching method and device of intelligent lighting equipment. The technical scheme is as follows:
in one aspect, a mode switching method for an intelligent lighting device is provided, the method including:
reading an electric signal sampling value in a built-in buffer at intervals of a specified time interval, and counting the reading times, wherein the electric signal sampling value in the buffer is obtained by sampling a ripple signal by a built-in analog-digital converter (ADC), and the specified time interval is determined by a sampling theorem based on the frequency of the ripple signal;
if the reading times reach the specified reading times, determining the average value of all the electric signal sampling values read within the specified reading times, and clearing the reading times, wherein the specified reading times are determined based on the frequency of the ripple signal and the specified time interval;
performing mode switching based on the determined average value.
Optionally, the performing mode switching based on the determined average value includes:
judging whether the average value is within a preset average value range or not;
if the average value is not in the preset average value range, clearing continuous normal times, and counting continuous abnormal times, wherein the continuous normal times refer to the times that the continuously determined average values are all in the preset average value range, and the continuous abnormal times refer to the times that the continuously determined average values are not in the preset average value range;
if the continuous abnormal times reach a first preset time and the current working mode is, switching from the working mode to a protection mode; and if the continuous abnormal times do not reach the first preset times, continuously returning to execute the operation of reading the electric signal sampling value in the built-in buffer at specified time intervals.
Optionally, after determining whether the average value is within a preset average value range, the method further includes:
if the average value is within the range of the preset average value, clearing the continuous abnormal times, and counting the continuous normal times;
if the continuous normal times reach a second preset times and the current protection mode is in, switching from the protection mode to a working mode; and if the continuous normal times do not reach the second preset times, continuing to return to execute the operation of reading the electric signal sampling value in the built-in buffer at the specified time interval.
Optionally, before reading the electrical signal sample value in the built-in buffer, the method further includes:
sampling the ripple signal through the ADC at preset sampling intervals to obtain an electric signal sampling value, wherein the preset sampling intervals are smaller than the specified time interval;
and replacing the electric signal sampling value cached in the cache with the currently obtained electric signal sampling value.
Optionally, after counting the number of reads, the method further includes:
and if the counted reading times do not reach the specified reading times, returning to the step of reading the electric signal sampling value in the built-in buffer at specified time intervals.
In another aspect, a mode switching apparatus of an intelligent lighting device is provided, the apparatus including:
the reading counting module is used for reading the electric signal sampling value in a built-in buffer at intervals of designated time interval and counting the reading times, the electric signal sampling value in the buffer is obtained by sampling a ripple signal by a built-in analog-digital converter (ADC), and the designated time interval is determined by a sampling theorem based on the frequency of the ripple signal;
a determining module, configured to determine an average value of all electrical signal sampling values read within a specified reading time if the reading time counted by the reading counting module reaches the specified reading time, and clear the reading time, where the specified reading time is determined based on the frequency of the ripple signal and the specified time interval;
and the switching module is used for switching modes based on the average value determined by the determining module.
Optionally, the switching module is configured to:
judging whether the average value is within a preset average value range or not;
if the average value is not in the range of the preset average value, clearing continuous normal times, and counting continuous abnormal times, wherein the continuous normal times refer to the times that the continuously determined average values are all in the range of the preset average value, and the continuous abnormal times refer to the times that the continuously determined average values are not in the range of the preset average value;
if the continuous abnormal times reach a first preset time and the current working mode is, switching from the working mode to a protection mode; and if the continuous abnormal times do not reach the first preset times, continuously returning to execute the operation of reading the electric signal sampling value in the built-in buffer at specified time intervals.
Optionally, the switching module is further configured to:
if the average value is within the range of the preset average value, clearing the continuous abnormal times, and counting the continuous normal times;
if the continuous normal times reach a second preset times and the current protection mode is in, switching from the protection mode to a working mode; and if the continuous normal times do not reach the second preset times, continuing to return to execute the operation of reading the electric signal sampling value in the built-in buffer at the specified time interval.
Optionally, the apparatus further comprises:
the sampling module is used for sampling the ripple signal through the ADC at intervals of a preset sampling interval to obtain an electric signal sampling value, and the preset sampling interval is smaller than the specified time interval;
and the replacing module is used for replacing the electric signal sampling value cached in the cache with the currently obtained electric signal sampling value.
Optionally, the apparatus further comprises:
and the return execution module is used for returning to execute the step of reading the electric signal sampling value in the built-in buffer at specified time intervals if the counted reading times do not reach the specified reading times.
The technical scheme provided by the embodiment of the invention has the following beneficial effects: and reading the electric signal sampling values in the built-in buffer at specified time intervals, counting the reading times, and if the reading times reach the specified reading times, switching the modes according to the average value of all the electric signal sampling values read in the specified reading times. Since the specified time interval is determined by the sampling theorem according to the frequency of the ripple signal, the characteristics of the ripple signal can be more completely interpreted by the read electric signal sampling value. In addition, because the specified reading times are determined according to the frequency of the ripple signal and the specified time interval, the read electric signal sampling value can be ensured to be the ripple signal in the complete period, and the influence of the ripple on the sampling result is eliminated.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a mode switching method of an intelligent lighting device according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a mode switching method of an intelligent lighting device according to another exemplary embodiment.
Fig. 3A is a schematic structural diagram illustrating a mode switching apparatus of an intelligent lighting device according to an exemplary embodiment.
Fig. 3B is a schematic structural diagram illustrating another mode switching apparatus of an intelligent lighting device according to an exemplary embodiment.
Fig. 3C is a schematic structural diagram illustrating another mode switching apparatus of an intelligent lighting device according to an exemplary embodiment.
Fig. 4 is a schematic structural diagram illustrating an intelligent lighting device according to an exemplary embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Before describing the embodiment of the present invention, a description will be given to an application scenario of the embodiment of the present invention. The mode switching method of the intelligent lighting device provided by the embodiment of the invention can be executed by the intelligent lighting device, and the intelligent lighting device can be configured with an ADC and a buffer, wherein the ADC can be used for sampling an electrical signal, and the buffer can be used for buffering an electrical signal sampling value obtained by sampling through the ADC.
Further, the intelligent lighting device is further configured with an MCU (micro controller Unit), where the MUC is a core device of the intelligent lighting device and may be configured to perform data processing, mode switching, and the like, so as to implement the mode switching method provided in the embodiment of the present invention.
It should be noted that, in a specific implementation, since the MCU generally has a Random Access Memory (RAM), the above-mentioned buffer can be implemented by the RAM. In addition, some MCUs may also be provided with ADCs, so that when an MCU configured in the smart lighting device is provided with an ADC, it may not be necessary to configure the ADC separately.
This intelligence lighting apparatus uses usually in the outdoor scene that operational environment probably is comparatively abominable, and the trouble such as overcurrent, excessive pressure appears easily, if not protect in time, this intelligence lighting apparatus is damaged easily. In addition, in some cases, the current or voltage may be too small due to a problem of the hardware itself, and thus, when the current or voltage is too small, it indicates that the intelligent lighting device may also have an abnormal condition. In addition, the intelligent lighting device is usually powered by mains electricity, which is also called AC (Alternating Current). Generally, because of the limitation of objective conditions such as hardware and cost, the intelligent lighting device usually does not filter the direct current after the alternating current is converted, so that the converted alternating current has regular sine or cosine characteristics. If under this kind of circumstances, detect according to traditional sampling mode and lead to the mistake protection easily, influence intelligent lighting apparatus's normal work.
Therefore, the embodiment of the invention provides a mode switching method of an intelligent lighting device, which can perform complete sampling in a complete period aiming at an electric signal with regular sine or cosine characteristics so as to eliminate the influence of ripples on a sampling result, thereby improving the accuracy of state detection of the intelligent lighting device. The intelligent lighting device can be an intelligent light supplement lamp and the like, which are not limited in the embodiment of the invention.
Fig. 1 is a flowchart illustrating a mode switching method of an intelligent lighting device according to an exemplary embodiment, which is exemplified by applying the mode switching method of the intelligent lighting device to the intelligent lighting device, and the mode switching method of the intelligent lighting device may include the following steps:
step 101: and reading the electric signal sampling value in a built-in buffer at specified time intervals, counting the reading times, sampling the ripple signal by a built-in ADC to obtain the electric signal sampling value in the buffer, and determining the specified time intervals by a sampling theorem based on the frequency of the ripple signal.
In the embodiment of the present invention, the specified time interval is a time interval for the intelligent lighting device to read the sampling value of the electrical signal from the buffer, and generally, the specified time interval is greater than the sampling interval of the ADC.
In the embodiment of the invention, the specified time interval is determined by the sampling theorem, and the cached electric signal sampling value is read from the buffer according to the specified time interval, so that the read electric signal sampling value can describe the original ripple signal without distortion, and the sampling precision is improved. In addition, the designated time interval is far larger than the preset sampling interval, namely, the MCU of the intelligent lighting device does not need to frequently read and process the electric signal sampling value sampled by the ADC, so that the effect of reducing the load of the MCU is achieved.
In a specific implementation, a timer may be configured in the intelligent lighting device, the timer is interrupted at the specified time interval, and the intelligent lighting device reads the electrical signal sampling value in the buffer of the ADC during the interruption of the timer and counts the number of reading times.
Step 102: and if the reading times reach the specified reading times, determining the average value of all the electric signal sampling values read within the specified reading times, and clearing the reading times, wherein the specified reading times are determined based on the frequency of the ripple signal and the specified time interval.
And if the reading times reach the specified reading times, the intelligent lighting equipment acquires all the electric signal sampling values read within the specified reading times, accumulates and sums all the acquired electric signal sampling values, and then divides the sum by the specified reading times to obtain the average value of all the electric signal sampling values.
In order to facilitate the subsequent statistics of the reading times to determine the next average value, the intelligent lighting device also clears the reading times after determining the average value of all the electrical signal sampling values read within the specified reading times, so that the intelligent lighting device can continue to calculate the next average value.
Step 103: mode switching is performed based on the determined average value.
If the intelligent lighting equipment is judged whether to be abnormal at present only based on the once-obtained average value, misjudgment is easy to occur, and thus misprotection is easy to cause. Therefore, in the embodiment of the present invention, the intelligent lighting device continuously determines a plurality of average values, and determines whether the intelligent lighting device is currently abnormal according to the plurality of average values continuously determined, so that the accuracy of the determination can be improved. The specific implementation of which can be seen in step 205 in the embodiment of fig. 2 as follows.
In the embodiment of the invention, the electric signal sampling values in the built-in buffer are read at intervals of specified time, the reading times are counted, and if the reading times reach the specified reading times, the mode switching can be carried out according to the average value of all the electric signal sampling values read within the specified reading times. Since the specified time interval is determined by the sampling theorem according to the frequency of the ripple signal, the characteristics of the ripple signal can be more completely interpreted by the read electric signal sampling value. In addition, the specified reading times are determined according to the frequency of the ripple signal and the specified time interval, so that the read electric signal sampling value can be guaranteed to be the ripple signal in a complete cycle, and the influence of the ripple signal on the sampling result is eliminated.
Fig. 2 is a flowchart illustrating a mode switching method of an intelligent lighting device according to another exemplary embodiment, which is exemplified by applying the mode switching method of the intelligent lighting device to the intelligent lighting device, and the mode switching method of the intelligent lighting device may include the following steps:
step 201: and sampling the ripple signal through a built-in analog-digital converter (ADC) at preset sampling intervals to obtain an electric signal sampling value.
The preset sampling interval may be set by a technician in a user-defined manner according to actual needs, or may be set by the intelligent lighting device in a default manner, which is not limited in the embodiment of the present invention.
That is, in the embodiment of the present invention, the intelligent lighting device samples the ripple signal through the built-in ADC, and in general, the sampling interval of the ADC is preset, and the preset sampling interval is usually smaller and generally much smaller than a specified time interval described below, where the specified time interval actually refers to a time interval at which the intelligent lighting device reads the electrical signal sampling value obtained after sampling by the ADC, and is specifically described below. For example, typically the preset sampling interval may be on the order of microseconds, while the specified time interval described below may be on the order of milliseconds.
It should be noted that, in practical implementation, the electrical signal samples actually include voltage samples and current samples. That is, in the actual implementation process, the intelligent lighting device needs to detect whether an abnormality occurs according to two parameter values of current and voltage, and therefore, in the sampling process, the electrical signal sampling value sampled by the ADC includes a voltage sampling value and a current sampling value.
Step 202: and replacing the electric signal sampling value cached in the cache with the currently obtained electric signal sampling value.
After the ripple signal is sampled by the ADC, the intelligent lighting device does not directly perform operation processing on the sampled electric signal sampling value, but buffers the electric signal sampling value in the buffer, replaces the originally buffered electric signal sampling value in the buffer, namely the electric signal sampling value buffered in the buffer is continuously replaced and updated, and useless electric signal sampling values can be automatically replaced and discarded.
Step 203: and reading the electric signal sampling value in a built-in buffer at specified time intervals, counting the reading times, sampling the ripple signal by a built-in ADC to obtain the electric signal sampling value in the buffer, and determining the specified time intervals by a sampling theorem based on the frequency of the ripple signal.
As described above, the specified time interval is greater than the predetermined sampling interval. In an embodiment of the present invention, the specified time interval is a time interval for the intelligent lighting device to read the sampling value of the electrical signal from the buffer, and the specified time interval is determined by a sampling theorem based on the frequency of the ripple signal. Specifically, if the frequency of the ripple signal is f (y), it can be known from the sampling theorem f (x) ≧ 2f (y), the specified time interval can be determined by the following formula (1):
Figure BDA0001256694870000081
wherein T represents the specified time interval, n is a natural number greater than or equal to 2, and in a specific implementation, the value of n is preferably 10. In addition, Ms represents the unit of the specified time interval, i.e., milliseconds.
It should be noted that, here, the specified time interval is determined by the sampling theorem, and the buffered electric signal sampling value is read from the buffer according to the specified time interval, so that the read electric signal sampling value can describe the original ripple signal without distortion, and the sampling precision is improved. In addition, the designated time interval is far larger than the preset sampling interval, namely, the MCU of the intelligent lighting device does not need to frequently read and process the electric signal sampling value sampled by the ADC, so that the effect of reducing the load of the MCU is achieved.
It is also worth mentioning that, in general, the sampling values of the first sampled electrical signals of the ADC are inaccurate at the initial start, and in the embodiment of the present invention, the ADC is directly started to perform continuous sampling based on the preset sampling interval when the MCU is powered on, and there is no operation of turning off the ADC and then turning on the ADC in the whole program execution device. Therefore, as the designated time interval is greater than the preset sampling interval, when the intelligent lighting device reads a value from the buffer of the ADC, the ADC has already performed multiple times of sampling, and the previous inaccurate electrical signal sampling values have been replaced, so that the accuracy of the read electrical signal sampling values is ensured.
As mentioned above, the sampled values of the electrical signal in the buffer are obtained by sampling the ripple signal through the built-in ADC at preset sampling intervals. In a specific implementation, a timer may be configured in the intelligent lighting device, the timer is interrupted at the specified time interval, and the intelligent lighting device reads the electrical signal sampling value in the buffer of the ADC during the interruption of the timer and counts the number of reading times.
So, carry out reading of electrical signal sampling value through timer control, can guarantee to read time interval's uniformity, further improved the eliminating effect to ripple signal among the intelligent lighting apparatus.
Step 204: and if the reading times reach the specified reading times, determining the average value of all the electric signal sampling values read within the specified reading times, and clearing the reading times, wherein the specified reading times are determined based on the frequency of the ripple signal and the specified time interval.
Wherein the specified number of readings is determined based on the frequency of the ripple signal and the specified time interval, and specifically, the specified number of readings can be determined by the following formula (2):
Figure BDA0001256694870000091
wherein, the N represents the number of read points in the one sampling complete period, the m represents the number of read ripple signals of the complete period, and the m is a natural number greater than or equal to 1, for example, when the m is 10, the ripple signals of 10 complete periods are read. Wherein t (y) represents a period of a ripple signal, and t (y) is 1000/f (x) (ms). The N1 represents the specified number of readings, i.e., the N1 represents the number of readings of the electrical signal sample value of the ripple signal for m complete cycles.
It should be noted that in a specific implementation, the value of N1 may not be set too small to eliminate accidental errors caused by ADC sampling.
And if the reading times reach the specified reading times, the intelligent lighting equipment acquires all the electric signal sampling values read within the specified reading times, accumulates and sums all the acquired electric signal sampling values, and then divides the sum by the specified reading times to obtain the average value of all the electric signal sampling values.
It should be noted that the above description is only given by taking as an example that all the electrical signal sample values are cumulatively summed after it is determined that the number of readings reaches a specified number of readings, and an average value of all the electrical signal sample values is determined based on the obtained sum. In another embodiment, the intelligent lighting device may further perform an accumulation operation while counting, that is, the intelligent lighting device performs an accumulation and summation operation each time an electrical signal sample is read from the buffer, and then determines whether the counted reading number reaches the specified reading number, and when it is determined that the reading number reaches the specified reading number, the obtained accumulation sum may be directly divided by the specified reading number, so as to determine an average value of all electrical signal samples read within the specified reading number.
In addition, in order to facilitate the subsequent continuous statistics of the reading times to determine the next average value, the intelligent lighting device also clears the reading times after determining the average value of all the electrical signal sampling values read within the specified reading times, so that the intelligent lighting device can continuously calculate the next average value.
Further, if the counted reading times does not reach the specified reading times, the step of reading the electric signal sampling value in the built-in buffer at specified time intervals is returned to.
That is, if the number of readings does not reach the specified number of readings, it indicates that the number of the currently read electrical signal sample values does not reach the number requirement for averaging, in this case, the process may return to step 203, i.e., continue to read the buffered electrical signal sample values from the buffer until the number of readings reaches the specified number of readings, and continue to execute step 204.
Step 205: mode switching is performed based on the determined average value.
In the actual implementation process, if whether the intelligent lighting device is abnormal currently is judged only based on the once-obtained average value, misjudgment is easy to occur, and thus misprotection is easy to cause. Therefore, in the embodiment of the present invention, the intelligent lighting device continuously determines a plurality of average values, and determines whether the intelligent lighting device is currently abnormal according to the plurality of average values continuously determined, so that the accuracy of the determination can be improved. The specific implementation of the method can comprise the following implementation steps (1) to (3):
(1) judging whether the average value is larger than or equal to a preset average value range;
the preset average value range may be set by a technician in a user-defined manner according to actual needs, or may be set by the default of the intelligent lighting device, which is not limited in the embodiment of the present invention.
It should be noted that, as described above, since the electrical signal sample values read from the buffer actually include the voltage sample values and the current sample values, the average value of all the electrical signal sample values determined as described above also includes the voltage average value and the current average value. Similarly, the preset average value range actually includes the preset voltage average value range and the current average value range. Therefore, in practical implementation, the intelligent lighting device needs to determine whether the determined voltage average value is within a preset voltage average value range and whether the determined current average value is within a preset current average value range.
If the determined voltage average value is not within the preset voltage average value range, or the determined current average value is not within the preset current average value range, or the determined voltage average value is not within the preset voltage average value range and the determined current average value is not within the preset current average value range, it is determined that the average value is not within the preset average value range. Otherwise, the intelligent lighting device determines that the average value is within a preset average value range only if the determined voltage average value is within the preset voltage average value range and the determined current average value is within the preset current average value range.
(2) If the average value is not in the preset average value range, clearing continuous normal times, and counting continuous abnormal times, wherein the continuous normal times refer to the times that the continuously determined average values are all in the preset average value range, and the continuous abnormal times refer to the times that the continuously determined average values are not in the preset average value range; if the continuous abnormal times reach a first preset times and the current working mode is, switching from the working mode to a protection mode; and if the continuous abnormal times do not reach the first preset times, continuously returning to execute the operation of reading the electric signal sampling value in the built-in register at specified time intervals.
The first preset number of times may be set by a technician in a user-defined manner according to actual needs, or may be set by the intelligent lighting device in a default manner, which is not limited in the embodiment of the present invention. For example, the first preset number may be 5.
If the determined average value is not in the preset average value range, it indicates that the current intelligent lighting device is abnormal, that is, the intelligent lighting device cannot be continuously normal, and therefore, the continuous abnormal times are counted, for example, the continuous abnormal times are added by 1, and the continuous normal times are cleared. And then, the intelligent lighting equipment judges whether the counted continuous abnormal times reach a first preset time, if so, the abnormal conditions possibly occur continuously for a long time, and under the conditions, if the intelligent lighting equipment is currently in a working mode, the intelligent lighting equipment is automatically switched from the current working mode to a protection mode to protect the intelligent lighting equipment in order to avoid being damaged.
Of course, if the counted continuous abnormal times does not reach the first preset times, it indicates that the intelligent lighting device is likely to be abnormal only temporarily, and in this case, the intelligent lighting device may not be damaged, and therefore, the mode switching may not be required, and the electrical signal sampling value in the buffer memory may be continuously read to continuously determine whether the abnormality still occurs.
It should be noted that the protection mode may be an off mode, or the current and voltage of the power supply may be reduced in other ways, so as to achieve the purpose of protection. For example, when the intelligent lighting device is an intelligent fill-in light, if the intelligent fill-in light has a connection relationship with other devices such as a camera, the protection mode may further be configured to send an exception notification such as a ring to the device to notify the user of the exception, so as to facilitate the user to perform exception protection processing. The embodiment of the present invention does not specifically limit the protection mode.
(3) If the average value is within the range of the preset average value, resetting the continuous abnormal times, counting the continuous normal times, and if the continuous normal times reach a second preset time and are currently in a protection mode, switching from the protection mode to a working mode; and if the continuous normal times do not reach the second preset times, continuously returning to execute the operation of reading the electric signal sampling value in the built-in register at specified time intervals.
The second preset number may be set by a technician in a self-defined manner according to actual needs, or may be set by the intelligent lighting device in a default manner, which is not limited in the embodiment of the present invention.
It should be noted that, in a specific implementation, the second preset number may be the same as the first preset number, or may be different from the first preset number, which is not limited in the embodiment of the present invention. For example, the second predetermined number of times may be 5, or the second predetermined number of times may be other values.
That is, in a specific implementation, it is also possible that the average value determined in the above step is within the preset average value range. When the average value is within the preset average value range, it is indicated that the intelligent lighting device is not abnormal at present, and it is also indicated that the intelligent lighting device is not abnormal continuously, so that the intelligent lighting device adds 1 to the continuous normal times and clears the continuous abnormal times.
In practical implementation, because the intelligent lighting device may be switched to the protection mode due to previous work abnormality, and when the intelligent lighting device is detected to be continuously normal, it is described that the intelligent lighting device can be restored to the work mode, for this reason, in the embodiment of the present invention, when it is determined that the continuous normal times reach the second preset times and the intelligent lighting device is currently in the protection mode, the protection mode is automatically switched back to the work mode, so that manual operation by a user is not required, and convenience in operation is improved.
Of course, if the continuous normal times does not reach the second preset times, it indicates that the intelligent lighting device may only temporarily recover to normal, which does not indicate that the intelligent lighting device will not be abnormal any more in the following, and in order to avoid being damaged, the intelligent lighting device continues to read the electrical signal sampling value from the buffer, and continues to determine whether the intelligent lighting device is continuously normal according to the steps provided above.
In the embodiment of the invention, the electric signal sampling values in the built-in buffer are read at intervals of specified time, the reading times are counted, and if the reading times reach the specified reading times, the mode switching can be carried out according to the average value of all the electric signal sampling values read within the specified reading times. Since the specified time interval is determined by the sampling theorem according to the frequency of the ripple signal, the characteristics of the ripple signal can be more completely interpreted by the read electric signal sampling value. In addition, because the specified reading times are determined according to the frequency of the ripple signal and the specified time interval, the read electric signal sampling value can be ensured to be the ripple signal in the complete period, and the influence of the ripple on the sampling result is eliminated.
Fig. 3A is a schematic structural diagram illustrating a mode switching apparatus of an intelligent lighting device according to an exemplary embodiment, where the mode switching apparatus of the intelligent lighting device may be implemented by software, hardware, or a combination of the two. The mode switching apparatus of the intelligent lighting device may include:
a reading statistic module 310, configured to read an electrical signal sampling value in a built-in buffer at specified time intervals, and count the number of times of reading, where the electrical signal sampling value in the buffer is obtained by sampling a ripple signal by a built-in analog-to-digital converter ADC, and the specified time interval is determined by a sampling theorem based on the frequency of the ripple signal;
a determining module 320, configured to determine an average value of all electrical signal sampling values read within a specified reading time if the reading time counted by the reading counting module 310 reaches the specified reading time, and clear the reading time, where the specified reading time is determined based on the frequency of the ripple signal and the specified time interval;
a switching module 330, configured to switch modes based on the average value determined by the determining module 320.
Optionally, the switching module 330 is configured to:
judging whether the average value is within a preset average value range or not;
if the average value is not in the preset average value range, clearing continuous normal times, and counting continuous abnormal times, wherein the continuous normal times refer to the times that the continuously determined average values are all in the preset average value range, and the continuous abnormal times refer to the times that the continuously determined average values are not in the preset average value range;
if the continuous abnormal times reach a first preset times and the current working mode is, switching from the working mode to a protection mode; and if the continuous abnormal times do not reach the first preset times, continuously returning to execute the operation of reading the electric signal sampling value in the built-in register at specified time intervals.
Optionally, the switching module 330 is further configured to:
if the average value is within the range of the preset average value, resetting the continuous abnormal times, and counting the continuous normal times;
if the continuous normal times reach a second preset times and the current protection mode is in, switching from the protection mode to the working mode; and if the continuous normal times do not reach the second preset times, continuing to return to execute the operation of reading the electric signal sampling value in the built-in register at the specified time interval.
Optionally, referring to fig. 3B, the apparatus further includes: a sampling module 340 and a replacement module 350;
the sampling module 340 is configured to sample the ripple signal through the ADC at preset sampling intervals to obtain an electrical signal sampling value, where the preset sampling intervals are smaller than the specified time interval;
the replacing module 350 is configured to replace the electrical signal sample value buffered in the buffer with the currently obtained electrical signal sample value.
Optionally, referring to fig. 3C, the apparatus further includes: returning to the execution module 360;
the return execution module 360 is configured to return to execute the step of reading the electrical signal sampling value in the built-in buffer at specified time intervals if the counted reading frequency does not reach the specified reading frequency.
In the embodiment of the invention, the electric signal sampling values in the built-in buffer are read at intervals of specified time, the reading times are counted, and if the reading times reach the specified reading times, the mode switching can be carried out according to the average value of all the electric signal sampling values read within the specified reading times. Since the specified time interval is determined by the sampling theorem according to the frequency of the ripple signal, the characteristics of the ripple signal can be more completely interpreted by the read electric signal sampling value. In addition, because the specified reading times are determined according to the frequency of the ripple signal and the specified time interval, the read electric signal sampling value can be ensured to be the ripple signal in the complete period, and the influence of the ripple on the sampling result is eliminated.
It should be noted that: in the above embodiment, when the mode switching apparatus of the intelligent lighting device is used to implement the mode switching method of the intelligent lighting device, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the mode switching device of the intelligent lighting device provided by the above embodiment and the mode switching method embodiment of the intelligent lighting device belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
Fig. 4 is a schematic structural diagram of an intelligent lighting device according to an exemplary embodiment, which mainly includes a transmitter 401, a receiver 402, a memory 404, a processor 403, and a communication bus 405. Those skilled in the art will appreciate that the configuration of the intelligent lighting device 400 shown in fig. 4 does not constitute a limitation of the intelligent lighting device, and may include more or less components than those shown, or combine some components, or arrange different components, which is not limited by the embodiments of the present invention.
The transmitter 401 may be configured to transmit data, such as frame data, to a subsequent processing module.
The memory 404 may be used for storing the parsed valid data, and the memory 404 may also be used for storing one or more operation programs and/or modules for performing the above-described data processing methods.
The processor 403 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an Application-Specific Integrated Circuit (ASIC), or one or more ics for controlling the execution of programs according to the present invention. The processor 403 may implement the methods provided above in the fig. 1 or fig. 2 embodiments by running or executing software programs and/or modules stored in the memory 404 and invoking data stored in the memory 404.
The communication bus 405 may include a path for communicating information between the processor 403 and the memory 404.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A mode switching method of an intelligent lighting device, the method comprising:
sampling the ripple signal through an analog-digital converter (ADC) at preset sampling intervals to obtain an electric signal sampling value, and replacing the electric signal sampling value cached in a built-in buffer with the currently obtained electric signal sampling value;
reading the electric signal sampling values in the buffer at specified time intervals, and counting the reading times, wherein the specified time intervals are determined by a sampling theorem based on the frequency of the ripple signal, the electric signal sampling values comprise voltage sampling values and current sampling values, and the preset sampling intervals are smaller than the specified time intervals;
if the reading times reach the specified reading times, determining the average value of all the electric signal sampling values read within the specified reading times, and clearing the reading times, wherein the specified reading times are determined based on the frequency of the ripple signal and the specified time interval;
performing mode switching based on the determined average value.
2. The method of claim 1, wherein the switching modes based on the determined average value comprises:
judging whether the average value is within a preset average value range or not;
if the average value is not in the preset average value range, clearing continuous normal times, and counting continuous abnormal times, wherein the continuous normal times refer to the times that the continuously determined average values are all in the preset average value range, and the continuous abnormal times refer to the times that the continuously determined average values are not in the preset average value range;
if the continuous abnormal times reach a first preset time and the current working mode is, switching from the working mode to a protection mode; and if the continuous abnormal times do not reach the first preset times, continuously returning to execute the operation of reading the electric signal sampling value in the built-in buffer at specified time intervals.
3. The method of claim 2, wherein after determining whether the average value is within a preset average value range, further comprising:
if the average value is within the range of the preset average value, clearing the continuous abnormal times, and counting the continuous normal times;
if the continuous normal times reach a second preset times and the current protection mode is in, switching from the protection mode to a working mode; and if the continuous normal times do not reach the second preset times, continuing to return to execute the operation of reading the electric signal sampling value in the built-in buffer at the specified time interval.
4. The method of claim 1, wherein after counting the number of reads, further comprising:
and if the counted reading times do not reach the specified reading times, returning to the step of reading the electric signal sampling value in the built-in buffer at specified time intervals.
5. A mode switching apparatus of an intelligent lighting device, the apparatus comprising:
the reading counting module is used for reading the electric signal sampling value in a built-in buffer at intervals of designated time interval and counting the reading times, the electric signal sampling value in the buffer is obtained by sampling a ripple signal by a built-in analog-digital converter (ADC), the designated time interval is determined by a sampling theorem based on the frequency of the ripple signal, and the electric signal sampling value comprises a voltage sampling value and a current sampling value;
a determining module, configured to determine an average value of all electrical signal sampling values read within a specified reading time if the reading time counted by the reading counting module reaches the specified reading time, and clear the reading time, where the specified reading time is determined based on the frequency of the ripple signal and the specified time interval;
a switching module for performing mode switching based on the average value determined by the determining module;
the sampling module is used for sampling the ripple information through the ADC at intervals of a preset sampling interval to obtain an electric signal sampling value, and the preset sampling interval is smaller than the specified time interval;
and the replacing module is used for replacing the electric signal sampling value cached in the cache with the currently obtained electric signal sampling value.
6. The apparatus of claim 5, wherein the switching module is to:
judging whether the average value is within a preset average value range or not;
if the average value is not in the preset average value range, clearing continuous normal times, and counting continuous abnormal times, wherein the continuous normal times refer to the times that the continuously determined average values are all in the preset average value range, and the continuous abnormal times refer to the times that the continuously determined average values are not in the preset average value range;
if the continuous abnormal times reach a first preset time and the current working mode is, switching from the working mode to a protection mode; and if the continuous abnormal times do not reach the first preset times, continuously returning to execute the operation of reading the electric signal sampling value in the built-in buffer at specified time intervals.
7. The apparatus of claim 6, wherein the switching module is further to:
if the average value is within the range of the preset average value, clearing the continuous abnormal times, and counting the continuous normal times;
if the continuous normal times reach a second preset times and the current protection mode is in, switching from the protection mode to a working mode; and if the continuous normal times do not reach the second preset times, continuing to return to execute the operation of reading the electric signal sampling value in the built-in buffer at the specified time interval.
8. The apparatus of claim 5, wherein the apparatus further comprises:
and the return execution module is used for returning to execute the step of reading the electric signal sampling value in the built-in buffer at specified time intervals if the counted reading times do not reach the specified reading times.
CN201710193098.0A 2017-03-28 2017-03-28 Mode switching method and device of intelligent lighting equipment Active CN108668415B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710193098.0A CN108668415B (en) 2017-03-28 2017-03-28 Mode switching method and device of intelligent lighting equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710193098.0A CN108668415B (en) 2017-03-28 2017-03-28 Mode switching method and device of intelligent lighting equipment

Publications (2)

Publication Number Publication Date
CN108668415A CN108668415A (en) 2018-10-16
CN108668415B true CN108668415B (en) 2020-06-16

Family

ID=63785922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710193098.0A Active CN108668415B (en) 2017-03-28 2017-03-28 Mode switching method and device of intelligent lighting equipment

Country Status (1)

Country Link
CN (1) CN108668415B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10021644C2 (en) * 2000-05-04 2002-08-01 Bosch Gmbh Robert Operating state-dependent switching of a scanning method of a pressure sensor
CN101247615A (en) * 2008-03-07 2008-08-20 上海华为技术有限公司 Method and device for improving reliability of communication equipment
CN102751778A (en) * 2012-06-05 2012-10-24 奇瑞汽车股份有限公司 Clamping plate type wireless power supply
CN103439587A (en) * 2013-09-10 2013-12-11 深圳市禾望电气有限公司 Three-phase alternating current detecting method
CN104037934A (en) * 2014-06-18 2014-09-10 深圳供电局有限公司 Spare power automatic switching emergency device and method for power system of transformer substation
CN106026745A (en) * 2016-05-20 2016-10-12 广东百事泰电子商务股份有限公司 Control chip for photovoltaic inverter integrated system
CN106301592A (en) * 2016-08-23 2017-01-04 索尔思光电(成都)有限公司 The method and device of protection APD receptor
CN106304518A (en) * 2015-05-13 2017-01-04 华润矽威科技(上海)有限公司 A kind of regulate LED colour temperature or the control circuit of brightness and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4605035B2 (en) * 2006-01-27 2011-01-05 株式会社デンソー Knock sensor signal processing device
TWI357702B (en) * 2008-02-26 2012-02-01 Leadtrend Tech Corp Error detecting circuit and error detcting method
CN105307352B (en) * 2015-11-20 2018-09-25 小米科技有限责任公司 The control method and device of Intelligent illumination device
CN106292336B (en) * 2016-10-10 2019-05-07 上海航天控制技术研究所 The fault simulation system and method for Satellite attitude and orbit control system based on embedded VxWorks

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10021644C2 (en) * 2000-05-04 2002-08-01 Bosch Gmbh Robert Operating state-dependent switching of a scanning method of a pressure sensor
CN101247615A (en) * 2008-03-07 2008-08-20 上海华为技术有限公司 Method and device for improving reliability of communication equipment
CN102751778A (en) * 2012-06-05 2012-10-24 奇瑞汽车股份有限公司 Clamping plate type wireless power supply
CN103439587A (en) * 2013-09-10 2013-12-11 深圳市禾望电气有限公司 Three-phase alternating current detecting method
CN104037934A (en) * 2014-06-18 2014-09-10 深圳供电局有限公司 Spare power automatic switching emergency device and method for power system of transformer substation
CN106304518A (en) * 2015-05-13 2017-01-04 华润矽威科技(上海)有限公司 A kind of regulate LED colour temperature or the control circuit of brightness and method
CN106026745A (en) * 2016-05-20 2016-10-12 广东百事泰电子商务股份有限公司 Control chip for photovoltaic inverter integrated system
CN106301592A (en) * 2016-08-23 2017-01-04 索尔思光电(成都)有限公司 The method and device of protection APD receptor

Also Published As

Publication number Publication date
CN108668415A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
EP2455773A1 (en) Detecting circuit for electric quantity, processing device and method for state detection of mobile telephone in standby
EP2961248A1 (en) Method and apparatus for automatically controlling state indicator of terminal device
EP3258378B1 (en) Measurement coordination by monitoring of program code execution
CN104991110A (en) Voltage abnormity detection method and device for single phase alternating current power supply
CN101895085A (en) Power supply circuit protective device and protective control method
CN102314403B (en) Device and method for identifying I2C (Inter-Integrated Circuit) bus signal by taking MCU (Micro Control Unit) as slave device
CN104808037A (en) Photovoltaic inverter leakage current detecting device and method
CN101275975A (en) Mobile phone cell low-voltage testing circuit
CN111983300A (en) Motor current detection method and system, stirrer and storage medium
CN112986803A (en) Fault detection circuit and method, power adapter and electronic equipment
US20130328405A1 (en) Ground test circuit
US20200259355A1 (en) Charging Control Method, Related Device, and Computer Storage Medium
CN108668415B (en) Mode switching method and device of intelligent lighting equipment
CN108963350B (en) Battery protection method and device
CN204256036U (en) The power-off signal that power supply interrupts produces circuit
CN108073108A (en) For controlling the method for the interruption in inverter
CN114337211B (en) Critical value oscillation control device, equipment and wireless earphone
CN108879589B (en) Overcurrent protection method and device, terminal equipment and storage medium
CN106849125A (en) A kind of intelligent capacitor compensation device and capacitor switching method
CN113447773A (en) Arc detection method and device and energy storage battery system
CN113010004B (en) Abnormal power consumption processing method and device and electronic equipment
CN204679559U (en) A kind of negative tempperature coefficient thermistor circuit
CN113721146B (en) Automatic shutdown method, device, terminal and storage medium
CN218497025U (en) Collection system of voltage accumulation value
CN203839925U (en) Direct current motor overload protection device

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
GR01 Patent grant
GR01 Patent grant