CN109726157A - USB interface control method, terminal device, storage medium and computer program product - Google Patents

USB interface control method, terminal device, storage medium and computer program product Download PDF

Info

Publication number
CN109726157A
CN109726157A CN201711049822.9A CN201711049822A CN109726157A CN 109726157 A CN109726157 A CN 109726157A CN 201711049822 A CN201711049822 A CN 201711049822A CN 109726157 A CN109726157 A CN 109726157A
Authority
CN
China
Prior art keywords
pin
terminal device
usb interface
usb
level
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.)
Pending
Application number
CN201711049822.9A
Other languages
Chinese (zh)
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.)
Huawei Device Co Ltd
Original Assignee
Huawei Device Dongguan Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Device Dongguan Co Ltd filed Critical Huawei Device Dongguan Co Ltd
Priority to CN201711049822.9A priority Critical patent/CN109726157A/en
Publication of CN109726157A publication Critical patent/CN109726157A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the present application discloses the USB interface control method and terminal device of a kind of terminal device, can reduce the corrosion to the pin of USB interface.The terminal device of the embodiment of the present application includes USB interface and switch.USB interface includes at least the first pin, and USB interface is for connecting USB device;Switch includes second pin and third pin;First pin is electrically connected with second pin, and third pin connects low level;When terminal device puts out screen, and USB device is extracted from terminal device, second pin is connect with third pin, so that the level of the first pin be dragged down.In the embodiment of the present application, when terminal device puts out screen, and USB device is extracted from terminal device, by the connection of second pin and third pin in switch, so that the level of the first pin is pulled low.So as to effectively reduce terminal device because water inlet or other outside environmental elements caused by USB interface because electrification caused by perishable problem.

Description

