patents.google.com

CN106300533B - A kind of charging method and device - Google Patents

  • ️Tue Jun 11 2019

CN106300533B - A kind of charging method and device - Google Patents

A kind of charging method and device Download PDF

Info

Publication number
CN106300533B
CN106300533B CN201610796152.6A CN201610796152A CN106300533B CN 106300533 B CN106300533 B CN 106300533B CN 201610796152 A CN201610796152 A CN 201610796152A CN 106300533 B CN106300533 B CN 106300533B Authority
CN
China
Prior art keywords
type
voltage
port
charging
cdp
Prior art date
2016-08-31
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.)
Active
Application number
CN201610796152.6A
Other languages
Chinese (zh)
Other versions
CN106300533A (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.)
2016-08-31
Filing date
2016-08-31
Publication date
2019-06-11
2016-08-31 Application filed by Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
2016-08-31 Priority to CN201610796152.6A priority Critical patent/CN106300533B/en
2017-01-04 Publication of CN106300533A publication Critical patent/CN106300533A/en
2019-06-11 Application granted granted Critical
2019-06-11 Publication of CN106300533B publication Critical patent/CN106300533B/en
Status Active legal-status Critical Current
2036-08-31 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The embodiment of the invention discloses a kind of charging method and device, method includes: the port type for obtaining charger, judges whether port type is standard down port SDP type or charging downlink port CDP type;If port type is SDP type or CDP type, charged using SDP type or the corresponding predetermined current threshold of CDP type;If the port type is not the SDP type and is not the CDP type, judge whether the port type is special charging port DCP type;When the port type is the DCP type, charge protocol is obtained;When the charge protocol includes connection hair fast charge agreement PE+2.0, charged using the corresponding charging scheme of the PE+2.0;When the charge protocol includes qualcomm quick charge agreement QC2.0, charged using the corresponding charging scheme of the QC2.0.Using the present invention, the port type by detecting charger charges to mobile terminal using charging modes corresponding with port type, to improve the service life of mobile terminal.

Description

A kind of charging method and device

Technical field

The present invention relates to field of computer technology more particularly to a kind of charging method and devices.

Background technique

With the development of mobile terminal technology, the function of the mobile terminals such as mobile phone, tablet computer is more and more, gradually at For essential a part in people's work and life.

However, increasing with mobile terminal function, power consumption is also with increase, it usually needs using charger to it It charges.In existing charging technique, when mobile terminal access charger after, charger to the mobile terminal accessed all It is charged using fixed charging modes, such as high constant-voltage charge, the lesser mobile terminal of charging voltage will be generated in this way Certain influence, to reduce the service life of mobile terminal.

Summary of the invention

The technical problem to be solved by the embodiment of the invention is that providing a kind of charging method and device, filled by detection The port type of electric appliance and charged using charging modes corresponding with port type to mobile terminal, to improve movement The service life of terminal.

In order to solve the above-mentioned technical problem, the embodiment of the invention provides a kind of charging methods, which comprises

The port type for obtaining charger, judges whether the port type is standard down port SDP type or fills Electric downlink port CDP type;

If the port type is the SDP type or the CDP type, the SDP type or described is used The corresponding predetermined current threshold of CDP type charges;

If the port type is not the SDP type and is not the CDP type, whether the port type is judged For special charging port DCP type;

When the port type is the DCP type, charge protocol is obtained;

When the charge protocol include connection hair fast charge agreement PE+2.0 when, using the corresponding charging scheme of the PE+2.0 into Row charging;

When the charge protocol includes qualcomm quick charge agreement QC2.0, carried out using the corresponding charging scheme of the QC2.0 Charging.

Correspondingly, the embodiment of the invention also provides a kind of charging unit, described device includes:

Type judging module, for obtaining the port type of charger, judge the port type whether be SDP type or Person's CDP type;

Charging module is used for when the port type is the SDP type or the CDP type, using the SDP Type or the corresponding predetermined current threshold of the CDP type charge;

The type judging module is also used to not be the SDP type in the port type and be not the CDP type When, judge whether the port type is DCP type;

Agreement obtains module, for obtaining charge protocol when the port type is the DCP type;

The charging module is also used to fill when the charge protocol includes PE+2.0 using the PE+2.0 is corresponding Electric scheme charges;

The charging module is also used to when the charge protocol includes QC2.0, using the corresponding charging of the QC2.0 Scheme charges.

In embodiments of the present invention, first determine whether charger port type whether be standard down port SDP type or Person's charging downlink port CDP type, if the SDP type, perhaps CDP type is then corresponding using SDP type or CDP type Predetermined current threshold charge;If not SDP type and be not CDP type, then judge whether the port type is dedicated Charging port DCP type, and when the port type is DCP type, obtain included charge protocol connection hair fast charge agreement PE+ 2.0 and/or qualcomm quick charge agreement QC2.0, and charged using charging scheme corresponding with QC2.0 or PE+2.0.Pass through It detects the port type of charger and is charged using charging modes corresponding with port type to mobile terminal, to improve The service life of mobile terminal is led in addition, also adding mobile terminal to the compatibility of different quick chargers (adapter) Quick charge to mobile terminal can be realized by crossing different charger of arranging in pairs or groups.

