CN106026232A - Detecting method and apparatus for USB port type - Google Patents

Detecting method and apparatus for USB port type Download PDF

Info

Publication number
CN106026232A
CN106026232A CN201610383829.3A CN201610383829A CN106026232A CN 106026232 A CN106026232 A CN 106026232A CN 201610383829 A CN201610383829 A CN 201610383829A CN 106026232 A CN106026232 A CN 106026232A
Authority
CN
China
Prior art keywords
detection
charging port
port type
usb interface
charging
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
CN201610383829.3A
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610383829.3A priority Critical patent/CN106026232A/en
Publication of CN106026232A publication Critical patent/CN106026232A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The invention discloses a detecting method and apparatus for a USB port type. The detecting method comprises the steps of when an inserted USB interface is detected, detecting the charging port type of the USB interface; when a detection stop condition is satisfied, stopping the detecting of the charging port type according to the detected charging port type; and when a re-detection condition is satisfied, re-detecting the charging port type once at predetermined intervals until the detection stop condition is satisfied according to the detected charging port type. According to the technical scheme, the re-detection condition is set in the charging process; when the re-detection condition is satisfied, the charging port type is detected periodically; therefore, the problem of wrong detection on the charging port type caused by negligence of a user or the aging of the connector of the USB data line is solved on the basis of sacrificing a quite short charging time; and in addition, the scheme is convenient to realize, and extra additional hardware cost is not required.

Description

