CN106329629A - Charging method and device - Google Patents

Charging method and device Download PDF

Info

Publication number
CN106329629A
CN106329629A CN201610797341.5A CN201610797341A CN106329629A CN 106329629 A CN106329629 A CN 106329629A CN 201610797341 A CN201610797341 A CN 201610797341A CN 106329629 A CN106329629 A CN 106329629A
Authority
CN
China
Prior art keywords
type
voltage
port
charging
cdp
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.)
Granted
Application number
CN201610797341.5A
Other languages
Chinese (zh)
Other versions
CN106329629B (en
Inventor
丁兆刚
许奕波
沈小波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen 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 Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201610797341.5A priority Critical patent/CN106329629B/en
Publication of CN106329629A publication Critical patent/CN106329629A/en
Application granted granted Critical
Publication of CN106329629B publication Critical patent/CN106329629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H02J7/007Regulation of charging or discharging current or voltage
    • H02J7/0071Regulation of charging or discharging current or voltage with a programmable schedule

Abstract

The embodiment of the invention discloses a charging method and device. The charging method comprises the steps of acquiring the port type of a charger, and judging whether the port type is a standard downstream port (SDP) type or a charging downstream port (CDP) type; if the port type is the SDP type or the CDP type, adopting a preset current threshold corresponding to the SDP type or the CDP type to perform charging; if the port type is not the SDP type or the CDP type, judging whether the port type is a dedicated charging port (DCP) type or not; if the port type is the DCP type, acquiring a charging protocol; when the charging protocol comprises a Qualcomm quick charge 2.0 (QC 2.0), adopting a charging scheme corresponding to the QC 2.0 to perform charging; when the charging protocol comprise a pump express plus 3.0 (PE+ 3.0), adopting a charging scheme corresponding to the PE+ 3.0 or a charging scheme corresponding to a pump express plug 2.0 (PE+ 2.0) to perform charging; when the charging protocol comprises the pump express plus 2.0 (PE+ 2.0), adopting the charging scheme corresponding to the PE+ 2.0 to perform charging. By adopting the charging method and device disclosed by the embodiment of the invention, charging is performed through detecting the port type of the charger and adopting a charging mode corresponding to the port type, and thus the service life of a mobile terminal is prolonged.

Description

A kind of charging method and device
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of charging method and device.
Background technology
Along with the development of mobile terminal technology, the function of the mobile terminal such as mobile phone, panel computer gets more and more, the most gradually becomes For a requisite part in people's work and life.
But, along with increasing of mobile terminal function, its power consumption is also with increase, it usually needs use charger to it It is charged.In existing charging technique, after mobile terminal accesses charger, the charger mobile terminal to being accessed is all Use fixing charging modes to be charged, such as high constant-voltage charge, so the mobile terminal that charging voltage is less will be produced Certain impact, thus reduce the service life of mobile terminal.
Summary of the invention
Embodiment of the present invention technical problem to be solved is, it is provided that a kind of charging method and device, is filled by detection The port type of electrical equipment and use the charging modes corresponding with port type that mobile terminal is charged, thus improve movement The service life of terminal.
In order to solve above-mentioned technical problem, embodiments providing a kind of charging method, described method includes:
Obtain the port type of charger, it is judged that whether described port type is standard down port SDP type or fills Electricity downlink port CDP type;
If described port type is described SDP type or described CDP type, then use described SDP type or described Predetermined current threshold corresponding to CDP type is charged;
If described port type is not described SDP type and is not described CDP type, then whether judge described port type For special charging port DCP type;
When described port type is described DCP type, obtain charge protocol;
When described charge protocol includes that high pass fills agreement QC2.0 soon, charging scheme corresponding for described QC+2.0 is used to enter Row charging;
When described charge protocol include connection send out fill agreement PE+3.0 soon time, use charging scheme corresponding for described PE+3.0 or Charging scheme corresponding for person PE+2.0 is charged;
When described charge protocol includes that connection fills agreement PE+2.0 soon, charging scheme corresponding for described PE+2.0 is used to enter Row charging.
Correspondingly, the embodiment of the present invention additionally provides a kind of charging device, and described device includes:
Type judging module, for obtaining the port type of charger, it is judged that described port type be whether SDP type or Person's CDP type;
Charging module, for when described port type is described SDP type or described CDP type, uses described SDP Type or predetermined current threshold corresponding to described CDP type are charged;
Described type judging module, being additionally operable at described port type not for described SDP type and is not described CDP type Time, it is judged that whether described port type is DCP type;
Agreement acquisition module, for when described port type is described DCP type, obtains charge protocol;
Described charging module, is additionally operable to, when described charge protocol includes QC2.0, use charging corresponding for described QC2.0 Scheme is charged;
Described charging module, is additionally operable to, when described charge protocol includes PE+3.0, use corresponding the filling of described PE+3.0 Electricity scheme or charging scheme corresponding to PE+2.0 are charged;
Described charging module, is additionally operable to, when described charge protocol includes PE+2.0, use corresponding the filling of described PE+2.0 Electricity scheme is charged.
In embodiments of the present invention, first determine whether the port type of charger be whether standard down port SDP type or Person charges downlink port CDP type, if described SDP type or CDP type, then uses SDP type or CDP type corresponding Predetermined current threshold be charged;If not SDP type and be not CDP type, then judge whether this port type is special Charging port DCP type, and when this port type is DCP type, the charge protocol included by acquisition: high pass fills agreement soon QC2.0 and/or connection are sent out and are filled agreement PE+3.0 soon and/or connection is sent out and filled agreement PE+2.0 soon, and use with QC2.0 or PE+3.0 or Charging scheme corresponding for person PE+2.0 is charged.Use corresponding with port type by the port type of detection charger Mobile terminal is charged by charging modes, thus improves the service life of mobile terminal, additionally, also add mobile terminal Compatibility to different quick chargers (adapter), by different charger of arranging in pairs or groups can realize mobile terminal fast Speed charging.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing In having technology to describe, the required accompanying drawing used is briefly described, it should be apparent that, the accompanying drawing in describing below is only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to Other accompanying drawing is obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of a kind of charging method in the embodiment of the present invention;
Fig. 2 is the structural representation of a kind of charging device in the embodiment of the present invention;
Fig. 3 is the structural representation of the type judging module of charging device in the embodiment of the present invention;
Fig. 4 is the structural representation of the type judging module of charging device in another embodiment of the present invention;
Fig. 5 is the structural representation of the type judging module of charging device in another embodiment of the present invention;
Fig. 6 is the Organization Chart of a kind of computer system performing above-mentioned charging method in the embodiment of the present invention.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Describe, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments wholely.Based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under not making creative work premise Embodiment, broadly falls into the scope of protection of the invention.
Term in description and claims of this specification and above-mentioned accompanying drawing " include " and " having " and they appoint What deformation, it is intended that cover non-exclusive comprising.Such as contain series of steps or the process of unit, method, system, product Product or equipment are not limited to step or the unit listed, but the most also include step or the unit do not listed, or The most also include other steps intrinsic for these processes, method, product or equipment or unit.
The execution of the charging method mentioned in the embodiment of the present invention depends on computer program, can run on Feng Ruoyiman body On the computer system of system.This computer program can run based on charging device.This charging device can be PC, put down The mobile terminal devices such as plate computer, notebook computer, smart mobile phone, Intelligent worn device.
It is described in detail individually below.
Fig. 1 is the schematic flow sheet of a kind of charging method in the embodiment of the present invention, and the most described method at least includes:
Step S101, obtains the port type of charger, it is judged that whether described port type is standard down port SDP class Type or charging downlink port CDP type.
Concrete, the charging device such as equipment general serial by charger such as mobile phone, panel computer or PC Bus (Universal Serial Bus, USB) port is attached with charger, and upon connection, detection charger is at USB Port type under battery charging specifications (USB Charging 1.2, BC1.2) specification, and judge that the port type detected is No for standard down port (Service Design Package, SDP) type or charging downlink port (Charging Downstream Port, CDP) type.Wherein, BC1.2 specification determines how each port should be enumerated to terminal unit, with And identify the agreement of port type.
It addition, the port type of USB BC1.2 specification is as shown in table 1, including SDP, CDP, charging downlink port (Dedicated Charging Port, DCP) and other port type.
Table 1
Concrete, described judge whether described port type is standard down port SDP type, including:
Obtain the tertiary voltage of the positive signal D+ of differential lines and the 4th voltage of the negative signal D-of described differential lines, institute State tertiary voltage and described 4th voltage is to connect the voltage before described charger;
Obtain the 5th voltage of the positive signal D+ of differential lines and the 6th voltage of the negative signal D-of described differential lines, institute State the 5th voltage and described 6th voltage is to connect the voltage after described charger;
When described tertiary voltage is more than described six voltage more than described 5th voltage and described 4th voltage, determine institute Stating port type is described SDP type.
In being embodied as, due at the positive signal line (Data+, D+) of the such port of SDP and negative signal line All there is on (Data-, D-) line 15k Ω pull down resistor, therefore when charging device is connected to SDP type charger, charging device D+ voltage be electrically charged the pull down resistor of the internal D+ signal of device and drag down, the D-voltage of charging device is also electrically charged the internal D-signal of device Pull down resistor drag down, i.e. detect when the D+ voltage within charging device and D-voltage are connecing when charging device (access device) After charger all step-down time, determine that the port of this charger is SDP type.
In the present embodiment, obtain respectively connect charging device before charger D+ and D-voltage and connect charger it D+ and the D-voltage of rear charging device, compares D+ voltage before and after connection with D-voltage, it is judged that the D before connection the most respectively + voltage and D-voltage the most all diminish.
Concrete, described judge whether described port type is charging downlink port CDP type, including:
Obtain the 7th voltage of the positive signal D+ of differential lines and the 8th voltage of the negative signal D-of described differential lines;
When described 7th voltage is more than four voltage thresholds more than tertiary voltage threshold value and described 8th voltage, connect institute State pull-up power supply and the draw power of described D+ of D-, obtain the level of described D+;
If the level of described D+ is low level, it is determined that described port type is CDP type.
In being embodied as, when charging device is connected to CDP type charger, first high because of the D+ signal level of charger In the D+ signal comparative level of charger, now CDP equipment turns on the power, and D-signal is driven high and electric higher than the judgement of D-signal Flat, now the port type of charger is identified as CDP type or DCP type;Then the pull-up of charging device D-signal is opened Power supply, i.e. maintaining D-signal is high level, disconnects the pull-up power supply of D+ signal, opens the draw power of D+ signal, now D simultaneously + signal will become low level, i.e. when detecting that charging device D+ signal is low level, determine that the port of this charger is CDP Type.
Wherein, the port of described charging downlink port (CDP) type had both supported large current charge, also supported completely compatible The data transmission of USB 2.0, and port has D+ with D-and communicate necessary 15k Ω pull down resistor, it may have charger detection The internal circuit of stage switching.
In the present embodiment, the D+ voltage in charging device and D-voltage after charging device acquisition connection charger, and point Do not compare with corresponding predetermined threshold value, when comparative result is both greater than corresponding predetermined threshold value, obtains and connecting D-'s Pull-up power supply and the level of D+ under the conditions of connecting the draw power of D+, and be low level at the level of this D+, determine described port Type is CDP type.
Step S102, if described port type is described SDP type or described CDP type, then uses described SDP type Or predetermined current threshold corresponding to described CDP type is charged.
Concrete, when described port type is described SDP type, use the first predetermined current threshold to be charged.Right In SDP type port charger, it is 2.5mA that the cut-off current of its correspondence is respectively when hanging up, and is 100mA, connects and join during connection Being set to during higher-wattage is 500mA, and described first predetermined current threshold can be 500mA;It is described CDP at described port type During type, using the second predetermined current threshold to be charged, described second predetermined current threshold can be 900mA.
Step S103, if described port type is not described SDP type and is not described CDP type, then judges described end Whether mouth type is special charging port DCP type.
Concrete, described judge whether described port type is special charging port DCP type, including:
Obtain first voltage of the positive signal D+ of differential lines and second voltage of the negative signal D-of described differential lines;
When described first voltage is more than the second voltage threshold more than the first voltage threshold and described second voltage, connect institute State pull-up power supply and the draw power of described D+ of D-, obtain the level of described D+;
If the level of described D+ is high level, it is determined that described port type is DCP type.
In being embodied as, when charging device is connected to DCP type charger, first high because of the D+ signal level of charger In the D+ signal comparative level of charger, and D+ Yu the D-signal of DCP type charging is short-circuit, and therefore D-signal is driven high and high In the decision level of D-signal, now the port type of charger is identified as DCP type or CDP type;Then charging is opened The pull-up power supply of device D-signal, i.e. maintaining D-signal is high level, disconnects the pull-up power supply of D+ signal, opens D+ signal simultaneously Draw power, now D+ signal will become high level, i.e. when detecting that charging device D+ signal is high level, determine that this fills The port of electrical equipment is DCP type.
Wherein, the port of described special charging port (DCP) type does not support that any data are transmitted, but can provide 1.5A Above electric current, is therefore usually used in supporting charger and onboard charger on the wall of relatively high charge ability, it is not necessary to enumerate.
In the present embodiment, the D+ voltage in charging device and D-voltage after charging device acquisition connection charger, and point Do not compare with corresponding predetermined threshold value, when comparative result is both greater than corresponding predetermined threshold value, obtains and connecting D-'s The level of D+ under the conditions of the draw power of pull-up power supply and connection D+, and when the level of this D+ is high level, determine described end Mouth type is DCP type.
Step S104, when described port type is described DCP type, obtains charge protocol.
Concrete, as shown in table 1, when port type is DCP type, support multiple charge protocol, obtain charging now Agreement, as connection fills agreement (Pump Express Plus 3.0, PE+3.0) soon, joins to send out and fill agreement (Pump Express soon Plus 2.0, PE+2.0) and high pass fill agreement (Quick Charge 2.0, QC2.0) soon.
Step S105, when described charge protocol includes that high pass fills agreement QC2.0 soon, uses corresponding the filling of described QC2.0 Electricity scheme is charged.
Concrete, it is a kind of fast charge protocol that high pass fills agreement QC2.0 soon, by the chip of protocol controller such as FP6600 can identify charger type automatically, adjusts the output voltage of charger, and the safety being allowed to obtain charger permission is the highest Charging voltage, saves the charging interval on the premise of protection charger.
Charging scheme corresponding for QC2.0 is: the charger that QC2.0 fills soon and the charging device holding wire D by USB interface + carry out communication, the output voltage of regulation QC2.0 with on-load voltage on D-.Concrete, when by charger (QC2.0 identification chip FP6600) end is when linking on charging device by data wire, and charger acquiescence allows D+ and D-short circuit, and charging device detects charging Device type is DCP type.Now output voltage is 5v, and charging device charges normal.If QC2.0 quick charge supported by charging device Agreement, then the hvdcp process of Android user's space will start, and starts to load the voltage of 0.325V on D+.When this electricity After pressure maintains 1.25s, charger will be switched off the short circuit of D+ and D-, and the voltage on D-will decline;Charging device detects on D- Voltage decline after, the value of hvdcp reading/sys/class/power_supply/usb/voltage_max, if 9000000 (mV), arranging the voltage on D+ is 3.3V, and the voltage on D-is 0.6V, charger output 9v voltage.If 5000000 (mV) arrange D+ be 0.6V, D-be 0V, charger output 5V voltage.
Step S106, when described charge protocol includes that connection fills agreement PE+3.0 soon, uses described PE+3.0 corresponding Charging scheme or charging scheme corresponding to PE+2.0 are charged.
Concrete, connection is sent out and is filled charger support 5V/7V/9V 2A or 12V in the charging scheme that agreement PE+3.0 is corresponding soon The charging voltage of 1.5A and charging current, and self adaptation is adjustable.
Further, since agreement is all backward compatible, say, that when supporting PE+3.0, also support PE+2.0, therefore, when When charge protocol includes PE+3.0, the charging scheme of a kind of correspondence in PE+3.0 and PE+2.0 can be used to be charged.
Step S107, when described charge protocol includes that connection fills agreement PE+2.0 soon, uses described PE+2.0 corresponding Charging scheme is charged.
Concrete, a kind of fast charge protocol of PE+2.0 Shi Lianfa company, the charging scheme that PE+2.0 is corresponding charges The output voltage values of device is that 3.6V, 3.8V, 4.0V, 4.2V, 4.4V, 4.6V, 4.8V, 5.0V, 7V, 9V, 12V self adaptation is adjustable, To ensure that, when charging, voltage floats and makes charging device be difficult to heating.
Optionally, described method also includes:
Fill agreement QC2.0 soon when described charge protocol includes high pass, connection fills agreement PE+3.0 soon and connection is sent out and filled association soon During view PE+2.0, obtain the priority level attribute of described QC2.0, the priority level attribute of described PE+3.0 and described PE respectively The priority level attribute of+2.0;
Described QC2.0, described PE+3.0 and described PE+2.0 medium priority other attribute preferably charge protocol is used to enter Row charging;
Wherein, at least one during described priority level attribute includes priority, detection duration or detection ordering.
Concrete, priority be computer time sharing system when processing multiple operation routine, determine each operation journey Sequence accepts the parameter of the priority level of system resource, if the biggest priority level of the parameter of priority level is high, then with QC2.0, PE+ Charging scheme corresponding to 3.0 agreements bigger with the parameter of the priority level in PE+2.0 is charged;If the detection time is short excellent First rank is high, then fill with the charging scheme that the agreement that QC2.0, PE+3.0 are shorter with the detection time in PE+2.0 is corresponding Electricity;If the preferential priority level of detection ordering is high, then corresponding with the agreement that first detects in QC2.0, PE+3.0 and PE+2.0 Charging scheme is charged.
In embodiments of the present invention, first determine whether the port type of charger be whether standard down port SDP type or Person charges downlink port CDP type, if described SDP type or CDP type, then uses SDP type or CDP type corresponding Predetermined current threshold be charged;If not SDP type and be not CDP type, then judge whether this port type is special Charging port DCP type, and when this port type is DCP type, the charge protocol included by acquisition: high pass fills agreement soon QC2.0 and/or connection are sent out and are filled agreement PE+3.0 soon and/or connection is sent out and filled agreement PE+2.0 soon, and use with QC2.0 or PE+3.0 or Charging scheme corresponding for person PE+2.0 is charged.Use corresponding with port type by the port type of detection charger Mobile terminal is charged by charging modes, thus improves the service life of mobile terminal, additionally, also add mobile terminal Compatibility to different quick chargers (adapter), by different charger of arranging in pairs or groups can realize mobile terminal fast Speed charging.
Fig. 2 is the composition structural representation of a kind of charging device that the embodiment of the present invention provides, the most described device Including:
Type judging module 210, for obtaining the port type of charger, it is judged that whether described port type is SDP class Type or CDP type.
Concrete, charging device such as the equipment such as mobile phone, panel computer or PC by the USB port of charger and Charger is attached, and upon connection, detects charger port type under USB BC1.2 specification, and judge to detect Port type be whether standard down port SDP type or charging downlink port CDP type.Wherein, BC1.2 specification determines How each port should be enumerated to terminal unit, and identifies the agreement of port type.
It addition, the port type of USB BC1.2 specification is as shown in table 1, including SDP, CDP, DCP and other port class Type.
Concrete, as it is shown on figure 3, described type judging module 210 judges whether described port type is SDP type, bag Include:
First voltage acquisition unit 211, for obtaining the tertiary voltage of the positive signal D+ of differential lines and described differential lines The 4th voltage of negative signal D-, described tertiary voltage and described 4th voltage are to connect the voltage before described charger;
Described first voltage acquisition unit 211, is additionally operable to obtain the 5th voltage of positive signal D+ of differential lines and described 6th voltage of the negative signal D-of differential lines, after described 5th voltage and described 6th voltage are the described charger of connection Voltage;
First port determines unit 212, for being more than described 5th voltage and described 4th voltage at described tertiary voltage During more than described six voltage, determine that described port type is described SDP type.
In being embodied as, due on the positive signal line D+ and negative signal line D-line of the such port of SDP all Having 15k Ω pull down resistor, therefore when charging device is connected to SDP type charger, the D+ voltage of charging device is electrically charged device The pull down resistor of internal D+ signal drags down, and the D-voltage of charging device is also electrically charged the pull down resistor of the internal D-signal of device and drags down, I.e. detect when the D+ voltage within charging device and D-voltage all become after receiving charger when charging device (access device) Time low, determine that the port of this charger is SDP type.
In the present embodiment, obtain respectively connect charging device before charger D+ and D-voltage and connect charger it D+ and the D-voltage of rear charging device, compares D+ voltage before and after connection with D-voltage, it is judged that the D before connection the most respectively + voltage and D-voltage the most all diminish.
Concrete, as shown in Figure 4, described type judging module 210 judges whether described port type is CDP type, bag Include:
Second voltage acquisition unit 213, for obtaining the 7th voltage of the positive signal D+ of differential lines and described differential lines The 8th voltage of negative signal D-;
First level acquiring unit 214, for being more than tertiary voltage threshold value and described 8th voltage at described 7th voltage During more than four voltage thresholds, connect pull-up power supply and the draw power of described D+ of described D-, obtain the level of described D+;
Second port determines unit 215, for when the level of described D+ is low level, determines that described port type is CDP type.
In being embodied as, when charging device is connected to CDP type charger, first high because of the D+ signal level of charger In the D+ signal comparative level of charger, now CDP equipment turns on the power, and D-signal is driven high and electric higher than the judgement of D-signal Flat, now the port type of charger is identified as CDP type or DCP type;Then the pull-up of charging device D-signal is opened Power supply, i.e. maintaining D-signal is high level, disconnects the pull-up power supply of D+ signal, opens the draw power of D+ signal, now D simultaneously + signal will become low level, i.e. when detecting that charging device D+ signal is low level, determine that the port of this charger is CDP Type.
Wherein, the port of described charging downlink port (CDP) type had both supported large current charge, also supported completely compatible The data transmission of USB 2.0, and port has D+ with D-and communicate necessary 15k Ω pull down resistor, it may have charger detection The internal circuit of stage switching.
In the present embodiment, the D+ voltage in charging device and D-voltage after charging device acquisition connection charger, and point Do not compare with corresponding predetermined threshold value, when comparative result is both greater than corresponding predetermined threshold value, obtains and connecting D-'s Pull-up power supply and the level of D+ under the conditions of connecting the draw power of D+, and be low level at the level of this D+, determine described port Type is CDP type.
Charging module 220, for when described port type is described SDP type or described CDP type, uses described SDP type or predetermined current threshold corresponding to described CDP type are charged.
Concrete, described charging module 220 specifically for:
When described port type is described SDP type, the first predetermined current threshold is used to be charged;
When described port type is described CDP type, the second predetermined current threshold is used to be charged.
In being embodied as, for SDP type port charger, it is 2.5mA that the cut-off current of its correspondence is respectively when hanging up, Being 100mA during connection, connecting and being configured to during higher-wattage is 500mA, and described first predetermined current threshold can be 500mA; Described second predetermined current threshold can be 900mA.
Described type judging module 210, being additionally operable at described port type not for described SDP type and is not described CDP During type, it is judged that whether described port type is DCP type.
Concrete, as it is shown in figure 5, described type judging module 210 judges whether described port type is DCP type, bag Include:
Tertiary voltage acquiring unit 216, for obtaining first voltage of the positive signal D+ of differential lines and described differential lines Second voltage of negative signal D-;
Second electrical level acquiring unit 217, for being more than the first voltage threshold and described second voltage at described first voltage During more than the second voltage threshold, connect pull-up power supply and the draw power of described D+ of described D-, obtain the level of described D+;
3rd port determines unit 218, for when the level of described D+ is high level, determines that described port type is DCP type.
In being embodied as, when charging device is connected to DCP type charger, first high because of the D+ signal level of charger In the D+ signal comparative level of charger, and D+ Yu the D-signal of DCP type charging is short-circuit, and therefore D-signal is driven high and high In the decision level of D-signal, now the port type of charger is identified as DCP type or CDP type;Then charging is opened The pull-up power supply of device D-signal, i.e. maintaining D-signal is high level, disconnects the pull-up power supply of D+ signal, opens D+ signal simultaneously Draw power, now D+ signal will become high level, i.e. when detecting that charging device D+ signal is high level, determine that this fills The port of electrical equipment is DCP type.
Wherein, the port of described special charging port (DCP) type does not support that any data are transmitted, but can provide 1.5A Above electric current, is therefore usually used in supporting charger and onboard charger on the wall of relatively high charge ability, it is not necessary to enumerate.
In the present embodiment, the D+ voltage in charging device and D-voltage after charging device acquisition connection charger, and point Do not compare with corresponding predetermined threshold value, when comparative result is both greater than corresponding predetermined threshold value, obtains and connecting D-'s The level of D+ under the conditions of the draw power of pull-up power supply and connection D+, and when the level of this D+ is high level, determine described end Mouth type is DCP type.
Agreement acquisition module 230, for when described port type is described DCP type, obtains charge protocol.
Concrete, as shown in table 1, when port type is DCP type, support multiple charge protocol, obtain charging now Agreement, fills agreement QC2.0 soon, connection is sent out and filled agreement PE+3.0 soon and Lian Fa fills agreement PE+2.0 soon such as high pass.
Described charging module 220, is additionally operable to, when described charge protocol includes QC2.0, use corresponding the filling of described QC2.0 Electricity scheme is charged.
Concrete, it is a kind of fast charge protocol that high pass fills agreement QC2.0 soon, by the chip of protocol controller such as FP6600 can identify charger type automatically, adjusts the output voltage of charger, and the safety being allowed to obtain charger permission is the highest Charging voltage, saves the charging interval on the premise of protection charger.
Charging scheme corresponding for QC2.0 is: the charger that QC2.0 fills soon and the charging device holding wire D by USB interface + carry out communication, the output voltage of regulation QC2.0 with on-load voltage on D-.Concrete, when by charger (QC2.0 identification chip FP6600) end is when linking on charging device by data wire, and charger acquiescence allows D+ and D-short circuit, and charging device detects charging Device type is DCP type.Now output voltage is 5v, and charging device charges normal.If QC2.0 quick charge supported by charging device Agreement, then the hvdcp process of Android user's space will start, and starts to load the voltage of 0.325V on D+.When this electricity After pressure maintains 1.25s, charger will be switched off the short circuit of D+ and D-, and the voltage on D-will decline;Charging device detects on D- Voltage decline after, the value of hvdcp reading/sys/class/power_supply/usb/voltage_max, if 9000000 (mV), arranging the voltage on D+ is 3.3V, and the voltage on D-is 0.6V, charger output 9v voltage.If 5000000 (mV) arrange D+ be 0.6V, D-be 0V, charger output 5V voltage.
Described charging module 220, is additionally operable to, when described charge protocol includes PE+3.0, use described PE+3.0 corresponding Charging scheme or charging scheme corresponding to PE+2.0 are charged.
Concrete, connection is sent out and is filled charger support 5V/7V/9V 2A or 12V in the charging scheme that agreement PE+3.0 is corresponding soon The charging voltage of 1.5A and charging current, and self adaptation is adjustable.
Further, since agreement is all backward compatible, say, that when supporting PE+3.0, also support PE+2.0, therefore, when When charge protocol includes PE+3.0, the charging scheme of a kind of correspondence in PE+3.0 and PE+2.0 can be used to be charged.
Described charging module 220, is additionally operable to, when described charge protocol includes PE+2.0, use described PE+2.0 corresponding Charging scheme is charged.
Concrete, a kind of fast charge protocol of PE+2.0 Shi Lianfa company, the charging scheme that PE+2.0 is corresponding charges The output voltage values of device is that 3.6V, 3.8V, 4.0V, 4.2V, 4.4V, 4.6V, 4.8V, 5.0V, 7V, 9V, 12V self adaptation is adjustable, To ensure that, when charging, voltage floats and makes charging device be difficult to heating.
Optionally, as in figure 2 it is shown, described device also includes:
Attribute acquisition module 240, for when described charge protocol includes QC2.0, PE+3.0 and PE+2.0, obtains respectively The priority level taking the priority level attribute of described QC 2.0, the priority level attribute of described PE+3.0 and described PE+2.0 belongs to Property;
Described charging module 220, is additionally operable to use described QC2.0, described PE+3.0 and described PE+2.0 medium priority Other attribute preferably charge protocol is charged;
Wherein, at least one during described priority level attribute includes priority, detection duration or detection ordering.
Concrete, priority be computer time sharing system when processing multiple operation routine, determine each operation journey Sequence accepts the parameter of the priority level of system resource, if the biggest priority level of the parameter of priority level is high, then with QC2.0, PE+ Charging scheme corresponding to 3.0 agreements bigger with the parameter of the priority level in PE+2.0 is charged;If the detection time is short excellent First rank is high, then fill with the charging scheme that the agreement that QC2.0, PE+3.0 are shorter with the detection time in PE+2.0 is corresponding Electricity;If the preferential priority level of detection ordering is high, then corresponding with the agreement that first detects in QC2.0, PE+3.0 and PE+2.0 Charging scheme is charged.
In embodiments of the present invention, first determine whether the port type of charger be whether standard down port SDP type or Person charges downlink port CDP type, if described SDP type or CDP type, then uses SDP type or CDP type corresponding Predetermined current threshold be charged;If not SDP type and be not CDP type, then judge whether this port type is special Charging port DCP type, and when this port type is DCP type, the charge protocol included by acquisition: high pass fills agreement soon QC2.0 and/or connection are sent out and are filled agreement PE+3.0 soon and/or connection is sent out and filled agreement PE+2.0 soon, and use with QC2.0 or PE+3.0 or Charging scheme corresponding for person PE+2.0 is charged.Use corresponding with port type by the port type of detection charger Mobile terminal is charged by charging modes, thus improves the service life of mobile terminal, additionally, also add mobile terminal Compatibility to different quick chargers (adapter), by different charger of arranging in pairs or groups can realize mobile terminal fast Speed charging.
Fig. 6 illustrates a kind of computer system based on von Neumann system 10 running above-mentioned charging method.This calculating Machine system 10 can be smart mobile phone, panel computer, palm PC, the subscriber terminal equipment such as notebook computer or PC. Concrete, it may include the outer input interface 1001, processor 1002, memorizer 1003 and the output that are connected by system bus are connect Mouth 1004.Wherein, outer input interface 1001 can include touch screen 10016, optionally can also include network interface 10018. Memorizer 1003 can include external memory 10032 (such as hard disk, CD or floppy disk etc.) and built-in storage 10034.Output interface 1004 can include the equipment such as display screen 10042 and sound equipment/loudspeaker 10044.
In the present embodiment, the operation of this method is stored in based on computer program, the program file of this computer program In the external memory 10032 of aforementioned computer system based on von Neumann system 10, operationally it is loaded into built-in storage In 10034, it is transferred to after being then compiled as machine code in processor 1002 perform, so that based on von Neumann system Computer system 10 in form type judging module 210 in logic, charging module 220, agreement acquisition module 230 and attribute Acquisition module 240, and during above-mentioned charging method performs, the parameter of input is all received by outer input interface 1001, And it is transferred in memorizer 1003 caching, it is then input in processor 1002 process, the result data of process or caching Subsequently process in memorizer 1003, or be passed to output interface 1004 and export.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, be permissible Instructing relevant hardware by computer program to complete, described program can be stored in a computer read/write memory medium In, this program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic Dish, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc..
The above disclosed present pre-ferred embodiments that is only, can not limit the right model of the present invention with this certainly Enclose, the equivalent variations therefore made according to the claims in the present invention, still belong to the scope that the present invention is contained.

Claims (12)

1. a charging method, it is characterised in that including:
Obtain the port type of charger, it is judged that whether described port type is under standard down port SDP type or charging Row port CDP type;
If described port type is described SDP type or described CDP type, then use described SDP type or described CDP class The predetermined current threshold that type is corresponding is charged;
If described port type is not described SDP type and is not described CDP type, then judge whether described port type is special By charging port DCP type;
When described port type is described DCP type, obtain charge protocol;
When described charge protocol includes that high pass fills agreement QC2.0 soon, charging scheme corresponding for described QC+2.0 is used to fill Electricity;
When described charge protocol includes that connection fills agreement PE+3.0 soon, use charging scheme corresponding for described PE+3.0 or PE The charging scheme of+2.0 correspondences is charged;
When described charge protocol includes that connection fills agreement PE+2.0 soon, charging scheme corresponding for described PE+2.0 is used to fill Electricity.
2. the method for claim 1, it is characterised in that if described port type is described SDP type or institute State CDP type, then use described SDP type or predetermined current threshold corresponding to described CDP type to be charged, including:
When described port type is described SDP type, the first predetermined current threshold is used to be charged;
When described port type is described CDP type, the second predetermined current threshold is used to be charged.
3. the method for claim 1, it is characterised in that described judge whether described port type is standard down port SDP type, including:
Obtain the tertiary voltage of positive signal D+ of differential lines and the 4th voltage of the negative signal D-of described differential lines, described the Three voltages and described 4th voltage are to connect the voltage before described charger;
Obtain the 5th voltage of positive signal D+ of differential lines and the 6th voltage of the negative signal D-of described differential lines, described the Five voltages and described 6th voltage are to connect the voltage after described charger;
When described tertiary voltage is more than described six voltage more than described 5th voltage and described 4th voltage, determine described end Mouth type is described SDP type.
4. the method for claim 1, it is characterised in that described judge that whether described port type is charging downlink port CDP type, including:
Obtain the 7th voltage of the positive signal D+ of differential lines and the 8th voltage of the negative signal D-of described differential lines;
When described 7th voltage is more than four voltage thresholds more than tertiary voltage threshold value and described 8th voltage, connect described D- Pull-up power supply and the draw power of described D+, obtain the level of described D+;
If the level of described D+ is low level, it is determined that described port type is CDP type.
5. the method for claim 1, it is characterised in that described judge whether described port type is special charging port DCP type, including:
Obtain first voltage of the positive signal D+ of differential lines and second voltage of the negative signal D-of described differential lines;
When described first voltage is more than the second voltage threshold more than the first voltage threshold and described second voltage, connect described D- Pull-up power supply and the draw power of described D+, obtain the level of described D+;
If the level of described D+ is high level, it is determined that described port type is DCP type.
6. the method for claim 1, it is characterised in that described method also includes:
Fill agreement QC2.0 soon when described charge protocol includes high pass, connection fills agreement PE+3.0 soon and connection is sent out and filled agreement PE+ soon When 2.0, obtain the priority level attribute of described QC2.0, the priority level attribute of described PE+3.0 and described PE+2.0 respectively Priority level attribute;
Described QC2.0, described PE+3.0 and described PE+2.0 medium priority other attribute preferably charge protocol is used to fill Electricity;
Wherein, at least one during described priority level attribute includes priority, detection duration or detection ordering.
7. a charging device, it is characterised in that including:
Type judging module, for obtaining the port type of charger, it is judged that described port type be whether SDP type or CDP type;
Charging module, for when described port type is described SDP type or described CDP type, uses described SDP type Or predetermined current threshold corresponding to described CDP type is charged;
Described type judging module, be additionally operable to described port type for described SDP type and not for described CDP type time, Judge whether described port type is DCP type;
Agreement acquisition module, for when described port type is described DCP type, obtains charge protocol;
Described charging module, is additionally operable to, when described charge protocol includes QC2.0, use charging scheme corresponding for described QC2.0 It is charged;
Described charging module, is additionally operable to, when described charge protocol includes PE+3.0, use described charging side corresponding for PE+3.0 Case or charging scheme corresponding to PE+2.0 are charged;
Described charging module, is additionally operable to, when described charge protocol includes PE+2.0, use described charging side corresponding for PE+2.0 Case is charged.
8. device as claimed in claim 7, it is characterised in that described charging module specifically for:
When described port type is described SDP type, the first predetermined current threshold is used to be charged;
When described port type is described CDP type, the second predetermined current threshold is used to be charged.
9. device as claimed in claim 7, it is characterised in that described type judging module judges that whether described port type is SDP type, including:
First voltage acquisition unit, the negative pole letter of tertiary voltage and described differential lines for obtaining the positive signal D+ of differential lines 4th voltage of number D-, described tertiary voltage and described 4th voltage are to connect the voltage before described charger;
Described first voltage acquisition unit, is additionally operable to obtain the 5th voltage of positive signal D+ of differential lines and described differential lines 6th voltage of negative signal D-, described 5th voltage and described 6th voltage are to connect the voltage after described charger;
First port determines unit, for being more than described at described tertiary voltage more than described 5th voltage and described 4th voltage During six voltage, determine that described port type is described SDP type.
10. device as claimed in claim 7, it is characterised in that whether described type judging module judges described port type For CDP type, including:
Second voltage acquisition unit, the negative pole letter of the 7th voltage and described differential lines for obtaining the positive signal D+ of differential lines 8th voltage of number D-;
First level acquiring unit, for being more than the 4th at described 7th voltage more than tertiary voltage threshold value and described 8th voltage During voltage threshold, connect pull-up power supply and the draw power of described D+ of described D-, obtain the level of described D+;
Second port determines unit, for when the level of described D+ is low level, determines that described port type is CDP type.
11. devices as claimed in claim 7, it is characterised in that whether described type judging module judges described port type For DCP type, including:
Tertiary voltage acquiring unit, the negative pole letter of the first voltage and described differential lines for obtaining the positive signal D+ of differential lines Second voltage of number D-;
Second electrical level acquiring unit, for being more than second at described first voltage more than the first voltage threshold and described second voltage During voltage threshold, connect pull-up power supply and the draw power of described D+ of described D-, obtain the level of described D+;
3rd port determines unit, for when the level of described D+ is high level, determines that described port type is DCP type.
12. devices as claimed in claim 7, it is characterised in that described device also includes:
Attribute acquisition module, for when described charge protocol includes QC2.0, PE+3.0 and PE+2.0, obtains described respectively The priority level attribute of QC 2.0, the priority level attribute of described PE+3.0 and the priority level attribute of described PE+2.0;
Described charging module, is additionally operable to use described QC2.0, described PE+3.0 and the other attribute of described PE+2.0 medium priority relatively Excellent charge protocol is charged;
Wherein, at least one during described priority level attribute includes priority, detection duration or detection ordering.
CN201610797341.5A 2016-08-31 2016-08-31 A kind of charging method and device Active CN106329629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610797341.5A CN106329629B (en) 2016-08-31 2016-08-31 A kind of charging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610797341.5A CN106329629B (en) 2016-08-31 2016-08-31 A kind of charging method and device

Publications (2)

Publication Number Publication Date
CN106329629A true CN106329629A (en) 2017-01-11
CN106329629B CN106329629B (en) 2019-06-11

Family

ID=57787145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610797341.5A Active CN106329629B (en) 2016-08-31 2016-08-31 A kind of charging method and device

Country Status (1)

Country Link
CN (1) CN106329629B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025173A (en) * 2009-09-10 2011-04-20 美国博通公司 Method and system for distinguishing between charging ports
CN102156524A (en) * 2011-02-11 2011-08-17 威盛电子股份有限公司 Adaptive universal serial bus charging method and system
CN102684270A (en) * 2012-05-31 2012-09-19 华为技术有限公司 Method for identifying type of universal serial bus (USB) chargers and USB device
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof
US20140223200A1 (en) * 2013-02-01 2014-08-07 Broadcom Corporation Charger detection and optimization prior to host control
CN103986217A (en) * 2014-05-30 2014-08-13 深圳市中兴移动通信有限公司 Charger outputting different voltages in self-adaptation mode and implementation method thereof
CN104756350A (en) * 2012-10-29 2015-07-01 高通股份有限公司 High voltage dedicated charging port
CN105723297A (en) * 2013-11-18 2016-06-29 高通股份有限公司 Devices and methods for facilitating usb charger detection
CN105896679A (en) * 2016-05-31 2016-08-24 合肥联宝信息技术有限公司 Charging control method and electronic equipment employing same

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025173A (en) * 2009-09-10 2011-04-20 美国博通公司 Method and system for distinguishing between charging ports
CN102156524A (en) * 2011-02-11 2011-08-17 威盛电子股份有限公司 Adaptive universal serial bus charging method and system
CN102684270A (en) * 2012-05-31 2012-09-19 华为技术有限公司 Method for identifying type of universal serial bus (USB) chargers and USB device
CN104756350A (en) * 2012-10-29 2015-07-01 高通股份有限公司 High voltage dedicated charging port
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof
US20140223200A1 (en) * 2013-02-01 2014-08-07 Broadcom Corporation Charger detection and optimization prior to host control
CN105723297A (en) * 2013-11-18 2016-06-29 高通股份有限公司 Devices and methods for facilitating usb charger detection
CN103986217A (en) * 2014-05-30 2014-08-13 深圳市中兴移动通信有限公司 Charger outputting different voltages in self-adaptation mode and implementation method thereof
CN105896679A (en) * 2016-05-31 2016-08-24 合肥联宝信息技术有限公司 Charging control method and electronic equipment employing same

Also Published As

Publication number Publication date
CN106329629B (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN106329627A (en) Charging method and device
CN106230070A (en) A kind of charging method and device
CN102684270B (en) Method for identifying type of universal serial bus (USB) chargers and USB device
CN103080868B (en) Charging port
CN102393837B (en) USB charger recognition device and method
CN106329630A (en) Charging method and device
CN104756350B (en) High voltage special charging port
JP5388484B2 (en) Apparatus and method for detecting power supply
CN103208661A (en) Intelligent terminal and method for carrying out large-current charging
CN203800642U (en) Charging Po and charging system
CN108988431B (en) Multi-protocol charging device and multi-protocol charging method
CN103618356B (en) The charging system of a kind of mobile terminal and charging method thereof
CN103427460A (en) Power supply terminal, charge control method and charge control device
CN104617615B (en) Charging method and electronic equipment
CN201813422U (en) Charging chip and mobile terminal capable of automatically adjusting charging mode
CN103326078A (en) Mobile device charging method and system
CN101783427A (en) Intelligent charging method and intelligent charging device of terminal
CN106356918A (en) Quick charge recognition method and terminal equipment
CN203722283U (en) Charging cable and charging system
CN103683384A (en) Host apparatus and charging method thereof
CN206099469U (en) USB OTG mobile device reading and writing charging device
CN106329625A (en) Charging method and device
CN105048018B (en) The charging method and device of a kind of terminal with data exchanging function
CN106329628A (en) Charging method and device
CN105429217B (en) A kind of method for identifying the system of charger and its identifying charger

Legal Events

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