Detailed description of the invention

In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.

Fig. 1 is the flow diagram of one of embodiment of the present invention charging method;

Fig. 2 is the structural schematic diagram of one of embodiment of the present invention charging unit;

Fig. 3 is the structural schematic diagram of the type judging module of charging unit in the embodiment of the present invention;

Fig. 4 is the structural schematic diagram of the type judging module of charging unit in another embodiment of the present invention;

Fig. 5 is the structural schematic diagram of the type judging module of charging unit in another embodiment of the present invention;

Fig. 6 is a kind of architecture diagram for the computer system for executing above-mentioned charging method in the embodiment of the present invention.

Specific embodiment

Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.

Term " includes " in description and claims of this specification and above-mentioned attached drawing and " having " and they appoint What is deformed, it is intended that is covered and non-exclusive is included.Such as contain the process, method, system, production of a series of steps or units Product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or unit, or Optionally further comprising other step or units intrinsic for these process, methods, product or equipment.

The execution of charging method as mentioned in the embodiments of the present invention depends on computer program, can run on Feng Ruoyiman body On the computer system of system.The computer program can be run based on charging unit.The charging unit can be PC, put down The mobile terminal devices such as plate computer, laptop, smart phone, intelligent wearable device.

It is described in detail separately below.

Fig. 1 is that a kind of flow diagram of charging method, the method as shown in the figure include at least in the embodiment of the present invention:

Step S101 obtains the port type of charger, judges whether the port type is standard down port SDP class Type or charging downlink port CDP type.

Specifically, the general serial that the charging unit such as equipment such as mobile phone, tablet computer or PC pass through charger The port bus (Universal Serial Bus, USB) is attached with charger, and upon connection, detects charger in USB Port type under battery charging specifications (USB Charging 1.2, BC1.2) specification, and judge that the port type detected is No is standard down port (Service Design Package, SDP) type or charging downlink port (Charging Downstream Port, CDP) type.Wherein, BC1.2 specification has determined how each port should enumerate to terminal device, with And the agreement of identification port type.

In 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 types.

Table 1

Judge whether the port type is standard down port SDP type specifically, described, comprising:

Obtain the 4th voltage of the tertiary voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines, institute It states tertiary voltage and the 4th voltage is the voltage before connecting the charger;

Obtain the 6th voltage of the 5th voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines, institute It states the 5th voltage and the 6th voltage is the voltage after the connection charger;

When the tertiary voltage is greater than the 5th voltage and the 4th voltage is greater than six voltage, institute is determined Stating port type is the SDP type.

In specific implementation, due to the positive signal line (Data+, D+) and negative signal line in the such port SDP All there is 15k Ω pull down resistor, therefore when charging unit is connected to SDP type charger on (Data-, D-) line, charging unit D+ voltage be electrically charged the pull down resistor of D+ signal inside device and drag down, the D- voltage of charging unit is also electrically charged D- signal inside device Pull down resistor drag down, i.e., when charging unit (access device) detects that D+ voltage and D- voltage inside charging unit are connecing When being all lower after to charger, determine that the port of the charger is SDP type.

In the present embodiment, respectively obtain connection charger before charging unit D+ and D- voltage and connection charger it Then connection front and back D+ voltage is compared, the D before judging connection by D+ the and D- voltage of charging unit afterwards with D- voltage respectively Whether+voltage and D- voltage all become smaller.

Judge whether the port type is charging downlink port CDP type specifically, described, comprising:

Obtain the 8th voltage of the 7th voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines;

When the 7th voltage is greater than tertiary voltage threshold value and the 8th voltage is greater than four voltage thresholds, institute is connected The pull-up power supply of D- and the draw power of the D+ are stated, the level of the D+ is obtained;

If the level of the D+ is low level, it is determined that the port type is CDP type.

In specific implementation, when charging unit is connected to CDP type charger, first because the D+ signal level of charging equipment is high In the D+ signal comparative level of charger, CDP equipment opens power supply at this time, and D- signal is raised and is higher than the judgement electricity of D- signal Flat, the port type of charger is identified as CDP type or DCP type at this time;Then the pull-up of charging unit D- signal is opened Power supply, i.e. maintenance D- signal are high level, disconnect the pull-up power supply of D+ signal, open simultaneously the draw power of D+ signal, at this time D + signal will become low level, i.e., when detecting charging unit D+ signal is low level, determine that the port of the charger is CDP Type.

Wherein, large current charge is both supported in the port of described charging downlink port (CDP) type, also supports completely compatible The data of USB 2.0 are transmitted, and there is D+ and D- to communicate necessary 15k Ω pull down resistor for port, it may have charger detection The internal circuit of stage switching.

