This invention provides a method for automatic
failover of a central collector in a distributed IoT
system and the IoT
system itself. The method includes: a host computer sending an online status query message for devices via
CoAP protocol multicast, statistically analyzing the device response results, identifying central collectors that fail to respond multiple times consecutively as faulty central collectors, and sending a fault notification message
via protocol multicast, the message containing the
IP address of the faulty central collector; each IoT terminal determining whether the message data contains the
IP address of its currently reported central collector, and if so, sending a
path switching request message to the host computer; upon receiving the
path switching request message, the host computer selecting the central collector with the best computing resources to take over, sending a switchover response message to the IoT terminal, the message carrying the
IP address of the central collector taking over; upon receiving the switchover response message, the IoT terminal sending a registration message to the central collector taking over to complete terminal registration, and sending a deregistration message to the faulty central collector to complete terminal deregistration, thereby realizing
fault handling in the power
distribution system.