Commercial power failure detection method, control device and power supply switching system
The actual phase of the mains power supply is confirmed through the voltage detection circuit and a reference phase is generated. The input state of the mains power supply is judged by the phase difference, which solves the problem of misjudgment and long determination time of mains power outage detection in the prior art, and achieves higher detection accuracy and system reliability.
Patent Information
- Application Number
- CN202411712012.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art is prone to misjudgment when detecting power outage of mains. The voltage detection result is unstable due to short-term voltage fluctuations or harmonic interference, which increases the possibility of misjudgment, and the judgment time is long, which affects the reliability and safety of the system.
The voltage detection signal of the mains power supply is obtained through the voltage detection circuit, confirm the actual phase, and generate a reference phase. The input state of the mains power supply is judged by the phase difference between the actual phase and the reference phase, ensuring the rapid and accurate detection of the mains power outage.
It improves the accuracy of power outage detection, reduces the possibility of misjudgment, shortens the judgment time, and enhances the reliability and safety of the system.
Smart Images

Figure CN119727072A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power management, and in particular to a method for detecting a mains power failure, a control device and a power switching system. Background Art
[0002] Many existing electronic devices and systems have very high requirements for power quality, especially those used in the fields of medical, communications, finance and data centers. These devices are extremely sensitive to the stability of the power supply, and any short power outage may cause data loss, equipment failure or even serious safety accidents. Therefore, fast switching to backup power can ensure that these devices can still operate normally when the mains power is lost.
[0003] In the prior art, it is usually determined whether the mains power outage occurs by monitoring whether the mains voltage is lower than a certain threshold within a period of time. However, this judgment method may misjudge the mains power outage due to voltage fluctuations in the mains power within a short period of time (such as transient voltage drops). And when there are harmonics in the mains power, the voltage waveform is no longer a standard sine wave, which may cause the voltage detection result to be unstable and increase the possibility of misjudgment. In addition, this judgment method requires a long judgment time, which may cause the device to respond only after the actual power outage, affecting the reliability and safety of the system. Summary of the invention
[0004] The main purpose of the present invention is to provide a mains power failure detection method, a control device and a power supply switching system, aiming to improve the accuracy of mains power failure detection.
[0005] To achieve the above object, the present invention proposes a method for detecting a mains power failure, which is applied to a power switching system. The power switching system includes a voltage detection circuit. The method includes:
[0006] Obtaining a voltage detection signal outputted by a voltage detection circuit corresponding to the mains power supply, and confirming an actual phase of the mains power supply according to the voltage detection signal;
[0007] Based on the voltage detection signal, confirm the zero crossing point of the actual phase and generate a corresponding reference phase;
[0008] The input state of the commercial power supply is confirmed according to the phase difference between the actual phase and the reference phase.
[0009] In one embodiment, the power switching system further includes a filter circuit, and before the step of obtaining a voltage detection signal outputted by the voltage detection circuit corresponding to the mains power supply, the method further includes:
[0010] Get the mains power and filter out the harmonic components.
[0011] In one embodiment, the step of confirming the zero-crossing point of the actual phase based on the voltage detection signal and generating the corresponding reference phase specifically includes:
[0012] Based on the voltage detection signal, confirming the zero crossing point of the actual phase;
[0013] Confirming the frequency of the mains power supply according to the zero-crossing point of the actual phase;
[0014] According to the frequency of the commercial power supply, a reference phase of the corresponding frequency is generated.
[0015] In one embodiment, the step of confirming the input state of the mains power supply according to the phase difference between the actual phase and the reference phase specifically includes:
[0016] comparing the actual phase with the reference phase to confirm a phase difference between the actual phase and the reference phase;
[0017] Under the condition that the phase difference is less than a preset phase difference, confirming that the mains power supply is in a normal state;
[0018] Under the condition that the phase difference is greater than the preset phase difference, it is confirmed that the mains power supply is in an abnormal state.
[0019] In one embodiment, under the condition that the phase difference is greater than a preset phase difference, the step of confirming that the mains power supply is in an abnormal state specifically further includes:
[0020] Under the condition that the phase difference is greater than the preset phase difference, accumulating the number of times that the mains power supply is in an abnormal state;
[0021] Under the condition that the number of times that the mains power supply is in an abnormal state is cumulatively greater than a preset number, it is confirmed that the mains power supply is in a power-off state.
[0022] In one embodiment, after the step of accumulating the number of times the mains power supply is in an abnormal state under the condition that the phase difference is greater than the preset phase difference, the method further includes:
[0023] Under the condition that the phase difference is smaller than the preset phase difference and the cumulative number of times that the mains power supply is in an abnormal state is smaller than the preset number of times, the number of times that the mains power supply is in an abnormal state is reset to zero.
[0024] The present invention also proposes a control device, comprising: a memory, a processor, and a mains power failure detection program stored in the memory and executable on the processor, wherein the mains power failure detection program is configured to implement the steps of the mains power failure detection method as described in any one of the above items.
[0025] In one embodiment, the invention is applied to a power switching system, wherein the power switching system includes an access terminal of a mains power supply, a backup power supply, and a control device, wherein the control device includes a voltage detection circuit, a power switching circuit, and a main control circuit;
[0026] Wherein, the voltage detection circuit is electrically connected to the access terminal of the mains power supply, and is used to detect the mains power supply and output a voltage detection signal;
[0027] The first input end of the power switching circuit is electrically connected to the access end of the mains power supply, the second input end of the power switching circuit is electrically connected to the output end of the backup power supply, the controlled end of the power switching circuit is electrically connected to the main control circuit, and the output end of the power switching circuit is electrically connected to the load;
[0028] The main control circuit is used to control the power switching circuit to turn on or off the access end of the mains power supply and / or the path between the backup power supply and the load according to the voltage detection signal.
[0029] The present invention further provides a power switching system, which includes an access terminal for a mains power supply, a backup power supply, and a control device as described in any one of the above items.
[0030] The technical solution of the present invention detects the mains power supply by using a voltage detection circuit, thereby confirming the actual phase of the mains power supply. In addition, the zero-crossing point of the actual phase of the mains power supply is confirmed by the voltage detection signal output by the voltage detection circuit, and the corresponding reference phase is generated according to the zero-crossing point of the actual phase. When the output of the mains power supply is normal, the phase difference between the actual phase and the reference phase is within the preset phase difference; when the output of the mains power supply is powered off, the phase difference between the actual phase and the reference phase is greater than the preset phase difference and lasts for a certain period of time. Therefore, by using the phase difference and duration between the actual phase and the reference phase, it is possible to quickly and accurately determine whether the mains power supply is in a power-off state, so that the control device can quickly and accurately switch the power supply of the load. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0032] Figure 1 It is a schematic diagram of the flow of the mains power failure detection method of the present invention;
[0033] Figure 2A schematic diagram of a flow chart of an embodiment of a method for detecting a mains power failure according to the present invention;
[0034] Figure 3 A schematic diagram of a flow chart of another embodiment of a method for detecting a mains power failure according to the present invention;
[0035] Figure 4 A schematic diagram of a flow chart of another embodiment of a method for detecting a mains power failure according to the present invention;
[0036] Figure 5 It is a structural schematic diagram of the control device of the present invention.
[0037] Description of Figure Numbers:
[0038] 10. Main control circuit; 20. Voltage detection circuit; 30. Power switching circuit.
[0039] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0042] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0043] Many existing electronic devices and systems have very high requirements for power quality, especially those used in the fields of medical, communications, finance and data centers. These devices are extremely sensitive to the stability of the power supply, and any short power outage may cause data loss, equipment failure or even serious safety accidents. Therefore, fast switching to backup power can ensure that these devices can still operate normally when the mains power is lost.
[0044] In the prior art, it is usually determined whether the mains power outage occurs by monitoring whether the mains voltage is lower than a certain threshold within a period of time. However, this judgment method may misjudge the mains power outage due to voltage fluctuations in the mains power within a short period of time (such as transient voltage drops). And when there are harmonics in the mains power, the voltage waveform is no longer a standard sine wave, which may cause the voltage detection result to be unstable and increase the possibility of misjudgment. In addition, this judgment method requires a long judgment time, which may cause the device to respond only after the actual power outage, affecting the reliability and safety of the system.
[0045] Therefore, reference Figure 1 The present invention proposes a method for detecting a mains power failure, which is applied to a power switching system. The power switching system includes a voltage detection circuit. The method includes:
[0046] Step S100: obtaining a voltage detection signal outputted by a voltage detection circuit corresponding to the mains power supply, and confirming an actual phase of the mains power supply according to the voltage detection signal;
[0047] Step S200: confirming the zero-crossing point of the actual phase based on the voltage detection signal, and generating a corresponding reference phase;
[0048] Step S300: confirming the input state of the AC power supply according to the phase difference between the actual phase and the reference phase.
[0049] In this embodiment, the voltage detection circuit can be implemented by a high-voltage voltage-dividing detection circuit, a rectifier detection circuit, a Hall effect detection circuit, etc. Among them, in order to accurately detect the amplitude change of the mains power supply at each moment and further obtain the phase change of the mains power supply. After the voltage detection signal outputs the corresponding voltage detection signal, it is also necessary to amplify and condition the voltage detection signal through an operational amplifier circuit, so that the main control circuit converts the input analog signal into a corresponding digital signal after analog-to-digital conversion, thereby calculating the phase change of the mains power supply through Fourier transform or other algorithms.
[0050] In the present embodiment, in order to obtain the actual phase of the mains power supply, it is also possible to use an embedded method to set a mains phase-locked loop in a main control circuit such as an MCU. The mains power supply is adopted by a voltage detection circuit, and the analog-to-digital conversion in the main control circuit is performed to obtain a discrete voltage value, and then the waveform of the mains power supply is obtained. Among them, the mains phase-locked loop can track the input voltage detection signal, and the output signal can be kept synchronized with the mains even when the mains frequency fluctuates. When the mains power supply is working normally, the phase of the mains phase-locked loop output is consistent with the phase of the mains power supply; if the mains power supply is powered off, the output of the mains phase-locked loop will become unstable because it loses the synchronization reference. In other words, the mains phase-locked loop will still output a waveform signal of a fixed frequency and phase after the mains power is powered off, but it will not be synchronized with the normal mains.
[0051] Further, refer to Figure 2 The step of confirming the zero-crossing point of the actual phase based on the voltage detection signal and generating the corresponding reference phase specifically includes:
[0052] Step S210: confirming the zero-crossing point of the actual phase based on the voltage detection signal;
[0053] Step S220: confirming the frequency of the mains power supply according to the zero-crossing point of the actual phase;
[0054] Step S230: Generate a reference phase of the corresponding frequency according to the frequency of the mains power supply.
[0055] It is understandable that the voltage detection signal can also confirm that the mains voltage waveform passes through the zero point, that is, the node where the voltage value changes from positive to negative or from negative to positive, and then accurately obtain the phase and frequency of the mains. Among them, by detecting the time interval between two consecutive zero crossings, the frequency of the mains power supply can be calculated. After confirming the zero crossing point of the actual phase of the mains power supply, the corresponding reference phase can be generated by the virtual phase generation module. Among them, the virtual phase generation module is a built-in program in the main control circuit. The reference phase corresponds to the actual phase of the mains power supply when the mains power supply is normal. By confirming the zero crossing point, even in the absence of the mains power supply, the main control circuit can still obtain a reference phase corresponding to the actual phase when the mains power supply is normal, so as to facilitate the subsequent judgment of the mains power supply. Further, the output phase of the mains phase-locked loop and the output phase of the virtual phase generation module are synchronized when the mains power is normal, and will be different when the mains power is off, that is, the actual phase and the virtual phase are synchronized when the mains power is normal, and both generate the same number of waveform signals.
[0056] In this embodiment, when the mains power supply is powered normally, its phase is continuous and stable; and when the mains power supply is powered off, its phase will suddenly change or become unstable. It is understandable that the mains power supply is a continuous sine wave, and its phase changes continuously. For example, for a 50Hz mains power supply, there will be 50 complete sine wave cycles per second, and the phase of each cycle is from 0 to 2π and then back to 0. And when the mains power supply is powered normally, the phase of the mains power supply is stable and there will be no sudden jump. When the mains power supply is powered off, the voltage waveform will suddenly interrupt, resulting in a sudden change in phase. For example, if the mains power suddenly disappears at a certain moment, the phase will instantly change from a normal value to an uncertain value. After the mains power supply is powered off, the main control circuit continues to run the virtual phase generator, and a phase difference will appear between the actual phase and the reference phase, which can be detected by the phase comparison module. Among them, the phase comparison module is also a built-in program in the main control circuit. Therefore, the main control circuit can confirm the output state of the mains power supply by the phase difference between the actual phase and the reference phase.
[0057] In the present embodiment, the mains power supply is detected by using a voltage detection circuit to confirm the actual phase of the mains power supply. In addition, the zero crossing point of the actual phase of the mains power supply is confirmed by the voltage detection signal output by the voltage detection circuit, and the corresponding reference phase is generated according to the zero crossing point of the actual phase. When the output of the mains power supply is normal, the phase difference between the actual phase and the reference phase is within the preset phase difference; when the output of the mains power supply is powered off, the phase difference between the actual phase and the reference phase is greater than the preset phase difference and lasts for a certain period of time. Therefore, by the phase difference and duration between the actual phase and the reference phase, it is possible to quickly and accurately determine whether the mains power supply is in a power-off state, so as to facilitate the control device to quickly and accurately switch the power supply of the load.
[0058] In one embodiment of the present invention, the power switching system further includes a filter circuit, and before the step of obtaining a voltage detection signal outputted by the voltage detection circuit corresponding to the mains power supply, the method further includes:
[0059] Get the mains power and filter out the harmonic components.
[0060] In the present embodiment, the filter circuit can be implemented by a bandpass filter circuit, a notch filter circuit, etc. It is understandable that there is harmonic interference when the mains power supply supplies power to the load. Harmonic interference can change the shape of the voltage waveform, causing the position of the zero crossing point to deviate from the actual zero point. This will cause the zero crossing detection algorithm to misjudge the position of the zero crossing point, and then cause the main control circuit to have a problem of misjudgment. In addition, harmonics not only cause phase distortion, but also may cause frequency fluctuations. Therefore, it is necessary to set a corresponding filter circuit to filter out the harmonic components in the mains power supply, thereby improving the accuracy of the mains power failure detection.
[0061] refer to Figure 3 In one embodiment of the present invention, the step of confirming the input state of the mains power supply according to the phase difference between the actual phase and the reference phase specifically includes:
[0062] Step S310: comparing the actual phase with the reference phase to confirm a phase difference between the actual phase and the reference phase;
[0063] Step S320: Under the condition that the phase difference is less than a preset phase difference, confirming that the mains power supply is in a normal state;
[0064] Step S330: Under the condition that the phase difference is greater than a preset phase difference, confirming that the AC power supply is in an abnormal state.
[0065] In this embodiment, by setting a program of phase comparison function in the main control circuit, the actual phase obtained is compared with the reference phase to obtain the phase difference between the two. Among them, in order to confirm the output state of the mains power supply, a preset phase difference needs to be set as a judgment standard, and the preset phase difference is set by the R&D personnel according to the corresponding equipment requirements. It can be understood that the smaller the preset phase difference is set, the higher the detection sensitivity is, but the probability of misjudgment is correspondingly increased; and the larger the preset phase difference is set, the lower the detection sensitivity is, but the probability of misjudgment is correspondingly reduced. Therefore, the setting of the preset phase difference needs to balance the relationship between sensitivity and probability of misjudgment. For example, in this embodiment, the preset phase difference is 3 degrees, that is, when the phase difference between the actual phase and the reference phase is less than 3 degrees, it is confirmed that the mains power supply is in a normal state; and when the phase difference between the actual phase and the reference phase is greater than 3 degrees, it will be confirmed that the mains power supply is in an abnormal state.
[0066] refer to Figure 4 In one embodiment of the present invention, the step of confirming that the mains power supply is in an abnormal state under the condition that the phase difference is greater than a preset phase difference specifically includes:
[0067] Step S331: Under the condition that the phase difference is greater than the preset phase difference, the number of times that the mains power supply is in an abnormal state is accumulated;
[0068] Step S332: under the condition that the number of times that the mains power supply is in an abnormal state is cumulatively greater than a preset number of times, confirming that the mains power supply is in a power-off state.
[0069] It is understandable that there may be short-term fluctuations in the mains power supply, but these fluctuations usually do not affect the power supply quality. Such short-term fluctuations are called "transient events" or "short-term disturbances", which are common phenomena in power systems. Therefore, it is necessary to avoid misjudging such phenomena as power failures in the mains power failure detection. From the above content, it can be seen that by building a mains phase-locked loop related program in the main control circuit, the mains signal can be tracked, and the output signal can be kept synchronized with the mains even when the mains frequency fluctuates, so as to accurately extract the phase information of the mains. By building a virtual phase generation module related program in the main control circuit, a virtual reference phase can be generated based on the zero-crossing point detection of the mains power supply. This reference phase matches the actual phase of the mains power supply when the mains power is normal; after the mains power is lost, the last known correct phase continues to be provided as a reference, and even in the absence of the mains power, the main control circuit can still obtain a relatively stable phase reference. When the mains is working normally, the phase of the mains phase-locked loop output is consistent with the mains phase; if the mains is in a power-off state, the phase of the mains phase-locked loop output will become unstable because the synchronization reference is lost. Further, when the mains is in a power-off state, the mains phase-locked loop will continue to output an unstable phase, while the virtual phase generation module will keep the last phase value before the mains power is off. Among them, the phase difference between the unstable phase output of the mains phase-locked loop and the last phase value before the mains power is off maintained by the virtual phase generation module will be greater than the preset phase difference, and the main control circuit will accumulate the number of times the phase difference is greater than the preset phase difference. When the number of times the mains power supply is in an abnormal state is greater than the preset number, the main control circuit will confirm that the mains power supply is in a power-off state. Among them, the preset number can be set according to the sensitivity requirements of different devices. It should be noted that if the preset number is too low, the probability of misjudgment may increase. By adding the preset number, the misjudgment problem caused by short-term changes caused by fluctuations in the mains power supply can be avoided.
[0070] Furthermore, after the step of accumulating the number of times the mains power supply is in an abnormal state under the condition that the phase difference is greater than the preset phase difference, the method further includes:
[0071] Step S333: under the condition that the phase difference is smaller than the preset phase difference, and the cumulative number of times that the mains power supply is in an abnormal state is smaller than the preset number of times, the number of times that the mains power supply is in an abnormal state is cleared.
[0072] In this embodiment, the AC power supply may fluctuate, causing the phase difference between the actual phase output by the AC phase-locked loop and the reference phase output by the virtual phase generation module to be greater than the preset phase difference, but the duration of this fluctuation is short. Therefore, under the condition that the phase difference is greater than the preset phase difference, after the number of times the AC power supply is in an abnormal state is accumulated, and when the preset number is not reached, there is a phase difference less than the preset phase difference, it can be confirmed that the AC power supply fluctuates, and then the number of times the AC power supply is in an abnormal state is reset to zero, avoiding the number of times reaching the preset number due to the next power fluctuation. It can be understood that the accuracy of the main control circuit's detection of AC power failure can be further guaranteed by setting the number of times to be reset.
[0073] The present invention further proposes a control device, the control device comprising: a memory, a processor, and a mains power failure detection program stored in the memory and executable on the processor, the mains power failure detection program being configured to implement the steps of the mains power failure detection method as described in any one of the above. It is worth noting that since the control device of the present invention is based on the above mains power failure detection method, the embodiments of the control device of the present invention include all technical solutions of all embodiments of the above mains power failure detection method, and the technical effects achieved are also exactly the same, which will not be repeated here.
[0074] refer to Figure 5 In one embodiment of the present invention, the power switching system includes an access terminal of a mains power supply, a backup power supply, and a control device, and the control device includes a voltage detection circuit 20, a power switching circuit 30, and a main control circuit 10;
[0075] The voltage detection circuit 20 is electrically connected to the access terminal of the mains power supply, and is used to detect the mains power supply and output a voltage detection signal;
[0076] The first input end of the power switching circuit 30 is electrically connected to the access end of the mains power supply, the second input end of the power switching circuit 30 is electrically connected to the output end of the backup power supply, the controlled end of the power switching circuit 30 is electrically connected to the main control circuit 10, and the output end of the power switching circuit 30 is electrically connected to the load;
[0077] The main control circuit 10 is used to control the power switching circuit 30 to turn on or off the access end of the mains power supply and / or the path between the backup power supply and the load according to the voltage detection signal.
[0078] In the present embodiment, the voltage detection circuit 20 can be implemented by a high voltage voltage divider detection circuit, a rectifier detection circuit, a Hall effect detection circuit, etc. The power switching circuit 30 can be implemented by a mains switch circuit, a backup power switch circuit, etc. Among them, both the mains switch circuit and the backup power switch circuit can be implemented by relays. The main control circuit 10 can be implemented by a main controller, such as SOC (System On Chip), MCU (Microcontroller Unit), DSP (Digital Signal Process), FPGA (Field Programmable Gate Array), etc. The main control circuit 10 processes the input voltage monitoring signal through a built-in mains phase-locked loop, a virtual phase generation module, and a phase comparison module, and then determines the state of the mains power supply at this time. When the AC power supply is in a power-off state, the main control circuit 10 will control the power switching circuit 30 to disconnect the path between the AC power access end and the load, and connect the path between the backup power supply and the load, so as to achieve switching to the backup power supply when the AC power supply is in a power-off state, thereby avoiding data loss, equipment failure or even serious safety accidents caused by power interruption to the load.
[0079] refer to Figure 5 The present invention further proposes a power switching system, which includes an access terminal for a mains power supply, a backup power supply, and a control device as described in any one of the above. It is worth noting that since the power switching system of the present invention is based on the above control device, the embodiments of the power switching system of the present invention include all technical solutions of all embodiments of the above control device, and the technical effects achieved are also exactly the same, which will not be repeated here.
[0080] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A method for detecting a mains power failure, applied to a power switching system, characterized in that: The power switching system includes a voltage detection circuit, and the method includes: Obtaining a voltage detection signal outputted by a voltage detection circuit corresponding to the mains power supply, and confirming an actual phase of the mains power supply according to the voltage detection signal; Based on the voltage detection signal, confirm the zero crossing point of the actual phase and generate a corresponding reference phase; The input state of the commercial power supply is confirmed according to the phase difference between the actual phase and the reference phase.
2. The method according to claim 1, characterized in that The power switching system further includes a filter circuit. Before the step of obtaining a voltage detection signal outputted by the voltage detection circuit corresponding to the mains power supply, the method further includes: Get the mains power and filter out the harmonic components.
3. The method according to claim 1, characterized in that The step of confirming the zero-crossing point of the actual phase based on the voltage detection signal and generating the corresponding reference phase specifically includes: Based on the voltage detection signal, confirming the zero crossing point of the actual phase; Confirming the frequency of the mains power supply according to the zero-crossing point of the actual phase; According to the frequency of the commercial power supply, a reference phase of the corresponding frequency is generated.
4. The method according to any one of claims 1 to 3, characterized in that The step of confirming the input state of the mains power supply according to the phase difference between the actual phase and the reference phase specifically includes: comparing the actual phase with the reference phase to confirm a phase difference between the actual phase and the reference phase; Under the condition that the phase difference is less than a preset phase difference, confirming that the mains power supply is in a normal state; Under the condition that the phase difference is greater than the preset phase difference, it is confirmed that the mains power supply is in an abnormal state.
5. The method according to claim 4, characterized in that The step of confirming that the mains power supply is in an abnormal state under the condition that the phase difference is greater than the preset phase difference specifically includes: Under the condition that the phase difference is greater than the preset phase difference, accumulating the number of times that the mains power supply is in an abnormal state; Under the condition that the number of times that the mains power supply is in an abnormal state is cumulatively greater than a preset number, it is confirmed that the mains power supply is in a power-off state.
6. The method according to claim 5, characterized in that After the step of accumulating the number of times the mains power supply is in an abnormal state under the condition that the phase difference is greater than the preset phase difference, the method further includes: Under the condition that the phase difference is smaller than the preset phase difference and the cumulative number of times that the mains power supply is in an abnormal state is smaller than the preset number of times, the number of times that the mains power supply is in an abnormal state is reset to zero.
7. A control device, characterized in that: The control device comprises: a memory, a processor and a mains power failure detection program stored in the memory and executable on the processor, wherein the mains power failure detection program is configured to implement the steps of the mains power failure detection method according to any one of claims 1 to 6.
8. The control device according to claim 7, applied to a power switching system, characterized in that: The power switching system includes an access terminal of a mains power supply, a backup power supply, and a control device, wherein the control device includes a voltage detection circuit, a power switching circuit, and a main control circuit; Wherein, the voltage detection circuit is electrically connected to the access terminal of the mains power supply, and is used to detect the mains power supply and output a voltage detection signal; The first input end of the power switching circuit is electrically connected to the access end of the mains power supply, the second input end of the power switching circuit is electrically connected to the output end of the backup power supply, the controlled end of the power switching circuit is electrically connected to the main control circuit, and the output end of the power switching circuit is electrically connected to the load; The main control circuit is used to control the power switching circuit to turn on or off the access end of the mains power supply and / or the path between the backup power supply and the load according to the voltage detection signal.
9. A power switching system, characterized in that: The power switching system comprises an access terminal for a mains power supply, a backup power supply and a control device as claimed in any one of claims 7 to 8.