In the present embodiment, the D+ voltage and D- voltage after charging unit acquisition connection charger in charging unit, and point It is not compared with corresponding preset threshold, when comparison result is both greater than corresponding preset threshold, obtains connection D-'s The level of D+ under the conditions of pull-up power supply and the draw power of connection D+, and be low level in the level of the D+, determine the port Type is CDP type.

Step S102 uses the SDP type if the port type is the SDP type or the CDP type Or the corresponding predetermined current threshold of the CDP type charges.

Specifically, being charged when the port type is the SDP type using the first predetermined current threshold.It is right In SDP type port charger, corresponding cut-off current be respectively be 2.5mA when hanging up, when connection is 100mA, connects and matches It is 500mA when being set to higher-wattage, first predetermined current threshold can be 500mA.

It when the port type is the CDP type, is charged using the second predetermined current threshold, described second is pre- If current threshold can be 900mA.

Step S103 judges the end if the port type is not the SDP type and is not the CDP type Whether mouth type is special charging port DCP type.

Judge whether the port type is special charging port DCP type specifically, described, comprising:

Obtain the second voltage of the first voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines;

When the first voltage is greater than first voltage threshold value and the second voltage is greater than second voltage threshold value, institute is connected The pull-up power supply of D- and the draw power of the D+ are stated, the level of the D+ is obtained;

If the level of the D+ is high level, it is determined that the port type is DCP type.

In specific implementation, when charging unit is connected to DCP type charger, first because the D+ signal level of charging equipment is high In the D+ signal comparative level of charger, and the D+ and D- signal of the charging of DCP type are short-circuit, therefore D- signal is raised and height In the decision level of D- signal, the port type of charger is identified as DCP type or CDP type at this time;Then charging is opened The pull-up power supply of device D- signal, i.e. maintenance D- signal are high level, disconnect the pull-up power supply of D+ signal, open simultaneously D+ signal Draw power, D+ signal will become high level at this time, i.e., when detect charging unit D+ signal be high level when, determine that this is filled The port of electric appliance is DCP type.

Wherein, the port of special charging port (DCP) type does not support any data to transmit, but is capable of providing 1.5A Above electric current, therefore be usually used in supporting charger and onboard charger on the wall compared with high charge ability, without enumerating.

In the present embodiment, the D+ voltage and D- voltage after charging unit acquisition connection charger in charging unit, and point It is not compared with corresponding preset threshold, when comparison result is both greater than corresponding preset threshold, obtains connection D-'s The level of D+ under the conditions of pull-up power supply and the draw power of connection D+, and when the level of the D+ is high level, determine the end Mouth type is DCP type.

Step S104 obtains charge protocol when the port type is the DCP type.

Specifically, as shown in table 1, when port type is DCP type, supporting a variety of charge protocols, obtaining charging at this time Agreement, such as connection hair fast charge agreement (Pump Express Plus 2.0, PE+2.0) and qualcomm quick charge agreement (Quick Charge 2.0, QC2.0).

Step S105, it is corresponding using the PE+2.0 when the charge protocol includes connection hair fast charge agreement PE+2.0 Charging scheme charges.

Specifically, PE+2.0 is a kind of fast charge protocol of Lian Fa company, charge in the corresponding charging scheme of PE+2.0 The output voltage values of device are that 3.6V, 3.8V, 4.0V, 4.2V, 4.4V, 4.6V, 4.8V, 5.0V, 7V, 9V, 12V are adaptively adjustable, To guarantee that, in charging, voltage floats and charging unit is made to be not easy to generate heat.

Step S106 is filled when the charge protocol includes qualcomm quick charge agreement QC2.0 using the QC2.0 is corresponding Electric scheme charges.

Specifically, qualcomm quick charge agreement QC2.0 is a kind of fast charge protocol, such as by the chip of protocol controller FP6600 can automatic identification charger type, adjust the output voltage of charger, be allowed to obtain the safe highest of charger permission Charging voltage saves the charging time under the premise of protecting charger.

The corresponding charging scheme of QC2.0 are as follows: the charger and charging unit of QC2.0 fast charge pass through the signal wire D of USB interface + and D- on on-load voltage communicated, adjust the output voltage of QC2.0.Specifically, working as charger (QC2.0 identification chip FP6600 when) end is connected on charging unit by data line, charger default allows D+ and D- to be shorted, and charging unit detects charging Device type is DCP type.Output voltage is 5v at this time, and charging unit charges normal.If charging unit supports QC2.0 quick charge Agreement, then the hvdcp process of Android user's space will will start, and start the voltage that 0.325V is loaded 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 unit detects on D- Voltage decline after, hvdcp reading/sys/class/power_supply/usb/voltage_max value, if it is 9000000 (mV), the voltage being arranged on D+ are 3.3V, and the voltage on D- is 0.6V, and charger exports 9v voltage.If It is 0.6V, D- 0V, charger output 5V voltage that D+, which is arranged, in 5000000 (mV).

