The invention relates to the technical field of communication, and especially relates to an automatic link switching method and an automatic link switching device in order to solve the problem in the prior art that when a port, connected with
transmission equipment, of switching equipment has electrical signals but part of a link fails, the switching equipment cannot detect the failure of a main link, so that automatic link switching cannot be realized, the failure time of a long-distance
transmission system is prolonged, and the stability of the
system is poor. According to the invention, when that a main transmission port does not receive a detection data frame is detected by using M continuous cycles, that a main link fails is determined, the main link is closed, and a standby link is enabled. The situation in which switching equipment cannot automatically identify that
transmission equipment has electrical signals but the link is abnormal in the prior art is avoided, the failure time of the long-distance
transmission system is shortened, and the reliability of the long-distance
transmission system is improved. Meanwhile, the state of a link is determined by multiple detection cycles, and the probability that link fault is judged by mistaken due to
delay in detection data frame receiving by a transmission port is reduced.