This application discloses a
serial port switching method and electronic device, relating to the field of
server management technology, and applied to a
server device with a multi-management
controller architecture. The
server device includes a master node and multiple child nodes. The method includes: addressing the cumbersome operation of accessing faulty serial ports in a multi-management
controller architecture server, by supporting the pre-setting of valid target identifier parameters through parameter configuration commands, prioritizing the reading of this parameter and directly locating the corresponding target
serial port when a console access command is received, and automatically determining the target
serial port based on the status
record sequence if no valid target identifier parameter is read, and finally automatically completing the switching of the serial port connection link so that external access can access the target serial port through the master node, without the need for manual switching of physical links or complex command line configuration and
troubleshooting; solving the technical problem of cumbersome operation of accessing faulty serial ports in related technologies, and achieving the technical effect of simplifying the operation of accessing faulty serial ports.