CN108920397B - Device identification method and device, storage medium and electronic device - Google Patents

Device identification method and device, storage medium and electronic device Download PDF

Info

Publication number
CN108920397B
CN108920397B CN201810717922.2A CN201810717922A CN108920397B CN 108920397 B CN108920397 B CN 108920397B CN 201810717922 A CN201810717922 A CN 201810717922A CN 108920397 B CN108920397 B CN 108920397B
Authority
CN
China
Prior art keywords
interface
type
pin
detection voltage
electronic equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810717922.2A
Other languages
Chinese (zh)
Other versions
CN108920397A (en
Inventor
靳勇
陈观荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201810717922.2A priority Critical patent/CN108920397B/en
Publication of CN108920397A publication Critical patent/CN108920397A/en
Application granted granted Critical
Publication of CN108920397B publication Critical patent/CN108920397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Power Sources (AREA)

Abstract

The application discloses a device identification method, a device identification apparatus, a storage medium and an electronic device. The method can be applied to electronic equipment, the electronic equipment provides first detection voltage for a preset pin of a Type-C interface of the electronic equipment, the preset pin is a non-configuration channel pin, and when the fact that the Type-C interface of external equipment is not connected to the Type-C interface of the electronic equipment is not detected, the configuration channel pin of the Type-C interface of the electronic equipment has no detection voltage. The method comprises the following steps: when an instruction for indicating external equipment identification is received from a user, grounding a preset pin; when the preset pin is detected to be grounded, generating a trigger signal; providing a second detection voltage for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage; and after the second detection voltage is provided for the configuration channel pin, the external equipment is identified through the configuration channel pin. The embodiment can effectively solve the problem that the electronic equipment cannot identify the external equipment.

Description

Device identification method and device, storage medium and electronic device
Technical Field
The present application belongs to the field of terminal technologies, and in particular, to a device identification method, apparatus, storage medium, and electronic device.
Background
Currently, the USB interfaces used on many electronic devices are Type-C interfaces. The highlight of the Type-C interface is the slimmer design, faster transmission speed (up to 10Gbps), and more aggressive power transmission. And, Type-C interface supports and all can insert "positive and negative to insert" function from positive and negative both sides. However, in some cases, a problem may occur that the Type-C interface of the external device has been accessed to the Type-C interface of the electronic device, but the electronic device cannot identify the external device.
Disclosure of Invention
The embodiment of the application provides a device identification method, a device, a storage medium and an electronic device, which can effectively solve the problem that the electronic device cannot identify an external device.
The embodiment of the application provides an equipment identification method, which is applied to electronic equipment and provides a first detection voltage for a preset pin of a Type-C interface of the electronic equipment, wherein the preset pin is a non-configuration channel pin, and when a Type-C interface of external equipment is not detected to be connected into the Type-C interface of the electronic equipment, the configuration channel pin of the Type-C interface of the electronic equipment has no detection voltage, and the method comprises the following steps:
when an instruction for indicating external equipment identification is received from a user, grounding the preset pin;
when the preset pin is detected to be grounded, generating a trigger signal;
providing a second detection voltage for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage;
and after the second detection voltage is provided for the configuration channel pin, identifying external equipment through the configuration channel pin.
The embodiment of the application provides an equipment recognition device, is applied to electronic equipment, for the preset pin of Type-C interface of electronic equipment provides first detection voltage, preset pin is non-configuration channel pin, inserts when not detecting the Type-C interface that has external equipment the Type-C interface of electronic equipment, the configuration channel pin of Type-C interface of electronic equipment does not have detection voltage, the device includes:
the control module is used for grounding the preset pin when receiving an instruction for indicating external equipment identification from a user;
the generating module is used for generating a trigger signal when the preset pin is detected to be grounded;
the configuration module is used for providing a second detection voltage for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage;
and the identification module is used for identifying external equipment through the configuration channel pin after the second detection voltage is provided for the configuration channel pin.
The embodiment of the application provides a storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is enabled to execute the steps in the device identification method provided by the embodiment of the application.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the steps in the device identification method provided in the embodiment of the present application by calling the computer program stored in the memory.
In this embodiment, when it is necessary to identify an external device, in which only one pin in the Type-C interface may be grounded, a user may send an instruction to the electronic device, that is, the electronic device may receive an instruction for instructing to identify the external device. At this moment, the electronic device can actively ground the preset pin, and when the preset pin is grounded, the electronic device can be triggered to provide a second detection voltage for the configuration channel pin of the Type-C interface of the electronic device, so that the external device can be identified through the configuration channel pin. Therefore, the problem that the external equipment which only has one pin and can be grounded in the Type-C interface cannot be identified can be effectively solved by the embodiment.
Drawings
The technical solution and the advantages of the present invention will be apparent from the following detailed description of the embodiments of the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of an apparatus identification method according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of a Type-C socket interface provided in an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a Type-C plug interface provided in an embodiment of the present application.
Fig. 4 is another schematic flowchart of a device identification method according to an embodiment of the present application.
Fig. 5 to fig. 8 are scene schematic diagrams of an apparatus identification method according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of an apparatus identification device according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Fig. 11 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
It is understood that the execution subject of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a schematic flowchart of an apparatus identification method according to an embodiment of the present disclosure. The device identification method can be applied to electronic devices. The electronic equipment provides a first detection voltage for a preset pin of a Type-C interface of the electronic equipment, and the preset pin is a non-configuration channel pin. And when the Type-C interface of the external equipment is not detected to be accessed into the Type-C interface of the electronic equipment, the pin of the configuration channel of the Type-C interface of the electronic equipment has no detection voltage.
The flow of the device identification method provided in this embodiment may include:
in 101, when an instruction for instructing the external device identification is received from a user, a preset pin is grounded.
Currently, the USB interfaces used on many electronic devices are Type-C interfaces. The highlight of the Type-C interface is the slimmer design, faster transmission speed (up to 10Gbps), and more aggressive power transmission. And, Type-C interface supports and all can insert "positive and negative to insert" function from positive and negative both sides.
Referring to fig. 2, fig. 2 is a pin arrangement diagram of a Type-C socket interface in the related art. The signal processing method comprises the following steps of TX1+, TX1-, RX1+, RX1-, TX2+, TX2-, RX2+ and RX 2-are four pairs of differential signal pins, D + and D-are differential signal pins compatible with the USB2.0 standard, VBUS is a power supply pin, CC1 and CC2 are configuration channel pins, and SBU1 and SBU2 are bus pins. Through configuring the channel pins, the electronic equipment can perform identification of external equipment, role distinction of master and slave equipment, insertion identification of front and back sides and the like.
Referring to fig. 3, fig. 3 is a pin arrangement diagram of a Type-C plug interface in the related art.
In this embodiment, when it is not detected that the Type-C interface of the external device is connected to the Type-C interface of the electronic device, the configuration channel pin of the Type-C interface of the electronic device has no detection voltage. That is to say, in this embodiment, the electronic device does not perform the access detection of the Type-C interface of the external device through the configuration channel pin of the Type-C interface. Only when detecting that there is the Type-C interface of external equipment to insert electronic equipment's Type-C interface, electronic equipment can provide detection voltage for the configuration channel pin of its Type-C interface to discern external equipment.
In this embodiment, the electronic device detects whether there is a Type-C interface of the external device to access the Type-C interface of the electronic device through a preset pin of the Type-C interface. The preset pin is a non-configuration channel pin, and the electronic device provides a first detection voltage for the preset pin. For example, the preset pin may be any one, two or more of the pins a1, B1, a12 and B12 in fig. 2. That is to say, in this embodiment, one, two, or more pins of a1, B1, a12, and B12 may be modified, so that the modified pin is changed to a non-Ground (GND) pin, and the modified pin is determined to be a preset pin, where the preset pin may be used to perform access detection on a Type-C interface of an external device. For example, the modified pin may also be referred to as an access detection pin. In some embodiments, the first detection voltage may be a voltage with a very low value, such as 0.1V or 0.2V, etc.
In one embodiment, the a1, a12, B1, B12 of the external device are all Ground (GND) pins because of the standard (full function) Type-C interface. Therefore, when the Type-C interface of the external device is connected to the Type-C interface of the electronic device, the voltage of the preset pin of the Type-C interface of the electronic device is pulled down (changed to zero from the first detection voltage), so that the connection of the external device adopting the Type-C interface is detected.
However, some external devices currently available on the market have a non-standard (non-fully functional) Type-C interface. Only one of the A1, B1, A12, B12 of the Type-C interface of these external devices is connected to the chip of the Type-C interface, while the remaining three pins are not connected to the chip of the Type-C interface, i.e., the three pins are in NC (Notconnected) state. For example, only the A1 pin in the Type-C interface of the external device is connected with the chip of the Type-C interface, and the three pins B1, A12 and B12 are in the NC state. In this way, when the Type-C interface (only the a1 pin may be grounded) of the external device is connected to the Type-C interface of the electronic device provided in this embodiment (for example, the a1 pin is modified to be a preset pin), since no other pin of the Type-C interface of the external device can be connected to the ground pin in the Type-C interface of the electronic device, a ground loop cannot be formed between the external device and the electronic device, and the a1 pin of the external device cannot pull down the voltage of the a1 pin of the electronic device, the electronic device may consider that the Type-C interface of the external device is not connected currently, and the electronic device may not identify the external device adopting the Type-C interface.
In 101 of the embodiment of the present application, when an instruction for instructing to perform external device identification is received from a user, the electronic device may ground the preset pin. For example, the pin is a1 pin, i.e., the electronic device can ground the a1 pin of its Type-C interface.
At 102, when the preset pin is detected to be grounded, a trigger signal is generated.
For example, when the electronic device connects the a1 pin of the Type-C interface to ground, the detection voltage of the a1 pin is changed from the first detection voltage to zero, and the electronic device can detect that the a1 pin is connected to ground. When the a1 pin is detected as being grounded, the electronic device may generate a trigger signal.
In one embodiment, the trigger signal may be an interrupt signal or the like.
In 103, a second detection voltage is provided for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage.
At 104, after providing the second detection voltage to the configuration channel pin, the external device is identified through the configuration channel pin.
For example, 103 and 104 may include:
after generating the trigger signal, the electronic device may provide a second detection voltage for a configuration channel pin of a Type-C interface thereof. The second detection voltage may be greater than the first detection voltage. For example, the second detection voltage may be 1.5V or the like.
After providing the second detection voltage for the configuration channel pin, the electronic device may identify the external device through the configuration channel pin to determine what kind of device the external device is specific. For example, in some embodiments, the external device may be a device such as a headset using a Type-C interface or a USB flash drive using a Type-C interface.
It should be noted that the Type-C interface has three roles, which are a downlink interface, an uplink interface, and a dual role interface. When the Type-C interface of the electronic equipment is used as a downlink interface, the electronic equipment is used as main equipment, can supply power for the accessed external Type-C equipment, sends data to the external Type-C equipment, reads the data from the external Type-C equipment and the like. When the Type-C interface of the electronic equipment is used as an uplink interface, the electronic equipment is used as slave equipment, power can be obtained from the accessed external Type-C equipment, and data and the like are provided for the external Type-C equipment. When the Type-C interface of the electronic equipment is used as a dual role interface, the electronic equipment can be dynamically switched between the master equipment and the slave equipment.
For example, in this embodiment, the Type-C interface of the electronic device may be configured as a downlink interface, that is, the electronic device serves as a master device. When the Type-C interface of the external device is configured as an uplink interface, that is, the external Type-C device is used as a slave device, a configuration channel pin of the Type-C interface of the external device is connected with a pull-down resistor (the pull-down resistor may be a single resistor, or may be formed by connecting a plurality of resistors in series and/or in parallel).
It is easy to understand that, when the Type-C interface of the external device is connected to the Type-C interface of the electronic device, the configuration channel pin of the Type-C interface of the electronic device is connected to the configuration channel pin of the Type-C interface of the external device, so that the configuration channel pin of the electronic device is connected to the pull-down resistor of the configuration channel pin of the external device, and the voltage on the configuration channel pin of the electronic device is pulled down.
And for external devices with different functions (such as earphones and U disks adopting a Type-C interface) the resistance values of the pull-down resistors connected with the configuration channel pins are different. Therefore, when external devices with different functions are connected to the electronic device, the voltage of the configuration channel pin of the electronic device is pulled down to different degrees. Therefore, the electronic device can identify what kind of device the external device is by the voltage variation value of its configuration channel pin.
It can be understood that, in this embodiment, when an external device with only one pin in the Type-C interface capable of being grounded needs to be identified, a user may send an instruction to the electronic device, that is, the electronic device may receive an instruction for instructing to perform external device identification. At this moment, the electronic device can actively ground the preset pin, and when the preset pin is grounded, the electronic device can be triggered to provide a second detection voltage for the configuration channel pin of the Type-C interface of the electronic device, so that the external device can be identified through the configuration channel pin. Therefore, the problem that the external equipment which only has one pin and can be grounded in the Type-C interface cannot be identified can be effectively solved by the embodiment.
In addition, since the electronic device in the related art continuously provides the detection voltage to the configuration channel pin of the Type-C interface, the detection voltage is generally not lower than 1.5V. Thus, if exposed to a humid environment, the configuration channel pins of the Type-C interface of the electronic device are very susceptible to corrosion. In this embodiment, when it is not detected that the Type-C interface of the external device is connected to the Type-C interface of the electronic device, the configuration channel pin of the Type-C interface of the electronic device has no detection voltage. That is, the Type-C interface of the electronic device is not always live. Therefore, the scheme of the embodiment can also protect the configuration channel pins of the Type-C interface of the electronic equipment from being corroded.
Referring to fig. 4, fig. 4 is another schematic flow chart of the device identification method according to the embodiment of the present disclosure. The device identification method can be applied to electronic devices. When the Type-C interface of the external equipment is not detected to be accessed into the Type-C interface of the electronic equipment, the pin of the configuration channel of the Type-C interface of the electronic equipment has no detection voltage. The electronic equipment provides a first detection voltage for a preset pin of a Type-C interface of the electronic equipment, and the preset pin is a non-configuration channel pin. The preset pin can be selectively grounded through the first switch, that is, when the first switch is in an on state, the preset pin can be grounded.
The electronic device is provided with a second switch. The second switch may be a virtual switch implemented by software, or may be a physical switch implemented by hardware. When the second switch is turned on by the user, it may be determined that an instruction for instructing the identification of the external device is received from the user.
The flow of the device identification method provided in this embodiment may include:
in 201, when an instruction for instructing external device identification is not received from a user and it is detected that the voltage value of the preset pin becomes zero, the electronic device determines that the Type-C interface of the external device is accessed to the Type-C interface of the electronic device.
For example, the predetermined pin of the Type-C interface of the electronic device is the a1 pin, that is, the a1 pin of the Type-C interface of the electronic device is modified to be a non-ground pin, and the electronic device provides the a1 pin with a first detection voltage, for example, the first detection voltage is 0.1V.
Then, when an instruction for instructing the external device to recognize is not received from the user and the electronic device detects that the voltage value of the a1 pin of the Type-C interface of the electronic device has the first detection voltage changed to zero, the electronic device may determine that the Type-C interface of the external device is connected to the Type-C interface of the electronic device.
After the Type-C interface of the external equipment is determined to be accessed into the Type-C interface of the electronic equipment, the electronic equipment enters 205, namely the electronic equipment is triggered to provide second detection voltage for the configuration channel pin of the Type-C interface. The electronic device may then identify the external device by configuring the channel pin.
At 202, when it is detected that the second switch is turned on by the user, the electronic device determines that an instruction for instructing the external device to recognize is received from the user.
For example, the second switch is a virtual switch implemented by software. Then, when it is detected that the second switch is turned on by the user, the electronic device may determine that an instruction for instructing the external device to be recognized is received from the user.
In 203, the electronic device controls the first switch to enter an on state when receiving an instruction for instructing external device identification from a user, and the preset pin is grounded when the first switch is in the on state.
For example, when it is determined that an instruction for instructing the external device to recognize is received from the user, the electronic device may control the first switch to be in an on state, and when the first switch is in the on state, the a1 pin is grounded.
At 204, the electronic device generates a trigger signal when the preset pin is detected to be grounded.
For example, when the electronic device connects the a1 pin of the Type-C interface to ground, the detection voltage of the a1 pin is changed from the first detection voltage to zero, and the electronic device can detect that the a1 pin is connected to ground. When the a1 pin is detected as being grounded, the electronic device may generate a trigger signal.
At 205, the electronic device provides a second detection voltage to the configuration channel pin, the second detection voltage being greater than the first detection voltage.
For example, after generating the trigger signal, the electronic device may provide the second detection voltage to the configuration channel pin of the Type-C interface thereof according to the trigger signal. The second detection voltage may be greater than the first detection voltage. For example, the second detection voltage may be 1.5V or the like.
Or when the electronic equipment determines that the Type-C interface of the external equipment is connected to the Type-C interface of the electronic equipment, the electronic equipment can provide a second detection voltage for the configuration channel pin of the Type-C interface.
At 206, the electronic device identifies the external device through the configuration channel pin after providing the second detection voltage to the configuration channel pin.
For example, after providing the second detection voltage to the configuration channel pin, the electronic device may identify the external device through the configuration channel pin to determine what kind of device the external device is specific. For example, in some embodiments, the external device may be a device such as a headset using a Type-C interface or a USB flash drive using a Type-C interface.
In some other embodiments, in addition to the second switch being provided for determining whether an instruction for instructing the external device to be recognized is received from the user, the electronic device may determine whether an instruction for instructing the external device to be recognized is received from the user as follows.
In one embodiment, the step of receiving an instruction from a user to perform external device identification may include:
when the display screen in the screen-saving state receives a touch operation of a preset track, the electronic equipment determines that an instruction for indicating external equipment identification is received from a user.
For example, the predetermined trajectory is an "o" shape. Then, if the display screen is in a screen-off state and the user draws an "o" shaped track on the display screen, the electronic device may receive a touch operation of a preset track, and at this time, the electronic device may determine that an instruction for instructing to perform external device identification is received from the user.
In another embodiment, the step of receiving an instruction from a user to perform external device identification may include:
when receiving the voice command of the preset content, the electronic equipment determines that the command for instructing the external equipment identification is received from the user.
For example, the voice command of the preset content is "xiaohu, and the external device is recognized through the Type-C interface". Then, when the user issues a voice command of "small europe, recognizing the external device through the Type-C interface" to the electronic device, the electronic device may determine that a command for instructing the external device to be recognized is received from the user.
In one embodiment, after the electronic device provides the second detection voltage to the configuration channel pin thereof, whether the external device is identified within a preset time period may also be detected. If the external device is not identified within the preset time, that is, although the user turns on the second switch to enable the electronic device to provide the second detection voltage for the configuration channel pin, the user does not access the external device to the electronic device within the preset time. In this case, the electronic device may disconnect the second detection voltage of the configuration channel pin, leaving the configuration channel pin uncharged.
Referring to fig. 5 to 7, fig. 5 to 7 are schematic views of a scene of an apparatus identification method according to an embodiment of the present application.
For example, the electronic device provided in this embodiment is an electronic device using a Type-C interface. And, the user has reformed the a1 pin of the Type-C interface of the electronic device, so that the a1 pin becomes a non-Ground (GND) pin, and the reformed a1 pin is provided with a first detection voltage. The modified A1 pin can be used for realizing the access detection of the Type-C interface of the external equipment. The modified a1 pin can be selectively grounded through the first switch, i.e., the a1 pin can be grounded when the first switch is in an on state. When the Type-C interface of the external equipment is not detected to be accessed into the Type-C interface of the electronic equipment, the pin of the configuration channel of the Type-C interface of the electronic equipment has no detection voltage. The electronic device is provided with a second switch. The second switch is a virtual switch implemented by means of software. When the second switch is turned on by the user, it may be determined that an instruction for instructing the identification of the external device is received from the user.
For example, as shown in fig. 5, the user accesses the earphone adopting the Type-C interface to the electronic device adopting the Type-C interface provided in the present embodiment.
If the Type-C interface of the earphone is a fully functional Type-C interface, namely, all of the A1, B1, A12 and B12 are Ground (GND) pins. In this case, when the Type-C interface of the headset is connected to the Type-C interface of the electronic device, the voltage of the a1 pin of the Type-C interface of the electronic device is pulled low, i.e., becomes zero from the first detection voltage. When detecting that the voltage of the a1 pin of the Type-C interface becomes zero, the electronic device can determine that there is an access of an external device of the Type-C interface. Then, the electronic device may provide a second detection voltage for the configuration channel pin of the Type-C interface of the electronic device, and identify what kind of device the external device is according to the voltage variation value of the configuration channel pin. For example, by configuring the voltage variation value of the channel pin, the electronic device recognizes that the external device is specifically a headset employing a Type-C interface.
If the Type-C interface of the earphone is not a fully functional Type-C interface, for example, the a1 pin of the Type-C interface of the earphone is connected to the chip of the Type-C interface, that is, the a1 pin of the Type-C interface of the earphone can be grounded, and B1, a12, and B12 are all in an NC state. In this case, when the Type-C interface of the earphone is connected to the Type-C interface of the electronic device, for example, the a1 pin of the earphone is connected to the a1 pin of the electronic device, because no other pin of the Type-C interface of the earphone can be connected to the ground pin of the Type-C interface of the electronic device, a ground loop cannot be formed between the earphone and the electronic device, and further the voltage of the a1 pin of the electronic device cannot be pulled down by the a1 pin of the earphone, the electronic device may consider that no Type-C interface of the external device is currently connected, that is, the electronic device may not provide the second detection voltage for the configuration channel pin of the Type-C interface of the electronic device, that is, the electronic device does not identify the external device using the Type-C interface.
In this case, when the user finds that the electronic device does not recognize the headset, the user may enter the second switch of the setting interface and then switch the second switch from the turned-off state to the turned-on state, as shown in fig. 6.
After detecting that the user turns on the second switch, the electronic device may determine that an instruction for instructing the external device to recognize is received from the user. The electronic device may then control the first switch to enter an on state, and when the first switch is in the on state, the a1 pin of the Type-C interface of the electronic device is grounded.
For example, in one embodiment, as shown in FIG. 7, the A1 pin of the electronic device is connected to ground through a TFT switch. Three ends of the TFT switch are respectively connected with the A1 pin of the electronic device, the first switch control circuit and the ground. When it is determined that an instruction for instructing the external device to be recognized is received from the user, the electronic device may transmit a high level signal to the first switch control circuit, thereby turning on the first switch. When the first switch is turned on, the a1 pin of the electronic device is connected to ground.
When detecting that the a1 pin of the electronic device is grounded, the electronic device may generate a trigger signal and provide a second detection voltage to the configuration channel pin in the Type-C interface thereof according to the trigger signal. After the second detection voltage is provided for the configuration channel pin in the Type-C interface of the electronic device, the electronic device may handshake with the external device through the configuration channel pin (i.e., establish a communication connection with the external device). After the handshake with the external device is successful, the electronic device can identify the external device through the configuration channel pin of the electronic device to determine what kind of device the external device is specific. For example, in this embodiment, the electronic device recognizes that the external device is an earphone.
In one embodiment, as shown in fig. 8, a resistor may be connected to the end of the TFT switch connected to ground. The resistor can prevent the A1 pin of the electronic device from being burnt out by external large current.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an apparatus identification device according to an embodiment of the present application. The device identification apparatus can be applied to electronic devices. The electronic equipment provides a first detection voltage for a preset pin of a Type-C interface of the electronic equipment, and the preset pin is a non-configuration channel pin. When the Type-C interface of the external equipment is not detected to be accessed into the Type-C interface of the electronic equipment, the pin of the configuration channel of the Type-C interface of the electronic equipment has no detection voltage.
The device-identifying apparatus 400 may include: the system comprises a control module 401, a generation module 402, a configuration module 403 and an identification module 404.
The control module 401 is configured to ground the preset pin when receiving an instruction for instructing to perform external device identification from a user.
A generating module 402, configured to generate a trigger signal when it is detected that the preset pin is grounded.
The configuration module 403 is configured to provide a second detection voltage to the configuration channel pin according to the trigger signal, where the second detection voltage is greater than the first detection voltage.
An identifying module 404, configured to identify an external device through the configuration channel pin after the second detection voltage is provided to the configuration channel pin.
In one embodiment, the predetermined pin is selectively grounded through a first switch.
The control module 401 may be configured to: when an instruction for indicating external equipment identification is received from a user, the first switch is controlled to enter an on state, and when the first switch is in the on state, the preset pin is grounded.
In one embodiment, a second switch is provided on the electronic device.
The control module 401 may be configured to: when it is detected that the second switch is turned on by a user, it is determined that an instruction for instructing the identification of an external device is received from the user.
In one embodiment, when the Type-C interface of the external device is connected to the Type-C interface of the electronic device, the voltage value of the preset pin is changed from the first detection voltage to zero.
The configuration module 403 may also be used to: when an instruction for indicating external equipment identification is not received from a user and the voltage value of the preset pin is detected to be zero, determining that a Type-C interface of the external equipment is accessed to a Type-C interface of the electronic equipment; and when the Type-C interface of the external equipment is determined to be accessed into the Type-C interface of the electronic equipment, providing the second detection voltage for the configuration channel pin, and identifying the external equipment.
In one embodiment, the control module 401 may be configured to: and when the display screen in the screen-rest state receives the touch operation of the preset track, determining that an instruction for indicating the external equipment identification is received from the user.
In one embodiment, the control module 401 may be configured to: when a voice instruction of preset content is received, it is determined that an instruction for instructing external device recognition is received from the user.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute the steps in the device identification method provided by the embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the steps in the device identification method provided in this embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The electronic device 500 may include a Type-C interface 501, a memory 502, a processor 503, and the like. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 7 does not constitute a limitation of the electronic device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The memory 502 may be used to store applications and data. Memory 502 stores applications containing executable code. The application programs may constitute various functional modules. The processor 503 executes various functional applications and data processing by running an application program stored in the memory 502.
The processor 503 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 502 and calling the data stored in the memory 502, thereby performing overall monitoring of the electronic device.
In this embodiment, the electronic device provides a first detection voltage for a preset pin of a Type-C interface of the electronic device, where the preset pin is a non-configuration channel pin, and when it is not detected that a Type-C interface of an external device is connected to a Type-C interface of the electronic device, the configuration channel pin of the Type-C interface of the electronic device has no detection voltage, a processor 503 in the electronic device loads an executable code corresponding to a process of one or more application programs into a memory 502 according to the following instruction, and the processor 503 runs the application program stored in the memory 502, so as to implement the steps:
when an instruction for indicating external equipment identification is received from a user, grounding the preset pin;
when the preset pin is detected to be grounded, generating a trigger signal;
providing a second detection voltage for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage;
and after the second detection voltage is provided for the configuration channel pin, identifying external equipment through the configuration channel pin.
Referring to fig. 11, the electronic device 600 may include a Type-C interface 601, a memory 602, a processor 603, an input unit 604, an output unit 605, a display screen 606, and the like.
The memory 602 may be used to store applications and data. The memory 602 stores applications containing executable code. The application programs may constitute various functional modules. The processor 603 executes various functional applications and data processing by running an application program stored in the memory 602.
The processor 603 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 602 and calling data stored in the memory 602, thereby integrally monitoring the electronic device.
The input unit 604 may be used to receive input numbers, character information, or user characteristic information, such as a fingerprint, and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The output unit 605 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The output unit may include a display panel.
The display 606 may be used to display information such as images and text.
In this embodiment, the electronic device provides a first detection voltage for a preset pin of a Type-C interface of the electronic device, where the preset pin is a non-configuration channel pin, and when it is not detected that a Type-C interface of an external device is connected to a Type-C interface of the electronic device, the configuration channel pin of the Type-C interface of the electronic device has no detection voltage, a processor 603 in the electronic device loads an executable code corresponding to a process of one or more application programs into a memory 602 according to the following instruction, and the processor 603 runs the application program stored in the memory 602, so as to implement the steps:
when an instruction for indicating external equipment identification is received from a user, grounding the preset pin;
when the preset pin is detected to be grounded, generating a trigger signal;
providing a second detection voltage for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage;
and after the second detection voltage is provided for the configuration channel pin, identifying external equipment through the configuration channel pin.
In one embodiment, the preset pin is selectively grounded through the first switch, and the processor 603 performs the step of grounding the preset pin when receiving an instruction for instructing to perform external device identification from a user, and may perform: when an instruction for indicating external equipment identification is received from a user, the first switch is controlled to enter an on state, and when the first switch is in the on state, the preset pin is grounded.
In one embodiment, a second switch is provided on the electronic device, and when the processor 603 executes the step of receiving an instruction from the user to perform external device identification, the steps may be executed as follows: when it is detected that the second switch is turned on by a user, it is determined that an instruction for instructing the identification of an external device is received from the user.
In one embodiment, when the Type-C interface of the external device is connected to the Type-C interface of the electronic device, the voltage value of the preset pin is changed from the first detection voltage to zero, and the processor 603 may further perform: when an instruction for indicating external equipment identification is not received from a user and the voltage value of the preset pin is detected to be zero, determining that a Type-C interface of the external equipment is accessed to a Type-C interface of the electronic equipment; and when the Type-C interface of the external equipment is determined to be accessed into the Type-C interface of the electronic equipment, providing the second detection voltage for the configuration channel pin, and identifying the external equipment.
In one embodiment, when the processor 603 executes the step of receiving the instruction for instructing external device identification from the user, the following steps may be executed: and when the display screen in the screen-rest state receives the touch operation of the preset track, determining that an instruction for indicating the external equipment identification is received from the user.
In one embodiment, when the processor 603 executes the step of receiving an instruction for instructing external device identification from a user, the following steps may be executed: when a voice instruction of preset content is received, it is determined that an instruction for instructing external device recognition is received from the user.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the device identification method, and are not described herein again.
The device identification apparatus provided in the embodiment of the present application and the device identification method in the above embodiments belong to the same concept, and any method provided in the device identification method embodiment may be run on the device identification apparatus, and a specific implementation process thereof is described in the device identification method embodiment in detail, and is not described herein again.
It should be noted that, for the device identification method described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the device identification method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and during the execution, the process of the embodiment of the device identification method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
For the device identification apparatus in the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The above detailed description is provided for a device identification method, apparatus, storage medium and electronic device provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (7)

1. A device identification method is applied to electronic equipment and is characterized in that a Type-C interface of the electronic equipment is a double-role interface, when a preset pin of the Type-C interface of the electronic equipment is provided with a first detection voltage, the preset pin is used for detecting whether a Type-C interface of external equipment is connected with the Type-C interface of the electronic equipment, the preset pin is a non-configuration channel pin, when the Type-C interface of the external equipment is not detected to be connected with the Type-C interface of the electronic equipment, the configuration channel pin of the Type-C interface of the electronic equipment has no detection voltage, and when the Type-C interface of the external equipment is connected with the Type-C interface of the electronic equipment, the preset pin is connected with the only grounding pin of the Type-C interface of the external equipment, the electronic equipment comprises a first switch, a second switch and a TFT switch, wherein three ends of the TFT switch are respectively connected with the preset pin, the first switch control circuit and the ground, and the method comprises the following steps:
when detecting that a user turns on the second switch on a setting interface, determining that an instruction for indicating external equipment identification is received, and controlling the first switch to enter a switch-on state through the TFT switch so as to ground the preset pin;
when the preset pin is detected to be grounded, generating a trigger signal;
providing a second detection voltage for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage;
and after the second detection voltage is provided for the configuration channel pin, identifying external equipment through the configuration channel pin.
2. The device identification method according to claim 1, wherein when a Type-C interface of an external device is connected to a Type-C interface of the electronic device, a voltage value of the preset pin is changed from the first detection voltage to zero, and the method further comprises:
and when an instruction for indicating external equipment identification is not received from a user and the voltage value of the preset pin is detected to be zero, determining that the Type-C interface of the external equipment is accessed to the Type-C interface of the electronic equipment.
3. The device identification method according to claim 1, wherein the step of receiving an instruction for instructing the identification of the external device from the user comprises:
and when the display screen in the screen-rest state receives the touch operation of the preset track, determining that an instruction for indicating the external equipment identification is received from the user.
4. The device identification method according to claim 1, wherein the step of receiving an instruction for instructing the identification of the external device from the user comprises: when a voice instruction of preset content is received, it is determined that an instruction for instructing external device recognition is received from the user.
5. A device identification device is applied to electronic equipment and is characterized in that a Type-C interface of the electronic equipment is a double-role interface, when a preset pin of the Type-C interface of the electronic equipment is provided with a first detection voltage, the preset pin is used for detecting whether a Type-C interface of external equipment is connected with the Type-C interface of the electronic equipment, the preset pin is a non-configuration channel pin, when the Type-C interface of the external equipment is not detected to be connected with the Type-C interface of the electronic equipment, the configuration channel pin of the Type-C interface of the electronic equipment has no detection voltage, and when the Type-C interface of the external equipment is connected with the Type-C interface of the electronic equipment, the preset pin is connected with the only grounding pin of the Type-C interface of the external equipment, the electronic equipment includes first switch, second switch and TFT switch, the three-terminal of TFT switch respectively with preset pin, first switch control circuit and ground link to each other, the device includes:
the control module is used for determining that an instruction for indicating external equipment identification is received when detecting that a user turns on the second switch on a setting interface, and controlling the first switch to enter a switching-on state through the TFT switch so as to ground the preset pin;
the generating module is used for generating a trigger signal when the preset pin is detected to be grounded;
the configuration module is used for providing a second detection voltage for the configuration channel pin according to the trigger signal, wherein the second detection voltage is greater than the first detection voltage;
and the identification module is used for identifying external equipment through the configuration channel pin after the second detection voltage is provided for the configuration channel pin.
6. A storage medium having stored thereon a computer program, characterized in that the computer program, when executed on a computer, causes the computer to execute the method according to any of claims 1 to 4.
7. An electronic device comprising a memory, a processor, wherein the processor is configured to perform the method of any of claims 1 to 4 by invoking a computer program stored in the memory.
CN201810717922.2A 2018-07-02 2018-07-02 Device identification method and device, storage medium and electronic device Active CN108920397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810717922.2A CN108920397B (en) 2018-07-02 2018-07-02 Device identification method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810717922.2A CN108920397B (en) 2018-07-02 2018-07-02 Device identification method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN108920397A CN108920397A (en) 2018-11-30
CN108920397B true CN108920397B (en) 2020-09-22

Family

ID=64423418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810717922.2A Active CN108920397B (en) 2018-07-02 2018-07-02 Device identification method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN108920397B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110018976B (en) * 2018-01-10 2022-06-10 华为技术有限公司 Method for USB master device to respond to USB slave device and related device
CN109802457A (en) * 2019-01-18 2019-05-24 青岛海信移动通信技术股份有限公司 A kind of electronic equipment and its charging method
CN112333327B (en) * 2020-11-20 2022-01-07 Oppo广东移动通信有限公司 Equipment detection method, device, storage medium, electronic equipment, external equipment and system
CN112737034A (en) * 2020-12-29 2021-04-30 四川长虹电器股份有限公司 Low-power consumption lithium battery charging management driving circuit
CN114942899B (en) * 2022-03-30 2024-01-05 深圳市广和通无线股份有限公司 Pin configuration method, module, equipment and storage medium
CN116049055B (en) * 2022-05-26 2023-09-08 荣耀终端有限公司 Access identification method of electronic equipment interface and electronic equipment
CN115878531B (en) * 2022-12-09 2024-03-15 珠海视熙科技有限公司 MiPi interface control method, electronic equipment, camera module, storage medium and video system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106934292A (en) * 2015-12-29 2017-07-07 北京明朝万达科技股份有限公司 A kind of cell phone apparatus identification and the method and system for disabling

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7631126B2 (en) * 2007-05-24 2009-12-08 Research In Motion Limited System and method for interfacing an electronic device with a host system
JP2013109410A (en) * 2011-11-17 2013-06-06 Semiconductor Components Industries Llc Determination circuit
JP2017045086A (en) * 2015-08-24 2017-03-02 キヤノン株式会社 Electronic apparatus and control method
CN108073537A (en) * 2016-11-11 2018-05-25 中兴通讯股份有限公司 Usb circuit, the implementation method of USB interface and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106934292A (en) * 2015-12-29 2017-07-07 北京明朝万达科技股份有限公司 A kind of cell phone apparatus identification and the method and system for disabling

Also Published As

Publication number Publication date
CN108920397A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN108920397B (en) Device identification method and device, storage medium and electronic device
US11050286B2 (en) Electronic device, method of controlling charging by electronic device, and method of supplying power by power supply device
US10503683B2 (en) Service redirect over USB Type-C
RU2682911C2 (en) Reversible connector for accessory devices
US8954628B2 (en) Portable device and peripheral extension dock
US10445274B2 (en) Universal serial bus (USB) hub for connecting different port types and method thereof
US9904338B2 (en) Control chip, control method and connection device utilizing the same
CN109672950B (en) Power saving circuit and power saving method based on Type-C earphone
CN108228509B (en) USB interface switching device and electronic equipment
JP2015103256A (en) System and method for detecting universal serial bus device
CN108681514B (en) Device detection method and device, storage medium and electronic device
CN105183679A (en) Electronic device and information processing method
CN108664430B (en) Equipment identification method and device, storage medium and electronic equipment
CN112799985B (en) USB interface control method, USB control circuit and intelligent networking equipment mainboard
CN111881074B (en) Electronic system, host device and control method
CN203552220U (en) Touch device of multiplex touch display screen
US11334506B2 (en) Interface connection device, system and method thereof
CN105589823A (en) Method, apparatus and circuit for realizing USB (universal serial bus) interface multiplexing MHL (mobile high-definition link)
TWI579704B (en) Ssic device and link control method for ssic device
CN110442539B (en) Mobile phone OTG switching method and device
CN114116415A (en) Hard disk backboard, hard disk lighting control system, method, device and medium
CN105446903A (en) Information processing method and electronic device
CN109074141B (en) Computing device with hot plug prediction circuit
CN111339013A (en) USB and UART line switching method and device
CN112333327B (en) Equipment detection method, device, storage medium, electronic equipment, external equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant