The invention discloses an automatic Training method and device for a switch port and a medium, and relates to the technical field of switch communication. The method comprises the following steps: monitoring a port state of a switch in real time, and triggering port
Serdes Training state detection when the port state is converted from a Down state to a Up state; if the port is not in the
Serdes Training completion state or the
Serdes Training non-completion state, detecting whether a
communication link of the Serdes is in a Down state or not; when it is determined that the
communication link of the Serdes is in the Down state, the port state of the switch is continuously detected for a preset duration so as to determine whether the condition
signal state of the port Serdes Training is stable or not, and when it is determined that the condition
signal state is stable, the port Serdes Training is carried out; the method comprises the following steps of:
polling a Serdes Training state of a port through a timed task, and when the port is determined to be in a Serdes Training completion state, updating parameters of a decision feedback
equalizer (DFE) in Serdes according to a Serdes Training result.