USB interface, terminal equipment, and equipment identification method and device

By introducing physical switches and control units in the USB interface, detecting equipment insertion status and identifying only when inserting, the problem of energy consumption waste caused by the continuous recognition of the terminal device USB interface is solved, and the efficiency of the equipment is improved.

CN119362090APending Publication Date: 2025-01-24BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310913654.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, the USB interface of the terminal device needs to continuously perform identification actions when plugging into the device, resulting in waste of energy consumption.

Method used

A USB interface is designed, which includes a physical switch and a control unit. It determines whether the device is plugged in by detecting the status of the physical switch, and only performs device type identification when the device is plugged in.

Benefits of technology

Effectively avoid unnecessary identification movements when the device is not inserted, reduces energy consumption waste, and improves the efficiency of the USB interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119362090A_ABST
    Figure CN119362090A_ABST
Patent Text Reader

Abstract

The invention relates to a USB interface, terminal equipment, and an equipment identification method and device. The USB interface comprises an interface female seat; the detection circuit comprises a physical switch and a control unit, the physical switch is arranged on the interface female seat, the control unit is used for detecting the state of the physical switch, the physical switch is in a first state when equipment is inserted into the interface female seat, and the physical switch is in a second state when no equipment is inserted into the interface female seat; and the pin is arranged in the interface female seat and is used for being connected with equipment inserted into the interface female seat under an identification instruction of the control unit and identifying the type of the equipment, and the identification instruction is generated when the control unit detects the first state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of terminal charging, and in particular to a USB interface and terminal equipment, and a device identification method and apparatus. Background Art

[0002] In recent years, the development speed of terminal devices such as smart phones has been getting faster and faster, and relevant technologies have made great progress. For example, current terminal devices often have an OTG power supply function, that is, the terminal device can power or charge the OTG device inserted into its USB interface. The USB interface of the terminal device can be inserted into a charger or an OTG device. In order to accurately identify the type of the device when the USB interface is inserted, the USB interface of the terminal device in the related art needs to continuously perform the identification action to ensure that the device type can be identified in time when the device is inserted into the USB interface, which causes energy waste. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the embodiments of the present disclosure provide a USB interface and terminal device, a device identification method and apparatus, so as to solve the defects in the related art.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided a USB interface, including:

[0005] Interface female socket;

[0006] A detection circuit, the detection circuit comprising a physical switch provided in the interface socket, and a control unit for detecting a state of the physical switch, the physical switch being in a first state when a device is inserted into the interface socket, and being in a second state when no device is inserted into the interface socket;

[0007] A pin is arranged in the interface socket and is used to connect to a device inserted in the interface socket and identify the device type under the identification instruction of the control unit, and the identification instruction is generated by the control unit when the first state is detected.

[0008] In one embodiment of the present disclosure, the physical switch is electrically connected to the system GND when in the first state, and is disconnected from the system GND when in the second state;

[0009] The control unit is configured to determine that the physical switch is in the first state when detecting that the physical switch is grounded;

[0010] The control unit is configured to determine that the physical switch is in the second state when it is detected that the physical switch is not grounded.

[0011] In one embodiment of the present disclosure, the detection circuit further includes a first resistor, one end of the first resistor is configured as a first voltage, and the other end of the first resistor is respectively connected to the physical switch and the INT pin of the control unit.

[0012] In one embodiment of the present disclosure, the physical switch includes a spring switch, the spring of which pops up into the interface socket when no device is inserted into the interface socket, and the spring of which closes when a device is inserted into the interface socket.

[0013] In one embodiment of the present disclosure, the interface female socket is electrically connected to the system GND;

[0014] The spring of the spring switch is connected to the control unit, and is disconnected from the interface socket when the spring of the spring switch bounces into the interface socket, and is electrically connected to the interface socket when the spring switch is closed.

[0015] In one embodiment of the present disclosure, the pin is configured to detect a voltage waveform under an identification instruction of the control unit.

[0016] In one embodiment of the present disclosure, the pin is configured to be grounded when the control unit does not generate the identification instruction.

[0017] In one embodiment of the present disclosure, a mounting hole is provided on a planar portion of an inner wall of the interface socket, and the physical switch is provided in the mounting hole; and / or,

[0018] The pins include a CC pin.

[0019] According to a second aspect of an embodiment of the present disclosure, a terminal device is provided, comprising the USB interface described in the first aspect.

[0020] In one embodiment of the present disclosure, the terminal device has an OTG function.

[0021] According to a third aspect of an embodiment of the present disclosure, there is provided a device identification method, including:

[0022] Detecting the state of a physical switch in the interface socket of the USB interface, wherein the physical switch is in a first state when a device is inserted into the interface socket, and in a second state when no device is inserted into the interface socket;