The detection method of USB port type and device
Technical field
It relates to charging technique field, particularly relate to detection method and the device of USB port type.
Background technology
Along with the fast development of smart mobile phone, the performance of mobile phone is increasingly stronger, and the power consumption rate of battery also shows Work accelerates, and people are more and more stronger for the demand of quick charge.
USB interface includes VBUS (voltage bus) pin, DP (Digital Positive, data are just) Pin (also referred to as D+ pin), (also referred to as D-draws DM (Digital Minus, data minus) pin Foot) and GND (Ground, ground wire) pin.In the related, DP pin and DM pin divide Other and terminal built-in charging IC (Integrated Circuit, integrated circuit) is electrically connected with, and leads in terminal Crossing in the case of USB interface is connected with charger, charging IC by DP pin and DM pin and fills Electrical equipment communicates, it is achieved charging port type detection.
USB association is proposed USB BC1.2 specification to distinguish different charging port types, with fully profit Charging rate is improved by the ability of charging port.BC1.2 specification briefly defines standard down port (SDP), charging downlink port (CDP) and special charging port (DCP) three kinds are different types of USB port.On the basis of BC1.2, high pass it is also proposed it quick charge standard QC2.0 and QC3.0.If DCP supports QC2.0 or QC3.0 agreement, charging rate can be improved further.
BC1.2 specification after connection VBUS being detected, compulsive requirement detection D+ and D-this two Whether individual data wire connects.Therefore according to BC1.2 specification, most equipment are all detecting After VBUS connects, wait the regular hour, just start with DP and DM and detect USB port type. If USB data line adapter is aging, or due to the carelessness of user, mobile phone may be caused to insert USB It is slow that this process of data wire becomes comparison.Thus it is likely to result on mobile phone being responsible for the power supply of charging Managing chip, in the case of DP and DM is not the most fully connected, has just started port type detection, Therefore the port type of mistake is detected.Next will fill according to the USB port type of mistake Electricity, have impact on charging rate.
Summary of the invention
Disclosure embodiment provides detection method and the device of USB port type.Described technical scheme is such as Under:
First aspect according to disclosure embodiment, it is provided that the detection method of a kind of USB port type, bag Include:
When insertion USB interface being detected, the charging port type of detection USB interface;
According to the charging port type of detection, when determining satisfied stopping testing conditions, stop charging port class Type detects;
According to the charging port type of detection, when determining satisfied testing conditions again, at interval of scheduled duration Again charging port type of detection is to meeting stopping testing conditions.
In one embodiment, when meeting following either condition, determine and meet testing conditions again, can wrap Include:
Determine that the charging port type of detection is standard down port or charging downlink port, and local terminal exists Data are not transmitted by USB interface in the scheduled time after this charging port type detection;
The charging port type determining detection is UNKNOWN TYPE.
In one embodiment, when meeting following either condition, determine and meet stopping testing conditions, can wrap Include:
Determine that this charging port type detected is standard down port or charging downlink port, and this End transmits data by USB interface in scheduled duration after this charging port type detection time;
The charging port type determining detection is special charging port type.
In one embodiment, determine when the charging port type of detection is special charging port type, also Comprise the steps that
Detect whether to support quick charge standard QC2.0 and QC3.0.
In one embodiment, insertion USB interface is detected, it may include:
When detection is connected to the voltage bus VBUS of USB interface, determines and insertion USB interface detected.
In one embodiment, the charging port type of USB interface is detected, it may include:
By the data of USB interface positive DP pin and data minus DM pin, detection USB interface Charging port type.
In one embodiment, after each charging port type detection, in charging port type inspection next time Before survey, may also include that
The charge mode corresponding according to this charging port type detected is charged.
Second aspect according to disclosure embodiment, it is provided that the detection device of a kind of USB port type, bag Include:
First detection module, for when insertion USB interface being detected, detecting the charging of USB interface Port type;
Stop detection module, for the charging port type according to detection, determine and meet stopping testing conditions Time, stop charging port type detection;
Again detection module, for the charging port type according to detection, determines and meets testing conditions again Time, again detect a charging port type at interval of scheduled duration to meeting stopping testing conditions.
In one embodiment, when meeting following either condition, determine and meet testing conditions again, can wrap Include:
Determine that the charging port type of detection is standard down port or charging downlink port, and local terminal exists Data are not transmitted by USB interface in the scheduled time after this charging port type detection;
The charging port type determining detection is UNKNOWN TYPE.
In one embodiment, when meeting following either condition, determine and meet stopping testing conditions, can wrap Include:
Determine that this charging port type detected is standard down port or charging downlink port, and this End transmits data by USB interface in scheduled duration after this charging port type detection time;
The charging port type determining detection is special charging port type.
In one embodiment, determine when the charging port type of detection is special charging port type, institute State device may also include that
Second detection module, for detecting whether support quick charge standard QC2.0 and QC3.0.
In one embodiment, first detection module, it may include:
Determine submodule, when detection is connected to the voltage bus VBUS of USB interface, determine inspection Measure insertion USB interface.
In one embodiment, first detection module, may also include that
Detection sub-module, is used for the data positive DP pin by USB interface and data minus DM pin, The charging port type of detection USB interface.
In one embodiment, described device may also include that
Charging module, for being charged according to the charge mode that this charging port type detected is corresponding.
The third aspect according to disclosure embodiment, it is provided that the detection device of a kind of USB port type, bag Include:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When insertion USB interface being detected, the charging port type of detection USB interface;
According to the charging port type of detection, when determining satisfied stopping testing conditions, stop charging port class Type detects;
According to the charging port type of detection, when determining satisfied testing conditions again, at interval of scheduled duration again Detect a charging port type to meeting stopping testing conditions.
Embodiment of the disclosure that the technical scheme of offer can include following beneficial effect:
Technique scheme, when insertion USB interface being detected, the charging port of detection USB interface Type, according to the charging port type of detection, when determining satisfied stopping testing conditions, stops charging port Type detection, according to the charging port type of detection, when determining satisfied testing conditions again, at interval of in advance Timing charging port type of long detection again stops testing conditions to satisfied.In charging process, if Fixed testing conditions again, when meeting testing conditions again, periodically examines charging port type Survey, thus on the basis of sacrificing the shortest charging interval, solve user because of carelessness or USB data line Adapter is aging, the identification charging port type error problem caused, and this programme realizes conveniently, no Need the hardware cost that extra increase is unnecessary.
It should be appreciated that it is only exemplary and explanatory that above general description and details hereinafter describe , the disclosure can not be limited.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meet these public affairs The embodiment opened, and for explaining the principle of the disclosure together with description.
Fig. 1 is the flow chart of the detection method according to the USB port type shown in an exemplary embodiment.
Fig. 2 is the block diagram of the detection device according to the USB port type shown in an exemplary embodiment.
Fig. 3 is the frame of the detection device according to the another kind of USB port type shown in an exemplary embodiment Figure.
Fig. 4 is the first detection in the detection device according to the USB port type shown in an exemplary embodiment The block diagram of module 21.
Fig. 5 is the first detection in the detection device according to the USB port type shown in an exemplary embodiment Another block diagram of module 21.
Fig. 6 is the frame of the detection device according to another the USB port type shown in an exemplary embodiment Figure.
Fig. 7 is the frame according to the detection device being applicable to USB port type shown in an exemplary embodiment Figure.
Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Following retouches Stating when relating to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous and wants Element.Embodiment described in following exemplary embodiment does not represent own consistent with the disclosure Embodiment.On the contrary, they only with as appended claims describes in detail, the disclosure some The example of the apparatus and method that aspect is consistent.
Three kinds of different types of ports of BC1.2 specification regulation: standard down port (SDP), this end On DP and the DM line of mouth, there is 15k Ω pull down resistor.Cut-off current is 2.5mA when hanging up, during connection For 100mA, connecting and being configured to during higher-wattage is 500mA;Special charging port (DCP), this Plant port and do not support that any data are transmitted, but the electric current of more than 1.5A can be provided.DP and DM of port Short circuit between line.Such port supports charger and onboard charger on the wall of relatively high charge ability, Without enumerating;Charging downlink port (CDP), this port had both been supported large current charge, had also been supported completely The data transmission of compatible USB 2.0.Port has DP with DM and communicates the necessary drop-down electricity of 15k Ω Resistance, it may have the internal circuit of charger detection-phase switching.Internal circuit allows portable equipment by CDP Make a distinction with other type port.
Fig. 1 is the flow process of the detection method according to a kind of USB port type shown in an exemplary embodiment Figure, as it is shown in figure 1, the detection method of this USB port type comprises the following steps S101-S103:
In step S101, when insertion USB interface being detected, the charging port of detection USB interface Type.
In step s 102, according to the charging port type of detection, when determining satisfied stopping testing conditions, Stop charging port type detection.
In step s 103, according to the charging port type of detection, when determining satisfied testing conditions again, Again a charging port type is detected to meeting stopping testing conditions at interval of scheduled duration.
Scheduled duration for example, 30 minutes, can be set by system, it is possible to set according to actual needs Fixed.
The said method of disclosure embodiment, in charging process, sets testing conditions again, when meeting Again during testing conditions, periodically charging port type is detected, thus sacrificing the shortest filling On electricity time basis, solve user aging because of carelessness or USB data line adapter, the identification caused Charging port type error problem, and this programme realizes conveniently, it is not necessary to the hardware that extra increase is unnecessary Cost.
In one embodiment, when meeting following condition one or condition two, determine and meet testing conditions again:
Condition one, determines that the charging port type of detection is standard down port or charging downlink port, And local terminal does not transmits data by USB interface in the scheduled time after this charging port type detection.
The such as 10 minutes scheduled time, can be set according to the actual requirements.When the charging end detected Mouth type is the one in standard down port, charging downlink port, and the most always Do not transmit data by this USB interface, then again detect a charging port class at interval of scheduled duration Type.
Condition two, determines that the charging port type of detection is UNKNOWN TYPE.
If be detected that charging port be the port of UNKNOWN TYPE, then directly the most again examine Survey charging port type.
In one embodiment, when meeting following condition three or condition four, determine and meet stopping detector bar Part:
Condition three, determines that this charging port type detected is standard down port or charging downstream end Mouthful, and local terminal transmitted by USB interface in scheduled duration after this charging port type detection time Data.
Scheduled duration for example, 10 minutes, when this charging port type detected be standard down port or Person charge downlink port time, and pass through within 10 minutes after this charging port type detection time USB interface transmission data, then stop detection port type.
Condition four, determines that the charging port type of detection is special charging port type.
When detecting that charging port type is special charging port type, it is not repeated to detect port type, Stop detection.
In one embodiment, determine when the charging port type of detection is special charging port type, also Comprise the steps that
Detect whether to support quick charge standard QC2.0 and QC3.0.
When the charging port type of detection is special charging port type, followed by follow-up QC2.0 With the detection of QC3.0, detect whether to support quick charge standard QC2.0 and QC3.0, if supported, Then it is charged with this rechargeable standard, thus completes quick charge.
In one embodiment, step S101 detects insertion USB interface, can be embodied as follows Mode one:
Mode one, when detection is connected to the voltage bus VBUS of USB interface, determines and insertion detected USB interface.
In one embodiment, the charging port type of the detection USB interface in step S101, can be real Execute as following manner two:
Mode two, by the data of USB interface positive DP pin and data minus DM pin, detects USB The charging port type of interface.
In one embodiment, after each charging port type detection, in charging port type inspection next time Before survey, above-mentioned step A that may also include:
Step A, the charge mode corresponding according to this charging port type detected is charged.
In order to not delay terminal charge, in the present embodiment, when meeting testing conditions again, charge every time After port type detection, before next charging port type detection, the charging port detected according to this Charge mode corresponding to type is charged, even if thus detection charging port type again, do not delay Terminal charge.
Following for disclosure device embodiment, may be used for performing method of disclosure embodiment.
Fig. 2 is the frame of the detection device according to a kind of USB port type shown in an exemplary embodiment Figure, this device can pass through software, hardware or both be implemented in combination with become the part of electronic equipment or Person is whole.As in figure 2 it is shown, the detection device of this USB port type includes:
First detection module 21, when being configured as detecting insertion USB interface, detects USB interface Charging port type.
Stop detection module 22, be configured to the charging port type according to detection, determine and meet stopping inspection During survey condition, stop charging port type detection;
Again detection module 23, are configured to the charging port type according to detection, determine to meet and again examine During survey condition, again detect a charging port type at interval of scheduled duration to meeting stopping testing conditions.
The said apparatus of disclosure embodiment, in charging process, sets testing conditions again, when meeting Again during testing conditions, periodically charging port type is detected, thus sacrificing the shortest filling On electricity time basis, solve user aging because of carelessness or USB data line adapter, the identification caused Charging port type error problem, and this programme realizes conveniently, it is not necessary to the hardware that extra increase is unnecessary Cost.
In one embodiment, when meeting following either condition, determine and meet testing conditions again, can wrap Include:
Determine that the charging port type of detection is standard down port or charging downlink port, and local terminal exists Data are not transmitted by USB interface in the scheduled time after this charging port type detection;
The charging port type determining detection is UNKNOWN TYPE.
In one embodiment, when meeting following either condition, determine and meet stopping testing conditions, can wrap Include:
Determine that this charging port type detected is standard down port or charging downlink port, and this End transmits data by USB interface in scheduled duration after this charging port type detection time;
The charging port type determining detection is special charging port type.
In one embodiment, determine when the charging port type of detection is special charging port type, as Shown in Fig. 3, said apparatus may also include that
Second detection module 24, is configured to detect whether to support quick charge standard QC2.0 and QC3.0.
In one embodiment, as shown in Figure 4, first detection module 21, it may include:
Determine submodule 41, when being configured to detect the voltage bus VBUS being connected to USB interface, Determine and insertion USB interface detected.
In one embodiment, as it is shown in figure 5, first detection module 21, may also include that
Detection sub-module 42, is configured to data positive DP pin and data minus DM of USB interface Pin, the charging port type of detection USB interface.
In one embodiment, as shown in Figure 6, described device may also include that
Charging module 25, is configured to the charge mode according to this charging port type detected is corresponding and enters Row charging.
Disclosure embodiment also provides for the detection device of a kind of USB port type, including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When insertion USB interface being detected, the charging port type of detection USB interface;
According to the charging port type of detection, when determining satisfied stopping testing conditions, stop charging port class Type detects;
According to the charging port type of detection, when determining satisfied testing conditions again, at interval of scheduled duration again Detect a charging port type to meeting stopping testing conditions.
When above-mentioned processor is also configured to meet following either condition, determines and meet testing conditions again, Comprise the steps that
Determine that the charging port type of detection is standard down port or charging downlink port, and local terminal exists Data are not transmitted by USB interface in the scheduled time after this charging port type detection;
The charging port type determining detection is UNKNOWN TYPE.
When above-mentioned processor is also configured to meet following either condition, determines and meet stopping testing conditions, Comprise the steps that
Determine that this charging port type detected is standard down port or charging downlink port, and this End transmits data by USB interface in scheduled duration after this charging port type detection time;
The charging port type determining detection is special charging port type.
Above-mentioned processor is also configured to determine that the charging port type of detection is special charging port type Time, may also include that
Detect whether to support quick charge standard QC2.0 and QC3.0.
Above-mentioned processor is also configured to
When detection is connected to the voltage bus VBUS of USB interface, determines and insertion USB interface detected.
Above-mentioned processor is also configured to
By the data of USB interface positive DP pin and data minus DM pin, detection USB interface Charging port type.
After above-mentioned processor is also configured to each charging port type detection, at charging port next time Before type detection, may also include that
The charge mode corresponding according to this charging port type detected is charged.
Fig. 7 is according to a kind of detection device for USB port type shown in an exemplary embodiment Block diagram, this device is applicable to terminal unit.Such as, device 1200 can be mobile phone, computer, Digital broadcast terminal, messaging devices, game console, tablet device, armarium, body-building sets Standby, personal digital assistant etc..
Device 1200 can include following one or more assembly: processes assembly 1202, memorizer 1204, Power supply module 1206, multimedia groupware 1208, audio-frequency assembly 1210, input/output (I/O) connects Mouth 1212, sensor cluster 1214, and communications component 1216.
Process assembly 1202 and generally control the integrated operation of device 1200, such as with display, call, The operation that data communication, camera operation and record operation are associated.Process assembly 1202 and can include one Or multiple processor 1220 performs instruction, to complete all or part of step of above-mentioned method.Additionally, Process assembly 1202 and can include one or more module, it is simple to process assembly 1202 and other assemblies it Between mutual.Such as, process assembly 1202 and can include multi-media module, to facilitate multimedia groupware 1208 and process between assembly 1202 mutual.
Memorizer 1204 is configured to store various types of data to support the operation at device 1200. The example of these data includes any application program for operation on device 1200 or the instruction of method, Contact data, telephone book data, message, picture, video etc..Memorizer 1204 can be by any class The volatibility of type or non-volatile memory device or combinations thereof realize, such as static random access memory Device (SRAM), Electrically Erasable Read Only Memory (EEPROM), erasable programmable is read-only Memorizer (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic Memorizer, flash memory, disk or CD.
The various assemblies that power supply module 1206 is device 1200 provide electric power.Power supply module 1206 can wrap Include power-supply management system, one or more power supplys, and other generate with for device 1200, manage and distribute The assembly that electric power is associated.
One output interface of offer that multimedia groupware 1208 is included between described device 1200 and user Screen.In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP). If screen includes that touch panel, screen may be implemented as touch screen, to receive the input from user Signal.Touch panel includes that one or more touch sensor touches with sensing, slides and on touch panel Gesture.Described touch sensor can not only sense touch or the border of sliding action, but also detects The persistent period relevant to described touch or slide and pressure.In certain embodiments, multimedia group Part 1208 includes a front-facing camera and/or post-positioned pick-up head.When device 1200 is in operator scheme, During such as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive many matchmakers of outside Volume data.Each front-facing camera and post-positioned pick-up head can be a fixing optical lens system or tool There are focal length and optical zoom ability.
Audio-frequency assembly 1210 is configured to output and/or input audio signal.Such as, audio-frequency assembly 1210 Including a mike (MIC), when device 1200 is in operator scheme, such as call model, record mould When formula and speech recognition mode, mike is configured to receive external audio signal.The audio frequency letter received Number can be further stored at memorizer 1204 or send via communications component 1216.Implement at some In example, audio-frequency assembly 1210 also includes a speaker, is used for exporting audio signal.
I/O interface 1212 is to process to provide interface between assembly 1202 and peripheral interface module, above-mentioned outside Enclosing interface module can be keyboard, puts striking wheel, button etc..These buttons may include but be not limited to: homepage Button, volume button, start button and locking press button.
Sensor cluster 1214 includes one or more sensor, for providing each side for device 1200 The state estimation in face.Such as, what sensor cluster 1214 can detect device 1200 beats opening/closing shape State, the relative localization of assembly, the most described assembly is display and the keypad of device 1200, sensor Assembly 1214 can also detect device 1200 or the position change of 1,200 1 assemblies of device, user and dress Put the presence or absence of 1200 contacts, device 1200 orientation or acceleration/deceleration and the temperature of device 1200 Degree change.Sensor cluster 1214 can include proximity transducer, is configured to do not having any thing The existence of object near detection during reason contact.Sensor cluster 1214 can also include optical sensor, as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, should Sensor cluster 1214 can also include acceleration transducer, gyro sensor, Magnetic Sensor, pressure Sensor or temperature sensor.
Communications component 1216 is configured to facilitate wired or wireless mode between device 1200 and other equipment Communication.Device 1200 can access wireless network based on communication standard, such as WiFi, 2G or 3G, Or combinations thereof.In one exemplary embodiment, communications component 1216 receives via broadcast channel From broadcast singal or the broadcast related information of external broadcasting management system.In one exemplary embodiment, Described communications component 1216 also includes near-field communication (NFC) module, to promote junction service.Such as, Can be based on RF identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, Ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 1200 can be by one or more application specific integrated circuits (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), able to programme patrol Collect device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor Or other electronic components realize, it is used for performing said method.
In the exemplary embodiment, a kind of non-transitory computer-readable storage including instruction is additionally provided Medium, such as, include the memorizer 1204 of instruction, and above-mentioned instruction can be by the processor 1220 of device 1200 Perform to complete said method.Such as, described non-transitory computer-readable recording medium can be ROM, Random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..
A kind of non-transitory computer-readable recording medium, when the instruction in described storage medium is by device When the processor of 1200 performs so that device 1200 is able to carry out the detection side of above-mentioned USB port type Method, described method includes:
When insertion USB interface being detected, the charging port type of detection USB interface;
According to the charging port type of detection, when determining satisfied stopping testing conditions, stop charging port class Type detects;
According to the charging port type of detection, when determining satisfied testing conditions again, at interval of scheduled duration again Detect a charging port type to meeting stopping testing conditions.
In one embodiment, when meeting following either condition, determine and meet testing conditions again, can wrap Include:
Determine that the charging port type of detection is standard down port or charging downlink port, and local terminal exists Data are not transmitted by USB interface in the scheduled time after this charging port type detection;
The charging port type determining detection is UNKNOWN TYPE.
In one embodiment, when meeting following either condition, determine and meet stopping testing conditions, can wrap Include:
Determine that this charging port type detected is standard down port or charging downlink port, and this End transmits data by USB interface in scheduled duration after this charging port type detection time;
The charging port type determining detection is special charging port type.
In one embodiment, determine when the charging port type of detection is special charging port type, also Comprise the steps that
Detect whether to support quick charge standard QC2.0 and QC3.0.
In one embodiment, insertion USB interface is detected, it may include:
When detection is connected to the voltage bus VBUS of USB interface, determines and insertion USB interface detected.
In one embodiment, the charging port type of USB interface is detected, it may include:
By the data of USB interface positive DP pin and data minus DM pin, detection USB interface Charging port type.
In one embodiment, after each charging port type detection, in charging port type inspection next time Before survey, may also include that
The charge mode corresponding according to this charging port type detected is charged.
Those skilled in the art, after considering description and putting into practice disclosure disclosed herein, will readily occur to this Other embodiment disclosed.The application is intended to any modification, purposes or the adaptability of the disclosure Change, these modification, purposes or adaptations are followed the general principle of the disclosure and include these public affairs Open undocumented common knowledge in the art or conventional techniques means.Description and embodiments only by Being considered as exemplary, the true scope of the disclosure and spirit are pointed out by claim below.
It should be appreciated that the disclosure be not limited to described above and illustrated in the accompanying drawings accurately Structure, and various modifications and changes can carried out without departing from the scope.The scope of the present disclosure is only by institute Attached claim limits.