Optionally, the method also includes:

When the charge protocol includes connection hair fast charge agreement PE+2.0 and qualcomm quick charge agreement QC2.0, institute is obtained respectively State the priority level attribute of PE+2.0 and the priority level attribute of the QC2.0;

It is charged using priority level attribute preferably charge protocol in the PE+2.0 and the QC2.0;

Wherein, the priority level attribute includes priority, detection at least one of duration or detection ordering.

Specifically, priority is computer time sharing system when handling multiple operation procedures, each operation journey is determined Sequence receives the parameter of the priority level of system resource, if the bigger priority level of the parameter of priority level is high, with QC2.0 and PE+ The corresponding charging scheme of the biggish agreement of the parameter of priority level in 2.0 charges;If the short priority level of detection time is high, Then charged with the corresponding charging scheme of the shorter agreement of the detection time in QC2.0 and PE+2.0;If detection ordering is preferential Priority level it is high, then charged with the corresponding charging scheme of agreement first detected in QC2.0 and PE+2.0.

In embodiments of the present invention, first determine whether charger port type whether be standard down port SDP type or Person's charging downlink port CDP type, if the SDP type, perhaps CDP type is then corresponding using SDP type or CDP type Predetermined current threshold charge;If not SDP type and be not CDP type, then judge whether the port type is dedicated Charging port DCP type, and when the port type is DCP type, obtain included charge protocol connection hair fast charge agreement PE+ 2.0 and/or qualcomm quick charge agreement QC2.0, and charged using charging scheme corresponding with QC2.0 or PE+2.0.Pass through It detects the port type of charger and is charged using charging modes corresponding with port type to mobile terminal, to improve The service life of mobile terminal is led in addition, also adding mobile terminal to the compatibility of different quick chargers (adapter) Quick charge to mobile terminal can be realized by crossing different charger of arranging in pairs or groups.

Fig. 2 is a kind of composed structure schematic diagram of charging unit provided in an embodiment of the present invention, described device as shown in the figure Include:

Type judging module 210 judges whether the port type is SDP class for obtaining the port type of charger Type or CDP type.

Specifically, the charging unit such as equipment such as mobile phone, tablet computer or PC by the USB port of charger with Charger is attached, and upon connection, port type of the detection charger under USB BC1.2 specification, and judges to detect Port type whether be standard down port SDP type or charging downlink port CDP type.Wherein, BC1.2 specification determines How each port should enumerate to terminal device, and the agreement of identification port type.

In addition, the port type of USB BC1.2 specification is as shown in table 1, including SDP, CDP, DCP and other ports class Type.

Specifically, as shown in figure 3, the type judging module 210 judges whether the port type is standard down end Mouth SDP type, comprising:

First voltage acquiring unit 211, for obtain the positive signal D+ of differential lines tertiary voltage and the differential lines Negative signal D- the 4th voltage, the tertiary voltage and the 4th voltage be the connection charger before voltage;

The first voltage acquiring unit 211 is also used to obtain the 5th voltage of the positive signal D+ of differential lines and described The 6th voltage of the negative signal D- of differential lines, the 5th voltage and the 6th voltage are after connecting the charger Voltage;

First port determination unit 212, for being greater than the 5th voltage and the 4th voltage in the tertiary voltage When greater than six voltage, determine that the port type is the SDP type.

In specific implementation, due on the positive signal line D+ of the such port SDP and negative signal line D- line all With 15k Ω pull down resistor, therefore when charging unit is connected to SDP type charger, the D+ voltage of charging unit is electrically charged device The pull down resistor of internal D+ signal drags down, and the pull down resistor that the D- voltage of charging unit is also electrically charged D- signal inside device drags down, I.e. when charging unit (access device) detects that D+ voltage and D- voltage inside charging unit all become after being connected to charger When low, determine that the port of the charger is SDP type.

In the present embodiment, respectively obtain connection charger before charging unit D+ and D- voltage and connection charger it Then connection front and back D+ voltage is compared, the D before judging connection by D+ the and D- voltage of charging unit afterwards with D- voltage respectively Whether+voltage and D- voltage all become smaller.

Specifically, as shown in figure 4, the type judging module 210 judges whether the port type is charging downstream end Mouth CDP type, comprising:

Second voltage acquiring unit 213, for obtain the positive signal D+ of differential lines the 7th voltage and the differential lines Negative signal D- the 8th voltage;

First level acquiring unit 214, for being greater than tertiary voltage threshold value and the 8th voltage in the 7th voltage When greater than four voltage thresholds, the pull-up power supply of the D- and the draw power of the D+ are connected, the level of the D+ is obtained;

Second port determination unit 215, for the level in the D+ be low level when, determine that the port type is CDP type.

