An electronic device, wherein the electronic device comprises a Type C USB interface (J1, 1050), and the Type C USB interface (J1, 1050) has a shielding housing; and the electronic device further comprises a processor, wherein the processor is connected to the Type C USB interface (J1, 1050); the Type C USB interface (J1, 1050) is configured to connect to an external device; the shielding housing of the Type C USB interface (J1, 1050) is disconnected from a ground signal of the electronic device and is connected to a first resistor and a second resistor, wherein the first resistor and the second resistor are configured to divide a voltage (Vcc) to generate a divided voltage and to apply the divided voltage to the shielding housing of the Type C USB interface (J1, 1050); when no external device is connected to the Type C USB interface (J1, 1050), a voltage level of the shielding housing of the Type C USB interface (J1, 1050) is a first voltage level, wherein the first voltage level is greater than 0; when the external device is connected to the Type C USB interface (J1, 1050), the processor outputs a signal to a CC pin of the Type C USB interface (J1, 1050); and when no external device is connected to the Type C USB interface (J1, 1050), the processor stops outputting the signal to the CC pin of the Type C USB interface (J1, 1050); the electronic device further comprises a first comparator; a first positive input end of the first comparator is connected to the shielding housing of the Type C USB interface (J1, 1050); a first negative input end of the first comparator is connected to a first reference voltage; a first output end of the first comparator is connected to the processor; the first comparator is configured to compare a voltage level of the first positive input end with a voltage level of the first negative input end and output a first comparison signal to the processor; and the processor is configured to determine, based on the first comparison signal, that the external device is unplugged from the Type C USB interface (J1, 1050) and/or that the external device is connected to the Type C USB interface (J1, 1050); or the processor comprises an ADC detection module, and the ADC detection module is connected to the shielding housing of the Type C USB interface (J1, 1050); the ADC detection module is configured to detect the voltage level of the shielding housing of the Type C USB interface (J1, 1050); and the processor is configured to determine, based on the voltage level detected by the ADC detection module, that the external device is unplugged from the Type C USB interface (J1, 1050), and/or that the external device is connected to the Type C USB interface (J1, 1050), and/or there is liquid in the Type C USB interface. the processor is connected to the Type C USB interface (J1, 1050); the Type C USB interface (J1, 1050) is configured to connect to an external device; the shielding housing of the Type C USB interface (J1, 1050) is disconnected from a ground signal of the electronic device and is connected to a first resistor and a second resistor, wherein the first resistor and the second resistor are configured to divide a voltage (Vcc) to generate a divided voltage and to apply the divided voltage to the shielding housing of the Type C USB interface (J1, 1050); when no external device is connected to the Type C USB interface (J1, 1050), a voltage level of the shielding housing of the Type C USB interface (J1, 1050) is a first voltage level, wherein the first voltage level is greater than 0; when the external device is connected to the Type C USB interface (J1, 1050), the processor outputs a signal to a CC pin of the Type C USB interface (J1, 1050); and when no external device is connected to the Type C USB interface (J1, 1050), the processor stops outputting the signal to the CC pin of the Type C USB interface (J1, 1050); the electronic device further comprises a first comparator; a first positive input end of the first comparator is connected to the shielding housing of the Type C USB interface (J1, 1050); a first negative input end of the first comparator is connected to a first reference voltage; a first output end of the first comparator is connected to the processor; the first comparator is configured to compare a voltage level of the first positive input end with a voltage level of the first negative input end and output a first comparison signal to the processor; and the processor is configured to determine, based on the first comparison signal, that the external device is unplugged from the Type C USB interface (J1, 1050) and/or that the external device is connected to the Type C USB interface (J1, 1050); or the processor comprises an ADC detection module, and the ADC detection module is connected to the shielding housing of the Type C USB interface (J1, 1050); the ADC detection module is configured to detect the voltage level of the shielding housing of the Type C USB interface (J1, 1050); and the processor is configured to determine, based on the voltage level detected by the ADC detection module, that the external device is unplugged from the Type C USB interface (J1, 1050), and/or that the external device is connected to the Type C USB interface (J1, 1050), and/or there is liquid in the Type C USB interface.