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

A kind of charging method and device Download PDF

Info

Publication number
CN106329629B
CN106329629B CN201610797341.5A CN201610797341A CN106329629B CN 106329629 B CN106329629 B CN 106329629B CN 201610797341 A CN201610797341 A CN 201610797341A CN 106329629 B CN106329629 B CN 106329629B
Authority
CN
China
Prior art keywords
type
voltage
port
agreement
charging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610797341.5A
Other languages
Chinese (zh)
Other versions
CN106329629A (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

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 SDP type, perhaps CDP type is then charged using SDP type or the corresponding predetermined current threshold of CDP type;If not SDP type and not be CDP type, then judge whether it is special charging port DCP type;When for DCP type, charge protocol is obtained;When charge protocol includes qualcomm quick charge agreement QC2.0, charged using the corresponding charging scheme of QC+2.0;When charge protocol includes connection hair fast charge agreement PE+3.0, charged using the corresponding charging scheme of PE+3.0 or the corresponding charging scheme of PE+2.0;When charge protocol includes connection hair fast charge agreement PE+2.0, charged using the corresponding charging scheme of PE+2.0.Using the present invention, the port type by detecting charger is charged 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 includes qualcomm quick charge agreement QC2.0, using the corresponding charging scheme of the QC+2.0 into Row charging;
When the charge protocol includes connection hair fast charge agreement PE+3.0, using the corresponding charging scheme of the PE+3.0 or The corresponding charging scheme of person PE+2.0 charges;
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.
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 when the charge protocol includes QC2.0, using the corresponding charging of the QC2.0 Scheme charges;
The charging module is also used to fill when the charge protocol includes PE+3.0 using the PE+3.0 is corresponding Electric scheme or the corresponding charging scheme of PE+2.0 charge;
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.
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: qualcomm quick charge agreement QC2.0 and/or connection hair fast charge agreement PE+3.0 and/or connection hair fast charge agreement PE+2.0, and using with QC2.0 or PE+3.0 or The corresponding charging scheme of person PE+2.0 charges.By detecting the port type of charger using corresponding with port type Charging modes charge to mobile terminal, so that the service life of mobile terminal is improved, in addition, also adding mobile terminal To the compatibility of different quick chargers (adapter), by arranging in pairs or groups, different chargers can be realized to the fast of mobile terminal Speed charging.
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 is the CDP in the port type It when type, is charged using the second predetermined current threshold, second predetermined 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 3.0, PE+3.0), 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 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).
Step S106, it is corresponding using the PE+3.0 when the charge protocol includes connection hair fast charge agreement PE+3.0 Charging scheme or the corresponding charging scheme of PE+2.0 charge.
Specifically, charger supports 5V/7V/9V 2A or 12V in the corresponding charging scheme of connection hair fast charge agreement PE+3.0 The charging voltage and charging current of 1.5A, and it is adaptive adjustable.
In addition, since agreement is all backward compatible, that is to say, that when supporting PE+3.0, also support PE+2.0, therefore, when When charge protocol includes PE+3.0, it can be charged using the corresponding charging scheme of one of PE+3.0 and PE+2.0.
Step S107, 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.
Optionally, the method also includes:
When the charge protocol includes qualcomm quick charge agreement QC2.0, connection hair fast charge agreement PE+3.0 and connection hair fast charge association When discussing PE+2.0, the priority level attribute of the QC2.0, the priority level attribute of the PE+3.0 and the PE are obtained respectively + 2.0 priority level attribute;
Using priority level attribute preferably charge protocol in the QC2.0, the PE+3.0 and the PE+2.0 into Row charging;
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, PE+ 3.0 charging schemes corresponding with the biggish agreement of the parameter of the priority level in PE+2.0 charge;If detection time is short excellent First rank is high, then is filled with the corresponding charging scheme of the shorter agreement of the detection time in QC2.0, PE+3.0 and PE+2.0 Electricity;If the preferential priority level of detection ordering is high, corresponding with the agreement first detected in QC2.0, PE+3.0 and PE+2.0 Charging 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: qualcomm quick charge agreement QC2.0 and/or connection hair fast charge agreement PE+3.0 and/or connection hair fast charge agreement PE+2.0, and using with QC2.0 or PE+3.0 or The corresponding charging scheme of person PE+2.0 charges.By detecting the port type of charger using corresponding with port type Charging modes charge to mobile terminal, so that the service life of mobile terminal is improved, in addition, also adding mobile terminal To the compatibility of different quick chargers (adapter), by arranging in pairs or groups, different chargers can be realized to the fast of mobile terminal Speed charging.
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 SDP type, packet It includes:
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 CDP type, packet It includes:
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 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 qualcomm quick charge agreement QC2.0, connection hair fast charge agreement PE+3.0 and Lian Fa fast charge agreement PE+2.0.
The charging module 220 is also used to fill when the charge protocol includes 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).
The charging module 220 is also used to when the charge protocol includes PE+3.0, corresponding using the PE+3.0 Charging scheme or the corresponding charging scheme of PE+2.0 charge.
Specifically, charger supports 5V/7V/9V 2A or 12V in the corresponding charging scheme of connection hair fast charge agreement PE+3.0 The charging voltage and charging current of 1.5A, and it is adaptive adjustable.
In addition, since agreement is all backward compatible, that is to say, that when supporting PE+3.0, also support PE+2.0, therefore, when When charge protocol includes PE+3.0, it can be charged using the corresponding charging scheme of one of PE+3.0 and PE+2.0.
The charging module 220 is also used to when the charge protocol includes PE+2.0, corresponding using the 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.
Optionally, as shown in Fig. 2, described device further include:
Attribute obtains module 240, for being obtained respectively when the charge protocol includes QC2.0, PE+3.0 and PE+2.0 Take the priority level category of the priority level attribute of the QC 2.0, the priority level attribute of the PE+3.0 and the PE+2.0 Property;
The charging module 220 is also used to using priority in the QC2.0, the PE+3.0 and the PE+2.0 Other attribute preferably charge protocol 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, PE+ 3.0 charging schemes corresponding with the biggish agreement of the parameter of the priority level in PE+2.0 charge;If detection time is short excellent First rank is high, then is filled with the corresponding charging scheme of the shorter agreement of the detection time in QC2.0, PE+3.0 and PE+2.0 Electricity;If the preferential priority level of detection ordering is high, corresponding with the agreement first detected in QC2.0, PE+3.0 and PE+2.0 Charging 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: qualcomm quick charge agreement QC2.0 and/or connection hair fast charge agreement PE+3.0 and/or connection hair fast charge agreement PE+2.0, and using with QC2.0 or PE+3.0 or The corresponding charging scheme of person PE+2.0 charges.By detecting the port type of charger using corresponding with port type Charging modes charge to mobile terminal, so that the service life of mobile terminal is improved, in addition, also adding mobile terminal To the compatibility of different quick chargers (adapter), by arranging in pairs or groups, different chargers can be realized to the fast of mobile terminal Speed charging.
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 connecting the charger with the differential lines that connect after the charger The voltage of positive signal D+ and the voltage of negative signal D- judge whether the port type is standard down port SDP type Or charging 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 qualcomm quick charge agreement QC2.0, charged using the corresponding charging scheme of the QC+2.0;
When the charge protocol is connection hair fast charge agreement PE+3.0, using the corresponding charging scheme of the PE+3.0 or PE+ 2.0 corresponding charging schemes charge;
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 includes the qualcomm quick charge agreement QC2.0, the hair fast charge agreement PE+3.0 and described When sending out fast charge agreement PE+2.0, priority level attribute, the hair fast charge association of the qualcomm quick charge agreement QC2.0 are obtained respectively Discuss the priority level attribute of PE+3.0 and the priority level attribute of the hair fast charge agreement PE+2.0, wherein described preferential Level attribute includes one in the parameter, detection time or detection ordering of priority level;
Using the qualcomm quick charge agreement QC2.0, the hair fast charge agreement PE+3.0 and the hair fast charge agreement PE+ The corresponding charging scheme of the biggish agreement of the parameter of priority level charges in 2.0;
Alternatively, using the qualcomm quick charge agreement QC2.0, the hair fast charge agreement PE+3.0 and the hair fast charge agreement The corresponding charging scheme of the shorter agreement of detection time charges in PE+2.0;
Alternatively, using the qualcomm quick charge agreement QC2.0, the hair fast charge agreement PE+3.0 and the hair fast charge agreement The corresponding charging scheme of the agreement first detected in PE+2.0 charges.
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 it is described 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 under standard Row 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 it is described 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 under charging Row 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, be also used to when the charge protocol be QC2.0 when, using the corresponding charging scheme of the QC2.0 into Row charging;
The charging module is also used to when the charge protocol is PE+3.0, using the corresponding charging scheme of the PE+3.0 Or the corresponding charging scheme of PE+2.0 charges;
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;
Priority obtains module, for including the qualcomm quick charge agreement QC2.0, hair fast charge association when the charge protocol When discussing the PE+3.0 and hair fast charge agreement PE+2.0, the priority level of the qualcomm quick charge agreement QC2.0 is obtained respectively The priority level of attribute, the priority level attribute of the hair fast charge agreement PE+3.0 and the hair fast charge agreement PE+2.0 Attribute, wherein the priority level attribute includes one in the parameter, detection time or detection ordering of priority level;
The charging module is also used to using the qualcomm quick charge agreement QC2.0, the hair fast charge agreement PE+3.0 and institute The corresponding charging scheme of the biggish agreement of parameter for stating priority level in connection hair fast charge agreement PE+2.0 charges;
Alternatively, using the qualcomm quick charge agreement QC2.0, the hair fast charge agreement PE+3.0 and the hair fast charge agreement The corresponding charging scheme of the shorter agreement of detection time charges in PE+2.0;
Alternatively, using the qualcomm quick charge agreement QC2.0, the hair fast charge agreement PE+3.0 and the hair fast charge agreement The corresponding charging scheme of the agreement first detected in PE+2.0 charges.
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 is according to before connection charger and even The voltage of the positive signal D+ of the differential lines after the charger and the voltage of negative signal D- are connect, judges the port type It whether is 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 is according to before connection charger and even The voltage of the positive signal D+ of the differential lines after the charger and the voltage of negative signal D- are connect, judges the port type It whether is 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.
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 CN106329629A (en) 2017-01-11
CN106329629B true 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 (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
CN106329629A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
CN106329630B (en) A kind of charging method and device
CN106329627A (en) Charging method and device
JP5388484B2 (en) Apparatus and method for detecting power supply
CN106230070A (en) A kind of charging method and device
CN102393837B (en) USB charger recognition device and method
CN104756350B (en) High voltage special charging port
CN102684270B (en) Method for identifying type of universal serial bus (USB) chargers and USB device
CN103064489B (en) A kind of method and terminal of carrying out internal circuit selection according to USB interface state
CN108988431B (en) Multi-protocol charging device and multi-protocol charging method
CN101783427B (en) Intelligent charging method and intelligent charging device of terminal
CN103427460B (en) A kind of power supply terminal, charge control method and device
CN103080868B (en) Charging port
CN103208661A (en) Intelligent terminal and method for carrying out large-current charging
CN106356918B (en) A kind of quick charge recognition methods and terminal device
CN106100025B (en) A kind of charge protector, charge protection method and mobile terminal
CN104617615B (en) Charging method and electronic equipment
US9018896B2 (en) Method and system for determining whether a portable device is charging
CN201813422U (en) Charging chip and mobile terminal capable of automatically adjusting charging mode
CN101674366A (en) Mobile terminal USB, or charger inserting identification method and identification device thereof
CN105071484B (en) A kind of charging method and device of the terminal with data exchanging function
CN105048018B (en) The charging method and device of a kind of terminal with data exchanging function
CN106160033B (en) A kind for the treatment of method and apparatus of terminal charger
CN106329628B (en) A kind of charging method and device
CN106329625A (en) Charging method and device
CN106300533B (en) A kind of charging method and device

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