Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method and the device for setting the bypass state after the system is powered down are provided, and the bypass state after the system is powered down can be conveniently and reliably set.
In order to solve the technical problems, the invention adopts the technical scheme that:
a method for setting a bypass state after a system is powered down comprises the following steps:
s1, acquiring the current working voltage value of the system;
s2, judging whether the current working voltage value is smaller than or equal to a preset voltage value, if so, executing the step S3, otherwise, acquiring the current working voltage value again, and judging again, wherein the preset voltage value is larger than the power supply voltage value of a circuit used for bypass switching by the system;
and S3, changing the bypass state of the system into a preset bypass state.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a device for setting a bypass state after a system is powered down comprises a main control module, a voltage monitoring module and a bypass switching module;
the bypass state switching module is electrically connected with the main control module, the main control module is connected with the voltage monitoring module, the main control module is connected with the bypass switching module, and the bypass switching module is used for controlling the bypass state of the system and supplying power to the system;
the main control module is used for executing the method for setting the bypass state of the system after power failure.
In conclusion, the beneficial effects of the invention are as follows: the main control module controls the voltage monitoring module to continuously judge the monitored current working voltage value of the system and the preset voltage value, so that before the current working voltage value of the system is smaller than the power supply voltage value of a circuit used for bypass switching of the system, the system is timely found out of power failure, and the bypass switching module is controlled according to the preset bypass state to change the bypass state of the system; compared with the dial switch design with complex operation, the bypass state of the system is set by adopting software control, the operation of a user is simpler, and the bypass state after the system is powered off can be conveniently and quickly set only by a software command.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1 to 2, a method for setting a bypass state after a system power failure includes the following steps:
s1, acquiring the current working voltage value of the system;
s2, judging whether the current working voltage value is smaller than or equal to a preset voltage value, if so, executing the step S3, otherwise, acquiring the current working voltage value again, and judging again, wherein the preset voltage value is larger than the power supply voltage value of a circuit used for bypass switching by the system;
and S3, changing the bypass state of the system into a preset bypass state.
From the above description, the beneficial effects of the present invention are: the method comprises the steps of obtaining a current working voltage value of a system and judging the current working voltage value of the system with a preset voltage value, so that before the current working voltage value of the system is smaller than a power supply voltage value of a circuit, used for bypass switching, of the system, the system is timely found to be powered down, the bypass state of the system is changed according to the preset bypass state, and compared with a large capacitor design with a capacitance value changing along with time, the situation that the system is unreliable due to the lapse of time is avoided; compared with the dial switch design with complex operation, the bypass state of the system is set by adopting software control, the operation of a user is simpler, and the bypass state after the power failure of the system can be conveniently set only by a software command.
Further, "no, before reacquiring the current operating voltage value," further includes:
whether a power-down command is received is detected, and if yes, the step S3 is executed.
As can be seen from the above description, even if the current system is not powered down, the bypass state of the system is still changed according to the preset bypass state after the power-down command is detected. Except the condition that the system detects the power failure, a user can directly issue a power failure instruction through software according to actual needs, and the bypass state of the system can be changed quickly and conveniently.
Further, step S1 is preceded by:
and S0, acquiring a normal working voltage value of the system, and setting the normal working voltage value as a preset voltage value according to a preset proportion.
As can be seen from the above description, the magnitude of the preset voltage value is set according to the magnitude of the normal operating voltage value of the current system in a preset proportion. And when the ratio of the current working voltage value of the system to the normal working voltage value is smaller than the preset ratio, the system is considered to be powered down.
Further, the preset ratio is [ 80%, 95% ].
From the above description, the preset ratio is as high as [ 80%, 95% ] in order to find out the system power down as early as possible and to allow enough time for changing the bypass state of the system subsequently.
Further, step S3 is specifically:
and abypass switching module 3 of the control system switches the bypass state of thebypass switching module 3 to a preset bypass state.
As can be seen from the above description, for the bypass state switching of the system, thebypass switching module 3 of the control system changes the corresponding bypass state in the system.
Referring to fig. 3, a device for setting a bypass state after a system power failure includes amain control module 1, avoltage monitoring module 2, and abypass switching module 3;
the bypass state switching module is electrically connected with themain control module 1, themain control module 1 is connected with thevoltage monitoring module 2, themain control module 1 is connected with thebypass switching module 3, and thebypass switching module 3 is used for controlling the bypass state of the system and is powered by the system;
themain control module 1 is used for executing the method for setting the bypass state of the system after power failure.
From the above description, the beneficial effects of the present invention are: themain control module 1 controls thevoltage monitoring module 2 to continuously monitor the current working voltage value of the system, so that thebypass switching module 3 is controlled according to the preset bypass state to change the bypass state of the system before the current working voltage value of the system is smaller than the power supply voltage value of a circuit used for bypass switching of the system, and the bypass state cannot become unreliable due to time lapse compared with a large capacitor design with a capacitance value changing along with time; compared with the dial switch design with complex operation, the bypass state of the system is set by adopting software control, the operation of a user is simpler, and the bypass state after the power failure of the system can be conveniently set only by a software command.
Further, the device also comprises avoltage reduction module 4;
and the voltage output end of thevoltage reduction module 4 is connected with thebypass switching module 3, and the voltage input end of the voltage reduction module is used for connecting a power supply of the system.
As can be seen from the above description, the power supply of the system supplies power to thebypass switching module 3 by the step-downmodule 4 outputting an output voltage suitable for thebypass switching module 3.
Further, thevoltage monitoring module 2 includes a voltage monitoring chip INA 231.
From the above description, the voltage monitoring chip with the INA231 programmable has higher precision.
Further, themain control module 1 includes a programmable logic device.
As can be seen from the above description, themain control module 1 is mainly implemented by a programmable logic device.
Further, thebypass switching module 3 includes a latching relay ohron.
From the above description, it can be seen that the latching relay ohron requires a low rated voltage and a fast switching time, and is very suitable for switching the bypass state of the system.
Referring to fig. 1, a first embodiment of the present invention is:
a method for setting a bypass state after a system power failure, as shown in fig. 1, includes the following steps:
s1, acquiring the current working voltage value of the system;
s2, judging whether the current working voltage value is smaller than or equal to a preset voltage value, if so, executing the step S3, otherwise, acquiring the current working voltage value again, and judging again, wherein the preset voltage value is larger than the power supply voltage value of a circuit used for bypass switching by the system;
and S3, changing the bypass state of the system into a preset bypass state.
In this embodiment, the current working voltage value of the system is obtained and is subjected to size judgment with the preset voltage value, so that before the current working voltage value of the system is smaller than the power supply voltage value of a circuit used for bypass switching by the system, the power failure of the system is timely found, the bypass state of the system is changed according to the preset bypass state, complex operations such as large capacitance or dial switch setting are not needed, simplicity and convenience are achieved, failure caused by factors such as time lapse is avoided, and the convenient and reliable setting of the bypass state after the power failure of the system is realized.
In this embodiment, step S3 specifically includes:
and abypass switching module 3 of the control system switches the bypass state of thebypass switching module 3 to a preset bypass state.
Correspondingly, the preset voltage value is larger than the power supply voltage value of the bypass switching circuit of the system, so that the system power failure can be found timely. And the bypass state switching of the system is completed under the condition that the power supply of thebypass switching module 3 is ensured.
Further, in the present embodiment, specifically, step S1 is preceded by:
and S0, acquiring a normal working voltage value of the system, and setting the normal working voltage value as a preset voltage value according to a preset proportion.
Wherein, the preset proportion is preferably [ 80%, 95% ] so as to find out the system power failure as early as possible and reserve enough time for changing the bypass state of the system subsequently.
Referring to fig. 2, the second embodiment of the present invention is:
on the basis of the first embodiment, as shown in fig. 2, before "reacquiring the current operating voltage value", a method for setting a bypass state after a system power failure further includes:
whether a power-down command is received is detected, and if yes, the step S3 is executed.
The power-down instruction is an artificial input mode. Even if the current system is not powered down, the operator can still change the bypass state of the system according to the preset bypass state by inputting a power-down command from the outside.
Referring to fig. 3, a third embodiment of the present invention is:
a device for setting a bypass state of a system after power failure comprises amain control module 1, avoltage monitoring module 2 and abypass switching module 3. The bypass state switching module is electrically connected with themain control module 1, themain control module 1 is connected with thevoltage monitoring module 2, themain control module 1 is connected with thebypass switching module 3, and thebypass switching module 3 is used for controlling the bypass state of the system and is powered by the system. Themain control module 1 is configured to execute the method for setting the bypass state after the system is powered down according to the first or second embodiment.
In the present embodiment, thevoltage monitoring module 2 includes a voltage monitoring chip INA 231. Other chips having the same function may be used in other embodiments.
Furthermore, in the present embodiment, thebypass switching module 3 includes a latching relay ohron. Other relays having the same function may be used in other embodiments.
In summary, the present invention discloses a method and an apparatus for setting a bypass state after a system power failure, wherein a main control module controls a voltage monitoring module to continuously judge a monitored current working voltage value of the system and a preset voltage value, so that before the current working voltage value of the system is smaller than a power supply voltage value of a circuit of the system for bypass switching, the system power failure is timely found, a bypass switching module is controlled according to the preset bypass state to change the bypass state of the system, a value close to a normal working voltage of the system is taken as the preset voltage value, and a relay with a fast switching speed is adopted to perform bypass switching, so that compared with a large capacitor design in which a capacitance value changes along with time, the design is not unreliable due to time lapse; compared with the dial switch design with complex operation, the bypass state of the system is set by adopting software control, the operation of a user is simpler, and the bypass state after the power failure of the system can be conveniently set only by a software command.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent modifications made by the contents of the present specification and the drawings, or applied to the related technical fields directly or indirectly, are included in the scope of the present invention.