In specific implementation, when charging unit is connected to CDP type charger, first because the D+ signal level of charging equipment is high In the D+ signal comparative level of charger, CDP equipment opens power supply at this time, and D- signal is raised and is higher than the judgement electricity of D- signal Flat, the port type of charger is identified as CDP type or DCP type at this time;Then the pull-up of charging unit D- signal is opened Power supply, i.e. maintenance D- signal are high level, disconnect the pull-up power supply of D+ signal, open simultaneously the draw power of D+ signal, at this time D + signal will become low level, i.e., when detecting charging unit D+ signal is low level, determine that the port of the charger is CDP Type.

Wherein, large current charge is both supported in the port of described charging downlink port (CDP) type, also supports completely compatible The data of USB 2.0 are transmitted, and there is D+ and D- to communicate necessary 15k Ω pull down resistor for port, it may have charger detection The internal circuit of stage switching.

In the present embodiment, the D+ voltage and D- voltage after charging unit acquisition connection charger in charging unit, and point It is not compared with corresponding preset threshold, when comparison result is both greater than corresponding preset threshold, obtains connection D-'s The level of D+ under the conditions of pull-up power supply and the draw power of connection D+, and be low level in the level of the D+, determine the port Type is CDP type.

Charging module 220 is used for when the port type is the SDP type or the CDP type, using described SDP type or the corresponding predetermined current threshold of the CDP type charge.

Specifically, the charging module 220 is specifically used for:

When the port type is the SDP type, charged using the first predetermined current threshold;

When the port type is the CDP type, charged using the second predetermined current threshold.

In specific implementation, for SDP type port charger, it is 2.5mA that corresponding cut-off current, which is respectively when hanging up, It is 100mA when connection, is 500mA when connecting and being configured to higher-wattage, first predetermined current threshold can be 500mA; Second predetermined current threshold can be 900mA.

The type judging module 210 is also used to not be the SDP type in the port type and be not the CDP When type, judge whether the port type is special charging port DCP type.

Specifically, as shown in figure 5, the type judging module 210 judges whether the port type is DCP type, packet It includes:

Tertiary voltage acquiring unit 216, for obtaining the first voltage and the differential lines of the positive signal D+ of differential lines Negative signal D- second voltage;

Second electrical level acquiring unit 217, for being greater than first voltage threshold value and the second voltage in the first voltage When greater than second voltage threshold value, the pull-up power supply of the D- and the draw power of the D+ are connected, the level of the D+ is obtained;

Third port determination unit 218, for the level in the D+ be high level when, determine that the port type is DCP type.

In specific implementation, when charging unit is connected to DCP type charger, first because the D+ signal level of charging equipment is high In the D+ signal comparative level of charger, and the D+ and D- signal of the charging of DCP type are short-circuit, therefore D- signal is raised and height In the decision level of D- signal, the port type of charger is identified as DCP type or CDP type at this time;Then charging is opened The pull-up power supply of device D- signal, i.e. maintenance D- signal are high level, disconnect the pull-up power supply of D+ signal, open simultaneously D+ signal Draw power, D+ signal will become high level at this time, i.e., when detect charging unit D+ signal be high level when, determine that this is filled The port of electric appliance is DCP type.

Wherein, the port of special charging port (DCP) type does not support any data to transmit, but is capable of providing 1.5A Above electric current, therefore be usually used in supporting charger and onboard charger on the wall compared with high charge ability, without enumerating.

In the present embodiment, the D+ voltage and D- voltage after charging unit acquisition connection charger in charging unit, and point It is not compared with corresponding preset threshold, when comparison result is both greater than corresponding preset threshold, obtains connection D-'s The level of D+ under the conditions of pull-up power supply and the draw power of connection D+, and when the level of the D+ is high level, determine the end Mouth type is DCP type.

Agreement obtains module 230, for obtaining charge protocol when the port type is the DCP type.

Specifically, as shown in table 1, when port type is DCP type, supporting a variety of charge protocols, obtaining charging at this time Agreement, such as connection hair fast charge agreement PE+2.0 and qualcomm quick charge agreement QC2.0.

The charging module 220 is also used to when the charge protocol includes connection hair fast charge agreement PE+2.0, using described The corresponding charging scheme of PE+2.0 charges.

Specifically, PE+2.0 is a kind of fast charge protocol of Lian Fa company, charge in the corresponding charging scheme of PE+2.0 The output voltage values of device are that 3.6V, 3.8V, 4.0V, 4.2V, 4.4V, 4.6V, 4.8V, 5.0V, 7V, 9V, 12V are adaptively adjustable, To guarantee that, in charging, voltage floats and charging unit is made to be not easy to generate heat.

The charging module 220 is also used to when the charge protocol includes qualcomm quick charge agreement QC2.0, using described The corresponding charging scheme of QC2.0 charges.