[0023] When the physical switch is in the first state, the pins of the USB interface are controlled to identify the device type of the device inserted into the interface socket.

[0024] In one embodiment of the present disclosure, the controlling the pin of the USB interface to identify the device type of the device inserted into the interface socket includes:

[0025] The pin is configured to detect a voltage waveform so that the pin can identify the device type of the device inserted into the interface socket.

[0026] According to a fourth aspect of an embodiment of the present disclosure, there is provided a device identification apparatus, including:

[0027] A detection module, used to detect the state of a physical switch in the interface socket of the USB interface, wherein the physical switch is in a first state when a device is inserted into the interface socket, and is in a second state when no device is inserted into the interface socket;

[0028] The identification module is used to control the pins of the USB interface to identify the device type of the device inserted into the interface socket when the physical switch is in the first state.

[0029] In one embodiment of the present disclosure, the identification module is specifically used to:

[0030] The pin is configured to detect a voltage waveform so that the pin can identify the device type of the device inserted into the interface socket.

[0031] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the method described in the third aspect when executing the computer instructions.

[0032] According to a sixth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in the third aspect is implemented.

[0033] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0034] In the charging circuit provided by the embodiment of the present disclosure, the OTG module in the power management chip that was originally used to boost the OTG function is reused as a boost module for the wireless reverse charging function, so that the DC power output by the battery is radiated outward by the wireless charging coil after being boosted by the OTG module and converted by the wireless charging chip, thereby realizing wireless reverse charging. The components in the charging circuit are all original components in wireless charging and battery power supply, so the wireless reverse charging function is realized without adding additional components; if the charging circuit is applied to the terminal device, the wireless reverse charging function can be realized while avoiding increasing the complexity of the circuit in the terminal device, thereby improving the utilization rate of the space in the terminal device and saving space for the expansion and enrichment of other functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0036] Figure 1 is a stereoscopic diagram of an interface female seat shown in an exemplary embodiment of the present disclosure;

[0037] Figure 2 is a top view of an interface female socket shown in an exemplary embodiment of the present disclosure;

[0038] Figure 3 is a top view of an interface female socket with a mounting hole shown in an exemplary embodiment of the present disclosure;

[0039] Figure 4 is a structural schematic diagram of a spring switch shown in an exemplary embodiment of the present disclosure;

[0040] Figure 5 is a schematic diagram of a detection circuit shown in an exemplary embodiment of the present disclosure;

[0041] Figure 6 is a schematic diagram of a detection waveform shown in an exemplary embodiment of the present disclosure;

[0042] Figure 7 is a flow chart of a device identification method shown in an exemplary embodiment of the present disclosure;

[0043] Figure 8 is a structural schematic diagram of a device identification apparatus shown in an exemplary embodiment of the present disclosure;

[0044] Fig. 9 It is a structural block diagram of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0045] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0046] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0047] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0048] In recent years, the development speed of terminal devices such as smart phones has been getting faster and faster, and relevant technologies have made great progress. For example, current terminal devices often have an OTG power supply function, that is, the terminal device can power or charge the OTG device inserted into its USB interface. The USB interface of the terminal device can be inserted into a charger or an OTG device. In order to accurately identify the type of the device when the USB interface is inserted, the USB interface of the terminal device in the related art needs to continuously perform the identification action to ensure that the device type can be identified in time when the device is inserted into the USB interface, which causes energy waste.

[0049] Based on this, in the first aspect, at least one embodiment of the present disclosure provides a USB interface, such as a Type-C interface, comprising: an interface socket; a detection circuit, the detection circuit comprising a physical switch provided on the interface socket, and a control unit for detecting the state of the physical switch, the physical switch being in a first state when a device is inserted into the interface socket, and being in a second state when no device is inserted into the interface socket; a pin, the pin being provided in the interface socket, for connecting to a device inserted into the interface socket and identifying a device type under an identification instruction of the control unit, the identification instruction being generated by the control unit when the first state is detected.

[0050] The interface socket is the main part of the USB interface, which is used to accommodate the USB interface of the charger and OTG device. Figure 1 and attached Figure 2 Shape shown.

[0051] In a possible embodiment, please refer to the attached Figure 3The plane portion of the inner wall of the interface socket is provided with a mounting hole, and the physical switch is arranged in the mounting hole.

[0052] In another possible embodiment, please refer to the attached Figure 4 The physical switch includes a spring switch, the spring of which pops up (ie, disconnects) when no device is inserted into the interface socket, and closes when a device is inserted into the interface socket, that is, the USB interface of the inserted device applies pressure to the spring to close it. In other words, the spring switch is in the second state when it pops up, and in the first state when it is closed.

