The present invention relates to the field of charging piles, and in particular, to a network switching method and an electronic device. The network switching method comprises: detecting whether communication of a first network of a target charging
pile is abnormal, the first network being a long-range communication network, and the target charging
pile being a charging
pile in a
charging station; if the communication of the first network is abnormal, acquiring
backup network configuration information, switching the first network of the target charging pile to a second
network on the basis of the
backup network configuration information, and, on the basis of the second network, controlling the target charging pile to be connected to a target node, the
backup network configuration information being used for establishing the second network, the second network being a short-range communication network, and the target node being a node with normal long-range communication. Thus, in the present embodiment, when communication of a current network of the charging pile is abnormal, switching to a backup network can be performed in a timely manner to continue the communication, thereby facilitating the improvement of the communication stability of the charging pile. In addition, manual maintenance on the
station is not needed, so that maintenance costs of the
charging station can be reduced, thereby improving the operational efficiency of the
charging station.