CN106230070B - Charging method and device - Google Patents
- ️Fri Jan 10 2020
CN106230070B - Charging method and device - Google Patents
Charging method and device Download PDFInfo
-
Publication number
- CN106230070B CN106230070B CN201610798997.9A CN201610798997A CN106230070B CN 106230070 B CN106230070 B CN 106230070B CN 201610798997 A CN201610798997 A CN 201610798997A CN 106230070 B CN106230070 B CN 106230070B Authority
- CN
- China Prior art keywords
- charging
- voltage
- type
- port
- protocol 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J7/00—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
- H02J7/007—Regulation of charging or discharging current or voltage
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02B—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
- Y02B40/00—Technologies aiming at improving the efficiency of home appliances, e.g. induction cooking or efficient technologies for refrigerators, freezers or dish washers
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 charging method and a charging device, wherein the method comprises the following steps: acquiring a port type of a charger, and judging whether the port type is a special charging port (DCP) type; when the port type is the DCP type, acquiring a charging protocol; when the charging protocol comprises a high-pass quick charging protocol QC2.0, charging by adopting a charging scheme corresponding to the QC 2.0; when the charging protocol comprises a simultaneous rapid charging protocol PE +3.0, charging by adopting a charging scheme corresponding to the PE +3.0 or a charging scheme corresponding to the PE + 2.0; and when the charging protocol comprises a simultaneous rapid charging protocol PE +2.0, charging by adopting a charging scheme corresponding to the PE + 2.0. By adopting the invention, the charging efficiency is improved by detecting the port type of the charger and the corresponding charging protocol and adopting the quick charging mode corresponding to the protocol for charging.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a charging method and a charging device.
Background
With the development of mobile terminal technology, mobile terminals such as mobile phones and tablet computers have more and more functions, and become an essential part of people in work and life.
However, as the functions of the mobile terminal increase, the power consumption thereof also increases, and it is generally required to charge the same using a charger. In the existing charging technology, after the mobile terminal is connected to the charger, the charger charges the connected mobile terminal in a fixed charging mode, such as constant voltage charging, which will prolong the charging time of the mobile terminal with larger battery capacity, thereby reducing the charging efficiency of the mobile terminal.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a charging method and device, in which a port type of a charger and a corresponding charging protocol are detected, and a fast charging mode corresponding to the protocol is adopted to perform charging, so as to improve charging efficiency.
In order to solve the above technical problem, an embodiment of the present invention provides a charging method, where the method includes:
acquiring a port type of a charger, and judging whether the port type is a special charging port (DCP) type;
when the port type is the DCP type, acquiring a charging protocol;
when the charging protocol comprises a high-pass quick charging protocol QC2.0, charging by adopting a charging scheme corresponding to the QC 2.0;
when the charging protocol comprises a simultaneous rapid charging protocol PE +3.0, charging by adopting a charging scheme corresponding to the PE +3.0 or a charging scheme corresponding to the PE + 2.0;
and when the charging protocol comprises a simultaneous rapid charging protocol PE +2.0, charging by adopting a charging scheme corresponding to the PE + 2.0.
Correspondingly, the embodiment of the invention also provides a charging device, which comprises:
the type judging module is used for acquiring the port type of the charger and judging whether the port type is a DCP type;
a protocol acquisition module, configured to acquire a charging protocol when the port type is the DCP type;
the charging module is used for charging by adopting a charging scheme corresponding to QC2.0 when the charging protocol comprises QC 2.0;
the charging module is further configured to charge the battery by using a charging scheme corresponding to the PE +3.0 or a charging scheme corresponding to the PE +2.0 when the charging protocol includes the PE + 3.0;
the charging module is further configured to charge the battery by using a charging scheme corresponding to the PE +2.0 when the charging protocol includes PE + 2.0.
In the embodiment of the invention, the port type of the charger is firstly obtained, whether the port type is a special charging port DCP type or not is judged, and if yes, the charging protocol is obtained: and then charging is carried out by adopting a charging scheme corresponding to PE +3.0 or PE +2.0 or QC 2.0. The port type and the corresponding charging protocol of the charger are detected, and a quick charging mode corresponding to the protocol is adopted for charging, so that the charging efficiency is improved, in addition, the compatibility of the mobile terminal to different quick chargers (adapters) is increased, and the quick charging of the mobile terminal can be realized by matching different chargers.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a charging method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a charging device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a type determination module of a charging device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a type determination module of a charging device according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a type determination module of a charging device according to another embodiment of the present invention;
fig. 6 is an architecture diagram of a computer system for executing the charging method according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "including" and "having," and any variations thereof, in the description and claims of this invention and the above-described drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The charging method according to the embodiment of the present invention is executed by a computer program and can be executed on a computer system of von-rhodamine system. The computer program may be run on the basis of a charging device. The charging device can be a mobile terminal device such as a personal computer, a tablet computer, a notebook computer, a smart phone and an intelligent wearable device.
The following are detailed below.
Fig. 1 is a schematic flow chart of a charging method according to an embodiment of the present invention, as shown in the figure, the method at least includes:
step S101, acquiring a port type of a charger, and judging whether the port type is a special charging port DCP type.
Specifically, a Charging device, such as a mobile phone, a tablet computer, or a personal computer, is connected to a charger through a Universal Serial Bus (USB) Port of the charger, and after the Charging device is connected to the charger, detects a Port type of the charger under a USB Charging specification (USB Charging 1.2, BC1.2), and determines whether the detected Port type is a Standard Downlink Port (SDP) type or a Charging Downlink Port (CDP) type. Among other things, the BC1.2 specification determines how each port should be enumerated to the end device, as well as the protocol that identifies the port type.
In addition, the Port types of the USB BC1.2 specification are shown in table 1, and include SDP, CDP, Charging downstream Port (DCP), and other Port types.
Judging whether the port type is a special charging port DCP type, including:
acquiring a first voltage of a positive electrode signal D + of a differential line and a second voltage of a negative electrode signal D-of the differential line;
when the first voltage is greater than a first voltage threshold and the second voltage is greater than a second voltage threshold, connecting a pull-up power supply of the D-and a pull-down power supply of the D + to obtain the level of the D +;
and if the level of the D + is high level, determining that the port type is a DCP type.
TABLE 1
In the concrete implementation, when the charging device is connected to a DCP type charger, firstly, because the (Data +, D +) signal level of the charging equipment is higher than the D + signal comparison level of the charger, and the D + and (Data-, D-) signals of the DCP type charging are short-circuited, the D-signal is pulled high and is higher than the judgment level of the D-signal, and the port type of the charger is identified as the DCP type or the CDP type; and then turning on a pull-up power supply of the D-signal of the charging device, namely maintaining the D-signal to be high level, turning off the pull-up power supply of the D + signal, and simultaneously turning on a pull-down power supply of the D + signal, wherein the D + signal becomes high level, namely when the D + signal of the charging device is detected to be high level, determining that the port of the charger is of a DCP type.
Among them, the Dedicated Charging Port (DCP) type port does not support any data transmission but can supply a current of 1.5A or more, and thus is commonly used for a wall charger and an in-vehicle charger supporting a higher charging capability without enumeration.
In this embodiment, the charging device obtains a D + voltage and a D-voltage in the charging device after the charging device is connected to the charger, and respectively compares the D + voltage and the D-voltage with corresponding preset thresholds, and when the comparison result is that both of the D + voltage and the D + voltage are greater than the corresponding preset thresholds, obtains a level of D + under the condition of a pull-up power supply connected to D + and a pull-down power supply connected to D +, and determines that the port type is the DCP type when the level of D + is a high level.
Optionally, after determining whether the port type is a DCP type, the method further includes:
when the port type is not the DCP type, judging whether the port type is a standard downlink port SDP type or a charging downlink port CDP type;
when the port type is the SDP type, charging by adopting a first preset current threshold;
when the port type is the CDP type, charging by adopting a second preset current threshold value;
and when the port type is not the SDP type and not the CDP type, charging by adopting a third preset current threshold value.
Specifically, when the port type is the SDP type, a first preset current threshold is used for charging. For the SDP type port charger, the corresponding current limiting values are 2.5mA when suspended, 100mA when connected, and 500mA when connected and configured as a higher power, respectively, and the first preset current threshold may be 500 mA; when the port type is the CDP type, charging by adopting a second preset current threshold, wherein the second preset current threshold can be 900 mA; and when the port type is not the SDP type and not the CDP type, charging by adopting a third preset current threshold, wherein the second preset current threshold can be 500 mA.
Judging whether the port type is a standard downlink port SDP type or not, wherein the judging comprises the following steps:
acquiring a third voltage of a positive electrode signal D + of a differential line and a fourth voltage of a negative electrode signal D-of the differential line, wherein the third voltage and the fourth voltage are voltages before being connected with the charger;
acquiring a fifth voltage of a positive electrode signal D + of a differential line and a sixth voltage of a negative electrode signal D-of the differential line, wherein the fifth voltage and the sixth voltage are voltages after being connected with the charger;
determining that the port type is the SDP type when the third voltage is greater than the fifth voltage and the fourth voltage is greater than the sixth voltage.
In a specific implementation, since the terminals of the SDP are provided with 15k Ω pull-down resistors on the positive signal line D + and the negative signal line D-lines of the terminals of the SDP, when the charging device is connected to the SDP type charger, the D + voltage of the charging device is pulled down by the pull-down resistor of the internal D + signal of the charger, and the D-voltage of the charging device is also pulled down by the pull-down resistor of the internal D-signal of the charger, i.e., when the charging device (access device) detects that the D + voltage and the D-voltage inside the charging device are both low after the charger is connected, the terminals of the charger are determined to be of the SDP type.
In this embodiment, the D + and D-voltages of the charging device before the connection with the charger and the D + and D-voltages of the charging device after the connection with the charger are respectively obtained, and then the D + voltage before and after the connection are respectively compared with the D-voltage to determine whether both the D + voltage and the D-voltage before the connection become small.
Judging whether the port type is a charging downlink port CDP type or not, wherein the judging comprises the following steps:
acquiring a seventh voltage of a positive electrode signal D + of a differential line and an eighth voltage of a negative electrode signal D-of the differential line;
when the seventh voltage is greater than a third voltage threshold and the eighth voltage is greater than a fourth voltage threshold, connecting the pull-up power supply of the D-and the pull-down power supply of the D + to obtain the level of the D +;
and if the level of the D + is low level, determining that the port type is the CDP type.
In specific implementation, when the charging device is connected to a CDP type charger, firstly, because the D + signal level of the charging equipment is higher than the D + signal comparison level of the charger, the CDP equipment is powered on, the D-signal is pulled high and is higher than the judgment level of the D-signal, and the port type of the charger is identified as the CDP type or the DCP type; and then, turning on a pull-up power supply of the D-signal of the charging device, namely maintaining the D-signal to be high level, turning off the pull-up power supply of the D + signal, and simultaneously turning on a pull-down power supply of the D + signal, wherein the D + signal is changed into low level, namely when the D + signal of the charging device is detected to be low level, determining that the port of the charger is of the CDP type.
The Charging Downstream Port (CDP) type port not only supports large-current charging, but also supports data transmission fully compatible with USB 2.0, and the port is provided with a 15k omega pull-down resistor necessary for D + and D-communication, and also is provided with an internal circuit for switching in a charger detection stage.
In this embodiment, the charging device obtains a D + voltage and a D-voltage in the charging device after the charging device is connected to the charger, and respectively compares the D + voltage and the D-voltage with corresponding preset threshold values, and when the comparison result is that both are greater than the corresponding preset threshold values, obtains a level of D + under the conditions of a pull-up power supply connected to D + and a pull-down power supply connected to D +, and determines that the port type is the CDP type when the level of D + is a low level.
Step S102, when the port type is the DCP type, a charging protocol is obtained.
Specifically, as shown in table 1, when the port type is the DCP type, multiple charging protocols are supported, and the charging protocols at this time are obtained, such as a concurrent rapid charging protocol (Pump Express Plus 3.0, PE +3.0), a concurrent rapid charging protocol (Pump Express Plus 2.0, PE +2.0), and a high-pass rapid charging protocol (Quick Charge 2.0, QC 2.0).
And step S103, when the charging protocol comprises a high-pass quick-charging protocol QC2.0, charging by adopting a charging scheme corresponding to the QC 2.0.
Specifically, the high-pass quick-charging protocol QC2.0 is a quick-charging protocol, and the type of the charger can be automatically identified through a chip of a protocol controller, such as FP6600, and the output voltage of the charger is adjusted to obtain the highest safe charging voltage allowed by the charger, so that the charging time is saved on the premise of protecting the charger.
The charging scheme corresponding to QC2.0 is: the charger and the charging device for QC2.0 quick charging communicate by loading voltage on the signal lines D + and D-of the USB interface, and the output voltage of QC2.0 is adjusted. Specifically, when the terminal of the charger (QC2.0 identification chip FP6600) is connected to the charging device through a data line, the charger defaults to short-circuit D + and D-, and the charging device detects that the charger type is a DCP type. At this time, the output voltage was 5v, and the charging device was normally charged. If the charging device supports a QC2.0 fast charging protocol, the hvdcp process of the Android user space is started, and a voltage of 0.325V is loaded on the D +. When the voltage is maintained for 1.25s, the charger will disconnect the short circuit of D + and D-, and the voltage on D-will drop; after the charging device detects the voltage drop on D-, the value of hvdcp read/sys/class/power _ supply/usb/voltage _ max, if 9000000(mV), sets the voltage on D + to 3.3V, the voltage on D-to 0.6V, and the charger outputs 9V voltage. If D + is set to 0.6V and D-is set to 0V for 5000000(mV), the charger outputs 5V.
And step S104, when the charging protocol comprises a simultaneous rapid charging protocol PE +3.0, charging by adopting a charging scheme corresponding to the PE +3.0 or a charging scheme corresponding to the PE + 2.0.
Specifically, the charger in the charging scheme corresponding to the concurrent rapid charging protocol PE +3.0 supports a charging voltage and a charging current of 5V/7V/9V 2A or 12V1.5A, and is adaptive and adjustable.
In addition, since the protocols are all downward compatible, that is, when PE +3.0 is supported, PE +2.0 is also supported, when the charging protocol includes PE +3.0, charging can be performed by using a charging scheme corresponding to one of PE +3.0 and PE + 2.0.
And step S105, when the charging protocol comprises a simultaneous rapid charging protocol PE +2.0, charging by adopting a charging scheme corresponding to the PE + 2.0.
Specifically, PE +2.0 is a fast charging protocol of the company, and the output voltage values of the charger in the charging scheme corresponding to PE +2.0 are 3.6V, 3.8V, 4.0V, 4.2V, 4.4V, 4.6V, 4.8V, 5.0V, 7V, 9V, and 12V, and are adaptively adjustable, so as to ensure that the voltage floats during charging, and the charging device is not prone to generate heat.
Optionally, the method further includes:
when the charging protocol comprises a high-pass quick-charging protocol QC2.0, a simultaneous quick-charging protocol PE +3.0 and a simultaneous quick-charging protocol PE +2.0, respectively acquiring a priority level attribute of the QC2.0, a priority level attribute of the PE +3.0 and a priority level attribute of the PE + 2.0;
charging by adopting a charging protocol with better priority level attributes in the QC2.0, the PE +3.0 and the PE + 2.0;
wherein the priority attribute comprises at least one of a priority, a detection duration, or a detection order.
Specifically, the priority is a parameter that determines the priority level of each operating program for receiving system resources when the computer time-sharing operating system processes a plurality of operating programs, and if the priority level of the parameter is higher, the charging is performed according to a charging scheme corresponding to a protocol with higher priority level parameters in QC2.0, PE +3.0 and PE + 2.0; if the detection time is short and the priority level is high, charging is carried out according to a charging scheme corresponding to a protocol with short detection time in QC2.0, PE +3.0 and PE + 2.0; and if the priority level of the detection sequence is high, charging according to a charging scheme corresponding to the protocol detected in QC2.0, PE +3.0 and PE + 2.0.
In the embodiment of the invention, the port type of the charger is firstly obtained, whether the port type is a special charging port DCP type or not is judged, and if yes, the charging protocol is obtained: and then charging is carried out by adopting a charging scheme corresponding to PE +3.0 or PE +2.0 or QC 2.0. The port type and the corresponding charging protocol of the charger are detected, and a quick charging mode corresponding to the protocol is adopted for charging, so that the charging efficiency is improved, in addition, the compatibility of the mobile terminal to different quick chargers (adapters) is increased, and the quick charging of the mobile terminal can be realized by matching different chargers.
Fig. 2 is a schematic structural diagram of a charging device according to an embodiment of the present invention, where the charging device includes:
the
type determining module210 is configured to obtain a port type of the charger, and determine whether the port type is a DCP type.
Specifically, a charging device such as a mobile phone, a tablet computer, or a personal computer is connected to a charger through a USB port of the charger, and after the charging device is connected to the charger, a port type of the charger under the USB BC1.2 specification is detected, and whether the detected port type is a standard downlink port SDP type or a charging downlink port CDP type is determined. Among other things, the BC1.2 specification determines how each port should be enumerated to the end device, as well as the protocol that identifies the port type.
In addition, the port types of the USB BC1.2 specification are shown in table 1, and include SDP, CDP, DCP, and other port types.
Specifically, as shown in fig. 3, the determining whether the port type is a DCP type by the
type determining module210 includes:
a first
voltage obtaining unit211, configured to obtain a first voltage of a positive signal D + of a differential line and a second voltage of a negative signal D-of the differential line;
a first
level obtaining unit212, configured to connect the pull-up power supply of D-and the pull-down power supply of D + to obtain a level of D + when the first voltage is greater than a first voltage threshold and the second voltage is greater than a second voltage threshold;
a first
port determining unit213, configured to determine that the port type is a DCP type when the level of D + is a high level.
In the specific implementation, when the charging device is connected to the DCP type charger, firstly, because the D + signal level of the charging equipment is higher than the D + signal comparison level of the charger, and the D + and D-signals of the DCP type charger are short-circuited, the D-signal is pulled high and is higher than the judgment level of the D-signal, and the port type of the charger is identified as the DCP type or the CDP type; and then turning on a pull-up power supply of the D-signal of the charging device, namely maintaining the D-signal to be high level, turning off the pull-up power supply of the D + signal, and simultaneously turning on a pull-down power supply of the D + signal, wherein the D + signal becomes high level, namely when the D + signal of the charging device is detected to be high level, determining that the port of the charger is of a DCP type.
Among them, the Dedicated Charging Port (DCP) type port does not support any data transmission but can supply a current of 1.5A or more, and thus is commonly used for a wall charger and an in-vehicle charger supporting a higher charging capability without enumeration.
In this embodiment, the charging device obtains a D + voltage and a D-voltage in the charging device after the charging device is connected to the charger, and respectively compares the D + voltage and the D-voltage with corresponding preset thresholds, and when the comparison result is that both of the D + voltage and the D + voltage are greater than the corresponding preset thresholds, obtains a level of D + under the condition of a pull-up power supply connected to D + and a pull-down power supply connected to D +, and determines that the port type is the DCP type when the level of D + is a high level.
A protocol obtaining module 220, configured to obtain a charging protocol when the port type is the DCP type.
Specifically, as shown in table 1, when the port type is the DCP type, multiple charging protocols are supported, and the charging protocols at this time, such as the tandem rapid charging protocol PE +3.0, the tandem rapid charging protocol PE +2.0, and the high-pass rapid charging protocol QC2.0, are acquired.
The charging module 230 is further configured to, when the charging protocol includes QC2.0, perform charging using a charging scheme corresponding to the QC 2.0.
Specifically, the high-pass quick-charging protocol QC2.0 is a quick-charging protocol, and the type of the charger can be automatically identified through a chip of a protocol controller, such as FP6600, and the output voltage of the charger is adjusted to obtain the highest safe charging voltage allowed by the charger, so that the charging time is saved on the premise of protecting the charger.
The charging scheme corresponding to QC2.0 is: the charger and the charging device for QC2.0 quick charging communicate by loading voltage on the signal lines D + and D-of the USB interface, and the output voltage of QC2.0 is adjusted. Specifically, when the terminal of the charger (QC2.0 identification chip FP6600) is connected to the charging device through a data line, the charger defaults to short-circuit D + and D-, and the charging device detects that the charger type is a DCP type. At this time, the output voltage was 5v, and the charging device was normally charged. If the charging device supports a QC2.0 fast charging protocol, the hvdcp process of the Android user space is started, and a voltage of 0.325V is loaded on the D +. When the voltage is maintained for 1.25s, the charger will disconnect the short circuit of D + and D-, and the voltage on D-will drop; after the charging device detects the voltage drop on D-, the value of hvdcp read/sys/class/power _ supply/usb/voltage _ max, if 9000000(mV), sets the voltage on D + to 3.3V, the voltage on D-to 0.6V, and the charger outputs 9V voltage. If D + is set to 0.6V and D-is set to 0V for 5000000(mV), the charger outputs 5V.
The charging module is further configured to charge the battery by using a charging scheme corresponding to the PE +3.0 or a charging scheme corresponding to the PE +2.0 when the charging protocol includes the PE + 3.0.
Specifically, the charger in the charging scheme corresponding to the concurrent rapid charging protocol PE +3.0 supports a charging voltage and a charging current of 5V/7V/9V 2A or 12V1.5A, and is adaptive and adjustable.
In addition, since the protocols are all downward compatible, that is, when PE +3.0 is supported, PE +2.0 is also supported, when the charging protocol includes PE +3.0, charging can be performed by using a charging scheme corresponding to one of PE +3.0 and PE + 2.0.
The charging module 230 is further configured to, when the charging protocol includes a simultaneous rapid charging protocol PE +2.0, perform charging by using a charging scheme corresponding to the PE + 2.0.
Specifically, PE +2.0 is a fast charging protocol of the company, and the output voltage values of the charger in the charging scheme corresponding to PE +2.0 are 3.6V, 3.8V, 4.0V, 4.2V, 4.4V, 4.6V, 4.8V, 5.0V, 7V, 9V, and 12V, and are adaptively adjustable, so as to ensure that the voltage floats during charging, and the charging device is not prone to generate heat.
Optionally, the
type determining module210 is further configured to determine whether the port type is a standard downlink port SDP type or a charging downlink port CDP type when the port type is not the DCP type;
the charging module 230 is further configured to charge the port by using a first preset current threshold when the port type is the SDP type;
the charging module 230 is further configured to charge the port with a second preset current threshold when the port type is the CDP type;
the charging module 230 is further configured to charge the terminal by using a third preset current threshold when the port type is not the SDP type and not the CDP type.
Specifically, when the port type is the SDP type, a first preset current threshold is used for charging. For the SDP type port charger, the corresponding current limiting values are 2.5mA when suspended, 100mA when connected, and 500mA when connected and configured as a higher power, respectively, and the first preset current threshold may be 500 mA; when the port type is the CDP type, charging by adopting a second preset current threshold, wherein the second preset current threshold can be 900 mA; and when the port type is not the SDP type and not the CDP type, charging by adopting a third preset current threshold, wherein the second preset current threshold can be 500 mA.
Specifically, as shown in fig. 4, the determining, by the
type determining module210, whether the port type is an SDP type includes:
a second
voltage obtaining unit214, configured to obtain a third voltage of a positive signal D + of a differential line and a fourth voltage of a negative signal D-of the differential line, where the third voltage and the fourth voltage are voltages before being connected to the charger;
the second
voltage obtaining unit214 is further configured to obtain a fifth voltage of a positive signal D + of a differential line and a sixth voltage of a negative signal D-of the differential line, where the fifth voltage and the sixth voltage are voltages after the charger is connected;
a second
port determination unit215, configured to determine that the port type is the SDP type when the third voltage is greater than the fifth voltage and the fourth voltage is greater than the sixth voltage.
In a specific implementation, since the terminals of the SDP are provided with 15k Ω pull-down resistors on the positive signal line D + and the negative signal line D-lines of the terminals of the SDP, when the charging device is connected to the SDP type charger, the D + voltage of the charging device is pulled down by the pull-down resistor of the internal D + signal of the charger, and the D-voltage of the charging device is also pulled down by the pull-down resistor of the internal D-signal of the charger, i.e., when the charging device (access device) detects that the D + voltage and the D-voltage inside the charging device are both low after the charger is connected, the terminals of the charger are determined to be of the SDP type.
In this embodiment, the D + and D-voltages of the charging device before the connection with the charger and the D + and D-voltages of the charging device after the connection with the charger are respectively obtained, and then the D + voltage before and after the connection are respectively compared with the D-voltage to determine whether both the D + voltage and the D-voltage before the connection become small.
Specifically, as shown in fig. 5, the determining whether the port type is a CDP type by the
type determining module210 includes:
a third
voltage obtaining unit216, configured to obtain a seventh voltage of a positive signal D + of a differential line and an eighth voltage of a negative signal D-of the differential line;
the second
level obtaining unit217 is further configured to connect the pull-up power supply of D-and the pull-down power supply of D + to obtain the level of D + when the seventh voltage is greater than a third voltage threshold and the eighth voltage is greater than a fourth voltage threshold;
a third
port determining unit218, configured to determine that the port type is the CDP type when the level of D + is a low level.
In specific implementation, when the charging device is connected to a CDP type charger, firstly, because the D + signal level of the charging equipment is higher than the D + signal comparison level of the charger, the CDP equipment is powered on, the D-signal is pulled high and is higher than the judgment level of the D-signal, and the port type of the charger is identified as the CDP type or the DCP type; and then, turning on a pull-up power supply of the D-signal of the charging device, namely maintaining the D-signal to be high level, turning off the pull-up power supply of the D + signal, and simultaneously turning on a pull-down power supply of the D + signal, wherein the D + signal is changed into low level, namely when the D + signal of the charging device is detected to be low level, determining that the port of the charger is of the CDP type.
The Charging Downstream Port (CDP) type port not only supports large-current charging, but also supports data transmission fully compatible with USB 2.0, and the port is provided with a 15k omega pull-down resistor necessary for D + and D-communication, and also is provided with an internal circuit for switching in a charger detection stage.
In this embodiment, the charging device obtains a D + voltage and a D-voltage in the charging device after the charging device is connected to the charger, and respectively compares the D + voltage and the D-voltage with corresponding preset thresholds, and when the comparison result is that both of the D + voltage and the D + voltage are greater than the corresponding preset thresholds, obtains a level of D + under the conditions of a pull-up power supply connected to D + and a pull-down power supply connected to D +, and determines that the port type is the CDP type when the level of D + is a low level.
Optionally, as shown in fig. 2, the apparatus further includes:
an attribute obtaining module 240, configured to, when the charging protocol includes QC2.0, PE +3.0, and PE +2.0, respectively obtain a priority level attribute of the QC2.0, a priority level attribute of the PE +3.0, and a priority level attribute of the PE + 2.0;
the charging module 230 is further configured to perform charging by using a charging protocol with a better priority attribute among the QC2.0, the PE +3.0, and the PE + 2.0;
wherein the priority attribute comprises at least one of a priority, a detection duration, or a detection order.
Specifically, the priority is a parameter that determines the priority level of each operating program for receiving system resources when the computer time-sharing operating system processes a plurality of operating programs, and if the priority level of the parameter is higher, the charging is performed according to a charging scheme corresponding to a protocol with higher priority level parameters in QC2.0, PE +3.0 and PE + 2.0; if the detection time is short and the priority level is high, charging is carried out according to a charging scheme corresponding to a protocol with short detection time in QC2.0, PE +3.0 and PE + 2.0; and if the priority level of the detection sequence is high, charging according to a charging scheme corresponding to the protocol detected in QC2.0, PE +3.0 and PE + 2.0.
In the embodiment of the invention, the port type of the charger is firstly obtained, whether the port type is a special charging port DCP type or not is judged, and if yes, the charging protocol is obtained: and then charging is carried out by adopting a charging scheme corresponding to PE +3.0 or PE +2.0 or QC 2.0. The port type and the corresponding charging protocol of the charger are detected, and a quick charging mode corresponding to the protocol is adopted for charging, so that the charging efficiency is improved, in addition, the compatibility of the mobile terminal to different quick chargers (adapters) is increased, and the quick charging of the mobile terminal can be realized by matching different chargers.
Fig. 6 shows a computer system 10 based on the von neumann architecture, which runs the charging method described above. The computer system 10 may be a user terminal device such as a smart phone, a tablet computer, a palm computer, a notebook computer or a personal computer. Specifically, an
external input interface1001, a
processor1002, a
memory1003, and an
output interface1004 connected through a system bus may be included. The
external input interface1001 may include a
touch screen10016, and optionally a
network interface10018.
Memory1003 can include external memory 10032 (e.g., a hard disk, optical or floppy disk, etc.) and
internal memory10034.
Output interfaces1004 may include devices such as a
display10042 and
speakers10044.
In this embodiment, the method is executed based on a computer program, a program file of the computer program is stored in the
external memory10032 of the computer system 10 based on the von neumann system, and the program file is loaded into the
internal memory10034 during the execution, then compiled into machine code, and then transferred to the
processor1002 for execution, so that the logical
type determining module210, the protocol acquiring module 220, the charging module 230, and the attribute acquiring module 240 are formed in the computer system 10 based on the von neumann system, and during the execution of the charging method, the input parameters are all received through the
external input interface1001 and transferred to the
memory1003 for caching, and then input into the
processor1002 for processing, and the result data of the processing is cached in the
memory1003 for subsequent processing, or transferred to the
output interface1004 for outputting.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.
Claims (8)
1. A method of charging, comprising:
acquiring a port type of a charger, and judging whether the port type is a special charging port (DCP) type;
when the port type is the DCP type, acquiring a charging protocol;
when the charging protocol is a high-pass quick charging protocol QC2.0, charging by adopting a charging scheme corresponding to the QC 2.0;
when the charging protocol is a simultaneous rapid charging protocol PE +3.0, charging by adopting a charging scheme corresponding to the PE +3.0 or a charging scheme corresponding to the PE + 2.0;
when the charging protocol is a joint rapid charging protocol PE +2.0, charging by adopting a charging scheme corresponding to the PE + 2.0;
when the charging protocol comprises a high-pass quick-charging protocol QC2.0, a concurrent quick-charging protocol PE +3.0 and a concurrent quick-charging protocol PE +2.0, respectively acquiring a priority attribute of the QC2.0, a priority attribute of the PE +3.0 and a priority attribute of the PE +2.0, wherein the priority attribute comprises one of a priority parameter, detection time or detection sequence;
charging by adopting a charging scheme corresponding to a protocol with a larger priority level in QC2.0, PE +3.0 and PE + 2.0;
or, charging by adopting a charging scheme corresponding to a protocol with a shorter detection time in QC2.0, PE +3.0 and PE + 2.0;
or, charging by adopting a charging scheme corresponding to a protocol detected in the QC2.0, the PE +3.0 and the PE + 2.0;
when the port type is not the DCP type, judging whether the port type is a standard downlink port SDP type or a charging downlink port CDP type;
when the port type is the SDP type, charging by adopting a first preset current threshold;
when the port type is the CDP type, charging by adopting a second preset current threshold value;
and when the port type is not the SDP type and not the CDP type, charging by adopting a third preset current threshold value.
2. The method of claim 1, wherein the determining whether the port type is a Dedicated Charging Port (DCP) type comprises:
acquiring a first voltage of a positive electrode signal D + of a differential line and a second voltage of a negative electrode signal D-of the differential line;
when the first voltage is greater than a first voltage threshold and the second voltage is greater than a second voltage threshold, connecting a pull-up power supply of the D-and a pull-down power supply of the D + to obtain the level of the D +;
and if the level of the D + is high level, determining that the port type is a DCP type.
3. The method of claim 1, wherein said determining whether said port type is a standard downstream port SDP type comprises:
acquiring a third voltage of a positive electrode signal D + of a differential line and a fourth voltage of a negative electrode signal D-of the differential line, wherein the third voltage and the fourth voltage are voltages before being connected with the charger;
acquiring a fifth voltage of a positive electrode signal D + of a differential line and a sixth voltage of a negative electrode signal D-of the differential line, wherein the fifth voltage and the sixth voltage are voltages after being connected with the charger;
determining that the port type is the SDP type when the third voltage is greater than the fifth voltage and the fourth voltage is greater than the sixth voltage.
4. The method of claim 1, wherein said determining whether said port type is a charging downstream port CDP type comprises:
acquiring a seventh voltage of a positive electrode signal D + of a differential line and an eighth voltage of a negative electrode signal D-of the differential line;
when the seventh voltage is greater than a third voltage threshold and the eighth voltage is greater than a fourth voltage threshold, connecting the pull-up power supply of the D-and the pull-down power supply of the D + to obtain the level of the D +;
and if the level of the D + is low level, determining that the port type is the CDP type.
5. A charging device, comprising:
the type judging module is used for acquiring the port type of the charger and judging whether the port type is a DCP type;
a protocol acquisition module, configured to acquire a charging protocol when the port type is the DCP type;
the charging module is used for charging by adopting a charging scheme corresponding to the QC2.0 when the charging protocol is QC 2.0;
the charging module is further configured to charge the battery by using a charging scheme corresponding to the PE +3.0 or a charging scheme corresponding to the PE +2.0 when the charging protocol is PE + 3.0;
the charging module is further configured to charge the battery by using a charging scheme corresponding to the PE +2.0 when the charging protocol is PE + 2.0;
the attribute acquisition module is used for respectively acquiring a priority level attribute of QC2.0, a priority level attribute of PE +3.0 and a priority level attribute of PE +2.0 when the charging protocol comprises a high-pass quick-charging protocol QC2.0, a simultaneous quick-charging protocol PE +3.0 and a simultaneous quick-charging protocol PE +2.0, wherein the priority level attribute comprises one of a priority level parameter, detection time or detection sequence;
the charging module is further configured to perform charging by using a charging scheme corresponding to a protocol with a higher priority level among the QC2.0, the PE +3.0, and the PE + 2.0; or, charging by adopting a charging scheme corresponding to a protocol with a shorter detection time in QC2.0, PE +3.0 and PE + 2.0; or, charging by adopting a charging scheme corresponding to a protocol detected in the QC2.0, the PE +3.0 and the PE + 2.0;
the type judging module is further configured to judge whether the port type is an SDP type or a CDP type when the port type is not the DCP type;
the charging module is further configured to charge the terminal by using a first preset current threshold when the port type is the SDP type;
the charging module is further configured to charge the port by using a second preset current threshold when the port type is the CDP type;
the charging module is further configured to charge the terminal by using a third preset current threshold when the port type is not the SDP type and not the CDP type.
6. The apparatus of claim 5, wherein the type determining module determines whether the port type is a DCP type, comprising:
the device comprises a first voltage acquisition unit, a second voltage acquisition unit and a control unit, wherein the first voltage acquisition unit is used for acquiring a first voltage of a positive electrode signal D + of a differential line and a second voltage of a negative electrode signal D-of the differential line;
a first level obtaining unit, configured to connect the pull-up power supply of the D-and the pull-down power supply of the D + to obtain a level of the D + when the first voltage is greater than a first voltage threshold and the second voltage is greater than a second voltage threshold;
a first port determining unit, configured to determine that the port type is a DCP type when the level of D + is a high level.
7. The apparatus of claim 5, wherein the type determining module determining whether the port type is an SDP type comprises:
the second voltage obtaining unit is used for obtaining a third voltage of a positive electrode signal D + of a differential line and a fourth voltage of a negative electrode signal D-of the differential line, and the third voltage and the fourth voltage are voltages before being connected with the charger;
the second voltage obtaining unit is further configured to obtain a fifth voltage of a positive signal D + of the differential line and a sixth voltage of a negative signal D-of the differential line, where the fifth voltage and the sixth voltage are voltages after being connected to the charger;
a second port determination unit, configured to determine that the port type is the SDP type when the third voltage is greater than the fifth voltage and the fourth voltage is greater than the sixth voltage.
8. The apparatus of claim 5, wherein the type determining module determining whether the port type is a CDP type comprises:
the third voltage obtaining unit is used for obtaining a seventh voltage of a positive electrode signal D + of the differential line and an eighth voltage of a negative electrode signal D-of the differential line;
the second level obtaining unit is further configured to connect the pull-up power supply of the D-and the pull-down power supply of the D + to obtain the level of the D + when the seventh voltage is greater than a third voltage threshold and the eighth voltage is greater than a fourth voltage threshold;
a third port determining unit, configured to determine that the port type is a CDP type when the level of D + is a low level.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610798997.9A CN106230070B (en) | 2016-08-31 | 2016-08-31 | Charging method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610798997.9A CN106230070B (en) | 2016-08-31 | 2016-08-31 | Charging method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106230070A CN106230070A (en) | 2016-12-14 |
CN106230070B true CN106230070B (en) | 2020-01-10 |
Family
ID=58075227
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610798997.9A Active CN106230070B (en) | 2016-08-31 | 2016-08-31 | Charging method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106230070B (en) |
Families Citing this family (7)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107069844B (en) * | 2017-01-13 | 2019-07-16 | Oppo广东移动通信有限公司 | Charging method, device and terminal |
CN106823392A (en) * | 2017-04-05 | 2017-06-13 | 赵红领 | USB power supply rail toy vehicle systems |
US10651663B2 (en) * | 2017-06-16 | 2020-05-12 | Nxp B.V. | Charging system and method |
WO2019027427A1 (en) * | 2017-07-31 | 2019-02-07 | Hewlett-Packard Development Company, L.P. | Using discharged energy |
CN112640246A (en) * | 2018-12-28 | 2021-04-09 | 深圳市柔宇科技股份有限公司 | Fast charging protocol conversion circuit, device and method |
CN112019681B (en) * | 2019-05-31 | 2021-10-26 | 北京小米移动软件有限公司 | Control method of mobile terminal, mobile terminal and storage medium |
CN113178906A (en) * | 2021-04-13 | 2021-07-27 | 北京小米移动软件有限公司 | Charging method, charging device, electronic device and storage medium |
Citations (6)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN105975038A (en) * | 2016-04-27 | 2016-09-28 | 北京小米移动软件有限公司 | Prompt method and device of charging port detection result |
Family Cites Families (2)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6053280B2 (en) * | 2011-12-22 | 2016-12-27 | ローム株式会社 | Charging circuit and electronic device using the same |
US9430323B2 (en) * | 2013-02-01 | 2016-08-30 | Broadcom Corporation | Power mode register reduction and power rail bring up enhancement |
-
2016
- 2016-08-31 CN CN201610798997.9A patent/CN106230070B/en active Active
Patent Citations (6)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN105975038A (en) * | 2016-04-27 | 2016-09-28 | 北京小米移动软件有限公司 | Prompt method and device of charging port detection result |
Also Published As
Publication number | Publication date |
---|---|
CN106230070A (en) | 2016-12-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106230070B (en) | 2020-01-10 | Charging method and device |
CN102393837B (en) | 2014-07-30 | USB charger recognition device and method |
JP5388484B2 (en) | 2014-01-15 | Apparatus and method for detecting power supply |
US9197075B2 (en) | 2015-11-24 | Charging port based on power state signal |
CN103064489B (en) | 2016-03-30 | A kind of method and terminal of carrying out internal circuit selection according to USB interface state |
CN108988431B (en) | 2021-09-17 | Multi-protocol charging device and multi-protocol charging method |
EP2985856A1 (en) | 2016-02-17 | Usb charging system with variable charging voltage, charger, and intelligent terminal |
CN106329627A (en) | 2017-01-11 | Charging method and device |
CN105449757B (en) | 2018-03-02 | Prevent the method and device that adapter or portable power source disconnect in charging process |
CN103208661A (en) | 2013-07-17 | Intelligent terminal and method for carrying out large-current charging |
CN106329625B (en) | 2019-12-10 | charging method and device |
CN103106167A (en) | 2013-05-15 | Universal Serial Bus (USB) equipment and control method thereof |
CN106329630B (en) | 2019-06-11 | A kind of charging method and device |
CN110829523A (en) | 2020-02-21 | Electronic equipment and reverse charging method |
CN103427460A (en) | 2013-12-04 | Power supply terminal, charge control method and charge control device |
CN105829990A (en) | 2016-08-03 | Method and apparatus for charging electronic device with USB connection |
CN104617615B (en) | 2017-03-22 | Charging method and electronic equipment |
CN105576753A (en) | 2016-05-11 | Information processing method and electronic equipment |
KR20110129202A (en) | 2011-12-01 | Computer system and its control method |
CN104953631A (en) | 2015-09-30 | Current control method and terminal device |
CN106774769B (en) | 2021-09-21 | Terminal working mode switching method and device and handheld terminal |
CN106300533B (en) | 2019-06-11 | A kind of charging method and device |
CN106329628B (en) | 2019-06-11 | A kind of charging method and device |
CN107887938B (en) | 2021-05-14 | Method and mobile terminal compatible with USB standard charging and quick charging |
CN107346905B (en) | 2023-01-31 | Power supply method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2016-12-14 | C06 | Publication | |
2016-12-14 | PB01 | Publication | |
2017-01-11 | SE01 | Entry into force of request for substantive examination | |
2017-01-11 | SE01 | Entry into force of request for substantive examination | |
2020-01-10 | GR01 | Patent grant | |
2020-01-10 | GR01 | Patent grant |