[0053] In another possible embodiment, the physical switch is electrically connected to the system GND when in the first state, and disconnected from the system GND when in the second state; the control unit is used to determine that the physical switch is in the first state when detecting that the physical switch is grounded; the control unit is used to determine that the physical switch is in the second state when detecting that the physical switch is not grounded. For example, the interface socket is electrically connected to the system GND, the spring of the spring switch is connected to the control unit, and when the spring of the spring switch bounces into the interface socket, it is disconnected from the interface socket and then disconnected from the system GND, and when the spring switch is closed, the spring of the spring switch is electrically connected to the interface socket and then electrically connected to the system GND.

[0054] Based on the physical switch in the above example, please refer to the attached Figure 5 , the detection circuit also includes a first resistor, one end of which is configured as a first voltage, such as 1.8V, and the other end of which is connected to the physical switch and the INT pin of the control unit MCU, respectively. It can be understood that when no device is inserted into the interface socket, the physical switch is disconnected from GND, so the potential of the INT pin of the control unit is pulled up to 1.8V by the first resistor, and when the device is inserted into the interface socket, the physical switch is electrically connected to GND, so the potential of the INT pin of the control unit is pulled down by the system GND, thereby forming an interrupt signal at the INT pin; in other words, the control unit determines that the physical switch is in the second state when the INT pin generates an interrupt signal, and determines that the physical switch is in the first state when the INT pin does not generate an interrupt signal.

[0055] The interface socket is provided with a plurality of pins, each of which has a different function. The pins mentioned in the above embodiment may be pins for identifying the device type, such as CC pins. Exemplarily, the pins are configured to detect voltage waveforms under the recognition instruction of the control unit; the pins are configured to be grounded when the control unit does not generate the recognition instruction.

[0056] Among them, the detection voltage waveform can be presented as Figure 6 The square wave shown is a square wave formed by alternating the second voltage (such as 1.8V or 3V) and 0V. The circuit diagram after the CC pin of the USB interface in this embodiment is connected to the CC pin of other devices is shown in the attached figure. Figure 2 As shown in the attached Figure 2 It can be seen that if the terminal device to which the USB interface in this embodiment belongs is used as a power supply device (source device), the CC pin can be configured to the second voltage in the manner on the left to identify the type of the power-consuming device (sink device). If the terminal device to which the USB interface in this embodiment belongs is used as a power-consuming device (sink device), the CC pin can be configured to ground (i.e., 0V) in the manner on the right to identify the power supply device (source device). Since it is impossible to confirm whether the terminal device to which the USB interface in this embodiment belongs is used as a power supply device or a power-consuming device when identifying the type of the inserted device, it is necessary to switch the configuration voltage of the CC pin according to the detection voltage waveform.

[0057] It should be noted that the components mentioned in the above content and located in the interface socket are not necessarily connected to the interface socket, especially when the interface socket is connected to the system GND, the pins (specifically pins other than the ground pins) are not electrically connected to the interface socket.

[0058] It is understandable that in order to timely identify the device type when a device is inserted into the USB interface in the related art, the configuration voltage of the CC pin needs to be continuously switched according to the detection voltage waveform, which not only causes energy waste, but also causes interface corrosion due to the long time when the CC pin is configured as the second voltage. However, this embodiment uses a physical switch to identify whether a device is inserted into the interface socket, and only when a device is inserted into the interface socket, the configuration voltage of the CC pin is continuously switched according to the detection voltage waveform, thereby avoiding energy waste and interface corrosion.

[0059] In a second aspect, at least one embodiment of the present disclosure provides a terminal device, comprising the USB interface described in the first aspect, wherein the terminal device has an OTG function, that is, the terminal device can power or charge an OTG device inserted into its USB interface.

[0060] In a third aspect, at least one embodiment of the present disclosure provides a device identification method, which can be applied to the terminal device described in the second aspect to control the USB interface described in the first aspect to identify the device type of the device inserted into the USB interface.

[0061] Please refer to the attached Figure 7 , which shows the process of the method, including step S701 to step S702.

[0062] In step S701, the state of a physical switch in the interface socket of the USB interface is detected, wherein the physical switch is in a first state when a device is inserted into the interface socket, and is in a second state when no device is inserted into the interface socket.

[0063] In step S702, when the physical switch is in the first state, the pins of the USB interface are controlled to identify the device type of the device inserted into the interface socket.

[0064] Exemplarily, when the physical switch is in the first state, the pin is configured to detect a voltage waveform so that the pin identifies the device type of the device inserted into the interface socket.

[0065] More details about this method have been introduced in detail when introducing the USB interface in the first aspect, and will not be repeated here.

[0066] According to a fourth aspect of the present disclosure, a device identification apparatus is provided. Figure 8 , the device comprises:

[0067] A detection module 801 is used to detect the state of a physical switch in an interface socket of a USB interface, wherein the physical switch is in a first state when a device is inserted into the interface socket, and is in a second state when no device is inserted into the interface socket;

