[go: up one dir, main page]

CN106155956B - Interface identification method and terminal - Google Patents

Interface identification method and terminal Download PDF

Info

Publication number
CN106155956B
CN106155956B CN201510155843.3A CN201510155843A CN106155956B CN 106155956 B CN106155956 B CN 106155956B CN 201510155843 A CN201510155843 A CN 201510155843A CN 106155956 B CN106155956 B CN 106155956B
Authority
CN
China
Prior art keywords
pin
interface
terminal
level signal
signal value
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.)
Expired - Fee Related
Application number
CN201510155843.3A
Other languages
Chinese (zh)
Other versions
CN106155956A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510155843.3A priority Critical patent/CN106155956B/en
Priority to PCT/CN2016/076279 priority patent/WO2016155483A1/en
Priority to RU2017137241A priority patent/RU2683615C1/en
Priority to JP2017550804A priority patent/JP6491760B2/en
Publication of CN106155956A publication Critical patent/CN106155956A/en
Application granted granted Critical
Publication of CN106155956B publication Critical patent/CN106155956B/en
Expired - Fee Related 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
    • 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
    • G06F13/4072Drivers or receivers
    • G06F13/4077Precharging or discharging

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)
  • Power Sources (AREA)
  • Information Transfer Systems (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses an interface identification method, which comprises the following steps: monitoring a level signal value of a first pin of an external USB interface of the terminal; judging whether the first pin receives a power supply signal of a first preset voltage or not according to the level signal value; if the first pin receives a power supply signal, judging that equipment externally connected with the terminal is first equipment, and electrically connecting a first interface in the terminal matched with the first equipment with an external USB interface; and if the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface, and electrically connecting a second interface inside the terminal matched with the second equipment with the external USB interface when judging that the equipment externally connected with the terminal is the second equipment according to the level signal value of the second pin. The invention also discloses a terminal. The interface identification method and the terminal provided by the invention can realize automatic switching between the USB interface and the RS232 interface and simultaneously avoid the phenomenon of damaging the interface when manual interface identification is carried out.

Description

Interface identification method and terminal
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an interface identification method and a terminal.
Background
The panel of the communication device is usually required to provide a USB (Universal Serial Bus) interface and an RS232 interface, and the USB interface is required to support a USB socket interface and a USB plug interface. The USB interface is generally used for transmission of configuration data, and the RS232 interface is generally used for maintenance of communication equipment. At present, the integration level of the communication equipment is higher and higher, the panel size of the communication equipment is smaller and smaller, and limited to the panel size, the communication equipment can only provide one interface in the USB interface and the RS232 interface, so that the use and maintenance of the communication equipment are troublesome.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide an interface identification method and a terminal, aiming at realizing automatic switching between a USB interface and an RS232 interface and avoiding the damage phenomenon to the interface when manual interface identification is carried out.
In order to achieve the above object, the present invention provides an interface identification method, which includes the following steps:
monitoring a level signal value of a first pin of an external USB interface of the terminal;
judging whether the first pin receives a power supply signal of a first preset voltage according to the level signal value;
if the first pin receives the power supply signal, judging that the equipment externally connected with the terminal is first equipment, and electrically connecting a first interface in the terminal matched with the first equipment with the external USB interface;
and if the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface, and electrically connecting a second interface inside the terminal matched with the second equipment with the external USB interface when judging that the equipment externally connected with the terminal is the second equipment according to the level signal value of the second pin.
Preferably, if the first pin does not receive the power supply signal, the step of obtaining a level signal value of a second pin of the external USB interface, and electrically connecting a second interface inside the terminal, which is matched with the second device, to the external USB interface when it is determined that the device external to the terminal is the second device according to the level signal value of the second pin includes:
if the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface;
judging whether the acquired level signal value of the second pin is smaller than a first preset value or not;
and if the level signal value of the second pin is smaller than the first preset value, judging that the equipment externally connected with the terminal is second equipment, and electrically connecting a second interface in the terminal matched with the second equipment with the external USB interface.
Preferably, after the step of determining whether the obtained level signal value of the second pin is smaller than a first predetermined value, the method further includes:
if the level signal value of the second pin is larger than or equal to the first preset value, outputting preset voltage of first preset time through the first pin;
acquiring level signal values of a second pin and a third pin of the external USB interface;
judging whether the level signal values of the second pin and the third pin are both larger than a second preset value;
and if the level signal values of the second pin and the third pin are both larger than a second preset value, judging that the equipment externally connected with the terminal is third equipment, and electrically connecting a third interface in the terminal matched with the third equipment with the external USB interface.
Preferably, the step of monitoring the level signal value of the first pin of the external USB interface of the terminal further includes:
and disconnecting the external USB interface from the first interface, the second interface and the third interface.
Preferably, the step of monitoring the level signal value of the first pin of the external USB interface of the terminal further includes:
and continuously monitoring the level signal value of the first pin of the external USB interface of the terminal in a second preset time.
In addition, to achieve the above object, the present invention further provides a terminal, including:
the monitoring module is used for monitoring the level signal value of a first pin of an external USB interface of the terminal;
the first judgment module is used for judging whether the first pin receives a power supply signal of a first preset voltage according to the level signal value;
the first connection module is used for judging that the equipment externally connected with the terminal is first equipment if the first pin receives the power supply signal, and electrically connecting a first interface in the terminal matched with the first equipment with the external USB interface;
and the second connection module is used for acquiring a level signal value of a second pin of the external USB interface if the first pin does not receive the power supply signal, and electrically connecting a second interface inside the terminal matched with the second device with the external USB interface when the external device of the terminal is judged to be the second device according to the level signal value of the second pin.
Preferably, the second connection module includes:
the first obtaining unit is used for obtaining a level signal value of a second pin of the external USB interface if the first pin does not receive the power supply signal;
the first judgment unit is used for judging whether the acquired level signal value of the second pin is smaller than a first preset value or not;
and the first connecting unit is used for judging that the equipment externally connected with the terminal is second equipment if the level signal value of the second pin is smaller than the first preset value, and electrically connecting a second interface in the terminal matched with the second equipment with the external USB interface.
Preferably, the second connection module further comprises:
the power supply output unit is used for outputting a preset voltage of a first preset time through the first pin if the level signal value of the second pin is greater than or equal to the first preset value;
the second acquisition unit is used for acquiring level signal values of a second pin and a third pin of the external USB interface;
the second judging unit is used for judging whether the level signal values of the second pin and the third pin are both larger than a second preset value;
and the second connecting unit is used for judging that the equipment externally connected with the terminal is third equipment if the level signal values of the second pin and the third pin are both larger than a second preset value, and electrically connecting a third interface in the terminal matched with the third equipment with the external USB interface.
Preferably, the terminal further includes:
and the disconnection module is used for disconnecting the electric connection of the external USB interface with the first interface, the second interface and the third interface.
Preferably, the monitoring module is further configured to:
and continuously monitoring the level signal value of the first pin of the external USB interface of the terminal in a second preset time.
According to the interface identification method and the terminal, whether a first pin receives a power supply signal with a first preset voltage or not is judged according to a level signal value of the first pin of an external USB interface of the terminal by monitoring the level signal value, when the first pin receives the power supply signal, the external equipment of the terminal is judged to be first equipment, and the first interface in the terminal matched with the first equipment is electrically connected with the external USB interface; and when the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface, and when the external equipment of the terminal is judged to be second equipment according to the level signal value of the second pin, electrically connecting a second interface inside the terminal matched with the second equipment with the external USB interface. Therefore, the device which is plugged outside currently can be automatically identified, such as a device with a USB socket, a device with a USB plug or a device with an RS232 interface, and the corresponding interface inside the connection terminal is matched, so that the automatic identification of the interface is realized, and meanwhile, the phenomenon of interface damage caused by overlarge level signal change in the manual interface switching process can be avoided.
Drawings
FIG. 1 is a flowchart illustrating an interface identification method according to a first embodiment of the present invention;
FIG. 2 is a detailed flowchart of step S104 in FIG. 1;
FIG. 3 is a flowchart illustrating an interface identification method according to a second embodiment of the present invention;
FIG. 4 is a functional block diagram of a terminal according to a first embodiment of the present invention;
FIG. 5 is a schematic diagram of a detailed functional block diagram of the second link module of FIG. 4;
FIG. 6 is a functional block diagram of a terminal according to a second embodiment of the present invention;
fig. 7 is a schematic diagram of hardware connection according to an embodiment of the terminal of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The present invention provides an interface identification method, referring to fig. 1, in an embodiment, the interface identification method includes the following steps:
step S101, monitoring a level signal value of a first pin of an external USB interface of a terminal;
in this embodiment, the terminal may include a mobile terminal with a USB interface, such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, and the like, and a fixed terminal with a USB interface, such as a digital TV, a desktop computer, and the like.
In this embodiment, the external USB interface is specifically a mini-USB connector, and is used for externally connecting a device with a USB socket interface, a device with a USB plug interface, a device with an RS132 interface, and the like. In this preferred embodiment, the external USB interface has at least three pins: pin 1 (first pin), pin 2 (third pin), and pin 3 (second pin), where pin 1 is a power line, and pin 2 and pin 3 are a data line negative D-and positive D +, respectively. It is understood that in other embodiments, the external USB interface may further include the following pins, such as the pin USB _ ID line and the ground line GND. The signal definition of the external USB interface is shown in the following table one:
Mini-USB connector USB socket interface USB plug interface RS232 interface
Pin
1 5V output 5V input Need not use
Pin 2 D- D- Transmitting serial data (TXD)
Pin 3 D+ D+ Receiving serial data (RXD)
Pin 4 USB_ID USB_ID Need not use
Pin 5 GND GND GND
Watch 1
In the preferred embodiment, the signal difference between the device with USB socket interface, the device with USB plug interface and the device with RS132 interface is shown in the following table two:
Figure BDA0000693196780000051
Figure BDA0000693196780000061
watch two
Step S102, judging whether the first pin receives a power supply signal with a first preset voltage according to the level signal value;
in this embodiment, according to the difference of the second table, a signal processing circuit is designed to monitor the level signal values of the pins 1, 2, and 3, so as to determine which type of interface inside the terminal and the external USB interface of the terminal are electrically connected in a matching manner. The signal processing circuit specifically comprises a power supply detection circuit, a 2V level detection circuit and a-2V/2V level detection circuit, wherein the power supply detection circuit monitors whether a power supply on a pin 1 supplies power or not, the 2V level detection circuit monitors a level signal value on a pin 2, and the-2V/2V level detection circuit monitors a level signal value on a pin 3.
In the preferred embodiment, the terminal first determines whether the power supply on pin 1 supplies power by monitoring the level signal value on the first pin, i.e., pin 1, according to the power supply detection circuit. The first predetermined voltage is 5v, and of course, in other embodiments, other voltage values may be set reasonably according to actual needs.
Step S103, if the first pin receives the power supply signal, determining that the equipment externally connected with the terminal is first equipment, and electrically connecting a first interface in the terminal matched with the first equipment with the external USB interface;
in this embodiment, if the first pin (pin 1) of the external USB interface of the terminal receives the power supply signal, it may be determined according to the second table that the external device of the terminal is the first device, that is, the device having the USB socket interface, and at this time, the control switch circuit of the terminal controls the first interface (USB plug interface) inside the terminal, which is matched with the first device (the device having the USB socket interface), to be electrically connected. The first interface corresponding to the terminal, namely the USB plug interface circuit, executes the USB standard protocol to perform interface initialization, communication and other operations.
And step S104, if the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface, and electrically connecting a second interface inside the terminal matched with the second device with the external USB interface when the external device of the terminal is judged to be the second device according to the level signal value of the second pin.
In this embodiment, if the first pin (pin 1) of the external USB interface of the terminal does not receive the power supply signal, and continues to obtain the level signal value of the second pin (pin 3) of the external USB interface, it may be determined according to table two that the device external to the terminal is the second device, that is, the device having the RS232 interface, and at this time, the control switch circuit of the terminal controls the second interface (internal RS232 interface) inside the terminal, which is matched with the second device (the device having the RS232 interface), to be electrically connected.
The interface identification method provided by the invention comprises the steps of judging whether a first pin receives a power supply signal with a first preset voltage or not according to a level signal value of the first pin of an external USB interface of a monitoring terminal, judging that equipment externally connected with the terminal is first equipment when the first pin receives the power supply signal, and electrically connecting a first interface in the terminal matched with the first equipment with the external USB interface; and when the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface, and when the external equipment of the terminal is judged to be second equipment according to the level signal value of the second pin, electrically connecting a second interface inside the terminal matched with the second equipment with the external USB interface. Therefore, the device which is plugged outside currently can be automatically identified, such as a device with a USB socket, a device with a USB plug or a device with an RS232 interface, and the corresponding interface inside the connection terminal is matched, so that the automatic identification of the interface is realized, and meanwhile, the phenomenon of interface damage caused by overlarge level signal change in the manual interface switching process can be avoided.
In an embodiment, as shown in fig. 2, on the basis of the embodiment of fig. 1, in this embodiment, the step S104 includes:
step S1041, if the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface;
in this embodiment, if the first pin (pin 1) of the external USB interface of the terminal does not receive the power supply signal, the level signal value of the second pin (pin 3) of the external USB interface is obtained through the-2V/2V level detection circuit.
Step S1042, determining whether the obtained level signal value of the second pin is smaller than a first predetermined value;
step S1043, if the level signal value of the second pin is smaller than the first predetermined value, determining that the device externally connected to the terminal is a second device, and electrically connecting a second interface inside the terminal, which is matched with the second device, with the external USB interface.
In this embodiment, when the-2V/2V level detection circuit monitors that the level signal value of pin 3 is smaller than the first predetermined value, such as-2V, it can determine, according to the second table, that the external plug-in device inserted into the current external USB interface should be a device having an RS232 interface. At this time, the control switch circuit of the terminal controls the second interface (internal RS232 interface) inside the terminal to be electrically connected to the second device (device having an RS232 interface).
In an embodiment, as shown in fig. 2, on the basis of the embodiment of fig. 1, in this embodiment, after the step S1042, the method further includes:
step S1044 is executed, if the level signal value of the second pin is greater than or equal to the first predetermined value, outputting a predetermined voltage for a first predetermined time through the first pin;
in this embodiment, when the level signal value at pin 3 is detected to be greater than or equal to a first predetermined value, e.g., -2V, the-2V/2V level detection circuit outputs a predetermined supply voltage, e.g., 5V, e.g., 500ms (milliseconds) through the first pin (pin 1). Of course, in other embodiments, the first predetermined time and the magnitude of the predetermined voltage value may be reasonably set according to actual needs.
Step S1045, acquiring level signal values of a second pin and a third pin of the external USB interface;
in this embodiment, when the first pin does not receive the power supply signal, for example, 5V, and the level signal value of the second pin (pin 3) monitored by the-2V/2V level detection circuit is greater than or equal to the first predetermined value, for example, -2V, the 5V power supply may be output through the pin 1, and the level signal value of the third pin (pin 2) and the level signal value of the second pin (pin 3) may be monitored by the-2V/2V level detection circuit, respectively.
Step S1046, judging whether the level signal values of the second pin and the third pin are both larger than a second preset value;
step S1047, if the level signal values of the second pin and the third pin are both greater than a second predetermined value, determining that the device externally connected to the terminal is a third device, and electrically connecting a third interface inside the terminal, which is matched with the third device, with the external USB interface.
In this embodiment, if it is monitored that the level signal values of the second pin and the third pin are both greater than the level of 2V after the 5V power is output through the pin 1, it may be determined according to the table two that the device externally connected to the terminal is a third device, that is, a device having a USB plug interface, and at this time, the control switch circuit of the terminal controls the third interface (USB socket interface) inside the terminal, which is matched with the third device (the device having the USB plug interface), to be electrically connected. And a corresponding third interface in the terminal, namely a USB socket interface circuit, executes the USB standard protocol to perform interface initialization, communication and other operations.
In an embodiment, as shown in fig. 3, on the basis of the embodiment of fig. 1, in this embodiment, before the step S101, the method further includes:
and step S105, disconnecting the external USB interface from the first interface, the second interface and the third interface.
In this embodiment, the control switch circuit of the terminal controls the external USB interface to be electrically disconnected from the first interface, the second interface, and the third interface. Therefore, the terminal can automatically identify which kind of equipment is the equipment plugged outside currently, such as equipment with a USB socket, equipment with a USB plug or equipment with an RS232 interface, and is matched with the corresponding interface inside the connection terminal, so that the automatic identification of the interface is realized. In addition, the level of the RS232 interface is much larger than the level amplitude of the USB interface, so that the phenomenon of interface damage caused by overlarge level signal change in the process of manually switching the interfaces can be avoided.
In an embodiment, on the basis of the above embodiment of fig. 1 or fig. 3, in this embodiment, the step S101 further includes:
and continuously monitoring the level signal value of the first pin of the external USB interface of the terminal in a second preset time.
In this embodiment, the level signal value of the first pin of the external USB interface of the terminal is continuously monitored for a second predetermined time, for example, 500 ms. Of course, in other embodiments, other predetermined time values may be reasonably set, based on the accurate level signal value that can be monitored, so as to avoid the level signal value from being distorted.
The present invention further provides a terminal 1, and referring to fig. 4, in an embodiment, the terminal 1 includes:
the monitoring module 101 is configured to monitor a level signal value of a first pin of an external USB interface of the terminal 1;
in this embodiment, the terminal 1 may include a mobile terminal with a USB interface, such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, and the like, and a fixed terminal with a USB interface, such as a digital TV, a desktop computer, and the like.
In this embodiment, the external USB interface is specifically a mini-USB connector, and is used for externally connecting a device with a USB socket interface, a device with a USB plug interface, a device with an RS132 interface, and the like. In this preferred embodiment, the external USB interface has at least three pins: pin 1 (first pin), pin 2 (third pin), and pin 3 (second pin), where pin 1 is a power line, and pin 2 and pin 3 are a data line negative D-and positive D +, respectively. It is understood that in other embodiments, the external USB interface may further include the following pins, such as the pin USB _ ID line and the ground line GND. The signal definition of the external USB interface is shown in the following table one:
Mini-USB connector USB socket interface USB plug interface RS232 interface
Pin
1 5V output 5V input Need not use
Pin 2 D- D- Transmitting serial data (TXD)
Pin 3 D+ D+ Receiving serial data (RXD)
Pin 4 USB_ID USB_ID Need not use
Pin 5 GND GND GND
Watch 1
In the preferred embodiment, the signal difference between the device with USB socket interface, the device with USB plug interface and the device with RS132 interface is shown in the following table two:
Figure BDA0000693196780000101
watch two
A first judging module 102, configured to judge whether the first pin receives a power supply signal of a first predetermined voltage according to the level signal value;
in this embodiment, according to the difference of the second table, a signal processing circuit 10 is designed to monitor the level signal values of the pins 1, 2, and 3, so as to determine which type of interface inside the terminal 1 and the external USB interface of the terminal 1 are electrically connected in a matching manner. Referring to fig. 7, the signal processing circuit 10 specifically includes a power supply detection circuit 12, a 2V level detection circuit 11, and a-2V/2V level detection circuit 13, where the power supply detection circuit 12 monitors whether the power supply on pin 1 supplies power, the 2V level detection circuit 11 monitors the level signal value on pin 2, and the-2V/2V level detection circuit 13 monitors the level signal value on pin 3.
In the preferred embodiment, the terminal 1 first monitors the level signal value on the first pin, i.e. pin 1, according to the power supply detection circuit 12 to determine whether the power supply on pin 1 supplies power. The first predetermined voltage is 5v, and of course, in other embodiments, other voltage values may be set reasonably according to actual needs.
The first connection module 103 is configured to determine that a device external to the terminal 1 is a first device if the first pin receives the power supply signal, and electrically connect a first interface inside the terminal 1, which is matched with the first device, with the external USB interface;
in this embodiment, if the first pin (pin 1) of the external USB interface of the terminal 1 receives the power supply signal, it can be determined according to the second table that the device externally connected to the terminal 1 is the first device, that is, the device having the USB socket interface, and at this time, referring to fig. 7, the switch circuit 30 of the terminal 1 controls the first interface (USB plug interface) inside the terminal 1 matching with the first device (the device having the USB socket interface) to be electrically connected. The corresponding first interface in the terminal 1, i.e. the USB plug interface circuit, executes the USB standard protocol to perform operations such as interface initialization and communication.
The second connection module 104 is configured to, if the first pin does not receive the power supply signal, obtain a level signal value of a second pin of the external USB interface, and when it is determined that the device external to the terminal 1 is a second device according to the level signal value of the second pin, electrically connect a second interface inside the terminal 1, which is matched with the second device, with the external USB interface.
According to the terminal 1 provided by the invention, by monitoring the level signal value of the first pin of the external USB interface of the terminal 1, whether the first pin receives a power supply signal with a first preset voltage or not is judged according to the level signal value, when the first pin receives the power supply signal, the external equipment of the terminal 1 is judged to be first equipment, and the first interface inside the terminal 1 matched with the first equipment is electrically connected with the external USB interface; and when the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface, and when the external equipment of the terminal 1 is judged to be second equipment according to the level signal value of the second pin, electrically connecting a second interface inside the terminal 1 matched with the second equipment with the external USB interface. Therefore, the device which is plugged outside currently can be automatically identified, such as a device with a USB socket, a device with a USB plug or a device with an RS232 interface, and the corresponding interface inside the connection terminal 1 is matched, so that the automatic identification of the interface is realized, and meanwhile, the phenomenon of interface damage caused by overlarge level signal change in the manual interface switching process can be avoided.
In an embodiment, as shown in fig. 5, on the basis of the embodiment of fig. 4, in this embodiment, the second connection module 104 includes:
a first obtaining unit 1041, configured to obtain a level signal value of a second pin of the external USB interface if the first pin does not receive the power supply signal;
in this embodiment, if the first pin (pin 1) of the external USB interface of the terminal 1 does not receive the power supply signal, the level signal value of the second pin (pin 3) of the external USB interface is obtained through the-2V/2V level detection circuit 13.
A first determining unit 1042, configured to determine whether the obtained level signal value of the second pin is smaller than a first predetermined value;
a first connection unit 1043, configured to determine, if the level signal value of the second pin is smaller than the first predetermined value, that the device external to the terminal 1 is a second device, and electrically connect a second interface inside the terminal 1, which is matched with the second device, with the external USB interface.
In this embodiment, when the level signal value of pin 3 is monitored to be smaller than the first predetermined value, such as-2V, the-2V/2V level detection circuit 13 may determine, according to the second table, that the external plug-in device inserted into the external USB interface is a device having an RS232 interface. At this time, the switch circuit 30 of the terminal 1 controls the second interface (internal RS232 interface) inside the terminal 1 to be electrically connected to the second device (device having an RS232 interface).
In an embodiment, as shown in fig. 5, on the basis of the embodiment of fig. 4, in this embodiment, the second connection module 104 further includes:
a power output unit 1044, configured to output a predetermined voltage for a first predetermined time through a first pin if the level signal value of the second pin is greater than or equal to the first predetermined value;
in this embodiment, when the level signal value of pin 3 is detected to be greater than or equal to a first predetermined value, for example, -2V, the-2V/2V level detection circuit 13 outputs a predetermined supply voltage, for example, 5V, for example, 500ms (millisecond) through the first pin (pin 1). Of course, in other embodiments, the first predetermined time and the magnitude of the predetermined voltage value may be reasonably set according to actual needs.
A second obtaining unit 1045, configured to obtain level signal values of a second pin and a third pin of the external USB interface;
in this embodiment, when the first pin does not receive the power supply signal, for example, 5V, and the level signal value of the second pin (pin 3) monitored by the-2V/2V level detection circuit 13 is greater than or equal to the first predetermined value, for example, -2V, the 5V power supply may be output through the pin 1, and the level signal value of the third pin (pin 2) and the level signal value of the second pin (pin 3) may be monitored by the-2V/2V level detection circuit 13, respectively.
A second determining unit 1046, configured to determine whether both level signal values of the second pin and the third pin are greater than a second predetermined value;
a second connection unit 1047, configured to determine, if the level signal values of the second pin and the third pin are both greater than a second predetermined value, that the device external to the terminal 1 is a third device, and electrically connect a third interface inside the terminal 1, which is matched with the third device, with the external USB interface.
In this embodiment, if it is monitored that the level signal values of the second pin and the third pin are both greater than the level of 2V after the 5V power is output through the pin 1, it may be determined according to the second table that the device externally connected to the terminal 1 is a third device, that is, a device having a USB plug interface, and at this time, referring to fig. 7, the switch circuit 30 of the terminal 1 controls the third interface (USB socket interface) inside the terminal 1 to be electrically connected to the third device (the device having the USB plug interface). The corresponding third interface in the terminal 1, i.e. the USB socket interface circuit, executes the USB standard protocol to perform operations such as interface initialization and communication.
In an embodiment, as shown in fig. 6, on the basis of the above embodiment of fig. 4, the terminal 1 further includes:
a disconnection module 105, configured to disconnect electrical connections between the external USB interface and the first interface, the second interface, and the third interface.
In this embodiment, the switch circuit 30 of the terminal 1 controls the external USB interface to be electrically disconnected from the first interface, the second interface, and the third interface. Therefore, the terminal 1 can automatically identify what kind of currently externally plugged device is, for example, a device with a USB socket, a device with a USB plug, or a device with an RS232 interface, and match with a corresponding interface inside the connection terminal 1, thereby implementing automatic identification of the interface. In addition, the level of the RS232 interface is much larger than the level amplitude of the USB interface, so that the phenomenon of interface damage caused by overlarge level signal change in the process of manually switching the interfaces can be avoided.
In an embodiment, on the basis of the above-mentioned embodiment of fig. 4 or fig. 6, the monitoring module 101 is further configured to:
and continuously monitoring the level signal value of the first pin of the external USB interface of the terminal 1 in a second preset time.
In this embodiment, the level signal value of the first pin of the external USB interface of the terminal 1 is continuously monitored for a second predetermined time, for example, 500 ms. Of course, in other embodiments, other predetermined time values may be reasonably set, based on the accurate level signal value that can be monitored, so as to avoid the level signal value from being distorted.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An interface identification method, characterized in that the interface identification method comprises the following steps:
monitoring a level signal value of a first pin of an external USB interface of a terminal, wherein the first pin is a power supply pin;
judging whether the first pin receives a power supply signal of a first preset voltage according to the level signal value;
if the first pin receives the power supply signal, determining that the equipment externally connected with the terminal is first equipment, and electrically connecting a first interface inside the terminal matched with the first equipment with the external USB interface, wherein the first equipment is equipment with a USB socket interface;
if the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface, and electrically connecting a second interface inside the terminal matched with the second device with the external USB interface when the external device of the terminal is judged to be the second device according to the level signal value of the second pin, wherein the second pin is a data pin, the second device is a device with an RS232 interface, and the level signal value of the first pin is different from the level signal value of the second pin.
2. The interface identification method according to claim 1, wherein the step of acquiring a level signal value of a second pin of the external USB interface if the first pin does not receive the power supply signal, and electrically connecting a second interface inside the terminal, which is matched with the second device, to the external USB interface when it is determined that the device externally connected to the terminal is the second device according to the level signal value of the second pin, comprises:
if the first pin does not receive the power supply signal, acquiring a level signal value of a second pin of the external USB interface;
judging whether the acquired level signal value of the second pin is smaller than a first preset value or not;
and if the level signal value of the second pin is smaller than the first preset value, judging that the equipment externally connected with the terminal is second equipment, and electrically connecting a second interface in the terminal matched with the second equipment with the external USB interface.
3. The interface identification method of claim 2, wherein the step of determining whether the obtained level signal value of the second pin is less than a first predetermined value further comprises:
if the level signal value of the second pin is larger than or equal to the first preset value, outputting preset voltage of first preset time through the first pin;
acquiring level signal values of a second pin and a third pin of the external USB interface;
judging whether the level signal values of the second pin and the third pin are both larger than a second preset value;
and if the level signal values of the second pin and the third pin are both larger than a second preset value, judging that the equipment externally connected with the terminal is third equipment, and electrically connecting a third interface in the terminal matched with the third equipment with the external USB interface.
4. The interface identifying method according to claim 3, wherein the step of monitoring the level signal value of the first pin of the external USB interface of the terminal is preceded by the step of:
and disconnecting the external USB interface from the first interface, the second interface and the third interface.
5. The interface identifying method of claim 1, wherein the step of monitoring the level signal value of the first pin of the external USB interface of the terminal further comprises:
and continuously monitoring the level signal value of the first pin of the external USB interface of the terminal in a second preset time.
6. A terminal, characterized in that the terminal comprises:
the monitoring module is used for monitoring a level signal value of a first pin of an external USB interface of the terminal, wherein the first pin is a power supply pin;
the first judgment module is used for judging whether the first pin receives a power supply signal of a first preset voltage according to the level signal value;
the first connection module is used for judging that the equipment externally connected with the terminal is first equipment if the first pin receives the power supply signal, and electrically connecting a first interface in the terminal matched with the first equipment with the external USB interface, wherein the first equipment is equipment with a USB socket interface;
and the second connection module is configured to, if the first pin does not receive the power supply signal, acquire a level signal value of a second pin of the external USB interface, and when it is determined that the device external to the terminal is a second device according to the level signal value of the second pin, electrically connect a second interface inside the terminal, which is matched with the second device, to the external USB interface, where the second pin is a data pin, the second device is a device having an RS232 interface, and a level signal value of the first pin is different from a level signal value of the second pin.
7. The terminal of claim 6, wherein the second connection module comprises:
the first obtaining unit is used for obtaining a level signal value of a second pin of the external USB interface if the first pin does not receive the power supply signal;
the first judgment unit is used for judging whether the acquired level signal value of the second pin is smaller than a first preset value or not;
and the first connecting unit is used for judging that the equipment externally connected with the terminal is second equipment if the level signal value of the second pin is smaller than the first preset value, and electrically connecting a second interface in the terminal matched with the second equipment with the external USB interface.
8. The terminal of claim 7, wherein the second connection module further comprises:
the power supply output unit is used for outputting a preset voltage of a first preset time through the first pin if the level signal value of the second pin is greater than or equal to the first preset value;
the second acquisition unit is used for acquiring level signal values of a second pin and a third pin of the external USB interface;
the second judging unit is used for judging whether the level signal values of the second pin and the third pin are both larger than a second preset value;
and the second connecting unit is used for judging that the equipment externally connected with the terminal is third equipment if the level signal values of the second pin and the third pin are both larger than a second preset value, and electrically connecting a third interface in the terminal matched with the third equipment with the external USB interface.
9. The terminal of claim 8, wherein the terminal further comprises:
and the disconnection module is used for disconnecting the electric connection of the external USB interface with the first interface, the second interface and the third interface.
10. The terminal of claim 6, wherein the monitoring module is further to:
and continuously monitoring the level signal value of the first pin of the external USB interface of the terminal in a second preset time.
CN201510155843.3A 2015-04-02 2015-04-02 Interface identification method and terminal Expired - Fee Related CN106155956B (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201510155843.3A CN106155956B (en) 2015-04-02 2015-04-02 Interface identification method and terminal
PCT/CN2016/076279 WO2016155483A1 (en) 2015-04-02 2016-03-14 Interface identification method and terminal
RU2017137241A RU2683615C1 (en) 2015-04-02 2016-03-14 Interface identification method and terminal
JP2017550804A JP6491760B2 (en) 2015-04-02 2016-03-14 Interface identification method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510155843.3A CN106155956B (en) 2015-04-02 2015-04-02 Interface identification method and terminal

Publications (2)

Publication Number Publication Date
CN106155956A CN106155956A (en) 2016-11-23
CN106155956B true CN106155956B (en) 2020-08-28

Family

ID=57004722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510155843.3A Expired - Fee Related CN106155956B (en) 2015-04-02 2015-04-02 Interface identification method and terminal

Country Status (4)

Country Link
JP (1) JP6491760B2 (en)
CN (1) CN106155956B (en)
RU (1) RU2683615C1 (en)
WO (1) WO2016155483A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112448820A (en) * 2019-08-27 2021-03-05 中兴通讯股份有限公司 Communication equipment panel interface and communication equipment
CN114115501B (en) * 2021-11-01 2024-04-02 佛山市顺德区美的电子科技有限公司 Interface voltage control circuit, method, electronic device, and storage medium
CN114817337B (en) * 2022-06-23 2022-09-16 深圳市科中云技术有限公司 Hardware interface type self-adaptive matching method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276319A (en) * 2008-02-05 2008-10-01 北京飞天诚信科技有限公司 Equipment and method for making USB interface to time-sharing apply as standard I /O interface
CN102750252A (en) * 2012-05-29 2012-10-24 惠州Tcl移动通信有限公司 Circuit capable of reusing universal serial bus (USB)/ universal asynchronous receiver/ transmitter (UART) interfaces and electronic device using same
CN102880238A (en) * 2012-08-30 2013-01-16 中兴通讯股份有限公司 Interface expanding method and device for tablet personal computer
CN103064489A (en) * 2011-10-21 2013-04-24 华为终端有限公司 Method for selecting internal circuit according to conditions of universal serial bus (USB) interface and terminal

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001109697A (en) * 1999-10-07 2001-04-20 Victor Co Of Japan Ltd Multiinterface device and bios processing method
JP2002007302A (en) * 2000-06-26 2002-01-11 Sony Corp Information processing system, pedestal device, portable information processor, and identifying method for pedestal device
TW512232B (en) * 2001-05-08 2002-12-01 Prolific Technology Inc USB connection-detection circuitry and operation methods of the same
JP2003241867A (en) * 2002-02-18 2003-08-29 Kyocera Corp Mobile terminal, communication cable, and interface switching method
CN2640130Y (en) * 2003-04-14 2004-09-08 上海先达企业发展有限公司 Composite communication interface
DE60320427T2 (en) * 2003-12-12 2009-05-07 Sony Ericsson Mobile Communications Ab Accessory identification algorithm for system connectors
CN100495377C (en) * 2007-03-09 2009-06-03 华为技术有限公司 Method and terminal interface for detecting plugged-in peripheral type
US7635280B1 (en) * 2008-07-30 2009-12-22 Apple Inc. Type A USB receptacle with plug detection
CN101404001B (en) * 2008-11-10 2010-06-30 华为终端有限公司 Serial port signal and USB signal compatible control circuit board and communication data cable
CN102193503A (en) * 2010-03-15 2011-09-21 研祥智能科技股份有限公司 Industrial control mainboard and method thereof for identifying external device
CN102082846B (en) * 2010-12-02 2014-01-15 惠州Tcl移动通信有限公司 Terminal equipment with plurality of externally arranged shared interfaces
JP5797949B2 (en) * 2011-06-28 2015-10-21 富士通コンポーネント株式会社 Communication device
US9183168B2 (en) * 2013-02-22 2015-11-10 Dell Products, Lp Dual mode USB and serial console port
JP5913211B2 (en) * 2013-06-21 2016-04-27 東芝テック株式会社 Interface device and information processing device
CN104035357B (en) * 2014-06-27 2017-04-19 广东欧珀移动通信有限公司 Headset, charging and OTG equipment circuit design based on USB socket

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276319A (en) * 2008-02-05 2008-10-01 北京飞天诚信科技有限公司 Equipment and method for making USB interface to time-sharing apply as standard I /O interface
CN103064489A (en) * 2011-10-21 2013-04-24 华为终端有限公司 Method for selecting internal circuit according to conditions of universal serial bus (USB) interface and terminal
CN102750252A (en) * 2012-05-29 2012-10-24 惠州Tcl移动通信有限公司 Circuit capable of reusing universal serial bus (USB)/ universal asynchronous receiver/ transmitter (UART) interfaces and electronic device using same
CN102880238A (en) * 2012-08-30 2013-01-16 中兴通讯股份有限公司 Interface expanding method and device for tablet personal computer

Also Published As

Publication number Publication date
WO2016155483A1 (en) 2016-10-06
JP2018511879A (en) 2018-04-26
JP6491760B2 (en) 2019-03-27
CN106155956A (en) 2016-11-23
RU2683615C1 (en) 2019-03-29

Similar Documents

Publication Publication Date Title
EP2720476A1 (en) Apparatus and method for detecting insertion of headset into mobile station
CN101951421A (en) Expansion use method for cell phone earphone interface
CN106155956B (en) Interface identification method and terminal
CN112367127A (en) Antenna detection circuit, electronic device, and antenna control method
KR20140126491A (en) power supply circuit and method for controlling thereof
CN203933930U (en) Earphone interface circuit and portable electron device
US20150253828A1 (en) Electronic system
US8840425B2 (en) Connector apparatus and adapter apparatus with indication function
US11503249B2 (en) Relay device, receiving device, and transmission system using same
US20170093095A1 (en) Transmission line for electronic apparatus
CN213399565U (en) Charging circuit and electronic device
US11675021B2 (en) Test apparatus for USB-PD device
CN106856289B (en) Electronic equipment and circuit thereof, switching equipment and circuit thereof and signal processing system
EP3690633B1 (en) Signal transmission circuit, signal transmission method and intelligent terminal
CN105450843A (en) Method and device of arranging operation mode of mobile terminal
CN107706977A (en) Method for detecting charging current and charging device
US20140200047A1 (en) Interface Card with Multiple Subscriber Identity Modules
US10063160B2 (en) Power adapter, cable, and charger
US10840697B2 (en) Power supply system compatible with multiple communication interface specifications and power receiver circuit thereof
CN108886225B (en) Charging cable
CN108287289B (en) Common ground detection circuit and detection method thereof
US20250103318A1 (en) Dongle device and firmware updating method thereof
CN111030226B (en) Equipment detection method and electronic equipment
CN104079030B (en) USB downstream port charger
CN212846780U (en) Test keysets and device

Legal Events

Date Code Title Description
C06 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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200828

Termination date: 20210402

CF01 Termination of patent right due to non-payment of annual fee