CN108448177B - Charging method and terminal - Google Patents

Charging method and terminal Download PDF

Info

Publication number
CN108448177B
CN108448177B CN201810209972.XA CN201810209972A CN108448177B CN 108448177 B CN108448177 B CN 108448177B CN 201810209972 A CN201810209972 A CN 201810209972A CN 108448177 B CN108448177 B CN 108448177B
Authority
CN
China
Prior art keywords
detection signal
terminal
type
charging
charging interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810209972.XA
Other languages
Chinese (zh)
Other versions
CN108448177A (en
Inventor
郭朋飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201810209972.XA priority Critical patent/CN108448177B/en
Publication of CN108448177A publication Critical patent/CN108448177A/en
Application granted granted Critical
Publication of CN108448177B publication Critical patent/CN108448177B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/425Structural combination with electronic components, e.g. electronic circuits integrated to the outside of the casing
    • H01M10/4257Smart batteries, e.g. electronic circuits inside the housing of the cells or batteries
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • H01M10/446Initial charging measures
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/48Accumulators combined with arrangements for measuring, testing or indicating the condition of cells, e.g. the level or density of the electrolyte
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/007Regulation of charging or discharging current or voltage
    • H02J7/0071Regulation of charging or discharging current or voltage with a programmable schedule
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/425Structural combination with electronic components, e.g. electronic circuits integrated to the outside of the casing
    • H01M2010/4271Battery management systems including electronic circuits, e.g. control of current or voltage to keep battery in healthy state, cell balancing
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/425Structural combination with electronic components, e.g. electronic circuits integrated to the outside of the casing
    • H01M2010/4278Systems for data transfer from batteries, e.g. transfer of battery parameters to a controller, data transferred between battery controller and main controller
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • H02J7/00034Charger exchanging data with an electronic device, i.e. telephone, whose internal battery is under charge
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Abstract

The embodiment of the invention provides a charging method and a terminal, and aims to solve the problem that the charging time of the terminal is prolonged. The method comprises the following steps: acquiring a detection result of the type of a charging interface of a charging device, wherein the detection result is a result of detecting the type of the charging interface for N times by adopting a first detection signal, and the charging device is a charging device connected with a terminal; if the detection result is a first result, detecting the type of the charging interface by adopting a second detection signal, wherein the first result is used for indicating that the types of the charging interfaces detected for N times are all non-dedicated charging interfaces (DCPs), the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal; if the type of the charging interface is detected to be the DCP by adopting the second detection signal, detecting the type of the charging interface by adopting the first detection signal again; and if the first detection signal is adopted again to detect that the type of the charging interface is the DCP, adopting the first power corresponding to the DCP to charge the terminal.

Description

Charging method and terminal
Technical Field
The embodiment of the invention relates to the technical field of terminals, in particular to a charging method and a terminal.
Background
With the development of terminal technology, as the dependence of a user on a terminal is higher and higher, after the electric quantity of the terminal is consumed, the requirement of the user on the charging time of the terminal is higher and higher.
In general, a terminal may establish a charging system through a Universal Serial Bus (USB) and an adapter. Currently, a terminal determines whether the charging system can be charged quickly by detecting whether a charging interface of an adapter is a dedicated charging interface (DCP). If the charging interface is detected to be the DCP, the terminal determines that the adapter can be charged quickly (for example, charging can be performed by using a charging signal of 5V/1.5A); if the charging interface is detected to be non-DCP, the terminal determines that the adapter cannot be charged quickly, that is, the terminal can be charged by using a conventional charging method (for example, charging signal of 5V/0.5A can be used for charging).
However, in the above method, when the terminal detects whether the charging interface of the adapter is a DCP or not, the terminal may erroneously recognize the DCP of the adapter as a non-DCP due to insertion jitter when the user connects the terminal and the adapter, poor contact between the charging interface of the terminal and the charging interface of the adapter, and the like, and thus the terminal may be charged by using a conventional charging method, and thus, a charging time of the terminal may be prolonged.
Disclosure of Invention
The embodiment of the invention provides a charging method and a terminal, and aims to solve the problem that the charging time of the terminal is prolonged.
In order to solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides a charging method, where the method includes: acquiring a detection result of the type of a charging interface of a charging device, wherein the detection result is a result of detecting the type of the charging interface for N times by adopting a first detection signal, the charging device is connected with a terminal, N is a first preset number of times, and N is a positive integer; if the detection result is a first result, detecting the type of the charging interface by adopting a second detection signal, wherein the first result is used for indicating that the type of the charging interface detected for N times is a non-dedicated charging interface DCP, the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal; if the second detection signal is adopted to detect that the type of the charging interface is the DCP, the first detection signal is adopted again to detect the type of the charging interface; and if the first detection signal is adopted again to detect that the type of the charging interface is the DCP, adopting first power corresponding to the DCP to charge the terminal.
In a second aspect, an embodiment of the present invention further provides a terminal, where the terminal includes: the device comprises an acquisition module, a first detection module, a second detection module and a charging module; the acquisition module is used for acquiring a detection result of the type of a charging interface of a charging device, wherein the detection result is a result of detecting the type of the charging interface for N times by adopting a first detection signal, the charging device is connected with a terminal, N is a first preset number of times, and N is a positive integer; the first detection module is configured to detect the type of the charging interface by using a second detection signal if the detection result obtained by the obtaining module is a first result, where the first result is used to indicate that N times of detection of the types of the charging interfaces are all non-dedicated charging interfaces DCP, the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal; the second detection module is configured to detect the type of the charging interface again by using the first detection signal if the first detection module detects that the type of the charging interface is DCP by using the second detection signal; the charging module is configured to charge the terminal with a first power corresponding to the DCP if the second detection module detects that the type of the charging interface is the DCP again by using the first detection signal.
In a third aspect, an embodiment of the present invention provides a terminal, including a processor, a memory, and a computer program stored on the memory and operable on the processor, where the computer program, when executed by the processor, implements the steps of the charging method according to the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the charging method according to the first aspect.
In the embodiment of the invention, a terminal obtains a detection result of the type of a charging interface of a charging device, wherein the detection result is a result of detecting the type of the charging interface for N times by adopting a first detection signal, the charging device is connected with the terminal, N is a first preset number of times, and N is a positive integer; if the detection result is a first result, detecting the type of the charging interface by adopting a second detection signal, wherein the first result is used for indicating that the type of the charging interface detected for N times is a non-dedicated charging interface DCP, the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal; if the second detection signal is adopted to detect that the type of the charging interface is the DCP, the first detection signal is adopted again to detect the type of the charging interface; and if the first detection signal is adopted again to detect that the type of the charging interface is the DCP, adopting first power corresponding to the DCP to charge the terminal. Firstly, after the terminal determines that the first result is detected by the first detection signal, the type of the charging interface is detected by the second detection signal, so that the detection times can be increased, and the detection mode is increased because the first detection signal is a detection signal generated by a power module of the terminal and the second detection signal is a detection signal generated by a control module of the terminal; furthermore, when the type of the charging interface is the DCP, the probability of detecting the type of the charging interface as the DCP can be improved; when the terminal detects that the type of the charging interface is the DCP by adopting the second detection signal, the terminal detects the type of the charging interface by adopting the first detection signal again, the detection times of adopting the first detection signal for detection are increased again, the probability that the type of the charging interface is detected as the DCP by adopting the first detection signal by the terminal is improved, namely, the probability that the terminal adopts the first power for charging is improved, and therefore the charging time of the terminal can be reduced.
Drawings
Fig. 1 is a schematic diagram of an architecture of a possible android operating system according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a charging system according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a charging method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of another charging method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a possible structure of a terminal according to various embodiments of the present invention;
fig. 6 is a schematic diagram of another possible structure of a terminal according to various embodiments of the present invention;
fig. 7 is a schematic diagram of a hardware structure of a terminal according to various embodiments of the present invention.
Detailed Description
To facilitate explanation of the charging method provided in the embodiment of the present invention, first, a battery charging specification 1.2(battery charging specification 1.2, BC1.2) is briefly introduced.
BC1.2 specifies three types of USB ports, namely a Standard Downlink Port (SDP), a Dedicated Charging Port (DCP), and a Charging Downlink Port (CDP).
1. D + and D-lines of the SDP type port are provided with 15k omega pull-down resistors, the SDP type interface is defined by USB2.0 or USB3.0 specification, and the charging current is 500mA when the interface is defined by USB2.0 specification; the charging current is 900mA when the interface is defined by USB2.0 specification.
2. The DCP type port supplies a current of 1.5A or more, does not support data transmission, and is short-circuited between D + and D-lines in the DCP type port during charging. This type of port can support higher charging capability wall and vehicle chargers.
3. The CDP type port supports both high current charging and data transfer that is fully USB2.0 compatible. The port has the 15k omega pull-down resistors necessary for D + and D-communications, as well as internal circuitry for the charger detection phase switching. The internal circuitry allows the portable device to distinguish the CDP from other types of ports.
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 some, not all, embodiments of the present invention. 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.
It should be noted that "/" in this context means "or", for example, A/B may mean A or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. "plurality" means two or more than two.
It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
The terminal in the embodiment of the present invention may be a terminal having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present invention are not limited in particular.
Next, a software environment applied to the charging method provided by the embodiment of the present invention is described by taking an android operating system as an example.
Fig. 1 is a schematic diagram of an architecture of a possible android operating system according to an embodiment of the present invention. In fig. 1, the architecture of the android operating system includes 4 layers, which are respectively: an application layer, an application framework layer, a system runtime layer, and a kernel layer (specifically, a Linux kernel layer).
The application program layer comprises various application programs (including system application programs and third-party application programs) in an android operating system.
The application framework layer is a framework of the application, and a developer can develop some applications based on the application framework layer under the condition of complying with the development principle of the framework of the application.
The system runtime layer includes libraries (also called system libraries) and android operating system runtime environments. The library mainly provides various resources required by the android operating system. The android operating system running environment is used for providing a software environment for the android operating system.
The kernel layer is an operating system layer of an android operating system and belongs to the bottommost layer of an android operating system software layer. The kernel layer provides kernel system services and hardware-related drivers for the android operating system based on the Linux kernel.
Taking an android operating system as an example, in the embodiment of the present invention, a developer may develop a software program for implementing the charging method provided in the embodiment of the present invention based on the system architecture of the android operating system shown in fig. 1, so that the charging method may operate based on the android operating system shown in fig. 1. Namely, the processor or the terminal device can implement the charging method provided by the embodiment of the invention by running the software program in the android operating system.
Fig. 2 is a schematic diagram of a charging system according to an embodiment of the present invention, as shown in fig. 2 (a), the charging system a includes a terminal 200, a charging line 21, and a charging device 22; the terminal 200 is connected to the charging device 22 through a charging cord 21. Wherein, the terminal 200 includes: an Application Processor (AP) 201, a Power Management Interface (PMIC) 202, and a Microcontroller (MCU) 203. Alternatively, as shown in fig. 2 (B), the terminal 210 includes: an AP201 and a PMIC 202. The PMIC202 detects the type of the charging interface by using a first detection signal, and the AP201 or the MCU203 detects the type of the charging interface by using a second detection signal. The AP201 is mainly used for controlling each application program in the terminal, the PMIC202 is mainly used for identifying and managing the charging device, the MCU203 is mainly used for detecting the type of a charging interface of the charging device, and the MCU203 may be an MCU having other functions in the terminal or an added MCU.
It should be noted that, in the embodiment of the present invention, the terminal may use the AP201 to detect the type of the charging interface of the charging device 22, or may use the MCU203 in the AP201 control terminal to detect the type of the charging interface of the charging device 22, which is not specifically limited in this embodiment of the present invention.
Fig. 3 is a schematic method flow diagram of a charging method according to an embodiment of the present invention, and the charging method according to the embodiment of the present invention is described below with reference to the charging system shown in fig. 2.
S301, the terminal obtains a detection result of the type of the charging interface of the charging device.
The detection result is that the terminal detects the type of the N-time charging interface by adopting a first detection signal, the charging device is a charging device connected with the terminal, N is a first preset time, and N is a positive integer.
Optionally, the terminal in the embodiment of the present invention may be a mobile phone, a tablet computer, a charger, and the like, and the charging device in the embodiment of the present invention may be an adapter, a charging head, a socket, a charger, a notebook, a host, and the like.
Generally, when the terminal supports fast charging, when detecting that the type of the charging interface of the charging device is DCP, the terminal may charge with a first charging power, and when detecting that the type of the charging interface of the charging device is non-DCP, the terminal may charge with a second charging power, where the first charging power is greater than the second charging power.
Specifically, with reference to fig. 2, the AP201 may obtain a detection result of the type of the charging interface of the charging device 22, where the detection result is that the PMIC202 detects the type of the charging interface N times by using the first detection signal.
In general, the PMIC may detect whether the charging interface of the charging device is DCP at a timing of BC1.2 (i.e., the PMIC transmits the first detection signal every 60ms, 40ms, and 20ms in sequence), and may detect that the type of the charging interface of the charging device is DCP within 6 times (i.e., N is 6), and then the terminal may be charged with the first power.
And S302, if the detection result is the first result, the terminal detects the type of the charging interface by adopting a second detection signal.
The first result is used for indicating that the types of the N times of detection charging interfaces are non-DCP, the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal.
Optionally, the control module in the embodiment of the present invention may be an AP or an MCU in a terminal, which is not specifically limited in this embodiment of the present invention.
Specifically, with reference to fig. 2, when the detection result obtained by the AP201 from the PMIC202 on the type of the charging interface of the charging device 22 is a first result, the AP201 or the MCU203 may detect the type of the charging interface by using a second detection signal. When the terminal is the terminal 200 shown in (a) in fig. 2, the AP201 may instruct the switch to connect to the MCU203, and may detect the type of the charging interface by using the second detection signal through the MCU 203; when the terminal is the terminal 210 shown in (b) of fig. 2, the type of the charging interface may be detected by the AP201 using the second detection signal.
Optionally, the AP201 may output signals with different levels through a general purpose input/output (GPIO) to control on/off of the switch.
It should be noted that, when the detection result is the first result, the control module in the terminal may generate a second detection signal by simulating the timing sequence of BC1.2 through a software program, and detect the type of the charging interface by using the second detection signal.
It can be understood that the terminal in the embodiment of the present invention is a terminal capable of supporting fast charging, and when the terminal is a terminal that does not support fast charging, the terminal cannot perform fast charging even if the terminal detects that the type of the charging interface of the charging device is DCP.
And S303, if the terminal detects that the type of the charging interface is the DCP by adopting the second detection signal, the terminal detects the type of the charging interface by adopting the first detection signal again.
Specifically, with reference to fig. 2, if the MCU203 or the AP201 detects that the type of the charging interface is DCP by using the second detection signal, the PMIC202 in fig. 2 may detect the type of the charging interface by using the first detection signal again. With reference to the terminal 200 shown in (a) of fig. 2, first, when the MCU203 in the terminal 200 detects that the type of the charging interface is DCP, the MCU203 sends a message 1 to the AP201, where the message 1 is used to notify the AP201 to determine that the type of the charging interface of the charging device 22 is DCP; secondly, after receiving the message 1, the AP201 controls the switch to be connected to the PMIC202, and sends a message 2 to the PMIC202, where the message 2 is used to notify the PMIC202 to detect the type of the charging interface by using the first detection signal again; finally, when the PMIC202 receives the message 2, the PMIC202 detects the type of the charging interface again by using the first detection signal. In conjunction with the terminal 210 shown in fig. 2 (b), when the AP201 detects that the type of the charging interface is DCP, the AP201 controls the switch to connect to the PMIC202, and sends a message 2 to the PMIC202, where the message 2 is used to notify the PMIC202 to detect the type of the charging interface again by using the first detection signal; when the PMIC202 receives the message 2, the PMIC202 detects the type of the charging interface again by using the first detection signal.
It should be noted that "the terminal re-detects the type of the charging interface by using the first detection signal" in the embodiment of the present invention may be re-detected when the terminal and the charging device maintain the original connection, or re-detected when the terminal and the charging device reestablish the connection, which is not specifically limited in this embodiment of the present invention.
And S304, if the terminal detects that the type of the charging interface is the DCP by adopting the first detection signal again, the terminal charges the terminal by adopting the first power corresponding to the DCP.
It should be noted that, during charging, the terminal may be charged through the PMIC, or may not be charged through the PMIC, and this is not particularly limited in the embodiment of the present invention.
It can be understood that, in the embodiment of the present invention, the "terminal charges the terminal with the first power corresponding to the DCP" means that the terminal allows the charging device to output the first power to power the terminal, that is, the charging power acceptable to the terminal is the first power.
It should be noted that, when the type of the charging interface of the charging device is DCP, the charging power that the charging device can provide may include a first power and a second power, and when the terminal detects that the charging interface of the DCP type is not DCP, the terminal sends the indication information to the charging device to indicate that the charging device can charge with the second power, and then the charging power that the charging device provides to the terminal is the second power.
In the charging method provided by the embodiment of the invention, the terminal obtains the detection result of the type of the charging interface of the charging device, wherein the detection result is the result of detecting the type of the charging interface for N times by adopting a first detection signal, the charging device is connected with the terminal, N is a first preset number of times, and N is a positive integer; if the detection result is the first result, the terminal detects the type of the charging interface by adopting a second detection signal; the first result is used for indicating that the types of the charging interfaces detected for N times are non-DCP, the first detection signal is a detection signal generated by a power module of the terminal, the second detection signal is a detection signal generated by a control module of the terminal, and if the terminal detects that the type of the charging interface is DCP by adopting the second detection signal, the terminal detects the type of the charging interface by adopting the first detection signal again; if the terminal detects that the type of the charging interface is the DCP again by adopting the first detection signal, the terminal charges the terminal by adopting first power corresponding to the DCP. Firstly, after the terminal determines that the first result is detected by the first detection signal, the type of the charging interface is detected by the second detection signal, so that the detection times can be increased, and the detection mode is increased because the first detection signal is a detection signal generated by a power module of the terminal and the second detection signal is a detection signal generated by a control module of the terminal; furthermore, when the type of the charging interface is the DCP, the probability of detecting the type of the charging interface as the DCP can be improved; when the terminal detects that the type of the charging interface is the DCP by adopting the second detection signal, the terminal detects the type of the charging interface by adopting the first detection signal again, the detection times of adopting the first detection signal for detection are increased again, the probability that the type of the charging interface is the DCP by adopting the first detection signal is improved, namely, the probability that the terminal adopts the first power for charging is improved, and therefore the charging time of the terminal can be reduced.
In a possible implementation manner, after the terminal detects that the type of the charging interface is DCP using the second detection signal, the charging method further includes, before the terminal detects the type of the charging interface again using the first detection signal, S305:
s305, the terminal outputs prompt information.
The prompt message is used for instructing a user to reconnect the charging device and the terminal.
Specifically, with reference to fig. 2, after the AP201 or the MCU203 detects that the type of the charging interface is DCP by using the second detection signal, the AP201 may generate a prompt message and output the prompt message.
Optionally, the prompt information may be displayed in the notification bar, may also be displayed in a prompt box in the display interface, and may also be output in a voice to prompt the user to reconnect the charging device and the terminal.
Further, the "the terminal detecting the type of the charging interface again using the first detection signal" in S303 in the above-described charging method may be performed by W1:
w1, if the user reconnects the charging device to the terminal, the terminal detects the type of the charging interface again using the first detection signal.
Alternatively, the user may reconnect any one interface of the charging cord between the terminal and the charging device.
It should be noted that, after the charging device is reconnected with the terminal, the terminal detects the type of the charging interface again by using the first detection signal, and if the type of the charging interface is detected to be DCP after the detection is again performed, the terminal may be charged by using the first charging power corresponding to the DCP type.
Specifically, referring to fig. 2 (a), if the charging device 22 is reconnected to the terminal 200, the PMIC202 detects the type of the charging interface again by using the first detection signal.
It should be noted that, in the embodiment of the present invention, the AP201 is connected to the PMIC202 by default, when the terminal is charged or the connection between the terminal and the charging device 22 is disconnected, the AP201 controls the switch to the PMIC202, and when the terminal and the charging device 22 are reconnected, the terminal detects the type of the charging interface by default using the PMIC202 by using the first detection signal.
Based on the scheme, if the terminal detects that the type of the charging interface is the DCP according to the second detection signal, the terminal can output prompt information to the user to remind the user to reconnect the charging device and the terminal, and after reconnection, the terminal can adopt the first detection signal to detect the type of the charging interface again, so that the detection times are improved, the probability of accurate type detection of the charging interface is increased, the charging can be carried out by adopting the first power more probably, and the charging time of the terminal is reduced.
Specifically, W1 in the above charging method may be performed by W2:
w2, if the target connection times are smaller than the second preset times, the terminal detects the type of the charging interface again by adopting the first detection signal.
The target connection frequency is the frequency of connecting the charging device and the terminal by a user in a target time period, and the target time period is a time period from detecting that the type of the charging interface is DCP by adopting the second detection signal to detecting that the type of the charging interface is DCP by adopting the first detection signal again.
It should be noted that, when the connection frequency between the charging device and the terminal is less than the second preset frequency, the terminal still has the first result after detecting the type of the charging interface by using the first detection signal, and if the terminal detects that the type of the charging interface is DCP by using the second detection signal, the terminal may detect the type of the charging interface by using the first detection signal again.
Optionally, the second preset number may be the same as the first preset number, or may be different from the first preset number, which is not specifically limited in this embodiment of the present invention.
Based on the scheme, if the target connection times are smaller than the second preset times, the type of the charging interface is detected by the terminal through the first detection signal again, and the times of detecting the type of the charging interface by the terminal are increased, so that the accuracy of detecting the type of the charging interface can be improved, the probability of detecting the DCP as the non-DCP is reduced, the probability of charging the terminal with high power is improved, and the charging time of the terminal is shortened.
Optionally, after the user reconnects the charging device to the terminal, the charging method further includes S306:
and S306, if the target connection times are equal to a second preset time, the terminal charges the terminal by adopting a second power corresponding to the non-DCP, and the second power is smaller than the first power.
It can be understood that when the connection times are equal to the second preset times, the PMIC in the terminal still has the first result after detecting the type of the charging interface by using the first detection signal, and then the probability that the charging interface of the charging device is the non-DCP is relatively high, even if the user is prompted to reconnect, the PMIC detection result may still be the non-DCP, therefore, the terminal charges the terminal by using the second power corresponding to the non-DCP, and the damage to the terminal caused by the charging power larger than the second power used by the terminal, for example, an accident caused by the terminal heating due to the excessive current, and the burning of components in the terminal due to the excessive voltage, can be avoided.
Optionally, when the terminal detects the type of the charging interface by using the second detection signal, the charging method further includes S307:
and S307, if the terminal detects that the type of the charging interface is the non-DCP by adopting the second detection signal, the terminal charges the terminal by adopting second power corresponding to the non-DCP, and the second power is smaller than the first power.
Based on the scheme, the first result is detected at the terminal, and the terminal detects that the type of the charging interface is the non-DCP by adopting the second detection signal, so that the fact that the type of the charging interface of the charging device has higher probability of being the non-DCP is shown, therefore, the probability that the terminal is damaged by adopting higher charging power for charging the terminal can be reduced by adopting the second power corresponding to the non-DCP by the terminal, and the terminal is further safer to charge.
It can be understood that the terminal detects the type of the charging interface again by using the first detection signal, and the detection result may be DCP or non-DCP, and optionally, the charging method further includes S308:
and S308, if the terminal detects that the type of the charging interface is non-DCP again by adopting the first detection signal, the terminal continues to detect the type of the charging interface by adopting the first detection signal until the detection times reach P times, the detection results of the P times are all non-DCP, P is a third preset time, and P is a positive integer.
It can be understood that, in the conventional detection method, when the type of the charging interface is detected to be DCP by using the first detection signal, the terminal may be charged by using the first power, and when the type of the charging interface is detected to be DCP for 6 times (that is, N is 6), the terminal may be charged by using the second power if the type of the charging interface is determined not to be DCP. In the embodiment of the invention, after the user reconnects the terminal and the charging device according to the prompt message and the type of the charging interface is detected again by adopting the first detection signal, if the P times are detected to be non-DCP, the type of the charging interface is considered not to be DCP, at the moment, if the target connection times do not reach the second preset times, the terminal continues to detect the type of the charging interface again by adopting the first detection signal until the target connection times reach the second preset times.
It should be noted that P in the embodiment of the present invention may be the same as N or may not be the same as N, and this is not particularly limited in the embodiment of the present invention.
Optionally, the charging method S303 may be executed through S303 a:
and S303a, if the terminal detects that the type of the charging interface is DCP by continuously adopting the second detection signal for M times, the terminal detects the type of the charging interface by adopting the first detection signal again, wherein M is a fourth preset number of times, and M is a positive integer.
Specifically, with reference to fig. 2, the fourth preset time is used to improve the accuracy of detecting that the type of the charging interface is DCP by the AP201 or the MCU203, after the AP201 or the MCU203 starts to use the second detection signal for detection, if the AP201/MCU203 continuously detects that the type of the charging interface is DCP by using the second detection signal for the fourth preset time, it indicates that the possibility that the type of the charging interface is DCP is relatively high, and at this time, the PMIC202 in the reuse terminal detects that the type of the charging interface is DCP by using the first detection signal again, and the probability of detecting that the type of the charging interface is DCP is relatively high.
Based on the scheme, before the terminal detects the type of the charging interface again by adopting the first detection signal, if the terminal detects that the type of the charging interface is DCP by adopting the second detection signal for M times continuously, the possibility that the type of the charging interface of the charging device connected with the terminal is DCP is higher, at the moment, the terminal detects the type of the charging interface again by adopting the first detection signal, the detection times for detecting the type of the charging interface are increased, the successful detection probability that the type of the charging interface is DCP is improved, the probability that the terminal charges by adopting the first power is further improved, and therefore the charging time of the terminal is shortened.
Exemplarily, fig. 4 is a schematic flowchart of a charging method according to an embodiment of the present invention, and with reference to fig. 2, the flowchart of the charging method in fig. 4 includes the following steps:
(1) if the terminal detects that the type of the charging interface is the non-DCP by using the first detection signal again in the above method embodiment, the terminal continues to detect the type of the charging interface by using the first detection signal until P times are reached, where P is not equal to N, as shown in (a) in fig. 4, the method includes the following steps:
after the terminal 200 and the charging device 22 are connected through the charging line 21, the switch is connected to the PMIC 202.
Step 1: the PMIC202 detects the type of the charging interface of the charging device 22 according to the first detection signal.
It should be noted that, after the connection is established for the first time, it is not necessary to determine whether the charging path is the target connection, and after the user reconnects the terminal and the charging device according to the prompt information, it is necessary to determine whether the charging path is the target connection, where the target connection is the connection that is reestablished by the user according to the prompt information.
If the PMIC202 detects that the type of the charging interface is DCP, the terminal 210 may be charged with the first power.
If the PMIC202 detects that the type of the charging interface is non-DCP according to the first detection signal, the detected number of times of the PMIC202 is increased by 1.
Step 2: it is determined whether the number of detections of the PMIC202 is less than or equal to N.
If the detected number of times by the PMIC202 is less than N, the PMIC202 detects the type of the charging interface of the charging device 22 again according to the first detection signal.
If the number of detections that the PMIC202 has detected is equal to N, the PMIC202 sends a notification message 1 to the AP201, where the notification message is used to indicate that the type of the charging interface of the charging device 22 is detected as non-DCP N times (i.e., a first result).
And step 3: after the AP201 obtains the first result, the control switch is switched from the PMIC202 to the MCU203, that is, the AP201 and the MCU203 establish connection with the charging device 22 through the charging line 21.
And 4, step 4: after the AP201 and the MCU203 establish connection through the charging line 21 and the charging device 22, the MCU203 detects whether the type of the charging interface is DCP according to the second detection signal.
If the MCU203 detects that the type of the charging interface is non-DCP, the MCU203 sends a notification message 2 to the AP201, where the notification message 2 is used to indicate that the result detected by the MCU203 is non-DCP, and the terminal 200 may be charged with the second power.
If the MCU203 detects that the type of the charging interface is DCP, the MCU203 sends a notification message 3 to the AP201, where the notification message 3 is used to indicate that the detected result of the MCU203 is DCP, and the AP201 generates and outputs a prompt message for prompting the user to reconnect the charging device 22 with the terminal 200.
And 5: AP201 detects that the user reconnects terminal 200 and charging device 22; after the reconnection, it is determined whether the number of times of detection by the PMIC202 of the type of charging interface of the charging device 22 according to the first detection signal is less than or equal to P.
If the detected number of times by the PMIC202 is less than P, the PMIC202 detects the type of the charging interface of the charging device 22 again according to the first detection signal.
If the detected number of times by the PMIC202 is equal to P, the PMIC202 sends a notification message 4 to the AP201, where the notification message 4 is used to indicate that the type of the charging interface of the charging device 22 is detected as non-DCP P times (denoted as a second result).
Step 6: after the AP201 obtains the second result, the switch is controlled to switch from the PMIC202 to the MCU203, that is, the AP201 and the MCU203 establish a connection with the charging device 22 through the charging line 21.
If the MCU203 detects that the type of the charging interface is still non-DCP, the target connection time is equal to Q (i.e., a second preset time), and Q is a positive integer, the terminal charges with a second power.
After the charging is completed, the AP201 controls the switch to switch from the MCU203 to the PMIC 202.
If the target connection number is less than Q, the PMIC202 detects the type of the charging interface of the charging device 22 again according to the first detection signal (i.e., continues to perform step 5).
(2) If the terminal detects that the type of the charging interface is the non-DCP by using the first detection signal again in the above method embodiment, the terminal continues to detect the type of the charging interface by using the first detection signal until P equals N in the detection times reaching P times, "as shown in (b) in fig. 4: in the charging method process, it is not necessary to detect whether the charging path is the target connection, and the switch is connected to the PMIC, then the PMIC202 detects the type of the charging interface of the charging device 22 by using the first detection signal, and determines whether the detection frequency is less than or equal to N (i.e., step 5 may be performed by using step 2, and the second result in step 5 is the first result). The description of the other steps may refer to the description of the relevant steps in (a) in fig. 4.
It can be understood that when the terminal detects that the type of the charging interface of the charging device is non-DCP after detecting P times according to the first detection signal again, the terminal detects again by using the second detection signal, so that the detection times are increased, and if the type of the charging interface is DCP, the probability that the terminal detects the type of the charging interface as DCP is improved, and then the probability that the terminal charges by using the first power is improved, so that the charging time of the terminal can be reduced.
Fig. 5 is a schematic diagram of a possible hardware structure of a terminal according to an embodiment of the present invention, and as shown in fig. 5, a terminal 500 includes: an acquisition module 501, a first detection module 502, a second detection module 503 and a charging module 504; an obtaining module 501, configured to obtain a detection result of a type of a charging interface of a charging device, where the detection result is a result of detecting the type of the charging interface N times by using a first detection signal, the charging device is a charging device connected to the terminal 500, N is a first preset number of times, and N is a positive integer; a first detecting module 502, configured to detect the type of the charging interface by using a second detecting signal if the detection result obtained by the obtaining module 501 is a first result, where the first result is used to indicate that the types of the charging interfaces detected N times are all non-DCP, the first detecting signal is a detecting signal generated by a power module of the terminal 500, and the second detecting signal is a detecting signal generated by a control module of the terminal 500; the second detecting module 503 is configured to detect the type of the charging interface again by using the first detecting signal if the first detecting module 502 detects that the type of the charging interface is DCP by using the second detecting signal; the charging module 504 is configured to charge the terminal 500 with the first power corresponding to the DCP if the second detecting module 503 detects that the type of the charging interface is the DCP again by using the first detection signal.
Optionally, in conjunction with fig. 5, as shown in fig. 6, the terminal 500 further includes an output module 505; the output module 505 is configured to output a prompt message before the second detection module 503 detects the type of the charging interface again by using the first detection signal, where the prompt message is used to instruct the user to reconnect the charging device with the terminal; the second detecting module 503 is specifically configured to detect the type of the charging interface by re-using the first detecting signal if the user reconnects the charging device with the terminal 500.
Optionally, the second detecting module 503 is specifically configured to detect the type of the charging interface by using the first detecting signal again if the target connection frequency is smaller than a second preset frequency, where the target connection frequency is a frequency of connecting the charging device and the terminal 500 by the user in a target time period, and the target time period is a time period from detecting that the type of the charging interface is DCP by using the second detecting signal to detecting that the type of the charging interface is DCP by using the first detecting signal again.
Optionally, the charging module 504 is further configured to charge the terminal 500 with a second power corresponding to the non-DCP if the target connection time is equal to a second preset time, where the second power is smaller than the first power.
Optionally, the charging module 504 is further configured to charge the terminal 500 with a second power corresponding to the non-DCP if the first detecting module 502 detects that the type of the charging interface is the non-DCP by using the second detection signal, where the second power is smaller than the first power.
Optionally, the second detecting module 503 is further configured to, if it is detected that the type of the charging interface is non-DCP by using the first detecting signal again, continue to detect the type of the charging interface by using the first detecting signal until the number of times of detection reaches P times, where the detection results of the P times are all non-DCP, P is a third preset number of times, and P is a positive integer.
Optionally, the second detecting module 503 is further configured to detect the type of the charging interface again by using the first detecting signal if the first detecting module 502 detects that the type of the charging interface is DCP by using the second detecting signal M times in succession, where M is a fourth preset number of times, and M is a positive integer.
The terminal 500 provided in the embodiment of the present invention can implement each process implemented by the terminal in the method embodiment described in any one of fig. 1 to fig. 6, and for avoiding repetition, details are not described here again.
Fig. 7 is a schematic diagram of a hardware structure of a terminal for implementing various embodiments of the present invention, where the terminal 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710, a power supply 711, and the like. Those skilled in the art will appreciate that the terminal configuration shown in fig. 7 is not intended to be limiting, and that the terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the terminal includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 710 is configured to obtain a detection result of the type of the charging interface of the charging device, where the detection result is a result of detecting the type of the charging interface N times by using a first detection signal, the charging device is a charging device connected to a terminal, and N is a first preset number of times; if the detection result is a first result, detecting the type of the charging interface by adopting a second detection signal, wherein the first result is used for indicating that the types of the charging interfaces detected for N times are all non-dedicated charging interfaces (DCPs), the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal; if the type of the charging interface is detected to be the DCP by adopting the second detection signal, detecting the type of the charging interface by adopting the first detection signal again; and if the first detection signal is adopted again to detect that the type of the charging interface is the DCP, adopting the first power corresponding to the DCP to charge the terminal.
In the terminal provided by the embodiment of the invention, the terminal obtains the detection result of the type of the charging interface of the charging device, wherein the detection result is the result of detecting the type of the charging interface for N times by adopting the first detection signal, the charging device is connected with the terminal, N is a first preset number of times, and N is a positive integer; if the detection result is a first result, detecting the type of the charging interface by adopting a second detection signal, wherein the first result is used for indicating that the type of the charging interface detected for N times is a non-dedicated charging interface DCP, the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal; if the second detection signal is adopted to detect that the type of the charging interface is the DCP, the first detection signal is adopted again to detect the type of the charging interface; and if the first detection signal is adopted again to detect that the type of the charging interface is the DCP, adopting first power corresponding to the DCP to charge the terminal. Firstly, after the terminal determines that the first result is detected by the first detection signal, the type of the charging interface is detected by the second detection signal, so that the detection times can be increased, and the detection mode is increased because the first detection signal is a detection signal generated by the power module and the second detection signal is a detection signal generated by the control module; furthermore, when the type of the charging interface is the DCP, the probability of detecting the type of the charging interface as the DCP can be improved; when the terminal detects that the type of the charging interface is the DCP by adopting the second detection signal, the terminal detects the type of the charging interface by adopting the first detection signal again, the detection times of adopting the first detection signal for detection are increased again, the probability that the type of the charging interface is detected as the DCP by adopting the first detection signal by the terminal is improved, namely, the probability that the terminal adopts the first power for charging is improved, and therefore the charging time of the terminal can be reduced.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 701 may be used for receiving and sending signals during a message transmission and reception process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 710; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 701 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 701 may also communicate with a network and other devices through a wireless communication system.
The terminal provides wireless broadband internet access to the user via the network module 702, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 703 may convert audio data received by the radio frequency unit 701 or the network module 702 or stored in the memory 709 into an audio signal and output as sound. Also, the audio output unit 703 may also provide audio output related to a specific function performed by the terminal 700 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 703 includes a speaker, a buzzer, a receiver, and the like.
The input unit 704 is used to receive audio or video signals. The input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics processor 7041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 706. The image frames processed by the graphic processor 7041 may be stored in the memory 709 (or other storage medium) or transmitted via the radio unit 701 or the network module 702. The microphone 7042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 701 in case of a phone call mode.
The terminal 700 also includes at least one sensor 705, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 7061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 7061 and/or a backlight when the terminal 700 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 705 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 706 is used to display information input by the user or information provided to the user. The Display unit 706 may include a Display panel 7061, and the Display panel 7061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 707 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal. Specifically, the user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 7071 (e.g., operations by a user on or near the touch panel 7071 using a finger, a stylus, or any other suitable object or attachment). The touch panel 7071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 710, receives a command from the processor 710, and executes the command. In addition, the touch panel 7071 can be implemented by various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 707 may include other input devices 7072 in addition to the touch panel 7071. In particular, the other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 7071 may be overlaid on the display panel 7061, and when the touch panel 7071 detects a touch operation on or near the touch panel 7071, the touch operation is transmitted to the processor 710 to determine the type of the touch event, and then the processor 710 provides a corresponding visual output on the display panel 7061 according to the type of the touch event. Although the touch panel 7071 and the display panel 7061 are shown in fig. 7 as two separate components to implement the input and output functions of the terminal, in some embodiments, the touch panel 7071 and the display panel 7061 may be integrated to implement the input and output functions of the terminal, which is not limited herein.
The interface unit 708 is an interface for connecting an external device to the terminal 700. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 708 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal 700 or may be used to transmit data between the terminal 700 and the external device.
The memory 709 may be used to store software programs as well as various data. The memory 709 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 709 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 710 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 709 and calling data stored in the memory 709, thereby integrally monitoring the terminal. Processor 710 may include one or more processing units; preferably, the processor 710 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 processor 710.
The terminal 700 may also include a power supply 711 (e.g., a battery) for providing power to the various components, and preferably, the power supply 711 may be logically coupled to the processor 710 via a power management system, such that functions of managing charging, discharging, and power consumption are performed via the power management system.
In addition, the terminal 700 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides a terminal, and with reference to fig. 7, the terminal includes a processor 710, a memory 709, and a computer program that is stored in the memory 709 and can be run on the processor 710, and when the computer program is executed by the processor 710, the computer program implements each process of the charging method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the charging method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method of charging, the method comprising:
the method comprises the steps of obtaining a detection result of the type of a charging interface of a charging device, wherein the detection result is the result of detecting the type of the charging interface for N times by adopting a first detection signal, the charging device is connected with a terminal, N is a first preset number of times, and N is a positive integer;
if the detection result is a first result, detecting the type of the charging interface by adopting a second detection signal, wherein the first result is used for indicating that the type of the charging interface detected for N times is a non-dedicated charging interface DCP, the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal;
if the second detection signal is adopted to detect that the type of the charging interface is the DCP, the first detection signal is adopted again to detect the type of the charging interface;
and if the first detection signal is adopted again to detect that the type of the charging interface is the DCP, adopting first power corresponding to the DCP to charge the terminal.
2. The method of claim 1, wherein before the detecting the type of the charging interface again using the first detection signal, the method further comprises:
outputting prompt information, wherein the prompt information is used for instructing a user to reconnect the charging device with the terminal;
the detecting the type of the charging interface by re-using the first detection signal includes:
and if the user reconnects the charging device and the terminal, detecting the type of the charging interface by adopting the first detection signal again.
3. The method of claim 2, wherein the detecting the type of the charging interface by the first detection signal again if the user reconnects the charging device with the terminal comprises:
if the target connection times are smaller than second preset times, detecting the type of the charging interface by adopting the first detection signal again;
the method further comprises the following steps:
if the target connection times are equal to the second preset times, adopting second power corresponding to the non-DCP to charge the terminal, wherein the second power is smaller than the first power;
the target connection times are times of connecting the charging device and the terminal by a user in a target time period, and the target time period is a time period from detecting that the type of the charging interface is DCP by adopting the second detection signal to detecting that the type of the charging interface is DCP by adopting the first detection signal again.
4. The method of claim 1, further comprising:
if the type of the charging interface is detected to be non-DCP by adopting the second detection signal, adopting second power corresponding to the non-DCP to charge the terminal, wherein the second power is smaller than the first power.
5. The method according to any one of claims 1-4, further comprising:
if the first detection signal is adopted again to detect that the type of the charging interface is the non-DCP, the first detection signal is continuously adopted to detect the type of the charging interface until the detection times reach P times, the detection results of the P times are the non-DCP, P is a third preset time, and P is a positive integer.
6. The method of claim 1, wherein detecting the type of the charging interface again using the first detection signal if the type of the charging interface is DCP using the second detection signal comprises:
and if the type of the charging interface is detected to be the DCP by adopting the second detection signal for M times continuously, detecting the type of the charging interface by adopting the first detection signal again, wherein M is a fourth preset time and is a positive integer.
7. A terminal, characterized in that the terminal comprises: the device comprises an acquisition module, a first detection module, a second detection module and a charging module;
the acquisition module is used for acquiring a detection result of the type of a charging interface of a charging device, wherein the detection result is a result of detecting the type of the charging interface for N times by adopting a first detection signal, the charging device is a charging device connected with a terminal, N is a first preset number of times, and N is a positive integer;
the first detection module is configured to detect the type of the charging interface by using a second detection signal if the detection result obtained by the obtaining module is a first result, where the first result is used to indicate that N times of detection on the types of the charging interfaces are all non-dedicated charging interfaces DCP, the first detection signal is a detection signal generated by a power module of the terminal, and the second detection signal is a detection signal generated by a control module of the terminal;
the second detection module is configured to detect the type of the charging interface again by using the first detection signal if the first detection module detects that the type of the charging interface is DCP by using the second detection signal;
the charging module is configured to charge the terminal with a first power corresponding to the DCP if the second detection module detects that the type of the charging interface is the DCP again with the first detection signal.
8. The terminal of claim 7, further comprising an output module;
the output module is used for outputting prompt information before the second detection module adopts the first detection signal again to detect the type of the charging interface, and the prompt information is used for indicating a user to reconnect the charging device with the terminal;
the second detection module is specifically configured to detect the type of the charging interface by re-using the first detection signal if the user reconnects the charging device with the terminal.
9. The terminal of claim 8,
the second detection module is specifically configured to detect the type of the charging interface by using the first detection signal again if the target connection frequency is less than a second preset frequency;
the charging module is further configured to charge the terminal with a second power corresponding to the non-DCP if the target connection times are equal to the second preset times, where the second power is smaller than the first power;
the target connection times are times of connecting the charging device and the terminal by a user in a target time period, and the target time period is a time period from detecting that the type of the charging interface is DCP by adopting the second detection signal to detecting that the type of the charging interface is DCP by adopting the first detection signal again.
10. The terminal of claim 7,
the second detection module is further configured to detect the type of the charging interface again by using the first detection signal if the first detection module detects that the type of the charging interface is DCP by using the second detection signal M times in succession, where M is a fourth preset number of times, and M is a positive integer.
CN201810209972.XA 2018-03-14 2018-03-14 Charging method and terminal Active CN108448177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810209972.XA CN108448177B (en) 2018-03-14 2018-03-14 Charging method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810209972.XA CN108448177B (en) 2018-03-14 2018-03-14 Charging method and terminal

Publications (2)

Publication Number Publication Date
CN108448177A CN108448177A (en) 2018-08-24
CN108448177B true CN108448177B (en) 2019-12-20

Family

ID=63195174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810209972.XA Active CN108448177B (en) 2018-03-14 2018-03-14 Charging method and terminal

Country Status (1)

Country Link
CN (1) CN108448177B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109888884B (en) * 2019-03-28 2020-09-18 维沃移动通信有限公司 Charging circuit, terminal equipment, charging interface and charging equipment
CN111835049B (en) * 2019-04-22 2022-06-24 北京小米移动软件有限公司 Charging terminal, method and device
CN115622177B (en) * 2022-09-30 2023-10-27 荣耀终端有限公司 Charging method, mobile terminal and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9148026B2 (en) * 2011-09-30 2015-09-29 Fairchild Semiconductor Corporation Charger detection with proprietary charger support
CN104426194A (en) * 2013-09-06 2015-03-18 联想(北京)有限公司 Charging method and charging equipment
CN104103868B (en) * 2014-07-21 2017-04-12 Tcl通讯(宁波)有限公司 Charging method and system for charger of mobile terminal
CN105553001B (en) * 2015-12-23 2019-04-30 深圳市万普拉斯科技有限公司 Charging method and intelligent terminal

Also Published As

Publication number Publication date
CN108448177A (en) 2018-08-24

Similar Documents

Publication Publication Date Title
CN109587789B (en) Random access method, mobile terminal and network equipment
CN108494030B (en) Wireless charging method, terminal and transmitting terminal equipment
CN111083684A (en) Method for controlling electronic equipment and electronic equipment
CN110058836B (en) Audio signal output method and terminal equipment
CN109842872B (en) Working mode control method, Bluetooth headset, terminal and computer storage medium
CN109888928B (en) Terminal and wireless charging control method
US20220046502A1 (en) Handover method and terminal
CN109560591B (en) Charging method, device and terminal
CN107834640B (en) Charging method and terminal
CN109755997B (en) Charging method and terminal equipment
CN109995110B (en) Connector, electronic equipment, data transmission method and device
CN108448177B (en) Charging method and terminal
CN109639887B (en) Control method and terminal equipment
US20210127279A1 (en) Method of controlling radio resource management measurement of neighboring cell, mobile communication terminal, and network side device
US20220110036A1 (en) Random access method and terminal
CN108649716B (en) Signal transmission method, receiving end, sending end and terminal equipment
CN108009116B (en) MicroUSB interface circuit and mobile terminal thereof
CN108388400B (en) Operation processing method and mobile terminal
CN108595352B (en) Protection method and device for mobile terminal
CN111181218A (en) Charging prompting method, electronic device and medium
CN107769324B (en) Charging method, charger, mobile terminal and server
CN108777627B (en) Power supply method and device
CN108955641B (en) Depth camera shooting method, depth camera shooting equipment and mobile terminal
CN110460127B (en) Wireless charging control method and terminal equipment
CN110825682B (en) USB control method and electronic equipment

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