Specifically, qualcomm quick charge agreement QC2.0 is a kind of fast charge protocol, such as by the chip of protocol controller FP6600 can automatic identification charger type, adjust the output voltage of charger, be allowed to obtain the safe highest of charger permission Charging voltage saves the charging time under the premise of protecting charger.

The corresponding charging scheme of QC2.0 are as follows: the charger and charging unit of QC2.0 fast charge pass through the signal wire D of USB interface + and D- on on-load voltage communicated, adjust the output voltage of QC2.0.Specifically, working as charger (QC2.0 identification chip FP6600 when) end is connected on charging unit by data line, charger default allows D+ and D- to be shorted, and charging unit detects charging Device type is DCP type.Output voltage is 5v at this time, and charging unit charges normal.If charging unit supports QC2.0 quick charge Agreement, then the hvdcp process of Android user's space will will start, and start the voltage that 0.325V is loaded 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 unit detects on D- Voltage decline after, hvdcp reading/sys/class/power_supply/usb/voltage_max value, if it is 9000000 (mV), the voltage being arranged on D+ are 3.3V, and the voltage on D- is 0.6V, and charger exports 9v voltage.If It is 0.6V, D- 0V, charger output 5V voltage that D+, which is arranged, in 5000000 (mV).

Optionally, as shown in Fig. 2, described device further include:

Attribute obtains module 240, for obtaining the PE+ respectively when the charge protocol includes PE+2.0 and QC2.0 2.0 priority level attribute and the priority level attribute of the QC2.0;

The charging module 220 is also used to preferably fill using priority level attribute in the PE+2.0 and QC2.0 Electric agreement charges;

Wherein, the priority level attribute includes priority, detection at least one of duration or detection ordering.

Specifically, priority is computer time sharing system when handling multiple operation procedures, each operation journey is determined Sequence receives the parameter of the priority level of system resource, if the bigger priority level of the parameter of priority level is high, with QC2.0 and PE+ The corresponding charging scheme of the biggish agreement of the parameter of priority level in 2.0 charges;If the short priority level of detection time is high, Then charged with the corresponding charging scheme of the shorter agreement of the detection time in QC2.0 and PE+2.0;If detection ordering is preferential Priority level it is high, then charged with the corresponding charging scheme of agreement first detected in QC2.0 and PE+2.0.

In embodiments of the present invention, first determine whether charger port type whether be standard down port SDP type or Person's charging downlink port CDP type, if the SDP type, perhaps CDP type is then corresponding using SDP type or CDP type Predetermined current threshold charge;If not SDP type and be not CDP type, then judge whether the port type is dedicated Charging port DCP type, and when the port type is DCP type, obtain included charge protocol connection hair fast charge agreement PE+ 2.0 and/or qualcomm quick charge agreement QC2.0, and charged using charging scheme corresponding with QC2.0 or PE+2.0.Pass through It detects the port type of charger and is charged using charging modes corresponding with port type to mobile terminal, to improve The service life of mobile terminal is led in addition, also adding mobile terminal to the compatibility of different quick chargers (adapter) Quick charge to mobile terminal can be realized by crossing different charger of arranging in pairs or groups.

Fig. 6 illustrates a kind of computer system 10 based on von Neumann system for running above-mentioned charging method.The calculating Machine system 10 can be smart phone, tablet computer, palm PC, the subscriber terminal equipments such as laptop or PC. Specifically, may include that outer input interface 1001, processor 1002, memory 1003 and the output connected by system bus connects Mouth 1004.Wherein, outer input interface 1001 may include touch screen 10016, optionally can also include network interface 10018. Memory 1003 may include external memory 10032 (such as hard disk, CD or floppy disk etc.) and built-in storage 10034.Output interface 1004 may include the equipment such as display screen 10042 and sound equipment/loudspeaker 10044.

In the present embodiment, the operation of this method is based on computer program, and the program file of the computer program is stored in In the external memory 10032 of the aforementioned computer system 10 based on von Neumann system, it is loaded into built-in storage at runtime It in 10034, is then compiled as being transferred in processor 1002 after machine code executing, so that being based on von Neumann system Computer system 10 in form type judging module 210 in logic, charging module 220, agreement and obtain module 230 and attribute Module 240 is obtained, and in above-mentioned charging method implementation procedure, the parameter of input passes through outer input interface 1001 and receives, And be transferred in memory 1003 and cache, it is then input in processor 1002 and is handled, the result data or caching of processing It is subsequently handled in memory 1003, or is passed to output interface 1004 and is exported.

Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..

The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (10)

1. a kind of charging method characterized by comprising

The port type for obtaining charger, according to before connection charger with the anode for the differential lines connecting after the charger The voltage of signal D+ and the voltage of negative signal D-, judge the port type whether be standard down port SDP type or Charge downlink port CDP type;

If the port type is the SDP type or the CDP type, the SDP type or the CDP class are used The corresponding predetermined current threshold of type charges;