USB interface control method, terminal device, storage medium and computer program product
Technical field
This application involves USB interface control method, the terminals of field of mobile terminals more particularly to a kind of terminal device to set Standby, storage medium and computer program product.
Background technique
Universal serial bus (universal serial bus, USB) charging is that mobile phone charging uses most common charging Technology.The principle of USB charging is to identify corresponding equipment by agreement, according to the difference of equipment, configures different charging plans Slightly.
All current industries using the terminal device of micro-USB interface are all to identify correspondence with the ID foot of USB interface Equipment.And the terminal device of TYPE-C interface is used, it is to carry out detection device using the ID foot or CC foot of USB interface.
ID foot or CC foot the two pins (also referred to as PIN foot) are preparing to always detection peripheral equipment, are to locate always therefore In electriferous state.Their level is close with cell voltage, but microampere (uA) level currents, driving capability are very weak.Work as terminal When equipment is intake, faint electric current leads to ID foot or CC foot and ground forms current loop, the constantly electrode around ionization, Electrochemical corrosion is formed, erosion adheres on the electrode, is connected to each PIN foot of USB, may result in each PIN foot level It changes.Cause the USB interface of terminal device that can not identify when being inserted into equipment or even PIN foot is short-circuit, burning apparatus.
Summary of the invention
The embodiment of the present application provide the USB interface control method of terminal device a kind of, terminal device, storage medium and Computer program product can reduce the corrosion to the pin of USB interface.
The embodiment of the present application first aspect provides a kind of terminal device, which includes USB interface, switch.Its In, USB interface includes at least the first pin, and USB interface is for connecting USB device;Switch includes second pin and third pin; First pin is electrically connected with second pin, and third pin connects low level;When terminal device puts out screen, and USB device is set from terminal When standby extraction, second pin is connect with third pin.
In the embodiment of the present application, when terminal device puts out screen, and USB device is extracted from terminal device, by switch The connection of second pin and third pin, so that the level of the first pin is pulled low.To by switch control USB interface The level of first pin, can effectively reduce terminal device because water inlet or other outside environmental elements caused by USB interface because of band Perishable problem caused by electricity prevents the USB interface of terminal device because of disabler problem caused by being corroded.
Optionally, USB interface further includes power pins, and switch further includes the 4th pin, and the 4th pin draws with the power supply Foot connection, the 4th pin be used for when the terminal device puts out screen, control second pin connect with the third pin or It disconnects.
Such as: when terminal device puts out screen, when USB device is inserted into terminal device, the level of Vbus becomes high level, with The 4th pin control second pin and third pin of Vbus connection disconnect;When terminal device puts out screen, when USB device is from terminal When equipment is extracted, the level of Vbus becomes low level, and the 4th pin control second pin and third pin connecting with Vbus connect It connects.
Optionally, switch further includes the 5th pin, and the 5th pin is used to put out screen when terminal device, and the USB is set When the standby extraction from the terminal device, controls the second pin and connect with the third pin.
Optionally, USB interface can be micro-USB interface, or TYPE-C interface.First pin can be institute State the ID pin of micro-USB interface, or the CC pin of TYPE-C interface.
Second aspect, the embodiment of the present application also provides a kind of USB interface control methods of terminal device, for having The terminal device of USB interface, this method comprises: put out screen when the terminal device, and when USB device is extracted from the USB interface, The external live pins of USB interface are controlled, i.e. the first pin connects low level, and first pin can be CC pin or ID draws Foot.
Because when user does not operate or when using terminal equipment, terminal device, which is in, puts out screen state, and USB interface does not have USB device insertion.Therefore, when terminal device is in screen state of putting out, and the USB device of USB interface is extracted, by USB interface The level of external live pins drags down, so as to when terminal device is not used in user, by the level of the live pins of leakage It sets low.Terminal device can be effectively reduced because USB caused by water inlet or other outside environmental elements corrodes, so as to from electrical Solve the problems, such as that USB interface corrodes in characteristic.
The third aspect, the embodiment of the present application provide a kind of terminal device, and specific implementation corresponds to above-mentioned second aspect and mentions The function of the USB interface control method of confession.The function can also be executed corresponding soft by hardware realization by hardware Part program is realized.Hardware and software includes one or more unit modules corresponding with above-mentioned function, and the unit module can To be software and/or hardware.
In one implementation, the terminal includes memory, for storing instruction;Processor, it is described for calling Instruction in memory executes method described in above-mentioned second aspect.
The another aspect of the application provides a kind of computer readable storage medium, in the computer readable storage medium It is stored with instruction, when run on a computer, so that computer executes method described in above-mentioned second aspect.
The another aspect of the application provides a kind of computer program product comprising instruction, when it runs on computers When, so that computer executes method described in above-mentioned second aspect.
As can be seen from the above technical solutions, the embodiment of the present application has the advantage that
In the embodiment of the present application, when terminal device is in screen state of putting out, and the USB device of USB interface is extracted, control The external live pins connection low level of USB interface can effectively subtract so as to set low the level of the live pins of leakage Few terminal device corrodes because of USB caused by water inlet or other outside environmental elements.
Detailed description of the invention
Fig. 1 is a kind of structural schematic diagram of USB interface in the embodiment of the present application;
Fig. 2 is a kind of structural schematic diagram of the terminal device in the embodiment of the present application;
Fig. 3 is that a kind of circuit of the terminal device in the embodiment of the present application realizes figure;
Fig. 4 is a kind of hardware structural diagram of the terminal device in the embodiment of the present application.
Specific embodiment
The embodiment of the present application is further elaborated below in conjunction with attached drawing.
The embodiment of the present application is suitable for the various terminal devices with USB interface, and the terminal device can be hand-held set Standby, mobile unit, calculates equipment or various forms of user equipmenies (user equipment, UE) at wearable device.Such as: It can be any terminal such as mobile phone, tablet computer, personal digital assistant (personal digital assistant, PDA) to set It is standby.Terminal device can also be referred to as terminal (terminal).
As shown in Figure 1, the USB interface of the terminal device in the embodiment of the present application may include power pins Vbus, data Pin DP and DM, identification pin ID or CC and grounding pin GND.One end of pin in USB interface leaks outside, one end and end The internal component of end equipment connects.Because of the part pin of USB interface, such as: terminal device is worked as in ID pin or the electrification of CC pin After moist or water inlet, the pin of leakage easily corrodes, and will lead to the funtion part failure or complete of the USB interface of terminal device Failure.
In the embodiment of the present invention, the leakage live pins voltage of USB interface is reduced by switch, corruption can be effectively prevent Erosion solves the problems, such as leakage PIN foot electrification from the root.It describes in detail below with reference to Fig. 2.
Fig. 2 is a kind of structural schematic diagram of the terminal device in the embodiment of the present application, and terminal device includes USB interface 201 With switch 202.USB interface 201 can refer to connection micro-USB equipment for connecting USB device, USB interface 201 Micro-USB interface may also mean that the TYPE-C interface of connection TYPE-C equipment.Switch 202 is used to control pair of USB interface The voltage of outer live pins.
USB interface 201 includes at least the first pin 2011, and the first pin 2011 can be USB interface as shown in Figure 1 In any external live pins, for example, the first pin 2011 can be with ID when USB interface 201 refers to micro-USB interface Pin, when USB interface 201 refers to TYPE-C interface, the first pin 2011 can be CC pin, and the first pin 2011 is in addition to institute Other than the ID pin or CC pin of citing, can also be other pins externally charged in USB interface, the embodiment of the present application with ID pin or CC pin are illustrated.
Switch 202 includes second pin 2021 and third pin 2022, and the first pin 2011 and second pin 2021 are electrically connected It connecing, third pin 2022 connects low level, when terminal device puts out screen, and USB device is extracted from terminal device, second pin 2021 and third pin 2022 be electrically connected so that the level of the first pin 2011 is identical as the level of third pin 2022, Become low level.
In the embodiment of the present application, the level of the first pin 2011 in USB interface 201 is controlled by switch 202, works as terminal Equipment puts out screen, and USB device passes through the second pin 2021 and third pin 2022 in switch 202 from when terminal device extraction Connection so that the level of the first pin 2011 is pulled low.So as to effectively reduce terminal device because of water inlet or other external worlds USB interface caused by environmental factor prevents the USB interface of terminal device from causing because being corroded because of perishable problem caused by charging Disabler problem.
Optionally, on the basis of Fig. 2 described embodiment, USB interface can also include power pins Vbus, and switch is also It may include the 4th pin, the 4th pin is connect with Vbus, and the 4th pin is used for when terminal device puts out screen, controls second pin With the connection and disconnection of third pin.
Terminal device is inserted by USB device or can control the height of the level of Vbus from terminal device extraction, thus When terminal device puts out screen, the connection and disconnection of second pin and third pin are controlled by the 4th pin connecting with Vbus. Such as: when terminal device puts out screen, when USB device is inserted into terminal device, the level of Vbus becomes high level, connect with Vbus The 4th pin control second pin and third pin disconnect;When terminal device puts out screen, when USB device is extracted from terminal device When, the level of Vbus becomes low level, and the 4th pin control second pin connecting with Vbus is connect with third pin.
Optionally, switch can also include the 5th pin, and the 5th pin is used for when terminal device puts out screen, and USB device When extracting from terminal device, the connection of second pin and third pin is controlled, so that the level of the first pin draws with third The level of foot is identical, becomes low level.
In most of usage scenario of terminal device, when user's operation or using terminal equipment, terminal device is in Bright screen state or terminal device have USB device insertion;On the contrary, when user does not operate or when using terminal equipment, at terminal device In putting out screen state, and the USB interface of terminal device does not have USB device insertion, i.e. USB device has been extracted from terminal device.This Shen When terminal device is in screen state of putting out, and the USB device of USB interface is extracted, the first of USB interface please be drawn in embodiment The level of foot drags down, so as to which when terminal device is in standby, the level of the live pins of leakage is set low.It can be with Effectively reduce terminal device because water inlet or other outside environmental elements caused by USB corrode, so as to be solved from electrical characteristic The problem of certainly USB interface corrodes.
Fig. 3 is a kind of electrical block diagram of the terminal device in the embodiment of the present application.The terminal device includes processing Chip 301, the first pin 302 of USB interface, the power pins Vbus 303 of USB interface, universal input export (general Purpose input output, GPIO) the 304, first metal-oxide-semiconductor 305 and the second metal-oxide-semiconductor 306 and the first adjustable resistance 307, Second resistance 308 and 3rd resistor 309.
Wherein, as shown in figure 3, the first metal-oxide-semiconductor 305 and the second metal-oxide-semiconductor 306 are opened described in embodiment shown in Fig. 2 It closes.The pin that first metal-oxide-semiconductor 305 connects the first adjustable resistance 307 is second pin described in embodiment shown in Fig. 2, First metal-oxide-semiconductor 305 and the pin of the second metal-oxide-semiconductor 306 ground connection are third pin described in embodiment shown in Fig. 2.
Optionally, can also be the first metal-oxide-semiconductor 305, the second metal-oxide-semiconductor 306, the first adjustable resistance 307, second resistance 308, And 3rd resistor 309 is to switch described in embodiment shown in Fig. 2.First adjustable resistance 307 connects the first of USB interface The pin of pin 302 is second pin described in embodiment shown in Fig. 2, and the first metal-oxide-semiconductor 305 and the second metal-oxide-semiconductor 306 connect The pin on ground is third pin described in embodiment shown in Fig. 2.
First pin 302 of USB interface can be in CC foot in USB interface or ID foot or USB interface other externally The pin of electrification.
Processing chip 301 is connected with one end of the first pin 302 and first adjustable resistance 307.First metal-oxide-semiconductor 305 drain electrode is connected with the other end of the first adjustable resistance 307, the source electrode ground connection of the first metal-oxide-semiconductor 305, grid and second resistance The drain electrode of 308 one end and second metal-oxide-semiconductor 306 is connected.The grid and power pins Vbus 303 of second metal-oxide-semiconductor 306 It is connected, source electrode ground connection.The other end of second resistance 308 is connected with GPIO 304.
Wherein, processing chip 301 can be power transmission (Power delivery, PD) chip, be also possible to other cores Piece, control of the processing chip 301 by the central processing unit (central processing units, CPU) of terminal device.Place Reason chip 301, according to CC pin or the level of ID pin, identifies the type of USB device for providing current signal.
The resistance value of first adjustable resistance 307 be it is adjustable, the first adjustable resistance 307 is for dividing, on the one hand, the When one metal-oxide-semiconductor 305 is connected, prevent electric current over the ground excessive, on the other hand, for when the first metal-oxide-semiconductor 305 is obstructed, by this The partial pressure of resistance can drag down the level of the first pin 302.
GPIO 304 be for adjust the conducting of the first metal-oxide-semiconductor 305 with it is obstructed.The second resistance being connect with GPIO 304 308 can be the resistance of fixed resistance value, such as: on the one hand 100K resistance, effect are to prevent from being connected when the second metal-oxide-semiconductor 306 Electric current is excessive when ground connection, further aspect is that preventing surge and impact.
Vbus 303 be used to adjust the conducting of the second metal-oxide-semiconductor 306 with it is obstructed, when the level of Vbus 303 is high level, The conducting of second metal-oxide-semiconductor 306, when the level of Vbus 303 is low level, the second metal-oxide-semiconductor 306 is obstructed.
When the level of the GPIO 304 is high level, and the level of the Vbus 303 is low level, described first Metal-oxide-semiconductor 305 is connected, and second metal-oxide-semiconductor 306 is obstructed, and the level of first pin 302 switchs to low level by high level.
Optionally, in order to improve stability, Vbus 303 can also connect 3rd resistor 309, one end of 3rd resistor 309 The Vbus 303 is connected, the other end connects the grid of second metal-oxide-semiconductor 306.The 3rd resistor 309 can be fixed resistance The resistance of value, such as: 100K resistance, which is used for Anti-surging or protecting against shock, to improve the stabilization of entire circuit Property.
In a kind of specific embodiment, when the USB interface of terminal device does not have USB device insertion, i.e. USB device is pulled out When out, the level of Vbus 303 is low level, when the USB interface of terminal device inserts USB device, the level of Vbus 303 For high level.
In a kind of specific embodiment, when the display screen of terminal device is in bright screen state, the electricity of GPIO 304 It puts down as low level, when the display screen of terminal device, which is in, puts out screen state, the level of GPIO 304 is high level.Specifically, can With, when the display screen of terminal device is in bright screen state, GPIO is low level by the CPU of terminal device control, screen is put out when being in When state, GPIO is high level.
It describes in detail below with reference to logic level of the table 1 to each pin.Low level, level 1 are indicated in table 1 for 0 Indicate high level.
When terminal device is in bright screen state, the level of GPIO is 0, when the USB that USB device is inserted into terminal device connects When mouth, the level of Vbus switchs to 1 by 0, i.e., switchs to high level by low level, and the second metal-oxide-semiconductor (closes shape by obstructed state before State) switch on state, it is obstructed state that the first metal-oxide-semiconductor, which is closed, and external the first pin of live pins maintains high level.
When terminal device is in bright screen state, the level of GPIO is 0, when the USB that USB device is inserted into terminal device connects When keeping insert state after mouthful, the level of Vbus is 1, and the second metal-oxide-semiconductor is in the conductive state, and the first metal-oxide-semiconductor is in obstructed state, The level of first pin maintains high level.
When terminal device is in bright screen state, the level of GPIO is 0, when the USB device being inserted into USB interface is extracted When, the level of Vbus switchs to 0 by 1, i.e., switchs to low level by high level, and the second metal-oxide-semiconductor is switched to obstructed by state before State, i.e. closed state, the first metal-oxide-semiconductor are closed, and are obstructed state, and the first pin maintains high level.
When terminal device, which is in, puts out screen state, the level of GPIO is 1, when the USB that USB device is inserted into terminal device connects When mouth, the level of Vbus switchs to 1 by 0, i.e., switchs to high level by low level, and the second metal-oxide-semiconductor (closes shape by obstructed state before State) switch on state, it is obstructed state that the first metal-oxide-semiconductor, which is closed, and the first pin maintains high level.
When terminal device, which is in, puts out screen state, the level of GPIO is 1, when the USB that USB device is inserted into terminal device connects When keeping insert state after mouthful, the level of Vbus is 1, and the second metal-oxide-semiconductor is in the conductive state, and the first metal-oxide-semiconductor is in obstructed state, The level of first pin maintains high level.
When terminal device, which is in, puts out screen state, the level of GPIO is 1, when the USB device being inserted into USB interface is extracted When, the level of Vbus switchs to 0 by 1, i.e., switchs to low level by high level, and the second metal-oxide-semiconductor is switched to obstructed by state before State, i.e. closed state, the first metal-oxide-semiconductor become on state from obstructed state, and the level of the first pin becomes low from high level Level becomes 0.When putting out screen state to work as terminal device and be in, and there is no USB device insertion in USB interface, the first pin Level be always low level.
Table 1
It is realized in conjunction with foregoing circuit, the USB interface control method of the terminal device in the embodiment of the present application, this method is used for Terminal device with USB interface, this method comprises:
When the terminal device puts out screen, and USB device is extracted from the USB interface, the external of the USB interface is controlled Live pins connect low level, and the external live pins are the first pin in Fig. 2 or embodiment shown in Fig. 3.
It optionally, is when the terminal device puts out screen, and USB TYPE C equipment when USB interface is TYPE-C interface When extracting from the USB TYPE C interface, the CC pin connection low level of the USB TYPE C interface is controlled.
It optionally, is to work as the terminal device to put out screen, and micro-USB is set when USB interface is micro-USB interface When the standby extraction from micro-USB C interface, the ID pin connection low level of the micro-USB interface is controlled.
The above method can be driven the program code stored in memory and driving circuit by the CPU of terminal device It realizes.The specific implementation process of circuit sees description of the above-mentioned Fig. 2 into embodiment shown in Fig. 3.
It should be noted that above-mentioned Fig. 2 or circuit structure shown in Fig. 3 do not constitute limit to the circuit structure of terminal device It is fixed, as long as the circuit structure for being able to achieve USB interface control method can constitute the terminal device in the embodiment of the present application Circuit structure.Such as: under another circuit structure, it can also be when terminal device is in and puts out screen state, by the electricity of GPIO When horizontal is low level.It is also possible to that the level of Vbus is set to height when the USB device of the USB interface of terminal device is extracted Level.
It is to the circuit structure realization of the terminal device in the embodiment of the present application and Jie of USB interface control method above It continues, the terminal device in the embodiment of the present application is introduced from hardware realization angle below.
Optionally, terminal device may include central processing unit (CPU) and memory, and the memory is for storing program Code, the central processing unit call the said program code in the memory, to execute in above-mentioned USB interface control method Operation, comprising: when USB device is extracted from the USB interface, control USB interface external live pins connection low level; Or, put out screen when the terminal device, and when USB device is extracted from the USB interface, the external electrification of the USB interface is controlled Pin connects low level.
It describes in detail below with reference to a kind of hardware configuration of the Fig. 4 to terminal device.Fig. 4 shows terminal device The block diagram of fractional hardware structure, terminal device includes: radio frequency (Radio Frequency, RF) circuit 410, memory 420, defeated Enter unit 430, display unit 440, sensor 450, voicefrequency circuit 460, Wireless Fidelity (wireless fidelity, WiFi) The components such as module 470, central processing unit 480 and power supply 490, USB interface 411.It will be understood by those skilled in the art that Fig. 4 Shown in terminal device structure do not constitute the restriction to terminal device, may include than illustrating more or fewer components, Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to each component parts of the Fig. 4 to terminal device:
RF circuit 410 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, handled to central processing unit 480;In addition, the data for designing uplink are sent to base station.In general, RF is electric Road 410 includes but is not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier (Low Noise Amplifier, LNA), duplexer etc..In addition, RF circuit 410 can also be communicated with network and other equipment by wireless communication.
Memory 420 can be used for storing software program and module, and central processing unit 480 is stored in memory by operation 420 software program and module, thereby executing the various function application and data processing of terminal device.Memory 420 can It mainly include storing program area and storage data area, wherein storing program area can be needed for storage program area, at least one function Application program (such as sound-playing function, image player function etc.) etc.;Storage data area can be stored according to terminal device Use created data (such as audio data, phone directory etc.) etc..In addition, memory 420 may include high random access Memory, can also include nonvolatile memory, a for example, at least disk memory, flush memory device or other are volatile Property solid-state memory.
Input unit 430 can be used for receiving the number or character information of input, and generates and set with the user of terminal device It sets and the related key signals of function control inputs.Specifically, input unit 430 may include touch panel 431 and other are defeated Enter equipment 432.Touch panel 431, also referred to as touch screen collect touch operation (such as the user of user on it or nearby Use the operation of any suitable object or attachment such as finger, stylus on touch panel 431 or near touch panel 431), And corresponding attachment device is driven according to preset formula.Optionally, touch panel 431 may include touch detecting apparatus and Two parts of touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation bring letter Number, transmit a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and is converted into Contact coordinate, then give central processing unit 480, and order that central processing unit 480 is sent can be received and executed.In addition, Touch panel 431 can be realized using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch surface Plate 431, input unit 430 can also include other input equipments 432.Specifically, other input equipments 432 may include but not It is limited to one of physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc. Or it is a variety of.
Display unit 440 can be used for showing information input by user or the information for being supplied to user.Display unit 440 can Including display panel 441, optionally, liquid crystal display (liquid crystal display, LCD), You Jifa can be used The forms such as optical diode (organic light-emitting diode, OLED) configure display panel 441.Further, Touch panel 431 can cover display panel 441, after touch panel 431 detects touch operation on it or nearby, transmission The type of touch event is determined to central processing unit 480, subsequent central processing unit 480 is being shown according to the type of touch event Corresponding visual output is provided on panel 441.Although touch panel 431 and display panel 441 are only as two in Fig. 4 Vertical component realizes the input and input function of terminal device, but in some embodiments it is possible to by touch panel 431 with Display panel 441 is integrated and that realizes terminal device output and input function.
Terminal device may also include at least one sensor 450, such as optical sensor, motion sensor and other sensings Device.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 441, and proximity sensor can close display when terminal device is moved in one's ear Panel 441 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect (generally three in all directions Axis) acceleration size, can detect that size and the direction of gravity when static, can be used to identify the application of terminal device posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; The other sensors such as the gyroscope, barometer, hygrometer, thermometer, the infrared sensor that can also configure as terminal device, This is repeated no more.
Voicefrequency circuit 460, loudspeaker 461, microphone 462 can provide the audio interface between user and terminal device.Sound Electric signal after the audio data received conversion can be transferred to loudspeaker 461, be converted to by loudspeaker 461 by frequency circuit 460 Voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 462, is received by voicefrequency circuit 460 After be converted to audio data, then after audio data output central processing unit 480 is handled, through RF circuit 410 to be sent to such as Another terminal device, or audio data is exported to memory 420 to be further processed.
WiFi belongs to short range wireless transmission technology, and terminal device can help user to receive and dispatch by WiFi module 470Electricity Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet for user and accesses.Although Fig. 4 shows Go out WiFi module 470, but it is understood that, and it is not belonging to must be configured into for terminal device, it completely can be according to need It to omit within the scope of not changing the essence of the invention.
Central processing unit 480 is the control centre of terminal device, utilizes various interfaces and the entire terminal device of connection Various pieces, by running or execute the software program and/or module that are stored in memory 420, and call and be stored in Data in memory 420 execute the various functions and processing data of terminal device, to carry out whole prison to terminal device Control.Optionally, central processing unit 480 may include one or more processing units;Optionally, central processing unit 480 can be integrated and be answered With processor and modem processor, wherein the main processing operation system of application processor, user interface and application program Deng modem processor mainly handles wireless communication.It is understood that above-mentioned modem processor can not also integrate Into central processing unit 480.In the embodiment of the present application, central processing unit 480 is for executing in above-mentioned USB interface control method All or part of the steps.
Terminal device further includes the power supply 490 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and processor 480 are logically contiguous, to realize management charging, electric discharge and power consumption by power-supply management system The functions such as management.
USB interface 411 is for connecting USB device.USB interface 411 may include the electricity in above-mentioned embodiment shown in FIG. 1 Source pin Vbus, data pin DP and DM, identification pin ID and/or CC and grounding pin GND.
Although being not shown, terminal device can also include camera, bluetooth module etc., and details are not described herein.
It should be noted that in the above-described embodiments, can wholly or partly by software, hardware, firmware or its Any combination is realized.When implemented in software, it can entirely or partly realize in the form of a computer program product.
The computer program product includes one or more computer instructions.Load and execute on computers the meter When calculation machine program instruction, entirely or partly generate according to process or function described in the embodiment of the present application.The computer can To be general purpose computer, special purpose computer, computer network or other programmable devices.The computer instruction can be deposited Storage in a computer-readable storage medium, or from a computer readable storage medium to another computer readable storage medium Transmission, for example, the computer instruction can pass through wired (example from a web-site, computer, server or data center Such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave) mode to another website Website, computer, server or data center are transmitted.The computer readable storage medium can be computer and can deposit Any usable medium of storage either includes that the data storages such as one or more usable mediums integrated server, data center are set It is standby.The usable medium can be magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or partly lead Body medium (such as solid state hard disk (solid state disk, SSD)) etc..
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.
The description and claims of this application and term " first ", " second ", " third " " in above-mentioned attached drawing The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage The data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can be in addition to illustrating herein Or the sequence other than the content of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that Cover it is non-exclusive include, for example, containing the process, method, system, product or equipment of a series of steps or units need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, apparatus embodiments described above are merely indicative, for example, the division of the unit, only Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling, direct-coupling or communication connection can be through some interfaces or the INDIRECT COUPLING or communication link of unit It connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.Some or all of unit therein can be selected to realize this embodiment scheme according to the actual needs.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the application Portion or part steps.And storage medium above-mentioned include: USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. are various can store program The medium of code.
The above, above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although referring to before Embodiment is stated the application is described in detail, those skilled in the art should understand that: it still can be to preceding Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these It modifies or replaces, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution.

