The invention provides a
software and hardware cooperation power supply protection circuit of a power distribution
automation terminal, which comprises a power supply input protection circuit, a
voltage conversion circuit, a power failure detection circuit, a
voltage maintenance protection circuit and a
clock backup battery protection circuit, and is characterized in that the power failure detection circuit adopts a photoelectric isolation technology to monitor a power supply input state in real time; when it is detected that the power supply is disconnected or powered down, a specific level
signal is output, and power down event detection is triggered; on the
software level, the function of a power failure detection pin is defined in an equipment tree, the power failure detection pin is configured to be an interrupt trigger pin, the power failure detection pin is initialized, interrupt is requested, an interrupt trigger condition is set to be level change, and a power failure detection event is triggered when the interrupt trigger condition occurs. According to the method,
system damage caused by accidental power failure is eliminated in a
software and hardware combination mode, the reliability of the terminal is remarkably improved, the service life of the terminal is remarkably prolonged, the software has enough time to complete file operation through power failure protection, and therefore the purpose of protecting the
file system is achieved.