If the port type is not the SDP type and is not the CDP type, judge whether the port type is special With charging port DCP type;

When the port type is the DCP type, charge protocol is obtained;

When the charge protocol is connection hair fast charge agreement PE+2.0, filled using the corresponding charging scheme of the PE+2.0 Electricity;

When the charge protocol is qualcomm quick charge agreement QC2.0, charged using the corresponding charging scheme of the QC2.0;

When the charge protocol includes connection hair fast charge agreement PE+2.0 and qualcomm quick charge agreement QC2.0, the PE+ is obtained respectively 2.0 priority level attribute and the priority level attribute of the QC2.0, wherein the priority level attribute includes priority level Parameter, one in detection time or detection ordering;

It is filled using the corresponding charging scheme of the biggish agreement of parameter of priority level in the PE+2.0 and the QC2.0 Electricity;

Alternatively, being charged using the shorter corresponding charging scheme of agreement of detection time in the PE+2.0 and the QC2.0;

Alternatively, being charged using the corresponding charging scheme of agreement first detected in the PE+2.0 and the QC2.0.

2. the method as described in claim 1, which is characterized in that if the port type is the SDP type or institute CDP type is stated, then is charged using the SDP type or the corresponding predetermined current threshold of the CDP type, comprising:

When the port type is the SDP type, charged using the first predetermined current threshold;

When the port type is the CDP type, charged using the second predetermined current threshold.

3. the method as described in claim 1, which is characterized in that described to judge whether the port type is standard down port SDP type, comprising:

Obtain the 4th voltage of the tertiary voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines, described the Three voltages and the 4th voltage are the voltage before connecting the charger;

Obtain the 6th voltage of the 5th voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines, described the Five voltages and the 6th voltage are the voltage after the connection charger;

When the tertiary voltage is greater than the 5th voltage and the 4th voltage is greater than six voltage, the end is determined Mouth type is the SDP type.

4. the method as described in claim 1, which is characterized in that described to judge whether the port type is charging downlink port CDP type, comprising:

Obtain the 8th voltage of the 7th voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines;

When the 7th voltage is greater than tertiary voltage threshold value and the 8th voltage is greater than four voltage thresholds, the D- is connected Pull-up power supply and the D+ draw power, obtain the level of the D+;

If the level of the D+ is low level, it is determined that the port type is CDP type.

5. the method as described in claim 1, which is characterized in that described to judge whether the port type is special charging port DCP type, comprising:

Obtain the second voltage of the first voltage of the positive signal D+ of differential lines and the negative signal D- of the differential lines;

When the first voltage is greater than first voltage threshold value and the second voltage is greater than second voltage threshold value, the D- is connected Pull-up power supply and the D+ draw power, obtain the level of the D+;

If the level of the D+ is high level, it is determined that the port type is DCP type.

6. a kind of charging unit characterized by comprising

Type judging module, for obtaining the port type of charger, according to connection charger before with connect the charger The voltage of the positive signal D+ of differential lines later and the voltage of negative signal D- judge whether the port type is SDP class Type or CDP type;

Charging module is used for when the port type is the SDP type or the CDP type, using the SDP type Or the corresponding predetermined current threshold of the CDP type charges;

The type judging module, when being also used to not be the SDP type in the port type and be not the CDP type, Judge whether the port type is DCP type;

Agreement obtains module, for obtaining charge protocol when the port type is the DCP type;

The charging module is also used to when the charge protocol is PE+2.0, using the corresponding charging scheme of the PE+2.0 It charges;

The charging module, be also used to when the charge protocol be QC2.0 when, using the corresponding charging scheme of the QC2.0 into Row charging;

Attribute obtains module, for obtaining the excellent of the PE+2.0 respectively when the charge protocol includes PE+2.0 and QC2.0 The priority level attribute of first level attribute and the QC2.0, wherein the priority level attribute include priority level parameter, One in detection time or detection ordering;

The charging module is also used to the biggish agreement pair of parameter using priority level in the PE+2.0 and QC2.0 The charging scheme answered charges;

Alternatively, being charged using the shorter corresponding charging scheme of agreement of detection time in the PE+2.0 and the QC2.0;

Alternatively, being charged using the corresponding charging scheme of agreement first detected in the PE+2.0 and the QC2.0.

7. device as claimed in claim 6, which is characterized in that the charging module is specifically used for:

When the port type is the SDP type, charged using the first predetermined current threshold;

When the port type is the CDP type, charged using the second predetermined current threshold.

8. device as claimed in claim 6, which is characterized in that the type judging module judge the port type whether be SDP type, comprising:

First voltage acquiring unit, for obtaining the tertiary voltage of the positive signal D+ of differential lines and the cathode letter of the differential lines The 4th voltage of number D-, the tertiary voltage and the 4th voltage be the connection charger before voltage;