Claims (8)

1. a kind of terminal device, which is characterized in that the terminal device includes USB interface, switch;
The USB interface includes at least the first pin;
The switch includes second pin, third pin;
The USB interface is for connecting USB device;
First pin is electrically connected with the second pin;
The third pin connects low level;
When the terminal device puts out screen, and USB device is extracted from the terminal device, the second pin is drawn with the third Foot electrical connection.
2. terminal device according to claim 1, which is characterized in that the USB interface further includes power pins, described to open Pass further includes the 4th pin, is connect with the power pins, and the 4th pin is used for when the terminal device puts out screen, control The second pin is connected or disconnected with the third pin.
3. terminal device according to claim 1 or 2, which is characterized in that the switch further includes the 5th pin, and described Five pins are used to put out screen when terminal device, and when the USB device is extracted from the terminal device, control the second pin and The third pin connection.
4. terminal device according to any one of claim 1-3, which is characterized in that first pin is the USB The CC pin or ID pin of interface.
5. a kind of general-purpose serial bus USB interface control method of terminal device, for the terminal device with USB interface, It is characterized in that, which comprises
When the terminal device puts out screen, and USB device is extracted from the USB interface, control the USB interface CC pin or ID pin connects low level.
6. a kind of terminal device, the terminal includes memory, for storing instruction;Processor, for calling the memory In instruction, execute method described in above-mentioned power 5.
7. a kind of computer readable storage medium, including instruction, when run on a computer, so that computer is executed as weighed Benefit require 5 described in method.
8. a kind of computer program product comprising instruction, when run on a computer, so that computer executes such as right It is required that method described in 5.
CN201711049822.9A 2017-10-31 2017-10-31 USB interface control method, terminal device, storage medium and computer program product Pending CN109726157A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711049822.9A CN109726157A (en) 2017-10-31 2017-10-31 USB interface control method, terminal device, storage medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711049822.9A CN109726157A (en) 2017-10-31 2017-10-31 USB interface control method, terminal device, storage medium and computer program product

