CN111327087B - Electronic equipment and charging method thereof - Google Patents
Electronic equipment and charging method thereof Download PDFInfo
- Publication number
- CN111327087B CN111327087B CN201811532001.5A CN201811532001A CN111327087B CN 111327087 B CN111327087 B CN 111327087B CN 201811532001 A CN201811532001 A CN 201811532001A CN 111327087 B CN111327087 B CN 111327087B
- Authority
- CN
- China
- Prior art keywords
- charger
- voltage
- charging
- determined
- type
- 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
Links
- 238000007600 charging Methods 0.000 title claims abstract description 226
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000012545 processing Methods 0.000 claims description 59
- 230000002159 abnormal effect Effects 0.000 claims description 57
- 230000008569 process Effects 0.000 claims description 25
- 238000010586 diagram Methods 0.000 description 24
- 238000001514 detection method Methods 0.000 description 7
- 230000005856 abnormality Effects 0.000 description 5
- 238000004590 computer program Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000012360 testing method Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 3
- 238000010277 constant-current charging Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000010280 constant potential charging Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010281 constant-current constant-voltage charging Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000011895 specific detection Methods 0.000 description 1
Images
Landscapes
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
The invention discloses electronic equipment and a charging method thereof, which are used for solving the problem of poor compatibility of a charger when the conventional electronic equipment is charged. After the charger is inserted, if the charger is detected not to be in a power supply state or the path from the charger to the battery is in a closed state, the state of the charging chip is reset, the signal positive DP and the signal negative DM of the charger are reset, the output current of the charger is reduced, whether the charger is in the power supply state or not and whether the path from the charger to the battery is in an open state or not are judged in a return mode, if not, the output current of the charger is reduced again until the charger is determined to be in the power supply state and the path from the charger to the battery is in the open state or the output current reaches a preset current threshold value, and the output current of the charger is adjusted, so that the electronic equipment can be charged by using more chargers with different specifications, and the compatibility of the charger when the electronic equipment is charged is improved.
Description
Technical Field
The present invention relates to the field of electronic devices, and in particular, to an electronic device and a charging method thereof.
Background
With the development of technology, the variety of mobile electronic devices such as mobile phones and tablet computers is increasing, and chargers used by different electronic devices are different, wherein the chargers are mainly embodied on charger heads and charging lines.
For the charger head, there are distinguished from the rated output voltage/rated output current: 5V/2A,5V/3A,9V/1.2A,9V/2A and the like, and the specifications are distinguished from the charger types: standard type, non-standard type, standard USB (Universal Serial Bus), and the like;
to the charging wire, most electronic equipment is used for the interface of charging to be micro USB at present, but TYPE-C interface with higher than micro (minimum) USB's data transmission speed with do not have positive and negative direction's branch, positive and negative all can insert advantage such as being replacing micro USB gradually, consequently the demand of the charging wire of TYPE-C interface is also higher and higher. Some manufacturers make the charging interface of the charging wire like TYPE-C, but the inside is the same as micro USB, so that some charging wires using the charging wire with TYPE-C (TYPE C) interface but the actual internal structure is still micro USB cannot be charged.
Therefore, some electronic devices can be charged using standard chargers, and cannot be charged using chargers of other specifications.
In summary, the compatibility of the charger is poor when the conventional electronic device is charged.
Disclosure of Invention
The invention provides electronic equipment and a charging method thereof, which are used for solving the problem of poor compatibility of a charger when the conventional electronic equipment is charged.
The method comprises the following steps:
in a first aspect, a method for charging provided by an embodiment of the present invention includes:
after the charger is inserted, judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state; if the charger is determined not to be in the power supply state or the path from the charger to the battery is in the closed state, resetting the state of the charging chip and resetting the signal positive DP and the signal negative DM of the charger, reducing the output current of the charger, and returning to the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state until the charger is determined to be in the power supply state and the path from the charger to the battery is in the open state or the output current is less than a preset current threshold.
In the above method, after the charger is inserted, if it is detected that the charger is not in the power supply state or the path from the charger to the battery is in the closed state, the state of the charging chip is reset, and the signal positive DP and the signal negative DM of the charger are reset, the output current of the charger is reduced, and whether the charger is in the power supply state and the path from the charger to the battery is in the open state is determined, if not, the output current of the charger is reduced again until it is determined that the charger is in the power supply state and the path from the charger to the battery is in the open state or a preset current threshold is reached. According to the embodiment of the invention, the output current of the charger is adjusted to enable some electronic equipment which cannot be charged to be charged, so that the electronic equipment can be charged by using more chargers with different specifications, and the compatibility of the charger when the electronic equipment is charged is improved.
In an optional embodiment, when charging is performed by a charger, if it is determined that the TYPE of an interface to be charged is TYPE-C, determining whether a CC signal is detected, and if so, determining whether the charger is in a power supply state and whether a path from the charger to a battery is in an open state; otherwise, the output current of the charger is adjusted to the preset current threshold value.
According to the method, if the TYPE of the interface for charging the electronic equipment is TYPE-C, the corresponding standard TYPE-C has the CC signal, and if no CC signal is detected, the CC line can be determined to be a non-standard TYPE-C line.
In an alternative embodiment, the reducing the output current of the charger includes:
and reducing the output current of the charger according to the set step value.
In an optional embodiment, before reducing the output current of the charger, the method further includes:
and determining that the output voltage of the charger does not exceed a preset output voltage corresponding to the type of the charger.
According to the method, if the output voltage of the charger is determined not to exceed the output voltage corresponding to the type of the charger, the charger is not damaged, if the charger is determined to be damaged, adjustment is not carried out any more, and if the charger is determined to be not damaged, the output battery of the charger is reduced according to the set step value, so that the charger can charge the electronic equipment as much as possible.
In an optional embodiment, after determining that the output voltage of the charger does not exceed the preset output voltage corresponding to the type of the charger and before reducing the output current of the charger, the method further includes:
if the type of the charger is determined to be a high-voltage charger and the output voltage of the charger does not reach the preset lowest output voltage threshold value corresponding to the high-voltage charger, the output voltage of the charger is adjusted to be the preset voltage threshold value.
According to the method, if the output voltage of the high-voltage charger is judged not to reach the corresponding preset lowest output voltage threshold value on the premise that the high-voltage charger is not damaged, the output voltage is adjusted in an attempt mode, the charger can charge the electronic equipment as much as possible, and the compatibility of the charger is improved.
In an optional implementation manner, after the charging abnormality is determined, according to the corresponding relation between the abnormal condition and the processing manner, the processing manner corresponding to the abnormal condition met by the charging abnormality is determined;
and processing according to the determined processing mode.
In an alternative embodiment, the exception condition and the corresponding handling manner include some or all of the following:
if the abnormal condition is that the type of the current charger is not a USB type and the charging amount is smaller than a set electric quantity threshold value, the output current is smaller than a minimum current value corresponding to a fast charging standard or smaller than a difference value between the maximum output current and the estimated maximum power consumption current, the processing mode is to inform that the charging is too slow;
if the abnormal condition is that the TYPE of an interface for charging the electronic equipment is determined to be TYPE-C, a CC signal is not detected, and the output current of the charger is adjusted to a preset current threshold value, then the charger is determined not to be in a power supply state or a passage from the charger to the battery is in a closed state, and the non-standard charging wire is notified in a processing mode;
if the abnormal condition is that the charger type is determined to be a non-standard charger, the abnormal condition is processed in a mode that the non-standard charger is informed, and the output current of the charger is adjusted to be a preset current threshold value;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set high-temperature range, the processing mode is to inform that the temperature of the battery is too high;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set low-temperature range, the processing mode is to inform that the temperature of the battery is too low;
and if the abnormal condition is that the temperature of the mainboard of the electronic equipment exceeds the high-temperature threshold, the notification mode is to process the overhigh temperature of the electronic equipment.
According to the method, the user is prompted by judging the abnormal conditions met in the charging process, the reason for the abnormal charging can be quickly located, and the using effect is improved.
In a second aspect, an embodiment of the present invention further provides an electronic device for charging, where the electronic device includes: processor and charging chip:
the processor is configured to: after the charger is inserted, judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state; if the charger is determined not to be in the power supply state or the path from the charger to the battery is in the closed state, resetting the state of the charging chip and resetting the signal positive DP and the signal negative DM of the charger, reducing the output current of the charger, and returning to the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state until the charger is determined to be in the power supply state and the path from the charger to the battery is in the open state or the output current is less than a preset current threshold.
In one possible implementation, the processor is further configured to:
when the charger is used for charging, if the TYPE of an interface for charging is determined to be TYPE-C, whether a CC signal is detected or not is judged, and if so, whether the charger is in a power supply state or not and whether a path from the charger to a battery is in an open state or not is judged; otherwise, the output current of the charger is adjusted to the preset current threshold value.
In one possible implementation, the processor is specifically configured to:
and reducing the output current of the charger according to the set step value.
In one possible implementation, the processor is further configured to:
and after the output voltage of the charger is determined not to exceed the preset output voltage corresponding to the type of the charger, reducing the output current of the charger.
In one possible implementation, the processor is specifically configured to:
if the type of the charger is determined to be the high-voltage charger and the output voltage of the charger does not reach the preset lowest output voltage threshold corresponding to the high-voltage charger, the output voltage of the charger is adjusted to be the preset voltage threshold, and then the output current of the charger is reduced.
In one possible implementation, the processor is specifically configured to:
after the charging abnormity is determined, determining a processing mode corresponding to the abnormal condition met by the charging abnormity according to the corresponding relation between the abnormal condition and the processing mode;
and processing according to the determined processing mode.
In one possible implementation, the processor is specifically configured to:
if the abnormal condition is that the type of the current charger is not a USB type and the charging amount is smaller than the set electric quantity threshold value, the output current is smaller than the minimum current value corresponding to the fast charging standard or smaller than the difference value between the maximum output current and the estimated maximum power consumption current, the processing mode is to inform that the charging is too slow;
if the abnormal condition is that the TYPE of an interface for charging the electronic equipment is determined to be TYPE-C, a CC signal is not detected, and the output current of the charger is adjusted to a preset current threshold value, then the charger is determined not to be in a power supply state or a passage from the charger to the battery is in a closed state, and the non-standard charging wire is notified in a processing mode;
if the abnormal condition is that the charger type is determined to be a non-standard charger, the abnormal condition is processed in a mode that the non-standard charger is informed, and the output current of the charger is adjusted to be a preset current threshold value;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set high-temperature range, the processing mode is to inform that the temperature of the battery is too high;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set low-temperature range, the processing mode is to inform that the temperature of the battery is too low;
and if the abnormal condition is that the temperature of the mainboard of the electronic equipment exceeds the high-temperature threshold, the notification mode is to process the overhigh temperature of the electronic equipment.
In a third aspect, an embodiment of the present invention further provides an electronic device for performing charging, where the electronic device includes:
a determination module: the charger is used for judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state after the charger is inserted;
a processing module: and if the charger is determined not to be in the power supply state or the path from the charger to the battery is in the closed state, resetting the state of the charging chip and resetting the signal positive DP and the signal negative DM of the charger, reducing the output current of the charger, and returning to the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state until the charger is determined to be in the power supply state and the path from the charger to the battery is in the open state or the output current is smaller than a preset current threshold value.
In a fourth aspect, the present application also provides a computer storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of the method of the first aspect.
In addition, for technical effects brought by any one implementation manner in the second aspect to the fourth aspect, reference may be made to technical effects brought by different implementation manners in the first aspect, and details are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments will be briefly introduced below, and it is apparent that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings may be obtained according to the drawings without inventive labor.
Fig. 1 is a schematic view of a charging scenario according to an embodiment of the present invention;
fig. 2A is a schematic structural diagram of a charger according to an embodiment of the present invention;
fig. 2B is a schematic structural diagram of another charger according to an embodiment of the present invention;
fig. 2C is a schematic structural diagram of a third charger according to an embodiment of the invention;
fig. 3 is a schematic diagram of a charging method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware connection between an electronic device and a charger according to an embodiment of the present invention;
FIG. 5 is a schematic view of a processing flow of a non-standard TYPE-C line according to an embodiment of the present invention;
FIG. 6A is a schematic circuit diagram of a standard USB type charger for a first test according to an embodiment of the present invention;
FIG. 6B is a schematic circuit diagram of a standard charger for a first test according to an embodiment of the present invention;
fig. 6C is a schematic circuit diagram of a non-standard charger for a first test according to an embodiment of the present invention;
FIG. 7A is a schematic circuit diagram of a non-standard charger for a second test according to an embodiment of the present invention;
FIG. 7B is a schematic diagram of a circuit for providing a standard charger for a second test according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating a process for detecting that the charger is not in a power-on state or that the path from the charger to the battery is in an off state according to an embodiment of the present invention;
FIG. 9 is a flowchart illustrating a review process according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a process for determining a battery status according to an embodiment of the present invention;
fig. 11 is a schematic flowchart of a process for slowing down a charger according to an embodiment of the present invention;
fig. 12 is a schematic flowchart of a complete method for charging according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a first electronic device for charging according to an embodiment of the invention;
FIG. 14 is a schematic structural diagram of a second charging electronic device according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of a third electronic device for performing charging according to the embodiment of the present invention.
Detailed Description
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments will be briefly introduced below, and it is apparent that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings may be obtained according to the drawings without inventive labor.
Some of the words that appear in the text are explained below:
1. the SOC provided by the embodiment of the invention is called State of Charge (SOC) which is also called residual capacity, represents the ratio of the residual capacity of a battery after being used for a period of time or left unused for a long time to the capacity of the battery in a full Charge State, and is expressed by common percentage, and means that the residual capacity is 0-100%.
2. The "Board level" provided in the embodiments of the present invention refers to a Printed Circuit Board (PCB) Board of an electronic device, such as a motherboard of a mobile phone.
3. The electronic equipment provided by the embodiment of the invention refers to mobile electronic products, such as mobile phones, tablet computers, intelligent equipment and the like.
4. The "charger head" provided by the embodiment of the present invention refers to a power adapter, and is used for converting mains supply into voltage which can be borne by electronic equipment when the electronic equipment is charged through the charger head and a charging wire, wherein the input voltage is generally 100-240V, the output voltage is about 5V, and the power adapter has certain power output capability, for example: the specification of 5V/2A,9V/1A and the like is that under the condition of the same voltage, the charging is faster as the current is larger.
The application scenario described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not form a limitation on the technical solution provided in the embodiment of the present invention, and it can be known by a person skilled in the art that with the occurrence of a new application scenario, the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems. In the description of the present invention, the term "plurality" means two or more unless otherwise specified.
The embodiment of the invention is suitable for a scene that the electronic equipment is charged by using the charger, such as a mobile phone shown in figure 1.
Currently, mobile electronic devices are various, such as mobile phones, tablets, and the like. Charging requirements of different electronic devices are different, for example, a certain type of mobile phone needs a low-voltage charger, and a certain type of tablet computer needs a high-voltage charger, so as to meet the charging requirements of different electronic devices, specifications of the corresponding chargers are more and more, which are embodied in a charger head and a charging line, and the following description exemplifies the classification of the charger head:
the first classification method comprises the following steps: sorting by output current/output voltage;
the output current/output voltage of the charger includes, but is not limited to, the following specifications: 5V/2A,5V/3A,9V/1.2A and 9V/2A.
The charger may be classified into the above specifications according to output current/output voltage.
It should be noted that the output current of the charger is the maximum current that the charger can provide, and the current marked on the electronic device is the rated current of the electronic device, that is, the "required current" of the electronic device.
For example: one mobile phone supports 5V/1.5A input at most, if a 5V/1A charger is used, the mobile phone can be charged only by 5V/1A, the charging speed is low, and the heat is serious because the charger always works in full load; if a 5V/2A charger is used for charging, the mobile phone controls the charger to input only 1.5A of current, and the load of the charger is low, so that sufficient margin is provided.
It should be noted that, in order to prevent the charger from being damaged due to the constant full-load operation, the maximum output current is set in the charger, and when the maximum output current is exceeded, the charger is automatically protected to cut off the current output, so that the mobile phone cannot be charged.
And a second classification mode: sorting by low pressure and high pressure;
the classification of chargers can be distinguished by voltage class: a low voltage charger and a high voltage charger;
wherein, 5V/2A and 5V/3A belong to low-voltage chargers; 9V/1.2A and 9V/2A belong to high-voltage chargers.
Among them, the low voltage charger is also called a common 5V charger (DCP).
And (4) classification three: classifying according to charger types;
the Charger may be classified into an SDP (Standard downlink Port), DCP (Dedicated Charging Port), CDP (Charging downlink Port), ACA (access Charger Adapter), and non-Standard Charger type according to the BC1.2 protocol.
Among the types of chargers that are more commonly used are the SDP, DCP, and non-standard charger types.
SDP, commonly called standard USB type, for example, the standard USB type when charging through a USB port of a computer;
DCP, commonly known as standard charger type, such as standard charger for electronic products such as mobile phone or tablet computer;
non-standard charger type, non-standard type of charger.
As shown in fig. 2A, 2B, and 2C, the structure of the charger is shown in different types:
fig. 2A is a schematic diagram of an internal structure of a standard USB type charger during charging, where D + Data line is a signal line DP (Data Plus, signal positive, hereinafter referred to as D +) of the USB type charger, D-Data line is a signal line DM (Data minus, signal negative, hereinafter referred to as D-) of the USB type charger, and the signal line DM has a pull-down resistance of 15K.
As shown in fig. 2B, for the detected schematic diagram of the internal structure of the standard charger during charging, the signal line DP (D +) and the signal line DM (D-) of the standard charger are short-circuited, and the rated current of most mobile phone chargers in the market is above 1.5A.
As shown in fig. 2C, a schematic diagram of an internal structure of the detected non-standard charger during charging is shown, where a signal line DP (D +) and a signal line DM (D-) of the non-standard charger are suspended;
it should be noted that most detected non-standard chargers are caused by too slow speed when the charger or the charging wire is inserted, slow insertion causes the DP and the DM to be connected too late, and DP and DM are detected to be floating because the DP and DM of the electronic device and the charger are not connected at the time of detection, and it is determined that the detected charger type is a non-standard charger.
Accordingly, there are many types of charging cord, which are mainly embodied in the type of interface for charging, and the types of charging cord include, but are not limited to, some or all of the following: USB Type-A, USB Type-B, micro USB, USB Type-C (hereinafter referred to as Type-C), etc.
The USB Type-A interface is a common USB interface and is mainly used for devices such as computers, chargers, mice, keyboards, USB flash disks and the like;
the USB Type-B interface Type is mainly used for equipment such as a printer;
the Micro USB interface type is a common interface of a mobile phone charger;
Type-C is a neotype cell-phone charger interface, supports positive and negative blind insertion, supports heavy current and big voltage, helps improving the charging speed, when using Type-C interface to carry out data transmission and charge, the speed all is higher than using the Micro USB interface.
Because the charger specifications are different, some electronic equipment can only use standard chargers, and the charging requirements of the electronic equipment cannot be met when other chargers are applied. The embodiment of the invention detects the charging process when the charger is used for charging, if the charger is detected not to be in a power supply state or the passage from the charger to the battery is in a closed state, the output current or the output voltage of the charger is adjusted to enable the charger to try to charge the electronic equipment as much as possible, and if the charger is detected not to be in the power supply state or the passage from the charger to the battery is in the closed state after the output current and/or the output voltage are adjusted, the reason of incapability of charging is further judged, and the user is pertinently prompted according to the reason of incapability of charging.
The embodiments of the present invention will be described in further detail with reference to the drawings attached hereto.
As shown in fig. 3, an embodiment of the present invention provides a method for charging, which specifically includes the following steps:
step 300: after the charger is inserted, judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state;
step 301: if the charger is determined not to be in the power supply state or the path from the charger to the battery is in the closed state, resetting the state of the charging chip and resetting the signal positive DP and the signal negative DM of the charger, reducing the output current of the charger, and returning to the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state until the charger is determined to be in the power supply state and the path from the charger to the battery is in the open state or the output current is less than a preset current threshold value.
Through the scheme, after the charger is inserted, if the charger is detected not to be in a power supply state or a passage from the charger to the battery is in a closed state, the state of the charging chip is reset, the signal positive DP and the signal negative DM of the charger are reset, the output current of the charger is reduced, whether the charger is in the power supply state or not and whether the passage from the charger to the battery is in an open state or not are judged in a return mode, and if not, the output current of the charger is reduced again until the charger is determined to be in the power supply state and the passage from the charger to the battery is in the open state or a preset current threshold value is reached. According to the embodiment of the invention, the output current of the charger is adjusted to enable some electronic equipment which cannot be charged to be charged, so that the electronic equipment can be charged by using more chargers with different specifications, and the compatibility of the charger when the electronic equipment is charged is improved.
An exemplary connection diagram of an electronic device charged by a charger according to an embodiment of the present invention is shown in fig. 4, which is an exemplary connection diagram of an electronic device having a standard Type-C interface charged by a charger with a standard Type-C line.
The pins of the charger include the VBUS output voltage, signal (D +) DP, signal (D-) DM, and GND ground. Type-C charging wire has the CC passageway, and the chip that charges of corresponding electronic equipment also has corresponding pin to be connected with the charging wire to keep being connected with the charger.
The CC is a channel of a standard TYPE-C line, is a key channel newly added in a USB TYPE-C line, and has the functions of detecting USB connection, transmitting data among USB devices, establishing and managing connection of VBUS and the like.
When the charger is used for charging, after the charger is inserted, if the TYPE of the interface for charging is determined to be TYPE-C by the electronic device, the TYPE of the charging line needs to be detected.
The type of the interface of the charging line is the same as the type of the interface of the electronic device, so if the type of the charging line is to be detected, the type of the interface of the electronic device for charging may be determined, and the following describes a manner of determining the type of the interface of the electronic device for charging:
the hardware structure of the electronic device is various, and the way of determining the type of the interface for charging is different for different corresponding hardware structures, such as the following cases:
the first condition is as follows: the electronic equipment is provided with only one charging interface;
if there is only one interface for charging the electronic device, the variable of the interface type is fixed in the software, and the interface type for charging the electronic device can be determined without detection.
Case two: the electronic equipment is provided with a plurality of charging interfaces;
the Type-C and microUSB interfaces can be distinguished through hardware design, and the interface Type for charging is notified to the processor through gpio (General Purpose Input Output).
For example, if the gpio flag bit is 1 or the gpio flag bit is monitored to be at a high level, it indicates that the interface for charging is of a Type-C Type; if the gpio flag bit is 0 or gpio is monitored to be low, it indicates that the interface for charging is micro USB.
If the electronic device determines that the TYPE of the interface to be charged is TYPE-C, if the CC signal is detected, it determines that the charging line used for charging is a standard TYPE-C line, if the CC signal is not detected, it indicates that the charging line used is a non-standard TYPE-C line, and if the electronic device determines that the TYPE of the interface to be charged is TYPE-C and the CC signal is not detected, the processing shown in fig. 5 is performed:
In the embodiment of the present invention, the notification manner includes, but is not limited to: a voice prompt or a text prompt.
In step 503, the electronic device can be charged by reducing the output current of the charger to the preset current threshold, but the charging is slow due to the small current.
For the value of the preset current threshold, the lowest charging current under the USB 2.0 standard is 500mA; the lowest charging current under the USB3.0 standard is 900mA.
Correspondingly, if the charging protocol applied by the charger is USB 2.0, the preset current threshold is determined to be 500mA, and if the charging protocol applied by the charger is USB3.0, the preset current threshold is determined to be 900mA.
The charging protocol applied by the charger can be determined through the level change of the charging chip and the charger signal line, the electronic device performs specific setting according to the application protocol of the charger, and the setting corresponding to other charging protocols is not repeated here.
For the existing charging process, after a charger is inserted, the electronic equipment starts different charging control schemes according to the type of the charger so as to control the current of each stage.
As can be seen above, the types of chargers include, but are not limited to: the standard charger type, the standard USB type, or the non-standard charger type.
For the way of determining the type of charger, the following is exemplified:
the first embodiment is as follows: as shown in fig. 6A, 6B and 6C, in order to detect the type of the charger by mtk (MediaTek, taiwan co-generation technology), when the charger is plugged in, an analog switch in the charger is turned on, and the type of the charger is determined by detecting the level of the DM: as shown in fig. 6A, if the detected DM is low, the charger type is a standard USB type charger; fig. 6B and 6C if DM is high, the charger type is either a standard charger or a non-standard charger.
And when the charger type is judged to be a standard charger or a non-standard charger, the analog switch is turned off, and the charger type is determined to be the standard charger or the non-standard charger by detecting a 1.5K pull-up resistor of the DP and a 15K pull-down resistor of the DM. By detecting the DM level: as shown in fig. 7A, if DM is high, the charger type is a standard charger; as shown in fig. 7B, if DM is low, the charger type is non-standard charging.
Example two: referring to fig. 4, the charger type is detected by BC1.2 (Battery Charge) protocol.
When the charger is plugged in, a PHY (physical layer) inside the electronic device starts a charger detection process, and the detection is performed for the first time: detecting the voltage on the DP, and if the voltage on the DP is more than 0.4v and the voltage on the DM is detected to be more than 0 and less than 0.4v, determining that the charger type is a standard USB type; or if the voltage on DP is greater than 0.4v and it is detected that the voltage on DM is greater than 0.4v, then the charger type is determined to be DCP or CDP.
And (3) second detection: detecting the voltage on the DM, and if the voltage on the DM is more than 0.4v and the voltage on the DP is less than 0.4v, determining that the type of the charger is CDP; or if the voltage on the DM is greater than 0.4v and the voltage on the DP is greater than 0.4v, determining the type of the charger as DCP;
for a non-standard charger, since DP and DM are floating or not properly connected during detection, if the voltage on DP and DM is detected to be 0, it is determined that the charger type is a non-standard charger.
After the charger type is determined to be the DCP, whether the specification of the charger is the high-voltage charger is detected according to a protocol applied by the high-voltage charger, wherein the protocol of the high-voltage charger corresponding to the high-pass system is QC2.0/3.0, and the protocol of the high-voltage charger corresponding to the mtk system is mtk pe +.
And determining the charger type corresponding to the detected DP and DM levels according to the corresponding relation between the level values of the DP and the DM and the output voltage of the charger by a high-pass charging protocol QC (Qualcomm, high-pass) 2.0/3.0. Accordingly, the output voltage of the charger may also be adjusted by adjusting the levels of DP and DM.
Wherein, the corresponding relationship between the level values of DP and DM and the output voltage of the charger is shown in table 1 below:
| DP(V) | DM(V) | output voltage of charger (V) |
| 0.6 | 0.6 | 12 |
| 3.3 | 0.6 | 9 |
| 3.3 | 3.3 | 20 |
| 0.6 | GND | 5 |
TABLE 1
The protocol is suitable for standard USB communication cable or general USB charging cable, the electronic device communicates with the charger head to transmit instructions through VBUS and GND wire (grounding wire) of the USB cable, and D + and D-signal wires are not needed. The protocol regulates the output voltage of the charger head by pulsing the current, including 12V, 9V, 7V, 5V, 4.8V, 4.6V, 4.4V, 4.2V, 4V, 3.8V, and 3.6V.
For the charger, a low voltage is 5.5V or less, and a high voltage is 5.5V or more.
According to the embodiment of the invention, after the charger is inserted, if the TYPE of the interface for charging the electronic equipment is detected to be TYPE-C, and a CC signal is determined to be detected; or determining that the TYPE of an interface for charging the electronic equipment is not TYPE-C, configuring the output current of the charger by the electronic equipment according to the TYPE of the charger, detecting whether the charger is in a power supply state or not and whether a path from the charger to the battery is in an open state or not after the preset time is reached, and if so, not needing processing; embodiments of the present invention provide a possible solution if the charger is not powered or if the path from the charger to the battery is off.
Fig. 8 is a schematic process flow diagram of an embodiment of the invention when detecting that the charger is not in a power supply state or the path from the charger to the battery is in a closed state, where the specific implementation steps of the re-inspection process in fig. 8 refer to fig. 9.
After the type and specification of the charger are determined, different specifications (high voltage and low voltage) of a standard charger (DCP) can be divided into the following corresponding adjustment modes:
a standard low voltage charger (DCP) with an output voltage not exceeding 6.5V in a first adjustment mode;
as shown in the flow chart of fig. 8, if it is determined that the type of the charger is the standard type low-voltage charger and it is detected that the output voltage VBUS of the charger is less than 6.5V, the rechecking process is performed on the charger, and the specific execution steps of the rechecking process are shown in fig. 9: reducing the output current of the charger according to a predetermined step value, resetting the state of the charging chip and the DP and DM of the charger before reducing the output current of the charger to enable the reconfigured current, and returning to the step of determining whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state after adjusting the output current.
For example, if I1= I- δ I and δ I is a custom variable, such as 200mA, the output current of the charger is adjusted according to I1= I-200 after detecting that the charger is not in a power supply state or the path from the charger to the battery is in a closed state.
When the current value is adjusted for the first time, the I can be a rated current value when the electronic equipment is charged; or other values preset according to the use requirements.
For example, when the standard charger specification of a certain mobile phone is 5V/2A, and the rated current value is 2A, the output current I1 of the reconfigured charger is determined to be 2000mA-200ma =1800ma by calculating I1= I-200.
It should be noted that the rated current value of the electronic device is fixed, detection is not required, and the rated current value can be obtained according to a value preset in software.
After the output current of the charger is adjusted according to the method, if the charger is in a power supply state and a path from the charger to the battery is in an open state, the current state is kept for continuous charging; if the state of the charger is not the power supply state or the passage from the charger to the battery is the closed state, the output current of the charger is adjusted again according to the algorithm until the charger is judged to be the power supply state and the passage from the charger to the battery is the open state, or the output current of the charger reaches the preset current threshold value, namely the output current cannot be reduced any more.
For example, with reference to the above embodiment, if the preset current threshold is 500mA, and if the output current of the charger is 1800mA, it is detected that the charger is not In the power supply state or the path from the charger to the battery is In the off state, the adjusted current value is continuously calculated according to In = Ipre-200. Here, ipre is the last output current value.
The second adjusted output current is I2=1800mA-200ma =1600ma, and the state of the charging chip and DP and DM of the charger are reset again before the output current value of the charger is adjusted, thereby enabling the reconfigured current, and the determining step is returned again.
If the charger is judged not to be In a power supply state or the passage from the charger to the battery is In a closed state, the current value of the next time is continuously adjusted according to In = Ipre-200 until the adjusted current value is less than 500mA, the adjustment is not continued, and the user is informed to try again after the charger or the charging wire is replaced, wherein the informing mode is the informing mode described above, and the details are not repeated here.
Regulation of the charger output voltage: the charger head is internally provided with a charging control MCU (Microcontroller Unit), a charging chip of the electronic equipment is communicated with the charger head through a charging wire and sends a trigger signal for triggering and adjusting the output voltage of the charger, and the MCU in the charger head adjusts the output voltage of the charger according to different received trigger signals;
for example, the high-pass QC2.0/3.0 charger triggers different output voltages according to the received voltage signals on DP and DM; the MTK PE + type charger triggers voltage boosting or voltage reduction through the magnitude of charging current; the MTK PE3.0 Type charger uses a standard Type-C interface, and the charger adjusts the output voltage of the charger according to DP/DM/CC1/CC2 signals.
A second adjustment mode, a standard low voltage charger (DCP) with output voltage exceeding 6.5V;
as shown in the flow chart of fig. 8, after determining that the type of the charger is DCP, if it is detected that the output voltage VBUS is greater than 6.5V, it is determined that the charger is damaged, and the embodiment of the present invention notifies the user that the charger is damaged, and tries to prompt the user to replace the charger again in a similar manner or by voice.
Regulating mode three, standard high voltage charger (HVDCP) with output voltage over 6V;
the preset minimum output voltage threshold of the high-voltage charger is generally 6V, and as shown in the process of fig. 8, if it is detected that the output voltage of the charger is less than 6V, after trying to set the charger to a lower output voltage, it is detected that the charger is not in a power supply state or a path from the charger to the battery is in a closed state.
Before the output voltage is adjusted to 5V, the state of the charging chip and DP and DM of the charger are reset, thereby enabling the reconfigured voltage, and it is determined that the charger is not in a power supply state or a path from the charger to the battery is in a closed state after the voltage value is adjusted.
If yes, keeping the current state to continue charging; if not, the output current is adjusted according to the preset step value until the charger is determined to be in a power supply state and a path from the charger to the battery is in an open state, or the output current is smaller than a preset current threshold value.
For the adjustment of the output current, the specific implementation steps may refer to the specific adjustment steps of the output current in the standard type charger (DCP) with the output voltage not exceeding 6.5V in the first adjustment mode, which is not described herein again.
The adjustment mode is four, and the output voltage exceeds a standard high-voltage charger of 6V;
as shown in the flowchart of fig. 8, if it is determined that the type of the charger is the standard type high voltage charger and it is detected that the output voltage exceeds 6V, the output current of the charger may be reduced by a predetermined step value, the state of the charging chip and DP and DM of the charger need to be reset before the output current of the charger is reduced, thereby enabling the reconfigured current, and it is determined that the charger is not in a power supply state or a path from the charger to the battery is in a closed state after the current value is adjusted.
If yes, keeping the current state to continue charging; if not, the output current is adjusted according to the preset step value until the charger is determined to be in a power supply state and a path from the charger to the battery is in an open state or the output current is smaller than a preset current threshold value.
For the adjustment of the output current, the specific implementation steps may refer to the specific adjustment steps of the output current in the standard type charger (DCP) with the output voltage not exceeding 6.5V in the first adjustment mode, which is not described herein again.
It should be noted that, in the whole charging process, if a charging abnormality occurs, the present invention may notify or adjust the specific charging abnormality, and the specific charging abnormality is described below:
charging exception one: a battery temperature anomaly;
the battery temperature is detected in the whole charging process through the flow shown in fig. 10, and the specific detection mode is as follows: after the charger is connected, whether the battery exists or not is judged by checking the state of the battery, if so, the temperature of the battery is continuously read, and if the temperature is abnormal (lower than 0 ℃ or higher than 60 ℃), a user is prompted that the battery does not exist or the temperature of the battery is too high or the temperature of the battery is too low; if normal, proceed to the next step.
Among them, there are many ways to obtain the battery status based on hardware solutions, such as reading through gpio/ADC.
For example, the resistance value of a thermistor connected to the battery or the chip is obtained, and the battery temperature is determined by obtaining the resistance value of the thermistor inside the battery through an analog-to-digital converter.
And charging abnormity II: the charging speed is abnormal;
as shown in fig. 11, a flowchart of a method for determining charging speed according to an embodiment of the present invention is provided.
The electronic device reads the current remaining capacity SOC, the incoming battery current (IBAT), the battery temperature (BAT _ TEMP), the BOARD temperature (bound _ TEMP), the CHARGER TYPE (CHARGER _ TYPE) and the output Voltage (VBUS) of the CHARGER.
The following description will be made to determine whether the charging speed is too slow:
if the electric quantity SOC is smaller than S _ thr, the charging current IBAT of the battery is smaller than a threshold I _ thr (I _ thr = min (1C-1000mA, 1500)), and the type of the plug-in charger is detected to be not USB, the charging speed of the charger is determined to be slow;
it should be noted that the charger or the electronic device can divide the charging process into different stages, such as: trickle charge, pre-charge, constant current charge, constant voltage charge to protect the battery from being damaged by long-term quick charge, wherein, the threshold value of S _ thr can be determined according to the charging stage set by the charger or the electronic device, and the charging speed is reduced above the charging stage until the remaining capacity is 80%.
Among them, there are various selection ways for selecting the threshold value I _ thr, which are exemplified below:
the selection mode is as follows: taking a small value;
and determining the minimum value of the output current of the output power corresponding to the quick charging according to the platform standard.
For example, according to the boundary of the android platform for fast charging and slow charging, the charging power is faster than 7.5W, and the output voltage and the output current corresponding to the charging power are 5V/1.5A; then under the platform standard, the current threshold I _ thr is 1.5A.
And a second selection mode: setting according to project requirements and company/industry standards;
and determining a circuit threshold value I _ thr according to the difference value between the maximum charging current Itarg of the charger and the maximum power consumption current which is determined according to the project requirement and the company/industry standard setting.
For example, 3000mAh battery, the maximum charging current Itarg is 3000mA. δ I1 is an estimated value of the maximum system power consumption, and if the estimated value of the maximum system power consumption is 1000mA. Then in this scenario, the current threshold I _ thr is 3000mA-1000ma = -2000ma.
After the charger is determined to be slow in charging speed, if the charger type is detected to be a non-standard charger, the abnormal charging condition is that the charger type is the non-standard charger, the corresponding processing mode is to adjust the output current of the charger to be a preset current threshold value, and inform a user of the non-standard charger, so that the charging is slow.
If the charger type is determined to be a standard type and the battery temperature is detected to be in a warm range, the abnormal charging condition is that the temperature of the rechargeable battery is in a set high-temperature range, and the corresponding processing mode is to inform a user that the battery is over-temperature and the charging is slow;
if the charger type is determined to be the standard type and the battery temperature is detected to be in a cold range, the charging abnormal condition is that the temperature of the rechargeable battery is in a set low temperature range, and the corresponding processing mode is to inform a user that the battery temperature is too low and the charging is slow.
If the battery temperature is determined to be normal and the board-level temperature is detected to exceed the threshold, the abnormal condition is that the temperature of the mainboard of the electronic equipment exceeds a high-temperature threshold, and the corresponding processing mode is to inform a user that the electronic equipment is heated and the charging is slow.
And (3) charging abnormity: damage to the charger;
in the second adjustment method, if the output voltage of the ordinary 5V charger exceeds 6.5V, the charger is notified of the damage, and the charger is replaced and then the attempt is made again.
Charging exception four: the charging wire is abnormal;
if the abnormal condition is that the TYPE of the interface for charging the electronic equipment is TYPE-C as described above, and no CC signal is detected, the output current of the charger is adjusted to be a preset current threshold value, whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state are judged, and if the charger is in the power supply state and the path from the charger to the battery is in the open state, a nonstandard TYPE-C charging wire is notified, and the charging is slow; if not, the user is informed to try again after replacing the charging wire.
As shown in fig. 12, a complete method for charging according to an embodiment of the present invention includes the following steps:
step 1200: inserting a charger;
step 1201: judging whether the battery state is normal, if so, executing a step 1103, otherwise, executing a step 1202;
step 1202: prompting the user that the battery is abnormal;
step 1203: judging whether the TYPE of an interface for charging the electronic equipment is TYPE-C or not, if so, executing a step 1206, otherwise, executing a step 1204;
step 1204: judging whether a CC signal is detected, if so, executing a step 1206, otherwise, executing a step 1205;
step 1205: jump to step 500 in FIG. 5 above;
step 1206: detecting the type of a charger, and configuring current according to the type of the charger;
step 1207: judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state, if so, executing a step 1209, otherwise, executing a step 1208;
step 1208: jump to step 800 in FIG. 8 above;
step 1209: and judging whether the charging speed of the charger is too low, if so, executing a step 1310, otherwise, ending the process.
Step 1210: jump to step 1100 in fig. 11 above.
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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.
Based on the same concept, as shown in fig. 13, an embodiment of the present invention provides an electronic device for performing charging, the device including: processor 1300 and charging chip 1301:
the processor 1300 is configured to: after the charger is inserted, judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state; if the charger is determined not to be in the power supply state or the path from the charger to the battery is in the closed state, the state of the charging chip 1301 is reset, the signal positive DP and the signal negative DM of the charger are reset, the output current of the charger is reduced, and the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state is returned until the charger is determined to be in the power supply state and the path from the charger to the battery is in the open state or the output current is smaller than the preset current threshold value.
Optionally, the processor 1300 is further configured to:
when the charger is used for charging, if the TYPE of an interface for charging is determined to be TYPE-C, whether a CC signal is detected or not is judged, and if so, whether the charger is in a power supply state or not and whether a path from the charger to a battery is in an open state or not is judged; otherwise, the output current of the charger is adjusted to the preset current threshold value.
Optionally, the processor 1300 is specifically configured to:
and reducing the output current of the charger according to the set step value.
Optionally, the processor 1300 is further configured to:
and after the output voltage of the charger is determined not to exceed the preset output voltage corresponding to the type of the charger, reducing the output current of the charger.
Optionally, the processor 1300 is specifically configured to:
if the type of the charger is determined to be the high-voltage charger and the output voltage of the charger does not reach the preset lowest output voltage threshold corresponding to the high-voltage charger, the output voltage of the charger is adjusted to be the preset voltage threshold, and then the output current of the charger is reduced.
Optionally, the processor 1300 is further configured to:
after the charging abnormity is determined, determining a processing mode corresponding to the abnormal condition met by the charging abnormity according to the corresponding relation between the abnormal condition and the processing mode;
and processing according to the determined processing mode.
Optionally, the exception condition and the corresponding processing mode include some or all of the following:
if the abnormal condition is that the type of the current charger is not a USB type and the charging amount is smaller than the set electric quantity threshold value, the output current is smaller than the minimum current value corresponding to the fast charging standard or smaller than the difference value between the maximum output current and the estimated maximum power consumption current, the processing mode is to inform that the charging is too slow;
if the abnormal condition is that the TYPE of an interface for charging the electronic equipment is determined to be TYPE-C, a CC signal is not detected, and after the output current of the charger is adjusted to a preset current threshold value, whether the charger is in a power supply state or not and whether a path from the charger to the battery is in an open state or not are judged, the non-standard charging wire is notified in a processing mode;
if the abnormal condition is that the charger type is determined to be a non-standard charger, the abnormal condition is processed in a mode that the non-standard charger is informed, and the output current of the charger is adjusted to be a preset current threshold value;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set high-temperature range, the processing mode is to inform that the temperature of the battery is too high;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set low-temperature range, the processing mode is to inform that the temperature of the battery is too low;
and if the abnormal condition is that the temperature of the mainboard of the electronic equipment exceeds the high-temperature threshold, the notification mode is to process the overhigh temperature of the electronic equipment.
As shown in fig. 14, another electronic device for performing charging according to an embodiment of the present invention includes:
the determination module 1400: the charger is used for judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state after the charger is inserted;
the processing module 1401: and if the charger is determined not to be in the power supply state or the path from the charger to the battery is in the closed state, resetting the state of the charging chip and resetting the signal positive DP and the signal negative DM of the charger, reducing the output current of the charger, and returning to the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state until the charger is determined to be in the power supply state and the path from the charger to the battery is in the open state or the output current is smaller than a preset current threshold value.
Optionally, the determining module 1400 is further configured to:
when the charger is used for charging, if the TYPE of an interface for charging is determined to be TYPE-C, whether a CC signal is detected or not is judged, and if so, whether the charger is in a power supply state or not and whether a path from the charger to a battery is in an open state or not is judged; otherwise, the output current of the charger is adjusted to the preset current threshold value.
Optionally, the processing module 1401 is specifically configured to:
and reducing the output current of the charger according to the set step value.
Optionally, the processing module 1401 is further configured to:
and after the output voltage of the charger is determined not to exceed the preset output voltage corresponding to the type of the charger, reducing the output current of the charger.
Optionally, the processing module 1401 is specifically configured to:
if the type of the charger is determined to be the high-voltage charger and the output voltage of the charger does not reach the preset lowest output voltage threshold corresponding to the high-voltage charger, the output voltage of the charger is adjusted to be the preset voltage threshold, and then the output current of the charger is reduced.
Optionally, the processing module 1401 is further configured to:
after the charging abnormity is determined, determining a processing mode corresponding to the abnormal condition met by the charging abnormity according to the corresponding relation between the abnormal condition and the processing mode;
and processing according to the determined processing mode.
Optionally, the exception condition and the corresponding processing mode include some or all of the following:
if the abnormal condition is that the type of the current charger is not a USB type and the charging amount is smaller than the set electric quantity threshold value, the output current is smaller than the minimum current value corresponding to the fast charging standard or smaller than the difference value between the maximum output current and the estimated maximum power consumption current, the processing mode is to inform that the charging is too slow;
if the abnormal condition is that the TYPE of an interface for charging the electronic equipment is TYPE-C and no CC signal is detected, and the output current of the charger is adjusted to a preset current threshold value, the charger is determined not to be in a power supply state or a passage from the charger to the battery is in a closed state, the abnormal condition is that a non-standard charging wire is informed;
if the abnormal condition is that the charger type is determined to be a non-standard charger, the abnormal condition is processed in a mode that the non-standard charger is informed, and the output current of the charger is adjusted to be a preset current threshold value;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set high-temperature range, the processing mode is to inform that the temperature of the battery is too high;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set low-temperature range, the processing mode is to inform that the temperature of the battery is too low;
if the abnormal condition is that the temperature of the mainboard of the electronic equipment exceeds the high-temperature threshold, the notification mode is to process the overhigh temperature of the electronic equipment.
As shown in fig. 15, another electronic device 1500 for charging according to an embodiment of the present invention includes: the charging interface 1510, the processor 1520, the charging chip 1530, the battery 1540, the memory 1550 and the like. Those skilled in the art will appreciate that the configuration of the electronic device shown in fig. 15 does not constitute a limitation of the electronic device, and the electronic device provided in the embodiments of the present application may include more or less components than those shown, or may combine some components, or may be arranged in different components.
The following describes each component of the electronic device 1500 in detail with reference to fig. 15:
the electronic device 1500 may be physically connected to other devices through the charging interface 1510. Optionally, the charging interface 1510 is connected to the charging interface of the other device through a cable, so as to implement data transmission between the electronic device 1500 and the other device.
The memory 1550 may be used to store software programs and modules. The processor 1520 executes various functional applications and data processing of the electronic device 1500 by executing the software programs and modules stored in the memory 1550, and when the processor 1520 executes the program codes in the memory 1550, part or all of the processes in fig. 3 according to the embodiment of the present invention can be implemented.
In addition, the memory 1550 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 1520 is a control center of the electronic device 1500, connects various components using various interfaces and lines, performs various functions of the electronic device 1500 and processes data by operating or executing software programs and/or modules stored in the memory 1550 and calling data stored in the memory 1550, thereby implementing various services based on the electronic device.
Optionally, the processor 1520 may include one or more processing units. Alternatively, the processor 1520 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1520.
The charging chip 1530 connects the electronic device 1500 and a processing unit of a charger through the charging interface 1510, and determines the charging state thereof by detecting the battery voltage: pre-charging, constant current charging and constant voltage charging. When the battery voltage is less than a threshold Voltage (VO) VO (MIN), the battery is in a pre-charge state, and the battery is charged with a small current, and the charging current can be adjusted by an LDO (low dropout regulator) circuit. The method comprises the steps of pre-charging to enable battery voltage to reach VO (MIN), entering a fast charging state of constant current charging, enabling charging current to be adjusted through an LDO (Low Dropout Regulator) circuit or a switching circuit, enabling the battery voltage to rise to constant voltage charging voltage VO (REG) through constant current charging, then entering a constant voltage charging state, enabling the precision of the charging voltage to be better than +/-1%, gradually reducing the charging current in the state, and ending charging after the charging current is smaller than a threshold value. After the charging is finished, the battery voltage is always monitored, and when the battery voltage is smaller than a threshold value VO (RCH), the battery is recharged, and a next charging period is started. For safety, the temperature of the battery is monitored by the thermistor inside the battery and the appropriate peripheral resistors throughout the charging process, allowing the temperature of the battery to be controlled within a user-set range.
The electronic device 1500 also includes a battery 1540 for powering the various components. Optionally, the battery 1540 may be logically connected to the processor 1520 through a power management system, so as to implement functions of managing charging, discharging, power consumption, and the like through the power management system.
It is to be noted that the processor 1520 can perform the functions of the processor 1300 in fig. 13, and the memory 1550 stores the contents of the processor 1301 according to the embodiment of the present invention.
An embodiment of the present invention further provides a computer-readable non-volatile storage medium, which includes program code, and when the program code runs on a computing electronic device, the program code is configured to enable the computing electronic device to execute the steps of the method for charging according to the embodiment of the present invention.
The present application is described above with reference to block diagrams and/or flowchart illustrations of methods, apparatus (systems) and/or computer program products according to embodiments of the application. It will be understood that one block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, and/or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer and/or other programmable data processing apparatus, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the subject application may also be embodied in hardware and/or in software (including firmware, resident software, micro-code, etc.). Furthermore, the application may take the form of a computer program product on a computer-usable or computer-readable storage medium having computer-usable or computer-readable program code embodied in the medium for use by or in connection with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (8)
1. A method for charging an electronic device, the method comprising:
after the charger is inserted, judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state;
if the charger is determined not to be in a power supply state or a path from the charger to the battery is in a closed state, if the type of the charger is determined to be a low-voltage charger and the output voltage of the charger is determined to be less than a preset first voltage threshold corresponding to the low-voltage charger, or if the type of the charger is determined to be a high-voltage charger and the output voltage of the charger is determined to be not more than a preset second voltage threshold corresponding to the high-voltage charger, or if the type of the charger is the high-voltage charger and the output voltage of the charger is determined to be greater than the preset second voltage threshold corresponding to the high-voltage charger and the output voltage of the charger is determined to be adjusted to be a preset third voltage threshold, resetting the state of a charging chip, resetting a signal positive DP and a signal negative DM of the charger, reducing the output current of the charger, and returning to the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state until the charger is determined to be in the power supply state and the path from the charger to the battery is determined to be in the open state or the output current is less than the preset current threshold;
before reducing the output current of the charger, the method further comprises the following steps:
if the type of the charger is a low-voltage charger and the output voltage of the charger is determined to be not less than a preset first voltage threshold corresponding to the low-voltage charger, informing that the charger is damaged;
wherein the first voltage threshold is greater than the second voltage threshold and greater than the third voltage threshold.
2. The method of claim 1, further comprising:
when the charger is used for charging, if the TYPE of an interface for charging is determined to be TYPE-C, whether a CC signal is detected or not is judged, and if so, whether the charger is in a power supply state or not and whether a path from the charger to a battery is in an open state or not is judged; otherwise, the output current of the charger is adjusted to the preset current threshold value.
3. The method of claim 1, wherein the reducing the output current of the charger comprises:
and reducing the output current of the charger according to the set step value.
4. The method of claim 1, further comprising:
after the charging abnormity is determined, determining a processing mode corresponding to the abnormal condition met by the charging abnormity according to the corresponding relation between the abnormal condition and the processing mode;
and processing according to the determined processing mode.
5. The method of claim 4, wherein the exception condition and corresponding handling includes some or all of:
if the abnormal condition is that the type of the current charger is not a Universal Serial Bus (USB) type and the charging amount is smaller than a set electric quantity threshold value, the output current is smaller than a minimum current value corresponding to a fast charging standard or smaller than a difference value between the maximum output current and the estimated maximum power consumption current, the processing mode is to inform that the charging is too slow;
if the abnormal condition is that the TYPE of an interface for charging the electronic equipment is determined to be TYPE-C, a CC signal is not detected, and the output current of the charger is adjusted to a preset current threshold value, then the charger is determined not to be in a power supply state or a passage from the charger to the battery is in a closed state, and the non-standard charging wire is notified in a processing mode;
if the abnormal condition is that the charger type is determined to be a non-standard charger, the abnormal condition is processed in a mode that the non-standard charger is informed, and the output current of the charger is adjusted to be a preset current threshold value;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set high-temperature range, the processing mode is to inform that the temperature of the battery is too high;
if the abnormal condition is that the temperature of the rechargeable battery is determined to be in the set low-temperature range, the processing mode is to inform that the temperature of the battery is too low;
and if the abnormal condition is that the temperature of the mainboard of the electronic equipment exceeds the high-temperature threshold, the notification mode is to process the overhigh temperature of the electronic equipment.
6. An electronic device, characterized in that the electronic device comprises: processor and charging chip:
the processor is configured to: after the charger is inserted, judging whether the charger is in a power supply state and whether a path from the charger to the battery is in an open state;
if the charger is determined not to be in a power supply state or a path from the charger to the battery is in a closed state, if the type of the charger is determined to be a low-voltage charger and the output voltage of the charger is determined to be less than a preset first voltage threshold corresponding to the low-voltage charger, or if the type of the charger is determined to be a high-voltage charger and the output voltage of the charger is determined to be not more than a preset second voltage threshold corresponding to the high-voltage charger, or if the type of the charger is the high-voltage charger and the output voltage of the charger is determined to be greater than the preset second voltage threshold corresponding to the high-voltage charger and the output voltage of the charger is determined to be adjusted to be a preset third voltage threshold, resetting the state of a charging chip, resetting a signal positive DP and a signal negative DM of the charger, reducing the output current of the charger, and returning to the step of judging whether the charger is in the power supply state and the path from the charger to the battery is in the open state until the charger is determined to be in the power supply state and the path from the charger to the battery is determined to be in the open state or the output current is less than the preset current threshold;
before reducing the output current of the charger, the method further comprises the following steps:
if the type of the charger is a low-voltage charger and the output voltage of the charger is determined to be not less than a preset first voltage threshold corresponding to the low-voltage charger, informing that the charger is damaged;
wherein the first voltage threshold is greater than the second voltage threshold and greater than the third voltage threshold.
7. The electronic device of claim 6, wherein the processor is further to:
when the charger is used for charging, if the TYPE of an interface for charging is determined to be TYPE-C, whether a CC signal is detected or not is judged, and if so, whether the charger is in a power supply state or not and whether a path from the charger to a battery is in an open state or not is judged; otherwise, the output current of the charger is adjusted to the preset current threshold value.
8. The electronic device of claim 6, wherein the processor is specifically configured to:
and reducing the output current of the charger according to the set step value.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811532001.5A CN111327087B (en) | 2018-12-14 | 2018-12-14 | Electronic equipment and charging method thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811532001.5A CN111327087B (en) | 2018-12-14 | 2018-12-14 | Electronic equipment and charging method thereof |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111327087A CN111327087A (en) | 2020-06-23 |
| CN111327087B true CN111327087B (en) | 2023-03-21 |
Family
ID=71170442
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201811532001.5A Active CN111327087B (en) | 2018-12-14 | 2018-12-14 | Electronic equipment and charging method thereof |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111327087B (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114003531B (en) * | 2020-07-28 | 2024-06-21 | 苏州能讯高能半导体有限公司 | USB Type C interface circuit and terminal equipment |
| CN113820537B (en) * | 2021-09-02 | 2025-07-29 | 深圳市奋达科技股份有限公司 | Detection circuit for detecting output power of USB power supply |
| CN115549232B (en) * | 2022-04-21 | 2024-03-22 | 荣耀终端有限公司 | Charging method, device, electronic device and keyboard for electronic equipment |
| CN115001111B (en) * | 2022-07-18 | 2024-12-17 | Oppo广东移动通信有限公司 | Charging monitoring method, abnormality determining method, device, electronic equipment and server |
| CN116238378A (en) * | 2023-04-21 | 2023-06-09 | 陈思璇 | Charging pile charging abnormity detection method and system |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104868512B (en) * | 2014-02-26 | 2020-04-17 | 深圳富泰宏精密工业有限公司 | System and method for intelligently and dynamically identifying charger load capacity |
| CN104393627B (en) * | 2014-08-29 | 2017-06-30 | 展讯通信(上海)有限公司 | USB charger, mobile terminal and charge control method |
| CN105471022B (en) * | 2015-11-20 | 2018-06-19 | 南京矽力杰半导体技术有限公司 | A kind of adaptive charging control circuit and control method in switch charger |
| CN106026258B (en) * | 2016-06-24 | 2018-12-28 | 青岛海信移动通信技术股份有限公司 | A kind of mobile terminal |
| WO2018032274A1 (en) * | 2016-08-15 | 2018-02-22 | 北京小米移动软件有限公司 | Electronic device, charger, charging system and charging method |
| CN106505660B (en) * | 2016-10-31 | 2019-10-11 | 宇龙计算机通信科技(深圳)有限公司 | A charging protection method, charging protector and terminal |
| CN109768599B (en) * | 2016-11-29 | 2023-09-12 | 海信视像科技股份有限公司 | Charging method based on multiple USB-C interfaces and main equipment |
| CN107742912A (en) * | 2017-11-08 | 2018-02-27 | 深圳天珑无线科技有限公司 | Charging method, fast fill device and computer-readable recording medium |
-
2018
- 2018-12-14 CN CN201811532001.5A patent/CN111327087B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN111327087A (en) | 2020-06-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111327087B (en) | Electronic equipment and charging method thereof | |
| US11757289B2 (en) | Circuits, devices, methods and systems to secure power-up for battery operating devices even with low current chargers and to execute other performances | |
| JP4197189B2 (en) | Circuit for power supply and method of operation | |
| CN103777730B (en) | Power management circuit and method thereof | |
| CN202772364U (en) | Connector and control chip | |
| JP5388484B2 (en) | Apparatus and method for detecting power supply | |
| US20160218539A1 (en) | Method and apparatus for operating an internal charger system of a portable electronic device | |
| CN105556737B (en) | The dynamic of rechargeable battery charges | |
| CN106329627A (en) | Charging method and device | |
| CN106329630A (en) | Charging method and device | |
| US10256648B1 (en) | Portable device battery charging circuits and methods | |
| CN106329625B (en) | charging method and device | |
| CN104953631A (en) | Current control method and terminal device | |
| CN106300533A (en) | A kind of charging method and device | |
| CN106329628A (en) | Charging method and device | |
| JP6916629B2 (en) | Electronics and control methods | |
| CA2419488C (en) | Circuit and method of operation for an electrical power supply | |
| CN119275955A (en) | Charger and power distribution method of charger | |
| CN106532790B (en) | Mobile power supply device and power supply control method thereof | |
| CN118412964A (en) | Multi-protocol load quick-charging control system | |
| HK1082600B (en) | Circuit and method of operation for an electrical power supply | |
| HK1082600A (en) | Circuit and method of operation for an electrical power supply | |
| CN106329629A (en) | Charging method and device | |
| CN106329631A (en) | Charging method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP01 | Change in the name or title of a patent holder |
Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd. Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd. |
|
| CP01 | Change in the name or title of a patent holder |