The first voltage acquiring unit, be also used to obtain the positive signal D+ of differential lines the 5th voltage and the differential lines The 6th voltage of negative signal D-, the 5th voltage and the 6th voltage are the voltage after the connection charger;

First port determination unit is used to be greater than the 5th voltage in the tertiary voltage and the 4th voltage is greater than described When six voltage, determine that the port type is the SDP type.

9. device as claimed in claim 6, which is characterized in that the type judging module judge the port type whether be CDP type, comprising:

Second voltage acquiring unit, for obtaining the 7th voltage of the positive signal D+ of differential lines and the cathode letter of the differential lines The 8th voltage of number D-;

First level acquiring unit is used to be greater than tertiary voltage threshold value in the 7th voltage and the 8th voltage is greater than the 4th When voltage threshold, the pull-up power supply of the D- and the draw power of the D+ are connected, the level of the D+ is obtained;

Second port determination unit, for the level in the D+ be low level when, determine the port type be CDP type.

10. device as claimed in claim 6, which is characterized in that whether the type judging module judges the port type For DCP type, comprising:

Tertiary voltage acquiring unit, for obtaining the first voltage of the positive signal D+ of differential lines and the cathode letter of the differential lines The second voltage of number D-;

Second electrical level acquiring unit is used to be greater than first voltage threshold value in the first voltage and the second voltage is greater than second When voltage threshold, the pull-up power supply of the D- and the draw power of the D+ are connected, the level of the D+ is obtained;

Third port determination unit, for the level in the D+ be high level when, determine the port type be DCP type.

CN201610796152.6A 2016-08-31 2016-08-31 A kind of charging method and device Active CN106300533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610796152.6A CN106300533B (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
CN201610796152.6A CN106300533B (en) 2016-08-31 2016-08-31 A kind of charging method and device

Publications (2)

Publication Number Publication Date
CN106300533A CN106300533A (en) 2017-01-04
CN106300533B true CN106300533B (en) 2019-06-11

Family

ID=57709546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610796152.6A Active CN106300533B (en) 2016-08-31 2016-08-31 A kind of charging method and device

Country Status (1)

Country Link
CN (1) CN106300533B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110829523B (en) * 2019-10-31 2021-12-31 华为技术有限公司 Electronic equipment and reverse charging method
CN113162131B (en) * 2020-01-22 2025-03-04 华为技术有限公司 Reverse charging system, reverse charging method and terminal device

Citations (8)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9542267B2 (en) * 2013-02-01 2017-01-10 Broadcom Corporation Enhanced recovery mechanisms

Patent Citations (8)

* 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
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
CN106300533A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN106329630B (en) 2019-06-11 A kind of charging method and device
CN106329627A (en) 2017-01-11 Charging method and device
JP5388484B2 (en) 2014-01-15 Apparatus and method for detecting power supply
CN102393837B (en) 2014-07-30 USB charger recognition device and method
CN104756350B (en) 2018-03-02 High voltage special charging port
CN106230070B (en) 2020-01-10 Charging method and device
CN101783427B (en) 2014-06-11 Intelligent charging method and intelligent charging device of terminal
CN101674366B (en) 2012-03-28 Mobile terminal USB, or charger inserting identification method and identification device thereof
CN108988431B (en) 2021-09-17 Multi-protocol charging device and multi-protocol charging method
CN106356918B (en) 2019-10-11 A kind of quick charge recognition methods and terminal device
CN103080868B (en) 2016-04-06 Charging port
CN106100025B (en) 2019-04-19 A kind of charge protector, charge protection method and mobile terminal
CN103427460A (en) 2013-12-04 Power supply terminal, charge control method and charge control device
CN201813422U (en) 2011-04-27 Charging chip and mobile terminal capable of automatically adjusting charging mode
CN104617615B (en) 2017-03-22 Charging method and electronic equipment
CN104796011A (en) 2015-07-22 Charging method, AC adapter, charging managing device and terminal
CN110176792A (en) 2019-08-27 More mouthfuls of fast charging type portable power source circuits of one kind and its control method
CN106571663A (en) 2017-04-19 Charging method, terminal and charging adapter
US20120306455A1 (en) 2012-12-06 Method and system for determining whether a portable device is charging
CN106329625A (en) 2017-01-11 Charging method and device
CN201039411Y (en) 2008-03-19 A mobile phone with self-adapted charging device
CN106300533B (en) 2019-06-11 A kind of charging method and device
CN106160033B (en) 2019-11-22 A kind for the treatment of method and apparatus of terminal charger
CN103490109B (en) 2016-12-14 The charging method of a kind of terminal and device
CN106329628B (en) 2019-06-11 A kind of charging method and device

Legal Events

Date Code Title Description
2017-01-04 C06 Publication
2017-01-04 PB01 Publication
2017-02-01 C10 Entry into substantive examination
2017-02-01 SE01 Entry into force of request for substantive examination
2019-06-11 GR01 Patent grant
2019-06-11 GR01 Patent grant