Publications (1)

Publication Number Publication Date
CN109726157A true CN109726157A (en) 2019-05-07

Family

ID=66293556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711049822.9A Pending CN109726157A (en) 2017-10-31 2017-10-31 USB interface control method, terminal device, storage medium and computer program product

Country Status (1)

Country Link
CN (1) CN109726157A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908689A (en) * 2019-11-27 2020-03-24 杭州莱宸科技有限公司 Program upgrading interface circuit, embedded device, downloading interface circuit and downloader
CN112422145A (en) * 2020-11-10 2021-02-26 上海移远通信技术股份有限公司 Intercom
CN113507284A (en) * 2021-06-16 2021-10-15 广州朗国电子科技股份有限公司 Circuit for self-adaption of default screen direction of android device
CN114264423A (en) * 2022-03-03 2022-04-01 荣耀终端有限公司 Liquid inlet detection control method and electronic equipment
CN116069697A (en) * 2023-03-06 2023-05-05 荣耀终端有限公司 Type-C interface level control method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104951034A (en) * 2015-07-16 2015-09-30 广东欧珀移动通信有限公司 Mobile terminal and USB interface mode control method and device thereof
CN105182154A (en) * 2015-08-25 2015-12-23 广东欧珀移动通信有限公司 Universal serial bus interface detection circuit and method
CN106844265A (en) * 2017-02-06 2017-06-13 维沃移动通信有限公司 The control method and mobile terminal of a kind of general-purpose serial bus USB interface
CN107300965A (en) * 2017-05-12 2017-10-27 青岛海信移动通信技术股份有限公司 The implementation method and device of a kind of USB interface waterproof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104951034A (en) * 2015-07-16 2015-09-30 广东欧珀移动通信有限公司 Mobile terminal and USB interface mode control method and device thereof
CN105182154A (en) * 2015-08-25 2015-12-23 广东欧珀移动通信有限公司 Universal serial bus interface detection circuit and method
CN106844265A (en) * 2017-02-06 2017-06-13 维沃移动通信有限公司 The control method and mobile terminal of a kind of general-purpose serial bus USB interface
CN107300965A (en) * 2017-05-12 2017-10-27 青岛海信移动通信技术股份有限公司 The implementation method and device of a kind of USB interface waterproof

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908689A (en) * 2019-11-27 2020-03-24 杭州莱宸科技有限公司 Program upgrading interface circuit, embedded device, downloading interface circuit and downloader
CN110908689B (en) * 2019-11-27 2023-09-15 杭州莱宸科技有限公司 Program upgrade interface circuit, embedded device, download interface circuit, and downloader
CN112422145A (en) * 2020-11-10 2021-02-26 上海移远通信技术股份有限公司 Intercom
CN112422145B (en) * 2020-11-10 2022-03-08 上海移远通信技术股份有限公司 Intercom
CN113507284A (en) * 2021-06-16 2021-10-15 广州朗国电子科技股份有限公司 Circuit for self-adaption of default screen direction of android device
CN114264423A (en) * 2022-03-03 2022-04-01 荣耀终端有限公司 Liquid inlet detection control method and electronic equipment
CN114264423B (en) * 2022-03-03 2022-07-05 荣耀终端有限公司 Liquid inlet detection control method and electronic equipment
CN116069697A (en) * 2023-03-06 2023-05-05 荣耀终端有限公司 Type-C interface level control method and related device
CN116069697B (en) * 2023-03-06 2023-08-22 荣耀终端有限公司 Type-C interface level control method and related device

