An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
- the memory is configured to store a computer program;
- and
- the processor is configured to, in response to executing the program stored on the memory, implement a method for switching an interface mode, applied to a PCIE network card, wherein the PCIE network card comprises an Ethernet optical port and a main processor, and the Ethernet optical port is connected to the main processor;
- the Ethernet optical port is configured to support a plurality of interface modes, and the interface modes comprise a PCIE interface mode;
- the method comprises:
- switching the interface mode of the Ethernet optical port through the main processor, wherein in response to the interface mode of the Ethernet optical port being switched to the PCIE interface mode, the PCIE network card is connected to a PCIE slot of a host as a storage expansion card;
- wherein the method further comprises:
- in response to the interface mode of the Ethernet optical port being an optical port mode, a level control signal outputted by the main processor being a high-level signal, and prohibiting, by a clock module, outputting a reference clock signal, wherein a level conversion chip converts the high-level signal in the Ethernet optical port into a low-level signal compatible with the main processor;
- and
- in response to a module type of an optical module read by the main processor being a non-optical module type, switching the optical port mode to the PCIE interface mode, wherein the level control signal outputted by the main processor is a low-level signal, and the clock module outputs the reference clock signal;
- the reference clock signal is used for using the Ethernet optical port as a PCIE external interface, and the PCIE external interface is configured to externally connect to a solid state drive.