Claims (15)

1. the detection method of a USB port type, it is characterised in that including:
When insertion USB interface being detected, the charging port type of detection USB interface;
According to the charging port type of detection, when determining satisfied stopping testing conditions, stop charging port class Type detects;
According to the charging port type of detection, when determining satisfied testing conditions again, at interval of scheduled duration Again charging port type of detection is to meeting stopping testing conditions.
Method the most according to claim 1, it is characterised in that when meeting following either condition, really Fixed satisfied testing conditions again, including:
Determine that the charging port type of detection is standard down port or charging downlink port, and local terminal exists Data are not transmitted by described USB interface in the scheduled time after this charging port type detection;
The charging port type determining detection is UNKNOWN TYPE.
Method the most according to claim 1, it is characterised in that when meeting following either condition, really Fixed satisfied stopping testing conditions, including:
Determine that this charging port type detected is standard down port or charging downlink port, and this End transmits number by described USB interface in scheduled duration after this charging port type detection time According to;
The charging port type determining detection is special charging port type.
Method the most according to claim 3, it is characterised in that determine the charging port type of detection During for special charging port type, also include:
Detect whether to support quick charge standard QC2.0 and QC3.0.
5. according to the arbitrary described method of Claims 1 to 4, it is characterised in that insertion USB detected Interface, including:
When detection is connected to the voltage bus VBUS of USB interface, determines and insertion USB interface detected.
6. according to the arbitrary described method of Claims 1 to 4, it is characterised in that detection USB interface Charging port type, including:
By the data of USB interface positive DP pin and data minus DM pin, detection USB interface Charging port type.
7. according to the arbitrary described method of Claims 1 to 4, it is characterised in that charging port class every time After type detection, before next charging port type detection, also include:
The charge mode corresponding according to this charging port type detected is charged.
8. the detection device of a USB port type, it is characterised in that including:
First detection module, for when insertion USB interface being detected, detecting the charging of USB interface Port type;
Stop detection module, for the charging port type according to detection, determine and meet stopping testing conditions Time, stop charging port type detection;
Again detection module, for the charging port type according to detection, determines and meets testing conditions again Time, again detect a charging port type at interval of scheduled duration to meeting stopping testing conditions.
Device the most according to claim 8, it is characterised in that when meeting following either condition, really Fixed satisfied testing conditions again, including:
Determine that the charging port type of detection is standard down port or charging downlink port, and local terminal exists Data are not transmitted by USB interface in the scheduled time after this charging port type detection;
The charging port type determining detection is UNKNOWN TYPE.
Device the most according to claim 8, it is characterised in that when meeting following either condition, Determine to meet and stop testing conditions, including:
Determine that this charging port type detected is standard down port or charging downlink port, and this End transmits data by USB interface in scheduled duration after this charging port type detection time;
The charging port type determining detection is special charging port type.
11. devices according to claim 10, it is characterised in that determine the charging port class of detection When type is special charging port type, described device also includes:
Second detection module, for detecting whether support quick charge standard QC2.0 and QC3.0.
12. according to Claim 8~11 arbitrary described devices, it is characterised in that first detection module, Including:
Determine submodule, when detection is connected to the voltage bus VBUS of USB interface, determine inspection Measure insertion USB interface.
13. according to Claim 8~11 arbitrary described devices, it is characterised in that first detection module, Also include:
Detection sub-module, is used for the data positive DP pin by USB interface and data minus DM pin, The charging port type of detection USB interface.
14. according to Claim 8~11 arbitrary described devices, it is characterised in that described device also wraps Include:
Charging module, for being charged according to the charge mode that this charging port type detected is corresponding.
The detection device of 15. 1 kinds of USB port types, it is characterised in that including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When insertion USB interface being detected, the charging port type of detection USB interface;
According to the charging port type of detection, when determining satisfied stopping testing conditions, stop charging port class Type detects;
According to the charging port type of detection, when determining satisfied testing conditions again, at interval of scheduled duration again Detect a charging port type to meeting stopping testing conditions.
CN201610383829.3A 2016-06-01 2016-06-01 Detecting method and apparatus for USB port type Pending CN106026232A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610383829.3A CN106026232A (en) 2016-06-01 2016-06-01 Detecting method and apparatus for USB port type

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610383829.3A CN106026232A (en) 2016-06-01 2016-06-01 Detecting method and apparatus for USB port type

