Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained without creative efforts
Example, shall fall within the protection scope of the present invention.
First embodiment
As shown in Figure 1, an embodiment of the present invention provides a kind of control method of general-purpose serial bus USB interface, it is applied to
Mobile terminal, the mobile terminal include the shell and touch panel of USB interface, and a wherein signal for the touch panel receives
End is connect with the shell of the USB interface;When the USB interface does not access external equipment, the recognition detection foot of the USB interface
In low level state, the method includes:
Step 101, electricity of the shell of the USB interface detected by the signal receiving end relative to ground terminal is obtained
Capacitance.
In the embodiment, the wherein shell of a signal receiving end and USB interface of the touch panel of mobile terminal is connected,
And be pre-set in the signal receiving end of the shell connection of USB interface, for detect the shell of USB interface relative to ground terminal it
Between capacitance, to distinguish the capacitance for the touch operation that other signal receiving ends in touch panel detect.
Step 102, when the capacitance is in the first preset threshold range, determine that the USB interface has outside to set
It is standby to be inserted into.
In the embodiment, before step 101, the first preset threshold range is preset:External equipment insertion USB is connect
In mouthful, and take the shell of current USB interface relative to the first capacitance of ground terminal;According to the first capacitance, determine for sentencing
Whether disconnected USB interface has the first preset threshold range that external equipment accesses.Therefore, the signal receiving end timing of touch panel is examined
Survey capacitance of the shell of USB interface between ground terminal.By the capacitance detected and the first preset threshold range into
Row compares, and when capacitance is in the first preset threshold range, that is, determines that current USB interface has external equipment access.
Step 103, when the USB interface has external equipment access, by the recognition detection foot of the USB interface by low electricity
Level state switches to high level state.
In the embodiment, when USB interface does not access external equipment, the recognition detection foot of USB detection feet is in low level
State.When detecting that USB interface has external equipment access, switched to by low level state by processor control recognition detection foot
High level state simplifies user's operation without the voltage status of user's manual switching recognition detection foot.In addition, the program
Recognition detection foot is prevented to be chronically at high level state, due to leading to shorted to earth into aqueous corrosion, so that recognition detection foot fault is examined
Survey has the insertion of OTG equipment for USB interface.
In said program, a wherein signal receiving end for touch panel is connected to the shell of USB interface.Pass through touch surface
Capacitance of the shell of the signal receiving end detection USB interface of plate between ground terminal.Judge USB interface according to capacitance
In whether have external equipment access.When determination has external equipment access, by the recognition detection foot of USB interface by low level state
Switch to high level state.In this way, recognition detection foot is avoided to be chronically at high level state, it is short over the ground due to causing into aqueous corrosion
Low level state is in behind road, so that recognition detection foot fault is detected as USB interface and has the insertion of OTG equipment.In addition, the program simplifies
User's operation, user are not necessarily to when starting OTG functions, by setup module are switched to recognition detection foot by low level state
High level state improves user experience.
Second embodiment
As shown in Fig. 2, an embodiment of the present invention provides a kind of control method of general-purpose serial bus USB interface, it is applied to
Mobile terminal, the mobile terminal include the shell and touch panel of USB interface, and a wherein signal for the touch panel receives
End is connect with the shell of the USB interface;When the USB interface does not access external equipment, the recognition detection foot of the USB interface
In low level state, the method includes:
Step 201, electricity of the shell of the USB interface detected by the signal receiving end relative to ground terminal is obtained
Capacitance.
In the embodiment, the wherein shell of a signal receiving end and USB interface of the touch panel of mobile terminal is connected,
And be pre-set in the signal receiving end of the shell connection of USB interface, for detect the shell of USB interface relative to ground terminal it
Between capacitance, to distinguish the capacitance for the touch operation that other signal receiving ends in touch panel detect.
Step 202, when the capacitance is in the first preset threshold range, determine that the USB interface has outside to set
It is standby to be inserted into.
In the embodiment, before step 201, the first preset threshold range is preset:External equipment insertion USB is connect
In mouthful, and obtain first capacitance of the shell relative to ground terminal of current USB interface;According to the first capacitance, determination is used for
Judge the first preset threshold range whether USB interface has external equipment to access.Therefore, the signal receiving end timing of touch panel
Detect capacitance of the shell of USB interface between ground terminal.By the capacitance detected and the first preset threshold range
It is compared, when capacitance is in the first preset threshold range, that is, determines that current USB interface has external equipment access.
Step 203, when the USB interface has external equipment access, by the recognition detection foot of the USB interface by low electricity
Level state switches to high level state.
In the embodiment, when USB interface does not access external equipment, the recognition detection foot of USB detection feet is in low level
State.When detecting that USB interface has external equipment access, switched to by low level state by processor control recognition detection foot
High level state simplifies user's operation without the voltage status of user's manual switching recognition detection foot.In addition, the program
Recognition detection foot is prevented to be chronically at high level state, due to leading to shorted to earth into aqueous corrosion, so that recognition detection foot fault is examined
Survey has the insertion of OTG equipment for USB interface.Wherein OTG equipment includes USB flash drive, keyboard and mouse etc..
Step 204, when the recognition detection foot is in high level state, detect whether the external equipment is that OTG is set
It is standby.
In the embodiment, recognition detection foot is used to detect whether the external equipment being inserted into USB interface is OTG equipment.
When recognition detection foot is in high level, if detecting, (external equipment insertion USB interface is interrupted in the failing edge triggering of recognition detection foot
In so that the recognition detection foot of USB interface is connect with ground terminal), it is determined that the external equipment being inserted into USB interface sets for OTG
Standby, then mobile terminal enters interrupt processing, switches to main equipment pattern;Conversely, determining that external equipment is non-OTG equipment.
Step 205, when determining that the external equipment is OTG equipment, the communication with the OTG equipment is established.
In the embodiment, when it is OTG equipment to determine the external equipment for being inserted into USB interface, mobile terminal switches to master and sets
Standby pattern, and send and the connection signal of OTG equipment foundation connection to OTG equipment.Mobile terminal receive OTG equipment according to
When the feedback signal for the receiving connection that connection signal returns, the connection with OTG equipment is established.
Further, when the determination external equipment is OTG equipment, the step with the communication of the OTG equipment is established
After rapid, the method further includes:
When the capacitance detected by the signal receiving end is in the second preset threshold range, determines and be inserted into
The external equipment of the USB interface removes, and the recognition detection foot is switched to low level state by high level state.
In the embodiment, before step 201, the second preset threshold range is preset:It is not accessed in USB interface outer
When portion's equipment, second capacitance of the shell relative to ground terminal of current USB interface is obtained;According to the second capacitance, determines and use
In the second preset threshold range for judging whether the external equipment of insertion USB interface removes.In this way, after step 205, if inspection
When measuring capacitance of the shell of USB interface between ground terminal and being in the second preset threshold range, that is, determine external
Equipment has been moved out, and recognition detection foot is switched to low level state by high level state, avoids in USB interface without external equipment
When insertion, recognition detection foot is chronically at high level state, prevents USB interface from causing recognition detection foot short over the ground due to corrosion
Road, so that recognition detection foot fault is detected as USB interface and has the insertion of OTG equipment.
Wherein, the step of whether the detection external equipment is OTG equipment, including:
It detects the external equipment and whether triggers the recognition detection foot and low level state is switched to by high level state
Interrupt signal.
In the embodiment, interrupt signal, that is, recognition detection foot is switched to by high level under the moment generation of low level state
Drop is interrupted along triggering.When detecting interrupt signal, determine that the external equipment for being inserted into USB interface is OTG equipment;Otherwise, it determines
External equipment is non-OTG equipment.
When detecting the interrupt signal, determine that the external equipment is OTG equipment.
In the embodiment, if the external equipment of access USB interface is OTG equipment, lead to the recognition detection of USB interface
Foot is connect with ground terminal, is forced recognition detection foot being pulled down to low level by high level, is triggered interrupt signal, at this time mobile terminal
Interrupt operation is carried out, control equipment pattern is switched to.
Wherein, when the determination external equipment is OTG equipment, the step of foundation with the communication of the OTG equipment, packet
It includes:
When determining that the external equipment is OTG equipment, power supply signal is exported to institute by the power pins of the USB interface
State OTG equipment.
In the embodiment, when it is OTG equipment to determine the external equipment for being inserted into USB interface, mobile terminal switches to master and sets
Standby pattern, internal direct current 5V chips are powered to the power pins of USB interface.And then the power supply by being connect with OTG equipment
Pin is powered to OTG equipment.
Detect the OTG equipment according to the power supply signal the USB interface data minus pin or data
When the high level pulse signal of positive pin triggering, the communication with the OTG equipment is established.
In the embodiment, after OTG equipment is powered by power pins, draw in the positive pin of the data of USB interface or data minus
A high level pulse is generated on foot, and the high level pulse on the positive pin of data or data minus pin is detected in mobile terminal
When, establish the connection with OTG equipment.
In said program, a wherein signal receiving end for touch panel is connected to the shell of USB interface.Pass through touch surface
Capacitance of the shell of the signal receiving end detection USB interface of plate between ground terminal.Judge USB interface according to capacitance
In whether have external equipment access.When determination has external equipment access, by the recognition detection foot of USB interface by low level state
High level state is switched to, whether the recognition detection foot detection external equipment for being further in high level state is OTG equipment.
In this way, avoiding recognition detection foot from being chronically at high level state, due to being in low level shape after leading to shorted to earth into aqueous corrosion
State, so that recognition detection foot fault is detected as USB interface and has the insertion of OTG equipment.In addition, this solution simplifies user's operation, user
It is not necessary that when starting OTG functions, recognition detection foot is switched to high level state by low level state by setup module, improve
User experience.
3rd embodiment
First embodiment above and second embodiment describe the different embodiment party of the control method of USB interface in detail respectively
Formula is described further corresponding mobile terminal below in conjunction with Fig. 3 and Fig. 4.
Specifically, the mobile terminal 300 of the embodiment of the present invention, includes the shell and touch panel of USB interface, the touch-control
A wherein signal receiving end for panel is connect with the shell of the USB interface;When the USB interface does not access external equipment, institute
The recognition detection foot for stating USB interface is in low level state, and the mobile terminal 300 further includes:Acquisition module 310 judges mould
Block 320 and the first control module 330.
Acquisition module 310, for obtaining the shell of the USB interface detected by the signal receiving end relative to connecing
The capacitance of ground terminal.
In the embodiment, the wherein shell of a signal receiving end and USB interface of the touch panel of mobile terminal is connected,
And be pre-set in the signal receiving end of the shell connection of USB interface, for detect the shell of USB interface relative to ground terminal it
Between capacitance, to distinguish the capacitance for the touch operation that other signal receiving ends in touch panel detect.
Judgment module 320, for when the capacitance is in the first preset threshold range, determining the USB interface
There is external equipment insertion.
In the embodiment, the first preset threshold range is preset:External equipment is inserted into USB interface, and is taken current
First capacitance of the shell of USB interface relative to ground terminal;According to the first capacitance, determine for whether judging USB interface
There is the first preset threshold range that external equipment accesses.Therefore, the signal receiving end timing of touch panel detects the shell of USB interface
Capacitance of the body between ground terminal.Judgment module 320 carries out the capacitance detected and the first preset threshold range
Compare, when capacitance is in the first preset threshold range, that is, determines that current USB interface has external equipment access.
First control module 330, for when the USB interface has external equipment access, by the identification of the USB interface
Detection foot switches to high level state by low level state.
In the embodiment, when USB interface does not access external equipment, the recognition detection foot of USB detection feet is in low level
State.When detecting that USB interface has external equipment access, the first control module 330 controls recognition detection foot by low level shape
State switches to high level state, without the voltage status of user's manual switching recognition detection foot, simplifies user's operation.This
Outside, the program prevents recognition detection foot to be chronically at high level state, due to leading to shorted to earth into aqueous corrosion, so that identification inspection
Survey foot fault, which is detected as USB interface, the insertion of OTG equipment.
Further, the mobile terminal 300 further includes:Detection module 340 and link block 350.
Detection module 340, for when the recognition detection foot is in high level state, whether detecting the external equipment
For OTG equipment.
In the embodiment, recognition detection foot is used to detect whether the external equipment being inserted into USB interface is OTG equipment.
When recognition detection foot is in high level, if detection module 340 detects that (external equipment is interrupted in the failing edge triggering of recognition detection foot
It is inserted into USB interface so that the recognition detection foot of USB interface is connect with ground terminal), it is determined that it is inserted into the outside in USB interface
Equipment is OTG equipment, then mobile terminal enters interrupt processing, switches to main equipment pattern;Conversely, determining that external equipment is non-
OTG equipment.
Link block 350 when for determining that the external equipment is OTG equipment, establishes the communication with the OTG equipment.
In the embodiment, when it is OTG equipment to determine the external equipment for being inserted into USB interface, mobile terminal switches to master and sets
Standby pattern.Link block 350 sends the connection signal for establishing connection with OTG equipment to OTG equipment, is received in mobile terminal
When the feedback signal for the receiving connection that OTG equipment is returned according to connection signal, the connection with OTG equipment is established.
Further, the mobile terminal 300 further includes:Second control module 360.
It is default to be in second for the capacitance detected by the signal receiving end for second control module 360
When in threshold range, determine that the external equipment for being inserted into the USB interface removes, and by the recognition detection foot by high level
State switches to low level state.
In the embodiment, the second preset threshold range is preset:When not accessing external equipment in USB interface, obtain
Second capacitance of the shell of current USB interface relative to ground terminal;According to the second capacitance, determine for judging to be inserted into USB
The second the preset threshold range whether external equipment of interface removes.If in this way, the shell for the USB interface that acquisition module 310 obtains
When capacitance of the body between ground terminal is in the second preset threshold range, that is, determine that external equipment has been moved out, second
Recognition detection foot is switched to low level state by control module 360 by high level state, avoids inserting without external equipment in USB interface
Fashionable, recognition detection foot is chronically at high level state, prevents USB interface since corrosion leads to recognition detection foot shorted to earth,
So that recognition detection foot fault is detected as USB interface and has the insertion of OTG equipment.
Wherein, the detection module 340 includes:Detection unit 341 and judging unit 342.
Whether detection unit 341 triggers the recognition detection foot for detecting the external equipment and is cut by high level state
Shift to the interrupt signal of low level state.
In the embodiment, interrupt signal, that is, recognition detection foot is switched to by high level under the moment generation of low level state
Drop is interrupted along triggering.Detection unit 341 is for detecting whether triggering interrupt signal is determined and is inserted into when detecting interrupt signal
The external equipment of USB interface is OTG equipment;Otherwise, it determines external equipment is non-OTG equipment.
Judging unit 342, for when detecting the interrupt signal, determining that the external equipment is OTG equipment.
In the embodiment, if the external equipment of access USB interface is OTG equipment, lead to the recognition detection of USB interface
Foot is connect with ground terminal, is forced recognition detection foot being pulled down to low level by high level, is triggered interrupt signal, at this time mobile terminal
Interrupt operation is carried out, control equipment pattern is switched to.
Wherein, the link block 350 includes:Output unit 351 and connection unit 352.
Output unit 351 passes through the power pins of the USB interface when for determining that the external equipment is OTG equipment
Power supply signal is exported to the OTG equipment.
In the embodiment, when it is OTG equipment to determine the external equipment for being inserted into USB interface, mobile terminal switches to master and sets
Standby pattern.Power pins of the output unit 351 by the direct current 5V chips inside mobile terminal to USB interface are powered, Jin Ertong
The power pins connecting with OTG equipment are crossed to power to OTG equipment.
Connection unit 352, for detect the OTG equipment according to the power supply signal the USB interface number
When according to negative pin or the high level pulse signal of the positive pin triggering of data, the communication with the OTG equipment is established.
In the embodiment, after OTG equipment is powered by power pins, draw in the positive pin of the data of USB interface or data minus
A high level pulse, high level of the connection unit 352 on detecting the positive pin of data or data minus pin are generated on foot
When pulse, the connection with OTG equipment is established.
In said program, a wherein signal receiving end for touch panel is connected to the shell of USB interface.Acquisition module
Capacitance of the shell for the USB interface that the signal receiving end of 310 acquisition touch panels detects between ground terminal.Judge
Module 320 judges whether there is external equipment access in USB interface according to capacitance.When determination has external equipment access, first
The recognition detection foot of USB interface is switched to high level state by control module 330 by low level state.Further, mould is detected
Block 340 detects whether external equipment is OTG equipment by the recognition detection foot in high level state.Determining that being inserted into USB connects
When the external equipment of mouth is OTG equipment, link block 350 establishes the connection with OTG equipment.In this way, avoiding recognition detection foot long
Phase is in high level state, due to being in low level state after leading to shorted to earth into aqueous corrosion, so that recognition detection foot fault is examined
Survey has the insertion of OTG equipment for USB interface.In addition, this solution simplifies user's operation, user is not necessarily to when starting OTG functions, leads to
It crosses setup module and recognition detection foot is switched into high level state by low level state, improve user experience.
Fourth embodiment
Fig. 5 is the block diagram of the mobile terminal 500 of another embodiment of the present invention, and mobile terminal as shown in Figure 5 includes:Extremely
Few a processor 501, memory 502, take pictures component 503 and user interface 504.Various components in mobile terminal 500 are logical
Bus system 505 is crossed to be coupled.It is understood that bus system 505 is for realizing the connection communication between these components.Bus
System 505 further includes power bus, controlling bus and status signal bus in addition in addition to including data/address bus.But in order to clear
For the sake of explanation, various buses are all designated as bus system 505 in Figure 5.
Wherein, user interface 504 may include display either pointing device (such as touch-sensitive plate or touch screen etc..
It is appreciated that the memory 502 in the embodiment of the present invention can be volatile memory or nonvolatile memory,
Both or may include volatile and non-volatile memory.Wherein, nonvolatile memory can be read-only memory (Read-
Only Memory, ROM), programmable read only memory (Programmable ROM, PROM), the read-only storage of erasable programmable
Device (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or
Flash memory.Volatile memory can be random access memory (Random Access Memory, RAM), be used as external high
Speed caching.By exemplary but be not restricted explanation, the RAM of many forms is available, such as static RAM
(Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory
(Synchronous DRAM, SDRAM), double data speed synchronous dynamic RAM (Double Data Rate
SDRAM, DDRSDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), synchronized links
Dynamic random access memory (Synchlink DRAM, SLDRAM) and direct rambus random access memory (Direct
Rambus RAM, DRRAM).The memory 502 of system and method described herein be intended to including but not limited to these and it is arbitrary its
It is suitble to the memory of type.
In some embodiments, memory 502 stores following element, executable modules or data structures, or
Their subset of person or their superset:Operating system 5021 and application program 5022.
Wherein, operating system 5021, including various system programs, such as ccf layer, core library layer, driving layer etc., are used for
Realize various basic businesses and the hardware based task of processing.Application program 5022, including various application programs, such as media
Player (Media Player), browser (Browser) etc., for realizing various applied business.Realize the embodiment of the present invention
The program of method may be embodied in application program 5022.
In an embodiment of the present invention, specifically can answer by the program or instruction of calling memory 502 to store
With the program or instruction stored in program 5022.Wherein, processor 501 is used to obtain the institute detected by the signal receiving end
State capacitance of the shell relative to ground terminal of USB interface;When the capacitance is in the first preset threshold range, determine
The USB interface has external equipment insertion;When the USB interface has external equipment access, the identification of the USB interface is examined
It surveys foot and high level state is switched to by low level state.
The method that the embodiments of the present invention disclose can be applied in processor 501, or be realized by processor 501.
Processor 501 may be a kind of IC chip, the processing capacity with signal.During realization, the above method it is each
Step can be completed by the integrated logic circuit of the hardware in processor 501 or the instruction of software form.Above-mentioned processing
Device 501 can be general processor, digital signal processor (Digital Signal Processor, DSP), special integrated electricity
Road (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.It is general
Processor can be microprocessor or the processor can also be any conventional processor etc..In conjunction with institute of the embodiment of the present invention
The step of disclosed method, can be embodied directly in hardware decoding processor and execute completion, or with the hardware in decoding processor
And software module combination executes completion.Software module can be located at random access memory, and flash memory, read-only memory may be programmed read-only
In the storage medium of this fields such as memory or electrically erasable programmable memory, register maturation.The storage medium is located at
The step of memory 502, processor 501 reads the information in memory 502, the above method is completed in conjunction with its hardware.
It is understood that embodiments described herein can use hardware, software, firmware, middleware, microcode or its
It combines to realize.For hardware realization, processing unit may be implemented in one or more application-specific integrated circuit (Application
Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing,
DSP), digital signal processing appts (DSP Device, DSPD), programmable logic device (Programmable Logic
Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general processor,
In controller, microcontroller, microprocessor, other electronic units for executing herein described function or combinations thereof.
For software implementations, it can be realized herein by executing the module (such as process, function etc.) of function described herein
The technology.Software code is storable in memory and is executed by processor.Memory can in the processor or
It is realized outside processor.
Specifically, processor 501 is additionally operable to, when the recognition detection foot is in high level state, detect the outside and set
Whether standby be OTG equipment;When determining that the external equipment is OTG equipment, the communication with the OTG equipment is established.
Specifically, processor 501 is additionally operable to the capacitance detected by the signal receiving end and is in second in advance
If when in threshold range, determining that the external equipment for being inserted into the USB interface removes, and by the recognition detection foot by high electricity
Level state switches to low level state.
Wherein, processor 501 is additionally operable to detect whether the external equipment triggers the recognition detection foot by high level shape
State switches to the interrupt signal of low level state;When detecting the interrupt signal, determine that the external equipment sets for OTG
It is standby.
Wherein, when processor 501 is additionally operable to determine that the external equipment is OTG equipment, pass through the power supply of the USB interface
Pin exports power supply signal to the OTG equipment;Detecting that the OTG equipment connects according to the power supply signal in the USB
When the high level pulse signal of the positive pin triggering of data minus pin or data of mouth, the communication with the OTG equipment is established.
A wherein signal receiving end for touch panel is connected to USB interface by the mobile terminal 500 of the embodiment of the present invention
Shell.Capacitance of the shell of USB interface between ground terminal is detected by the signal receiving end of touch panel.According to electricity
Capacitance judges whether there is external equipment access in USB interface.When determination has external equipment access, the identification of USB interface is examined
It surveys foot and high level state is switched to by low level state.Further, it is detected by the recognition detection foot in high level state
Whether external equipment is OTG equipment.When it is OTG equipment to determine the external equipment for being inserted into USB interface, establish and OTG equipment
Connection.In this way, avoiding recognition detection foot from being chronically at high level state, due to being in low electricity after leading to shorted to earth into aqueous corrosion
Level state, so that recognition detection foot fault is detected as USB interface and has the insertion of OTG equipment.In addition, this solution simplifies user's operation,
User is not necessarily to when starting OTG functions, and recognition detection foot is switched to high level state by low level state by setup module,
Improve user experience.
5th embodiment
Fig. 6 is the structural schematic diagram of the mobile terminal of another embodiment of the present invention.Specifically, the mobile terminal in Fig. 6
600 can be mobile phone, tablet computer, personal digital assistant (Personal Digital Assistant, PDA) or vehicle mounted electric
Brain etc..
Mobile terminal 600 in Fig. 6 includes power supply 610, memory 620, input unit 630, display unit 640, processing
Device 650, WIFI (Wireless Fidelity) module 660, voicefrequency circuit 670 and RF circuits 680.
Wherein, input unit 630 can be used for receiving number input by user or character information, and generation and mobile terminal
The 600 related signal input of user setting and function control.Specifically, in the embodiment of the present invention, which can
To include touch panel 631.Touch panel 631, also referred to as touch screen collect user on it or neighbouring touch operation
(for example user uses the operations of any suitable object or attachment on touch panel 631 such as finger, stylus), and according to advance
The formula of setting drives corresponding attachment device.Optionally, touch panel 631 may include touch detecting apparatus and touch controller
Two parts.Wherein, the touch orientation of touch detecting apparatus detection user, and the signal that touch operation is brought is detected, by signal
Send touch controller to;Touch controller receives touch information from touch detecting apparatus, and is converted into contact coordinate,
The processor 650 is given again, and can be received order that processor 650 is sent and be executed.Furthermore, it is possible to using resistance-type,
The multiple types such as condenser type, infrared ray and surface acoustic wave realize touch panel 631.In addition to touch panel 631, input unit
630 can also include other input equipments 632, other input equipments 632 can include but is not limited to physical keyboard, function key
It is one or more in (such as volume control button, switch key etc.), trace ball, mouse, operating lever etc..
Wherein, display unit 640 can be used for showing information input by user or be supplied to information and the movement of user
The various menu interfaces of terminal.Display unit 640 may include display panel 641, optionally, LCD or organic light emission may be used
The forms such as diode (Organic Light-Emitting Diode, OLED) configure display panel 641.
It should be noted that touch panel 631 can cover display panel 641, touch display screen is formed, when the touch display screen is examined
It measures and sends processor 650 on it or after neighbouring touch operation to determine the type of touch event, be followed by subsequent processing device
650 provide corresponding visual output according to the type of touch event in touch display screen.
Touch display screen includes Application Program Interface viewing area and common control viewing area.The Application Program Interface viewing area
And arrangement mode of the common control viewing area does not limit, can be arranged above and below, left-right situs etc. can distinguish two it is aobvious
Show the arrangement mode in area.The Application Program Interface viewing area is displayed for the interface of application program.Each interface can be with
Including the interface elements such as icon and/or widget desktop controls of at least one application program.The Application Program Interface viewing area
Or the empty interface not comprising any content.This commonly uses control viewing area for showing the higher control of utilization rate, for example,
Application icons such as button, interface number, scroll bar, phone directory icon etc. are set.
Wherein processor 650 is the control centre of mobile terminal, utilizes each of various interfaces and connection whole mobile phone
A part by running or execute the software program and/or module that are stored in first memory 621, and is called and is stored in
Data in second memory 622 execute the various functions and processing data of mobile terminal, whole to be carried out to mobile terminal
Monitoring.Optionally, processor 650 may include one or more processing units.
In embodiments of the present invention, by calling store the first memory 621 in software program and/or module and/
To the data in second memory 622, processor 650 is used to obtain the USB interface detected by the signal receiving end
Capacitance of the shell relative to ground terminal;When the capacitance is in the first preset threshold range, determine that the USB connects
Mouth has external equipment insertion;When the USB interface has external equipment access, by the recognition detection foot of the USB interface by low
Level state switches to high level state.
Specifically, processor 650 is additionally operable to, when the recognition detection foot is in high level state, detect the outside and set
Whether standby be OTG equipment;When determining that the external equipment is OTG equipment, the communication with the OTG equipment is established.
Specifically, processor 650 is additionally operable to the capacitance detected by the signal receiving end and is in second in advance
If when in threshold range, determining that the external equipment for being inserted into the USB interface removes, and by the recognition detection foot by high electricity
Level state switches to low level state.
Wherein, processor 650 is additionally operable to detect whether the external equipment triggers the recognition detection foot by high level shape
State switches to the interrupt signal of low level state;When detecting the interrupt signal, determine that the external equipment sets for OTG
It is standby.
Wherein, when processor 650 is additionally operable to determine that the external equipment is OTG equipment, pass through the power supply of the USB interface
Pin exports power supply signal to the OTG equipment;Detecting that the OTG equipment connects according to the power supply signal in the USB
When the high level pulse signal of the positive pin triggering of data minus pin or data of mouth, the communication with the OTG equipment is established.
A wherein signal receiving end for touch panel is connected to USB interface by the mobile terminal 600 of the embodiment of the present invention
Shell.Capacitance of the shell of USB interface between ground terminal is detected by the signal receiving end of touch panel.According to electricity
Capacitance judges whether there is external equipment access in USB interface.When determination has external equipment access, the identification of USB interface is examined
It surveys foot and high level state is switched to by low level state.Further, it is detected by the recognition detection foot in high level state
Whether external equipment is OTG equipment.When it is OTG equipment to determine the external equipment for being inserted into USB interface, establish and OTG equipment
Connection.In this way, avoiding recognition detection foot from being chronically at high level state, due to being in low electricity after leading to shorted to earth into aqueous corrosion
Level state, so that recognition detection foot fault is detected as USB interface and has the insertion of OTG equipment.In addition, this solution simplifies user's operation,
User is not necessarily to when starting OTG functions, and recognition detection foot is switched to high level state by low level state by setup module,
Improve user experience.
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In embodiment provided herein, it should be understood that disclosed device and method can pass through others
Mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only
A kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, device or unit
It connects, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be
People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
And storage medium above-mentioned includes:USB flash disk, mobile hard disk, ROM, RAM, magnetic disc or CD etc. are various can to store program code
Medium.
Above-described is the preferred embodiment of the present invention, it should be pointed out that the ordinary person of the art is come
It says, several improvements and modifications can also be carried out under the premise of not departing from principle of the present invention, these improvements and modifications also exist
In protection scope of the present invention.