Similar Documents

Publication Publication Date Title
CN109726157A (en) USB interface control method, terminal device, storage medium and computer program product
CN107632949B (en) Data line identification circuit, method and terminal
WO2021109931A1 (en) Touch control method and wearable device
CN108572767A (en) A kind of method in determining external object orientation, mobile terminal
CN108966085B (en) Self-adaptive audio circuit and mobile terminal
CN108810701B (en) A kind of Type-C interface method for detecting abnormality and mobile terminal
CN108874708A (en) OTG equipment, terminal charging method, mobile terminal and computer readable storage medium
CN109075704A (en) A kind of load supplying circuit and terminal
CN108829553A (en) Universal serial bus c-type interface detection circuit, detection method and electronic equipment
CN109861335A (en) Charging system, electronic equipment and charge control method
CN110352532B (en) Method for detecting swelling of rechargeable battery and portable electronic equipment
CN108920390B (en) Insertion detection circuit, insertion detection method, and electronic device
CN109687922A (en) Signal monitoring method, device, storage medium and the mobile terminal of wireless network
US20200012271A1 (en) Electronic device and method for controlling operation of electronic device
CN110190641B (en) Charging control circuit, terminal equipment and data line
CN112165136A (en) Interface arrangement and mobile terminal charge
CN108411310B (en) Interface circuit and electronic device
CN110113484A (en) A kind of control method of screen power supplies, device, storage medium and electronic equipment
CN109599830A (en) A kind of voltage overshoot protective device and mobile terminal
CN108429957A (en) TypeC earphones switching cable and wired earphone TypeC connection systems
CN107645151A (en) A kind of current foldback circuit, control method and device, terminal
CN111083288B (en) Screen control method and device, terminal equipment and storage medium
CN107995372A (en) A kind of false touch ground connection identifying processing method, circuit and mobile terminal
CN109980724B (en) Method and device for charging double-screen mobile terminal, mobile terminal and storage medium
CN108959002B (en) Insertion detection circuit, insertion detection method, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant after: Huawei Device Co., Ltd.

Address before: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Applicant before: HUAWEI terminal (Dongguan) Co., Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190507