Publications (1)

Publication Number Publication Date
CN106026232A true CN106026232A (en) 2016-10-12

Family

ID=57089312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610383829.3A Pending CN106026232A (en) 2016-06-01 2016-06-01 Detecting method and apparatus for USB port type

Country Status (1)

Country Link
CN (1) CN106026232A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792131A (en) * 2016-12-23 2017-05-31 东软集团股份有限公司 Data transmission method and device
CN108268393A (en) * 2016-12-30 2018-07-10 维沃移动通信有限公司 The processing method and mobile terminal of a kind of access device
CN109426643A (en) * 2017-08-25 2019-03-05 中兴通讯股份有限公司 USB interface request scheduling method, device and equipment
CN111026684A (en) * 2019-12-05 2020-04-17 北京小米移动软件有限公司 Interface control method, interface control device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070659A1 (en) * 2008-09-17 2010-03-18 Kenneth Ma Method and system for operating and/or charging a battery powered usb device based on a usb port type
CN102692570A (en) * 2011-03-24 2012-09-26 半导体元件工业有限责任公司 Input-output circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070659A1 (en) * 2008-09-17 2010-03-18 Kenneth Ma Method and system for operating and/or charging a battery powered usb device based on a usb port type
CN102692570A (en) * 2011-03-24 2012-09-26 半导体元件工业有限责任公司 Input-output circuit

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792131A (en) * 2016-12-23 2017-05-31 东软集团股份有限公司 Data transmission method and device
CN106792131B (en) * 2016-12-23 2019-08-02 东软集团股份有限公司 Data transmission method and device
CN108268393A (en) * 2016-12-30 2018-07-10 维沃移动通信有限公司 The processing method and mobile terminal of a kind of access device
CN109426643A (en) * 2017-08-25 2019-03-05 中兴通讯股份有限公司 USB interface request scheduling method, device and equipment
CN111026684A (en) * 2019-12-05 2020-04-17 北京小米移动软件有限公司 Interface control method, interface control device and storage medium