[0068] The identification module 802 is used to control the pins of the USB interface to identify the device type of the device inserted into the interface socket when the physical switch is in the first state.

[0069] In some embodiments of the present disclosure, the identification module is specifically used to:

[0070] The pin is configured to detect a voltage waveform so that the pin can identify the device type of the device inserted into the interface socket.

[0071] According to a fifth aspect of the embodiments of the present disclosure, an electronic device is provided. Fig. 9 It exemplarily shows a block diagram of a terminal device. For example, the electronic device 900 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0072] Reference Fig. 9 , the electronic device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 919 , and a communication component 916 .

[0073] The processing component 902 generally controls the overall operation of the electronic device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.

[0074] The memory 904 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0075] The power component 906 provides power to the various components of the electronic device 900. The power component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 900.

[0076] The multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0077] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the electronic device 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.

[0078] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0079] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the electronic device 900. For example, the sensor assembly 914 can detect the open / closed state of the electronic device 900, the relative positioning of components, such as the display and keypad of the electronic device 900, and the sensor assembly 914 can also detect the position change of the electronic device 900 or a component of the electronic device 900, the presence or absence of user contact with the electronic device 900, the orientation or acceleration / deceleration of the electronic device 900, and the temperature change of the electronic device 900. The sensor assembly 914 can also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0080] The communication component 916 is configured to facilitate wired or wireless communication between the electronic device 900 and other devices. The electronic device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0081] In an exemplary embodiment, the electronic device 900 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0082] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0083] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A USB interface, characterized in that: include: Interface female socket; A detection circuit, the detection circuit comprising a physical switch provided in the interface socket, and a control unit for detecting a state of the physical switch, the physical switch being in a first state when a device is inserted into the interface socket, and being in a second state when no device is inserted into the interface socket; A pin is arranged in the interface socket and is used to connect to a device inserted in the interface socket and identify the device type under the identification instruction of the control unit, and the identification instruction is generated by the control unit when the first state is detected.

2. The USB interface according to claim 1, characterized in that: The physical switch is electrically connected to the system GND when in the first state, and is disconnected from the system GND when in the second state; The control unit is configured to determine that the physical switch is in the first state when detecting that the physical switch is grounded; The control unit is configured to determine that the physical switch is in the second state when it is detected that the physical switch is not grounded.

3. The USB interface according to claim 2, characterized in that: The detection circuit further includes a first resistor, one end of which is configured as a first voltage, and the other end of which is connected to the physical switch and an INT pin of the control unit, respectively.

4. The USB interface according to any one of claims 1 to 3, characterized in that: The physical switch comprises a spring switch, wherein the spring of the spring switch pops up into the interface socket when no device is inserted into the interface socket, and the spring of the spring switch closes when a device is inserted into the interface socket.

5. The USB interface according to claim 4, characterized in that: The interface female socket is electrically connected to the system GND; The spring of the spring switch is connected to the control unit, and is disconnected from the interface socket when the spring of the spring switch bounces into the interface socket, and is electrically connected to the interface socket when the spring switch is closed.

6. The USB interface according to claim 1, characterized in that: The pin is configured to detect a voltage waveform under the recognition instruction of the control unit.

7. The USB interface according to claim 6, characterized in that: The pin is configured to be grounded when the control unit does not generate the identification instruction.

8. The USB interface according to claim 1, characterized in that: A mounting hole is provided on the plane portion of the inner wall of the interface female base, and the physical switch is provided in the mounting hole; and / or The pins include a CC pin.

9. A terminal device, characterized in that: The USB interface comprises the USB interface as claimed in any one of claims 1 to 8.

10. The terminal device according to claim 9, characterized in that: The terminal device has an OTG function.

11. A device identification method, characterized in that: include: Detecting the state of a physical switch in the interface socket of the USB interface, wherein the physical switch is in a first state when a device is inserted into the interface socket, and in a second state when no device is inserted into the interface socket; When the physical switch is in the first state, the pins of the USB interface are controlled to identify the device type of the device inserted into the interface socket.

12. The device identification method according to claim 11, characterized in that: The pins of the USB interface are controlled to identify the device type of the device inserted into the interface socket, including: The pin is configured to detect a voltage waveform so that the pin can identify the device type of the device inserted into the interface socket.

13. A device identification apparatus, characterized in that: include: A detection module, used to detect the state of a physical switch in the interface socket of the USB interface, wherein the physical switch is in a first state when a device is inserted into the interface socket, and is in a second state when no device is inserted into the interface socket; The identification module is used to control the pins of the USB interface to identify the device type of the device inserted into the interface socket when the physical switch is in the first state.

14. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the method according to any one of claims 11 to 12 when executing the computer instructions.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 11 to 12 is implemented.