Similar Documents

Publication Publication Date Title
CN106410303A (en) Charging method and charging apparatus
CN105373464A (en) Charging warning method and device of wearable equipment
CN105137356B (en) Detect the method and device of charged state
CN103957103A (en) Safety authentication method and device and mobile terminal
CN105896666A (en) Charging method and device of terminal and terminal
CN105720644A (en) Charging control method and device and terminal device
CN106026232A (en) Detecting method and apparatus for USB port type
CN107196372A (en) Charging method and device
CN105356529A (en) Prompting method and apparatus for rapid charging state
CN105160320A (en) Fingerprint identification method and apparatus, and mobile terminal
CN105224494A (en) Method for handover control and device
CN106329635A (en) Terminal charging method and device
CN106067571A (en) Method and electronic equipment for battery charging
CN105446858A (en) Replacement prompt method and apparatus for battery
CN106230066A (en) Charge prompting method and apparatus
CN104779420A (en) Battery charging method and device
CN105630655B (en) A kind of method and apparatus of prompt charging connection
CN105975038A (en) Prompt method and device of charging port detection result
CN104577235B (en) For the method for portable set charging, the method, apparatus and system of control charging
CN107331910A (en) Charging method and device
CN106532367A (en) Power consumption warning method and device of smart socket
CN104600786B (en) Portable power source and power information display methods
CN104967174B (en) Charge control method and device
CN106610476B (en) Test method, device and the terminal of charge and discharge process
CN105389225A (en) Touch screen reporting point processing method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20161012