CN115622177A - Charging method, mobile terminal and storage medium - Google Patents

Charging method, mobile terminal and storage medium Download PDF

Info

Publication number
CN115622177A
CN115622177A CN202211216452.4A CN202211216452A CN115622177A CN 115622177 A CN115622177 A CN 115622177A CN 202211216452 A CN202211216452 A CN 202211216452A CN 115622177 A CN115622177 A CN 115622177A
Authority
CN
China
Prior art keywords
charging
mobile terminal
information
power supply
detection
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.)
Granted
Application number
CN202211216452.4A
Other languages
Chinese (zh)
Other versions
CN115622177B (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211216452.4A priority Critical patent/CN115622177B/en
Publication of CN115622177A publication Critical patent/CN115622177A/en
Application granted granted Critical
Publication of CN115622177B publication Critical patent/CN115622177B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • 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
    • 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/00045Authentication, i.e. circuits for checking compatibility between one component, e.g. a battery or a battery charger, and another component, e.g. a power source
    • 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/0029Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
    • 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/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits

Landscapes

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

Abstract

The application provides a charging method, a mobile terminal and a storage medium, and relates to the technical field of charging. When a charging port of the mobile terminal detects that a charging device is inserted, the mobile terminal performs first quick charging detection on the charging device, and the first quick charging detection is used for determining that the charging port of the charging device is a DCP port or the quick charging protocol handshake detection of the mobile terminal and the charging device is successful; if the first quick charging detection fails, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and triggers reconnection of the VBUS power supply circuit after the VBUS power supply circuit is turned off; after the VBUS power supply circuit is reconnected, first quick charging detection is conducted on the charging equipment again; and if the first quick charging detection is successful, the mobile terminal detects the quick charging condition of the charging equipment, and after the quick charging condition is detected, the charging equipment quickly charges the mobile terminal.

Description

Charging method, mobile terminal and storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a charging method, a mobile terminal, and a storage medium.
Background
Currently, when a user uses a standard charger to charge electronic devices such as a mobile phone quickly, the following problems may be encountered: the fast charge is erroneously recognized as a Buck charge (normal usb charge), and the charging speed is very slow.
In order to solve the above problems, in the conventional solution, a user can normally recognize the quick charging as the quick charging at a high probability by plugging and unplugging the charger again without damaging the charger, and then quickly charge the electronic device. However, the method needs manual plugging and unplugging operation on the charger, so that the charging steps are added, and the charging experience of a user is influenced.
Disclosure of Invention
The embodiment of the application provides a charging method, a mobile terminal and a storage medium, which are used for solving the problems that when the mobile terminal is charged quickly, the charging speed is too low due to misidentification as Buck charging (common usb charging), and the user can perform non-inductive self-identification and secondary retry, so that the misidentification rate of the charging type is reduced, the charging speed of the mobile terminal is improved, and the charging experience of the user is further improved.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a charging method is provided, which may be applied to a mobile terminal. When a charging port of the mobile terminal detects that the charging equipment is inserted, the mobile terminal firstly performs first quick charging detection on the charging equipment, and the first quick charging detection is used for determining that a charging port of the charging equipment is a DCP port or determining that quick charging protocol handshake detection between the mobile terminal and the charging equipment is successful; if the first quick charging detection fails, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and after the VBUS power supply circuit is turned off, the mobile terminal is triggered to reconnect the VBUS power supply circuit (namely, the first power supply reconnection is triggered); after the mobile terminal completes the first power supply reconnection, performing first quick charge detection on the charging equipment again; and if the first quick charging detection is successful, the mobile terminal detects the quick charging condition of the charging equipment, and after the quick charging condition is detected, the charging equipment quickly charges the mobile terminal.
By adopting the technical scheme, when the first quick charging detection of the charger fails, namely the charging port of the charging equipment is a non-DCP port, or the charging port of the charging equipment is a DCP port, but the quick charging protocol handshake detection of the mobile terminal and the charging equipment fails, the VBUS power supply circuit is switched off and reconnected through internal triggering, the pulling-out and the plugging-in of the charging equipment are simulated, manual operation of a user is not needed, the false identification rate of the charging type is reduced, and the charging speed of the mobile terminal is improved.
The first quick charging detection is used for determining that a charging port of the charging device is a DCP port. Or the first quick charge detection is used for determining that the quick charge protocol handshake detection between the mobile terminal and the charging device is successful.
In a possible implementation manner, the first fast charge detection is used to determine that a charging port of the charging device is a DCP port. The first aspect describes how the mobile terminal simulates the unplugging and plugging operations of the charging device to perform fast charging in case of a failure of the first fast charging detection (i.e. the charging port of the charging device is not the DCP port). And under the condition that the first quick charging detection is successful (namely, the charging port of the charging device is a DCP port), the mobile terminal cannot necessarily perform quick charging. Specifically, after determining that the charging port of the charging device is a DCP port, the mobile terminal needs to determine whether the rapid charging protocol handshake detection between the mobile terminal and the charging device is successful. If the handshake detection of the rapid charging protocol between the mobile terminal and the charging device is successful, the mobile terminal can perform the subsequent detection step of rapid charging. Of course, if the rapid charging protocol handshake detection between the mobile terminal and the charging device fails, the mobile terminal cannot perform rapid charging. In this case, the mobile terminal may simulate the unplugging and plugging operations of the charging device for fast charging.
Specifically, in this implementation, the method may further include: if the first quick charge detection is successful, namely after the charging port of the charging equipment is determined to be a DCP port, the mobile terminal and the charging equipment perform second quick charge detection for determining that the quick charge protocol handshake detection of the mobile terminal and the charging equipment is successful; if the second quick charging detection fails, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and after the VBUS power supply circuit is turned off, the mobile terminal is triggered to reconnect the VBUS power supply circuit to serve as second power supply reconnection; after the mobile terminal completes second power supply reconnection, second quick charge detection is carried out on the charging equipment again; and if the second quick charging detection is successful, the mobile terminal detects the quick charging condition of the charging equipment, and after the quick charging condition is detected, the charging equipment quickly charges the mobile terminal. It can be understood that, before performing the second fast charge detection again on the charging device, the first fast charge detection also needs to be performed again to determine that the charging port of the charging device is the DCP port. If the first quick charge detection fails to be carried out again, namely the charging port of the charging equipment is a non-DCP port, the step of carrying out second quick charge detection again cannot be carried out; at this time, the first fast charge detection needs to be performed again.
In a possible implementation manner, the turning off the VBUS power supply circuit of the mobile terminal by the mobile terminal may include: the mobile terminal detects whether the current charging type of the mobile terminal is BUCK charging; if the current charging type is BUCK charging, the VBUS port of the mobile terminal is pulled up by the mobile terminal to turn off the VBUS power supply circuit. In the implementation mode, when the mobile terminal determines that the current charging type is BUCK charging, the VBUS power supply circuit is turned off by pulling up the VBUS port of the mobile terminal, that is, the charging device is pulled out in a simulated manner, and a user does not need to operate manually.
In one possible implementation, triggering the first power supply reconnection after turning off the VBUS power supply circuit includes: after the VBUS power supply circuit is turned off, the VBUS port of the mobile terminal is pulled down to trigger the first power supply reconnection, namely, the VBUS power supply circuit is reconnected. Triggering a second power supply reconnection after turning off the VBUS power supply circuit, comprising: after the VBUS power supply circuit is turned off, the VBUS port of the mobile terminal is pulled down to trigger the second power supply reconnection, namely, the VBUS power supply circuit is reconnected. After the VBUS port of the mobile terminal is pulled up to turn off the VBUS power supply circuit, namely the charging equipment is pulled out in a simulated mode, the VBUS port of the mobile terminal is pulled down to trigger reconnection of the VBUS power supply circuit, namely the charging equipment is inserted in a simulated mode again, a user does not need manual operation, and charging steps are reduced.
In one possible implementation manner, the mobile terminal pulls up a VBUS port of the mobile terminal to turn off a VBUS power supply circuit, including: judging whether the mobile terminal is provided with a preset zone bit, if the preset zone bit of the mobile terminal is not set, setting the preset zone bit by the mobile terminal, and pulling up a VBUS port of the mobile terminal to turn off a VBUS power supply circuit; after the VBUS power supply circuit is turned off, if the preset flag bit is set, the mobile terminal displays a first charging icon for indicating that the mobile terminal is carrying out BUCK charging; if the preset flag bit is set, the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power supply reconnection. Through setting up the flag bit of predetermineeing, confirm whether mobile terminal need change the icon that charges, can make the icon that charges show in charging process in succession, promote the experience of charging.
In one possible implementation, after the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power supply reconnection, the method further includes: if the preset flag bit is set, the mobile terminal does not send out the audio charging prompt. The sound can not be suddenly emitted in the charging process, so that the whole re-detection process is user-insensitive, and the charging experience of the user can be improved.
In one possible implementation, after the detection of the fast charge condition passes, the method further includes: and if the preset flag bit is set, the mobile terminal displays a second charging icon for indicating that the mobile terminal is performing quick charging. By setting the preset zone bit, the charging icon which needs to be displayed by the mobile terminal can be determined, so that the charging icon corresponding to the charging type can be displayed correctly.
In one possible implementation manner, after the mobile terminal sets the preset flag bit, before pulling up the VBUS port of the mobile terminal to turn off the VBUS power supply circuit, the method further includes: the mobile terminal is plugged and unplugged for times +1; after the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power supply reconnection, the method further comprises: the mobile terminal is plugged and unplugged for times +1; wherein, after the mobile terminal is rapidly charged by the charging device, the method further comprises: if the plugging times are larger than or equal to the preset retry times, the mobile terminal acquires the information of the charging equipment and reports the information of the charging equipment to the server; the information of the charging equipment comprises equipment information and plugging times of the charging equipment. The method can more accurately determine whether the mobile terminal enters the fast charging mode by re-triggering the fast charging detection through recording the retry times (plugging times) in the charging process according to the retry times, and can directly determine whether to report the big data according to the retry times after entering the fast charging mode, so that the data reporting efficiency is improved.
In a possible implementation manner, the above-mentioned mobile terminal turning off the VBUS power supply circuit of the mobile terminal includes: a kernel driving layer of the mobile terminal acquires charging plug-pull state information, current charging type and battery electric quantity information as charging associated information and synchronizes the charging associated information to a power _ supply battery node of the kernel driving layer; the charging plugging state information is used for indicating whether the mobile terminal and the charging equipment are plugged in place or not, and the current charging type is used for indicating whether the charging type of the mobile terminal is BUCK charging or not; the power _ supply battery node stores charging relevant information to obtain first battery node information; the battery service module of the frame layer of the mobile terminal acquires first battery node information and generates a first battery state updating broadcast based on the first battery node information; a SystemUI module of an application layer of the mobile terminal receives the first battery state updating broadcast, updates contents in the broadcast according to the first battery state and acquires a current charging type; if the current charging type is BUCK charging, the SystemUI module issues a GPIO (general purpose input/output) pulling action instruction to the kernel driving layer; and the kernel driving layer receives the GPIO action pulling-up instruction and pulls up the VBUS port of the mobile terminal so as to switch off the VBUS power supply circuit.
In one possible implementation, triggering the first power supply reconnection after turning off the VBUS power supply circuit includes: after the VBUS power supply circuit is turned off, the kernel driving layer synchronizes first indication information to the power _ supply battery node; the first indication information comprises turn-off information, and the turn-off information is used for indicating that the VBUS power supply circuit is turned off; the power _ supply battery node updates the first battery node information to obtain second battery node information based on the first indication information; the Battery service module acquires the information of the second battery node and generates a second battery state updating broadcast based on the information of the second battery node; the SystemUI module receives the second battery state updating broadcast, updates the content in the broadcast according to the second battery state and acquires the current charging type; if the current charging type is BUCK charging, the SystemUI module sends a low GPIO action instruction to the kernel driving layer; and the kernel driving layer receives the GPIO action pulling-down instruction, and pulls down the VBUS port of the mobile terminal so as to reconnect the VBUS power supply circuit. Clear upper and lower layer data recognition and interaction are set inside the mobile terminal, under the condition that a user is not sensitive, the VBUS power supply circuit is switched off and reconnected through the kernel driving layer to trigger the unplugging and plugging of the charger, then the charging type recognition processes such as BC1.2\ ACCP are carried out again, the false recognition probability of the charging equipment is reduced, and the charging rate and the charging experience are improved.
In one possible implementation manner, the charging correlation information further includes flag bit information, the first battery node information further includes flag bit information, and the first battery state update broadcast further includes flag bit information; the flag bit information is used for indicating whether a preset flag bit is set or not; when the current charging type is BUCK charging, before the systemin ui module issues a command to raise GPIO action to the kernel driver layer, the method further includes: the kernel driving layer acquires the zone bit information, determines whether a preset zone bit is set or not through the zone bit information, and sets the preset zone bit if the preset zone bit is not set; the first indication information further comprises flag bit updating information, and the flag bit updating information is used for indicating that a preset flag bit is set; the second battery node information further comprises flag bit update information; the second battery status update broadcast also includes flag bit update information; the application layer receives the second battery state updating broadcast and determines that the preset zone bit is set based on the second battery state updating broadcast; the application layer displays a first charging icon; the first charging icon is used for indicating that the mobile terminal is performing BUCK charging. Whether the charging icon of the upper interface needs to be changed or not can be determined by judging whether the kernel driving layer is provided with the preset zone bit or not, so that the charging icon can be continuously displayed in the charging process, and the charging experience is improved.
In a possible implementation manner, after the fast charge condition is detected to pass, the method further includes: the kernel driving layer acquires charging correlation updating information and synchronizes the charging correlation updating information to the power _ supply battery node; the charging correlation updating information comprises charging plug state information, a current charging type and battery electric quantity information; the power _ supply battery node saves charging associated update information and updates the second battery node information to obtain third battery node information; the Battery service module acquires the third battery node information and generates a third battery state updating broadcast based on the third battery node information; the application layer receives a third battery state updating broadcast and determines that a preset zone bit is set based on the third battery state updating broadcast; the application layer displays a second charging icon; the second charging icon is used for indicating that the mobile terminal is performing quick charging. The preset zone bit can be set through judging the kernel driving layer, so that the quick charging icon can be correctly displayed when the mobile terminal enters the quick charging.
In a possible implementation manner, if the first fast charging detection performed again is successful, the mobile terminal performs fast charging condition detection on the charging device, including: if the first quick charging detection is successful, the mobile terminal determines whether the charging protocol type of the charging equipment is a preset type, namely whether the charging protocol type is an SCP type; if the charging protocol type of the charging equipment is a preset type, namely an SCP type, the mobile terminal determines whether the charging equipment meets a preset quick charging condition, wherein the preset quick charging condition comprises at least one of a preset voltage condition, a preset current condition and a preset impedance condition; and if the charging equipment meets the preset quick charging condition, the mobile terminal determines that the charging equipment passes the detection of the quick charging condition.
If the second quick charge detection is successful, the above quick charge condition detection is also performed, and the specific process of the quick charge condition detection is the same as above and is not described herein again.
In one possible implementation manner, after the mobile terminal is rapidly charged by the charging device, the method further includes: and resetting the preset zone bit and resetting the plugging times by the kernel driving layer. After the mobile terminal is inserted into the charging device next time, the preset mark and the plugging times can be reset, and subsequent flow errors cannot be caused.
In one possible implementation, the method may further include: when a charging port of the mobile terminal detects that a charging device is inserted, the kernel driving layer determines preset reset time; and if the preset reset time is reached, resetting the preset zone bit by the kernel driving layer and resetting the plugging times. The charging equipment can be prevented from repeatedly retrying unsuccessfully to enter the dead loop by starting a timer after the charging equipment is inserted and setting the preset reset time, so that the influence on the whole power consumption is avoided.
In a second aspect, the present application provides a mobile terminal, comprising: the system comprises a charging interface, a battery, a memory and one or more processors; the charging interface, the battery and the memory are coupled with the processor; wherein the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the mobile terminal to perform the charging method of any of the above first aspects.
In a third aspect, the present application provides a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the charging method of any of the first aspects described above.
In a fourth aspect, the present application provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the charging method of any one of the first aspects above.
It is to be understood that the mobile terminal according to the second aspect, the computer-readable storage medium according to the third aspect, and the computer program product according to the fourth aspect are all configured to execute the corresponding method provided above, and therefore, the beneficial effects achieved by the mobile terminal can refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Drawings
Fig. 1 is a schematic diagram of a charging device and a mobile terminal according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a charger identification according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a hardware structure of a mobile phone according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a software structure of a mobile phone according to an embodiment of the present application;
fig. 5 is a flowchart illustrating an implementation of a charging method according to an embodiment of the present disclosure;
fig. 6 is a schematic view illustrating a charging icon according to an embodiment of the present disclosure;
fig. 7 is a flowchart illustrating another implementation of a charging method according to an embodiment of the present disclosure;
fig. 8 is a timing diagram of a software implementation of a charging method according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a chip system according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. The following terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature.
The embodiment of the application provides a charging method, which can be applied to a mobile terminal, and the mobile terminal can be a mobile phone, a tablet computer, a notebook computer and other devices.
For example, take the mobile terminal as the mobile phone 100 shown in fig. 1 as an example; the charging device in the embodiment of the present application refers to a standard charger 200 of a mobile phone, and the standard charger 200 can rapidly charge the mobile phone 100. The detection of the insertion of the charging device in the charging port 110 of the mobile terminal specifically means that the insertion of the standard charger 200 is detected in the charging port 110 of the mobile phone 100. It should be noted that, at present, most electronic devices (such as a mobile phone, a tablet pc, or other electronic products) have a Type-C interface as a charging port. The Type-C interface is a USB interface and is also called a USB Type-C interface. The Type-C interface supports functions of charging, data transmission, display output and the like of the USB standard.
When the mobile phone 100 detects that the charging port 110 is plugged into the standard charger 200, the mobile phone 100 will perform BC1.2 detection on the charging port 110, i.e. the USB port. The main purpose of BC1.2 detection is to determine the USB port type, specifically, the port type of the USB port is determined according to the obtained voltage and current information by detecting information such as voltage and current obtained by the mobile phone from the USB port.
The BC1.2 (Battery Charging v 1.2) is a protocol established by a BC (Battery Charging) group under the USB-IF, and is mainly used for standardizing the requirements of Battery Charging, and the protocol was originally implemented based on a USB2.0 protocol. The USB2.0 protocol specifies that the current limit of 500ma, which is a maximum of 500ma of current drawn by the peripheral from the USB charger, cannot meet the increasing demand for fast charging. Therefore, BC1.2 introduces a charging port identification mechanism, mainly comprising several USB port types: dedicated Charging Port (DCP): the DCP does not support a data protocol, supports quick charging and can provide large current, and the DCP is mainly used for special chargers such as wall charging and the like; standard downlink interface (SDP): the SDP port supports a USB protocol, the maximum current is 500mA, and the SDP can be regarded as a common USB interface; charging Downstream interface (CDP): CDP supports both data protocols and fast charging.
Referring to fig. 2, fig. 2 is a flowchart illustrating a charger identification process according to an embodiment of the present disclosure. As shown in fig. 2, after the charger is plugged in, BC1.2 port detection is performed on the USB port, and the port type of the USB port is determined according to the BC1.2 detection result. If the USB port is a DCP type, the charger handshake detection will continue, mainly the accp handshake detection, in order to determine whether the charger supports a specific charging protocol. The handshake detection specifically refers to: and the mobile phone performs rapid charging protocol handshaking with the charger according to a preset rapid charging protocol handshaking sequence. If the accp handshake detection is successful, the following charging protocol type detection is continued, and the charging protocol type detection specifically includes: the mobile phone judges whether the charger is of the SCP type or not by reading the charger type register. If the SCP type is not the SCP type, the charger carries out other non-rapid charging on the mobile phone, and if the SCP type is the SCP type, the super rapid charging icon is displayed on the interface of the mobile phone, and the detection of rapid charging conditions and the like is continuously carried out. If the charger meets the fast charging condition, the fast charging (also called direct charging) can be started, and the output voltage, current and the like of the charger are adjusted; and if the charger is detected not to meet the quick charging condition, the charger performs other non-quick charging on the mobile phone.
In the above charger identification process, two types of problems may occur: firstly, when the BC1.2 port of the USB port is detected, if the USB port is determined to be of the SDP type according to the detection result of the BC1.2 port, subsequent detection actions can not be carried out, and only Buck charging (common USB charging, the charging capability is 5V500 mA) can be carried out, so that the charging power of the mobile phone is very low and the charging speed is very low. Secondly, when the USB port identifies the DCP type and the accp handshake detection is carried out on the charger, if the accp handshake fails, the subsequent detection action cannot be entered, the fast charging cannot be entered, and finally, the 5V2A charging or Buck charging can be carried out (according to whether the charger supports the pd protocol and the capability negotiation), the charging capability is not higher than 5V2A, and the charging speed is very low.
In summary, after the standard charger is inserted into the mobile phone, the mobile phone cannot be charged successfully, and there is a case that the BC1.2 detection result is an SDP type (non-DCP type) or the BC1.2 detection result is a DCP type, but the accp handshake detection fails, which results in that the mobile phone finally performs buck charging. Therefore, how to correctly enter fast charging after the mobile phone is inserted into the standard charger is an urgent problem to be solved.
In some existing solutions, the above problem can be solved in the following ways: the charger is plugged again by a user, recognition processes such as BC1.2 detection/accp handshake detection and the like are triggered again, under the condition that the charger is not damaged, the USB port can be correctly recognized into a DCP type with high probability, and the accp handshake detection is successful, and then the rapid charging is carried out. However, by adopting the method, the charger needs to be manually plugged and unplugged, so that the charging steps are added, and the charging experience of a user is influenced.
The embodiment of the application provides a charging method, a mobile terminal and a storage medium, which do not need to manually insert and pull out a charger, and can perform noninductive self-identification and retry operation of a user when the charger is mistakenly identified as buck charging, so that a mobile phone can correctly enter fast charging after being inserted into a standard charger.
In the charging method provided in the embodiment of the application, when the charging port of the mobile terminal detects that the charger is inserted, the mobile terminal performs quick charging detection on the charger, determines whether the charging port of the charger is a DCP port or not, or determines whether quick charging protocol handshake detection between the mobile terminal and the charger is successful or not, and if the charging port of the charger is not the DCP port or the quick charging protocol handshake detection between the mobile terminal and the charger is unsuccessful, the mobile terminal turns off the VBUS power supply circuit and reconnects the VBUS power supply circuit after turning off the VBUS power supply circuit. And then, the mobile terminal carries out quick charge detection on the charger again, and after the detection of the fast charge is successful and the detection of the fast charge condition is passed, the charger can carry out quick charge on the mobile terminal. In the charging method, after the mobile terminal is inserted into the charger and the quick charging detection fails, the VBUS power supply circuit is turned off and reconnected through the mobile terminal to simulate the unplugging and reinsertion operations of the charger by a user, the quick charging detection is carried out again, and the user can perform the noninductive retry operation and the self-identification to ensure that the charger enters the quick charging correctly. The VBUS pin on the charging port is a power supply pin, the VBUS power supply circuit is turned off, namely, the power supply is turned off, namely, the charger is pulled out, the VBUS power supply circuit is reconnected, namely, the power supply is connected again, and namely, the charger is plugged in again.
For example, the mobile terminal in the embodiment of the present application may be a mobile phone, a tablet Computer, a notebook Computer, an Ultra-mobile Personal Computer (UMPC), a handheld Computer, a wearable electronic device (e.g., a smart watch, a smart bracelet, and smart glasses), and the like, which relate to BC1.2 detection and fast charging, and the embodiment of the present application does not limit the present application to this.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings. Taking the mobile terminal as a mobile phone as an example, a hardware structure of the mobile terminal (e.g., the mobile phone 300) is introduced. The hardware structure of the mobile terminal may refer to the detailed description of the mobile phone 300 in this embodiment, which is not described herein again. Referring to fig. 3, fig. 3 shows a schematic structural diagram of a mobile phone, and as shown in fig. 3, the mobile phone 300 may include: the mobile communication device comprises a processor 310, an external memory interface 320, an internal memory 321, a usb interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone, an earphone interface, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, a display 394, a Subscriber Identity Module (SIM) card interface 395 and the like.
The sensor module 380 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and other sensors.
It is to be understood that the illustrated structure of the present embodiment does not constitute a specific limitation to the mobile phone 300. In other embodiments, the handset 300 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 310 may include one or more processing units, such as: the processor 310 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. Wherein, the different processing units may be independent devices or may be integrated in one or more processors.
The controller may be a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the time sequence signal to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 310 for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 310. If the processor 310 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 310, thereby increasing the efficiency of the system.
In some embodiments, processor 310 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the connection relationship between the modules illustrated in the present embodiment is only an exemplary illustration, and does not constitute a limitation to the structure of the mobile phone 300. In other embodiments, the mobile phone 300 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 340 is used to receive charging input from a charger. In the embodiment of the present application, the charger is a wired charger, and the charging management module 340 may receive a charging input of the wired charger through the USB interface 330 (i.e., the charging interface). The charging management module 340 may also supply power to the electronic device through the power management module 341 while charging the battery 342.
The power management module 341 is configured to connect the battery 342, the charging management module 340 and the processor 310. The power management module 341 receives input from the battery 342 and/or the charging management module 340 and provides power to the processor 310, the internal memory 321, the external memory, the display 394, the camera 393, and the wireless communication module 360. The power management module 341 may also be configured to monitor parameters such as battery capacity, battery cycle count, and battery state of health (leakage, impedance). In other embodiments, the power management module 341 may also be disposed in the processor 310. In other embodiments, the power management module 341 and the charging management module 340 may be disposed in the same device.
The wireless communication function of the mobile phone 300 can be realized by the antenna 1, the antenna 2, the mobile communication module 350, the wireless communication module 360, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the handset 300 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 350 may provide a solution including 2G/3G/4G/5G wireless communication applied to the handset 300. The mobile communication module 350 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 350 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit the electromagnetic waves to the modem for demodulation.
The wireless communication module 360 may provide solutions for wireless communication applied to the mobile phone 300, including Wireless Local Area Networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global Navigation Satellite Systems (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like.
The wireless communication module 360 may be one or more devices integrating at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 310. The wireless communication module 360 may also receive a signal to be transmitted from the processor 310, frequency-modulate and amplify the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of the handset 300 is coupled to the mobile communication module 350 and antenna 2 is coupled to the wireless communication module 360 so that the electronic device 300 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), general Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The mobile phone 300 implements the display function through the GPU, the display screen 394, and the application processor. The GPU is a microprocessor for image processing, coupled to a display screen 394 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 394 is used to display images, video, and the like. The display screen 394 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like.
The cell phone 100 may implement a camera function via the ISP, camera 393, video codec, GPU, display 394, application processor, etc. The ISP is used to process the data fed back by the camera 393. The camera 393 is used to capture still images or video. In some embodiments, cell phone 300 may include 1 or N cameras 393, N being a positive integer greater than 1. The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the handset 300 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy. Video codecs are used to compress or decompress digital video. The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 320 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the mobile phone 300. The external memory card communicates with the processor 310 through the external memory interface 320 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 321 may be used to store computer-executable program code, which includes instructions. The processor 310 executes various functional applications of the cellular phone 300 and data processing by executing instructions stored in the internal memory 321. For example, in the embodiment of the present application, the processor 310 may execute instructions stored in the internal memory 321, and the internal memory 321 may include a program storage area and a data storage area.
The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, and the like) required by at least one function, and the like. The data storage area may store data (e.g., audio data, phone book, etc.) created during use of the electronic device 300, and the like. In addition, the internal memory 321 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The mobile phone 300 can implement audio functions through the audio module 370, the speaker 370A, the receiver 370B, the microphone, the earphone interface, and the application processor. Such as music playing, recording, etc.
The audio module 370 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 370 may also be used to encode and decode audio signals. In some embodiments, the audio module 370 may be disposed in the processor 310, or some functional modules of the audio module 370 may be disposed in the processor 310. The speaker 370A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The receiver 370B, also called "earpiece", is used to convert the electrical audio signal into a sound signal. Microphones, also known as "microphones", are used to convert sound signals into electrical signals.
The earphone interface is used for connecting a wired earphone. The headset interface may be USB interface 330, or may be an open mobile electronic device platform (OMTP) standard interface of 3.5mm, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
Keys 390 include a power-on key, a volume key, etc. The keys 390 may be mechanical keys. Or may be touch keys. The motor 391 may generate a vibration cue. Motor 391 may be used for incoming call vibration prompts, as well as for touch vibration feedback. Indicator 392 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc. The SIM card interface 395 is for connecting a SIM card. The SIM card can be attached to and detached from the cellular phone 300 by being inserted into or pulled out of the SIM card interface 395. The handset 300 can support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 395 may support a Nano SIM card, a Micro SIM card, a SIM card, etc.
The methods in the following embodiments can be implemented in the mobile phone 300 having the above hardware structure.
The software system of the mobile phone 300 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of the mobile phone 300.
Fig. 4 is a block diagram of a software structure of a mobile phone 300 according to an embodiment of the present disclosure. The layered architecture can divide the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, which are an Application layer (Application layer for short), an Application Framework layer (Framework layer for short), a native layer (native) and a Kernel driver layer (Kernel) from top to bottom. For example, as shown in FIG. 4, handset 300 may include an application layer, a framework layer, a native layer, and a kernel driver layer.
The application layer may include a series of application packages. For example, the application layer shown in fig. 4 may include applications and general applications of a System (System) UI. Common applications may be camera, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short message, and desktop launch (Launcher) applications. Applications of the System UI may include navigation bars and status bars of the cell phone 300, and the like. The status bar of the mobile phone comprises a charging icon of the mobile phone, and the charging icon is used for indicating the charging status of the mobile phone; percentage of battery charge; low power alerts, etc. The System UI is mainly used for monitoring System broadcasts and performing corresponding updates on the UI, such as update display of charging icons, update display of battery power, and the like.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
For example, the application framework layer may include a base framework, a battery service (Battery service), and a battery statistics service (Battery StatsService). The basic framework comprises a window manager, a content provider, a view system, a resource manager, a notification manager and the like. For example, the window manager described above is used to manage window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system can be used for constructing the display interface of the application program. Each display interface may be composed of one or more controls. Generally, a control may include an interface element such as an icon, button, menu, tab, text box, dialog box, status bar, navigation bar, widget, and the like. The resource manager provides various resources, such as localized strings, icons, pictures, layout files, video files, and the like, to the application. The notification manager enables the application program to display notification information in the status bar, can be used for conveying notification type messages, can automatically disappear after a short time of stay, and does not need user interaction. Such as a notification manager used to notify download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The BatteryService provides an interface for acquiring battery information, a charging state and the like, for example, acquiring charging plug state information, a current charging type and battery power information, wherein the charging plug state information indicates whether the mobile phone and the charger are plugged in place, and the current charging type indicates the charging type of the mobile phone. The BatteryService mainly has the functions of monitoring the battery information change message and forwarding the message to various places in the Android system in a system broadcast mode. The BatteryStatsservice is mainly used for power consumption statistics.
The local layer comprises a Healthd process, wherein the Healthd process is mainly used for monitoring a battery event from the kernel driving layer and transmitting battery data to the Batteryservice of the frame layer.
The kernel driving layer comprises a battery-related driver and a charge-discharge management-related driver, is responsible for interacting with hardware, registering Power supply attributes and generating a uevent event and reporting to the Native layer. Specifically, when the hardware state changes, the kernel driver layer triggers a related interrupt, invokes a corresponding interrupt function, and updates and modifies a corresponding Power supply node value. The kernel driving layer also comprises a charging control logic module which is used for inserting a charger, carrying out logic processes such as quick charging detection and the like through the charging control logic module, and updating the obtained related state information and values to each attribute node of the kernel layer; and when receiving a related instruction (pull up/pull down a VBUS port instruction) returned by the application program layer, performing the logic flow such as fast charge detection again.
In the embodiment of the present application, a mobile phone is taken as an example, and as shown in fig. 4, a working principle of implementing the method of the embodiment of the present application by each software layer in the mobile phone is described. After the mobile phone detects that the mobile terminal is inserted into a charger, logic flows such as charging plugging state detection, BC1.2 detection, accp handshake detection and charging type detection are carried out through direct _ charge _ check or icm _ dc _ state of a charging control logic module, then relevant detected state information and values are updated to a Power supply battery node of the inner core layer, a ue event is generated and reported to the native layer. The native layer receives the event report of the kernel layer, processes the event report through a health process, namely reads the information of the Power supplied battery node of the kernel layer, and uploads the information of the battery node to the Battery service of the frame layer for processing. And the Battery service receives the updated information of the battery nodes reported by the native layer and generates a battery state updating broadcast based on the updated information of the battery nodes. The system UI of the application layer acquires the charging plug-pull state information, the current charging type, the battery capacity information and the like by monitoring the battery state updating broadcast sent by the Batteryservice, and is used for displaying and updating the icons of the upper interface and other events. The system UI also updates the current charging type in the broadcast according to the battery state, sends a GPIO action command of raising/lowering to the kernel driving layer, after the charging control logic module of the kernel driving layer receives the command sent by the system UI, the VBUS port is raised/lowered, then the procedures of BC1.2 detection, accp handshake detection and the like are carried out again, quick charging is carried out after BC1.2 detection \ accp handshake detection and identification are normal, further charging type misidentification is reduced, charging experience is improved, and secondary retry without perception of a user is realized.
An embodiment of the present application provides a charging method, please refer to fig. 5, and fig. 5 is a flowchart illustrating an implementation of the charging method according to the embodiment of the present application. As shown in fig. 5, the charging method may include S501-S507.
S501, when the charging port of the mobile terminal detects that the charging equipment is inserted, the mobile terminal performs first quick charging detection on the charging equipment. The first fast charge detection is used for determining that a charging port of the charging device is a DCP port.
In this embodiment of the application, if the first fast charge detection is successful, it indicates that the charging port of the charging device is the DCP port, and if the first fast charge detection is failed, it indicates that the charging port of the charging device is not the DCP port. The BC1.2 detection is performed on the charging port by determining whether the charging port of the charging device is a DCP port.
After S501, if the charging port of the charging device is a DCP port, that is, the first fast charge detection is successful, the mobile terminal may perform S504. If the charging port of the charging device is not the DCP port, that is, the first fast charge detection fails, the mobile terminal may execute S502.
S502, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and triggers first power supply reconnection after the VBUS power supply circuit is turned off. Wherein the first supply reconnects to the reconnect VBUS supply circuit.
It should be understood that, in the conventional art, if the charging port of the charging device is not the DCP port, that is, the first fast charge detection fails, it indicates that the mobile terminal cannot be fast charged, but BUCK charging is possible. Therefore, in the embodiment of the present application, before the mobile terminal performs S502, it may be detected whether the current charging type of the mobile terminal is BUCK charging. If the current charging type of the mobile terminal is BUCK charging, the mobile terminal may perform S502.
If the first quick charging detection fails, the mobile terminal turns off the VBUS power supply circuit, and triggers reconnection of the VBUS power supply circuit after the VBUS power supply circuit is turned off, wherein the turning off of the VBUS power supply circuit means that a user is simulated to pull out the charging equipment, and the reconnection of the VBUS power supply circuit means that the user is simulated to reinsert the charging equipment. The embodiment of the present application may use the above-mentioned reconnection VBUS power supply circuit as the first power supply reconnection.
Specifically, the mobile terminal can turn off the VBUS power supply circuit by pulling up the VBUS port of the mobile terminal. Correspondingly, after the VBUS power supply circuit is turned off, the mobile terminal may trigger the first power supply reconnection (i.e., reconnection of the VBUS power supply circuit) in a manner of pulling down the VBUS port of the mobile terminal. Wherein, pulling up the VBUS port means pulling up the level of the VBUS port, and pulling down the VBUS port of the mobile terminal means pulling down the level of the VBUS port.
Wherein, the one-time disconnection-reconnection of the VBUS power supply circuit is equivalent to the one-time plugging and unplugging of the charger by a user. From the description of the above embodiments, it can be seen that: the user plugs and pulls the charger again, so that BC1.2 detection/accp handshake detection and other identification processes can be triggered again. Under the condition that the charger is not damaged, the USB port can be correctly identified as the DCP type with high probability, the accp handshake detection is successful, and then the quick charging is carried out. In this embodiment of the application, the mobile terminal may simulate, in a manner that the user does not perceive, a user to plug and unplug the charger when the BC1.2 detection fails (i.e., the first fast charge detection fails), so as to re-trigger the first fast charge detection (i.e., execute S503). Therefore, the mobile terminal can re-identify the charging port as the DCP port, so that the mobile terminal can perform quick charging.
It is understood that the first fast charge detection is for determining that the charging port of the charging device is a DCP port. The first aspect describes how the mobile terminal simulates the unplugging and plugging operations of the charging device to perform fast charging in case of a failure of the first fast charging detection (i.e. the charging port of the charging device is not the DCP port). And under the condition that the first quick charging detection is successful (namely, the charging port of the charging device is a DCP port), the mobile terminal cannot necessarily perform quick charging. Specifically, after determining that the charging port of the charging device is a DCP port, the mobile terminal needs to determine whether the rapid charging protocol handshake detection between the mobile terminal and the charging device is successful. If the handshake detection of the rapid charging protocol between the mobile terminal and the charging device is successful, the mobile terminal can perform rapid charging. Of course, if the rapid charging protocol handshake detection between the mobile terminal and the charging device fails, the mobile terminal cannot perform rapid charging. In this case, the mobile terminal may simulate a unplugging and plugging operation of the charging device for rapid charging.
And S503, after the mobile terminal completes the first power supply reconnection, the mobile terminal performs the first quick charge detection on the charging equipment again. The first fast charging detection is used for determining that a charging port of the charging device is a DCP port.
Specifically, after the mobile terminal completes the first power supply reconnection, namely, the disconnection and the reconnection of the VBUS power supply circuit, the mobile terminal performs the first fast charging detection again on the charging device, that is, the mobile terminal performs BC1.2 detection again, and determines the charging port type of the charging device.
After S503, if the charging port of the charging device is a DCP port, that is, the first fast charge detection is successful, the mobile terminal may execute S504. If the charging port of the charging device is not the DCP port, that is, the first fast charge detection fails, the mobile terminal may continue to execute S502.
In some embodiments, the mobile terminal may record the number of times of the first fast charge detection failure, and after the nth time of the first fast charge detection failure, the mobile terminal may send a prompt message to the user. The prompt information is used for indicating the failure of quick charging and can also indicate a user to manually plug and unplug a charging interface so as to try to perform quick charging. n is not less than 2, and n is an integer.
And S504, the mobile terminal and the charging equipment perform second quick charging detection. And the second quick charge detection is used for determining that the quick charge protocol handshake detection of the mobile terminal and the charging equipment is successful.
Specifically, after the charging port of the charging device is determined to be the DCP port through the first quick-charging detection, accp handshake detection is continuously performed on the charging device, that is, the mobile terminal and the charging device perform quick-charging protocol handshake detection, and whether the charging device supports the charging protocol is determined through the accp handshake detection. The accp handshake detection is called as second quick charge detection, and the second quick charge detection is used for determining that the quick charge protocol of the mobile terminal and the charging device is successful in handshake detection, namely, the second quick charge detection is successful, which indicates that the quick charge protocol of the mobile terminal and the charging device is successful in handshake detection, and the second quick charge detection is failed, which indicates that the quick charge protocol of the mobile terminal and the charging device is failed in handshake detection.
After S504, if the rapid charging protocol handshake detection between the mobile terminal and the charging device fails, that is, the second rapid charging detection fails, the mobile terminal executes S505. If the handshake detection of the fast charging protocol between the mobile terminal and the charging device is successful, that is, the second fast charging detection is successful, the mobile terminal executes S507.
And S505, the mobile terminal turns off the VBUS power supply circuit of the mobile terminal and triggers the second power supply reconnection after the VBUS power supply circuit is turned off. Wherein the second supply is reconnected to reconnect the VBUS supply circuit.
In the embodiment of the application, if the second fast charging detection fails, the mobile terminal turns off the VBUS power supply circuit, and triggers reconnection of the VBUS power supply circuit after the VBUS power supply circuit is turned off. According to the embodiment of the application, after the VBUS power supply circuit is turned off due to the failure of the second quick charge detection, the VBUS power supply circuit is reconnected to serve as the second power supply reconnection. Specifically, when the second fast charge detection fails, the mobile terminal turns off the VBUS power supply circuit by pulling up the VBUS port, and then triggers the second power supply reconnection by pulling down the VBUS port of the mobile terminal, that is, pulling down the level of the VBUS port.
It should be noted that the second power supply reconnection in S505 and the first power supply reconnection in S502 are both reconnecting the VBUS power supply circuit after the VBUS power supply circuit of the mobile terminal is turned off. The first supply reconnect and the second supply reconnect in the embodiments of the present application are merely to distinguish between different times of reconnecting the VBUS supply circuit.
And S506, after the mobile terminal completes second power supply reconnection, performing second quick charge detection on the charging equipment again. And the second quick charge detection is used for determining that the quick charge protocol handshake detection of the mobile terminal and the charging equipment is successful.
In the embodiment of the application, after the mobile terminal is reconnected to the VBUS power supply circuit, that is, after the second power supply reconnection is completed, the second quick charge detection is performed on the charging device again, that is, the mobile terminal performs the accp handshake detection again, and it is determined whether the charging device supports the charging protocol. It can be understood that, the mobile terminal also needs to perform the first fast charging detection again, that is, determine whether the charging port of the charging device is a DCP port; if the mobile terminal determines that the charging port of the charging equipment is the DCP port, the first quick charging detection is carried out again successfully, and then the second quick charging detection is carried out again to determine whether the charging equipment supports the charging protocol. If the repeated first quick charge detection fails, the mobile terminal needs to perform the repeated first quick charge detection again, and the mobile terminal cannot directly enter the second quick charge detection.
After S506, if the detection of the fast charging protocol handshake between the mobile terminal and the charging device is successful, that is, the second fast charging detection is successful, the mobile terminal performs S507. If the handshake detection of the fast charging protocol between the mobile terminal and the charging device fails, that is, the second fast charging detection fails, the mobile terminal executes S505.
And S507, the mobile terminal detects the quick charging condition of the charging equipment, and the charging equipment quickly charges the mobile terminal after the quick charging condition is detected to be passed.
In the embodiment of the application, after the second quick charge detection is successful, the detection of the quick charge condition of the charging device needs to be continued, and only after the detection of the quick charge condition is passed, the mobile terminal can successfully enter the quick charge.
Specifically, after the second quick charging detection is successful, the mobile terminal determines whether the charging protocol type of the charging device is a preset type, and if so, the mobile terminal continues to determine whether the charging device meets a preset quick charging condition. The method includes the steps that a preset type is a super fast charge (SCP) type, namely, a mobile terminal determines whether a charging protocol type of charging equipment is the SCP type, and if the charging equipment is the SCP type, whether the charging equipment meets a preset fast charge condition is continuously determined; if the SCP type is not the mobile terminal, the mobile terminal enters other non-fast charging modes. The mobile terminal reads the charging device type register to determine the charging protocol type of the charging device. The preset quick-charging condition comprises at least one of a preset voltage condition, a preset current condition and a preset impedance condition. If the charging equipment meets the preset quick charging condition, the mobile terminal determines that the charging equipment passes the detection of the quick charging condition, and the charging equipment can quickly charge the mobile terminal. Generally, the charging device needs to satisfy a preset voltage condition, a preset current condition and a preset impedance condition at the same time, and then the mobile terminal can determine that the charging device passes the detection of the quick charging condition, and the charging device can perform quick charging on the mobile terminal.
Therefore, after the mobile terminal is inserted into the charging device, if the charging port of the charging device is detected to be a non-DCP port by mistake or the charging port of the charging device is a DCP port but accp handshake detection fails, so that the charging type is identified to be the condition of BUCK charging by mistake, the non-inductive self-identification operation of a user can be performed, namely, the charging device is pulled out and inserted by a simulation user, BC1.2 detection or accp handshake detection is triggered again, namely, the first quick charging detection or the second quick charging detection of the embodiment can reduce the false identification probability, so that the mobile terminal correctly enters into quick charging after the charger is inserted, the charging speed of the mobile terminal is improved, and the charging experience of the user is further improved.
In other embodiments, the first fast charge detection is used to determine that the fast charge protocol handshake detection between the mobile terminal and the charging device is successful.
In this embodiment, if the handshake detection of the fast charging protocol between the mobile terminal and the charging device fails, that is, the first fast charging detection fails, the mobile terminal may turn off the VBUS power supply circuit of the mobile terminal, and trigger the first power supply reconnection after the VBUS power supply circuit is turned off. Wherein the first supply reconnects to the reconnect VBUS supply circuit. After the mobile terminal completes the first power supply reconnection, the mobile terminal may perform the first fast charge detection again on the charging device (i.e., it is determined that the fast charge protocol handshake detection between the mobile terminal and the charging device is successful). If the first quick charge detection is successful, the mobile terminal can perform quick charge condition detection on the charging equipment, and after the quick charge condition detection is passed, the charging equipment quickly charges the mobile terminal.
If the handshake detection of the mobile terminal and the quick charging protocol of the charging device is successful, that is, the first quick charging detection is successful, the mobile terminal can directly perform quick charging condition detection on the charging device, and after the quick charging condition detection is passed, the charging device quickly charges the mobile terminal.
From this, after mobile terminal inserts battery charging outfit, if the accp that appears battery charging outfit detects the failure of shaking hands, lead to the condition that the type of charging misidentification charges for BUCK, can pull out again male operation through the simulation user to battery charging outfit, trigger the accp again and detect of shaking hands, can reduce the misidentification probability for mobile terminal correctly gets into quick charge after inserting the charger, has improved mobile terminal's the speed of charging.
In the embodiment of the application, when the mobile terminal is rapidly charged through the charging equipment, a charging icon corresponding to rapid charging, generally a double-lightning icon, is displayed on a display interface of the mobile terminal; after the mobile terminal is inserted into the charging device, if the charging port of the charging device is erroneously detected as an SDP port (non-DCP port) or accp handshake detection fails, resulting in a situation that the charging type is erroneously identified as BUCK charging, the display interface of the mobile terminal displays a charging icon corresponding to BUCK charging, generally a single lightning icon. As shown in fig. 6, fig. 6 is a schematic diagram of a charging icon provided in the present embodiment, wherein in a status bar of a mobile phone, a battery level icon 600 is displayed when the mobile phone is not charged, a single lightning icon 601 is displayed when the mobile phone is buck charged, and a dual lightning icon 602 is displayed when the mobile phone is fast charged.
Therefore, how to correctly display the charging icon corresponding to the quick charging on the mobile terminal is a problem to be solved. According to the embodiment of the application, the charging icon can be correctly displayed on the display interface by the mobile terminal according to whether the zone bit is set or not by setting the zone bit, and the charging icon is correctly displayed without manual operation of plugging and unplugging the charger by a user.
Specifically, when the current charging type is detected to be BUCK charging, whether a preset flag bit is set on the mobile terminal is judged, if the preset flag bit of the mobile terminal is not set, the preset flag bit is set on the mobile terminal, and a VBUS port of the mobile terminal is pulled up to turn off the VBUS power supply circuit. The preset flag bit may be true, and is set and stored in the mobile terminal. It is understood that the preset flag bit may also have other values, and the present application is not limited thereto. At this time, the mobile terminal displays a first charging icon corresponding to BUCK charging, such as a single lightning bolt icon. Then, after the VBUS port of the mobile terminal is pulled up to turn off the VBUS power supply circuit, the mobile terminal judges whether a preset zone bit is set, if the preset zone bit is set, the mobile terminal continues to display a first charging icon, and the first charging icon is used for indicating that the mobile terminal is performing BUCK charging. At this time, although the VBUS power supply circuit is turned off, since the VBUS power supply circuit is immediately reconnected, the turn-off time is short, and the change of the charging icon may not be performed, so that the charging icon may be continuously displayed during the charging process. Before the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power supply reconnection, it needs to be determined that a preset flag bit is set.
After the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power supply reconnection, if a preset flag bit is set, the mobile terminal does not send out an audio charging prompt. The audio charging reminder may be charging prompt music, for example, after the charger is successfully inserted, the mobile terminal may send the charging prompt music to prompt the user to start charging, generally; the audio charging alert may also be an audio dynamic event, for example, after the charger is successfully inserted, the charging alert music is sent out by the mobile terminal, and the charging effectiveness is displayed on the display interface of the mobile terminal. It can be understood that when a charging device is detected to be successfully inserted, an audio charging reminder is generally triggered; after the first power supply reconnection is triggered, when the preset flag bit is determined to be set, the audio charging reminding is not required to be sent. That is to say, although the simulation user pulls out and inserts battery charging outfit again in this application, can not give out the audio frequency with actually inserting battery charging outfit the same and charge and remind, can not be like this in the charging process suddenly make sound, the whole in-process that detects again is that the user is noninductive, can promote user's the experience of charging.
After the quick charging condition detection is passed, if the preset flag bit is set, the charging icon is changed into a second charging icon, and the second charging icon indicates that the mobile terminal is performing quick charging. At this moment, the mobile terminal cannot send out the audio charging reminder.
In the embodiment of the application, whether the mobile terminal enters the fast charging mode through the fast charging re-triggering detection can be determined according to the retry times in the charging process by recording the retry times. If the mobile terminal is determined to enter the fast charging mode through the fast charging detection again, instead of successfully entering the fast charging mode through the fast charging detection after the charging equipment is detected to be inserted for the first time, the mobile terminal acquires the information of the charging equipment and reports the information of the charging equipment to the server. The information of the charging equipment comprises equipment information and retry times of the charging equipment; the device information of the charging device includes a manufacturer, a model, and the like of the charger. The server can be a big data platform, and the big data platform can record and analyze reported data and provide input and reference for subsequent charger manufacturer type selection.
Specifically, after the mobile terminal sets the preset flag bit, before the VBUS port of the mobile terminal is pulled up to turn off the VBUS power supply circuit, the mobile terminal is plugged and unplugged for a number of times +1. It is understood that the plugging number indicates the retry number, and does not indicate the actual plugging operation of the charging device, and is used as a plugging variable. And pulling down the VBUS port of the mobile terminal at the mobile terminal to trigger the reconnection of the first power supply or the second power supply, wherein the mobile terminal has the plugging times of +1. Therefore, after the charging device triggers the quick charging detection again, if the subsequent steps are successful at one time, the number of times of plugging and unplugging the mobile terminal is 2. It can be understood that, if there is a situation that the operation is not in place in the subsequent steps, the value of the mobile terminal may also be greater than 2; for example, the flag bit is set in the previous step, and when the flag bit cannot be detected in the subsequent flag bit judgment, the step of setting the flag bit needs to be returned again, and then the plugging and unplugging times need to be +1 again. That is to say, the mobile terminal may determine that the mobile terminal enters fast charging by performing fast charging detection again by determining the value of the number of times of plugging and unplugging, that is, after the charging device charges the mobile terminal fast, if the mobile terminal determines that the number of times of plugging and unplugging is greater than or equal to 2, it is determined that the mobile terminal enters fast charging by performing fast charging detection again. That is, after the charging device quickly charges the mobile terminal, if the mobile terminal determines that the number of times of plugging and unplugging is greater than or equal to 2, the mobile terminal obtains the information of the charging device and reports the information of the charging device to the server. After the fast charging is started, whether the big data is reported or not is directly determined according to the retry number value, and the data reporting efficiency can be improved.
In the embodiment of the application, after the charging device is used for rapidly charging the mobile terminal, the preset flag bit needs to be reset, and the plugging times needs to be cleared to return to the initial charging state. Therefore, after the mobile terminal is inserted into the charging equipment next time, the preset mark and the plugging times can be reset, and subsequent flow errors cannot be caused.
In the embodiment of the application, in order to avoid that the charging equipment unsuccessfully enters the dead cycle (namely, the charging equipment still is of the BUCK charging type) repeatedly and repeatedly, so that the power consumption of the whole machine is influenced, the preset reset time is set, timing is started after the mobile terminal is inserted into the charging equipment, if the mobile terminal does not enter the fast charging process yet when the preset reset time is reached, the preset flag bit is reset, and the plugging and unplugging times are reset, so that the mobile terminal restarts fast charging detection. For example, a Timer (Timer) may be started after the charging device is plugged in, and when a preset time is reached, the flag bit is reset and the number of plugging and unplugging times is cleared, that is, the mobile terminal only allows an imperceptible retry within a certain time (e.g., 1 min). Where a maximum of N retries may be performed, N depending on the timing set by the charge control logic. Therefore, by setting the preset reset time, the situation that the charging equipment repeatedly retries and fails to enter the dead cycle can be avoided, and the overall power consumption is reduced.
Referring to fig. 7, fig. 7 is a flowchart illustrating another charging method according to an embodiment of the present disclosure. As shown in fig. 7, when the charging port of the mobile terminal detects that the charger is inserted, the mobile terminal performs BC1.2 port detection on the charger, and if the charger of the charging device is a DCP port, the mobile terminal continues to perform accp handshake detection with the charger to determine whether handshake detection between the mobile terminal and the charger is successful. If the handshake detection is successful, the mobile terminal reads the charger type register to determine whether the charger is of an SCP type, if not, the mobile terminal enters other non-fast charging, and if so, the mobile terminal continues to determine whether the charger meets a direct charging (fast charging) condition. If the charger does not meet the direct charging condition, the mobile terminal enters other non-fast charging modes, and if the charger meets the direct charging condition, the mobile terminal enters direct charging mode.
If the handshake detection between the mobile terminal and the charger fails, the mobile terminal determines the current charging mode and whether a flag bit is set. And if the current charging mode of the mobile terminal is the USB charging mode and the zone bit is not set, the mobile terminal equipment sets the zone bit and the plugging times are plus 1. At this time, the mobile terminal pulls up the GPIO port to disconnect the VBUS circuit, which is equivalent to pulling out the charger. At this time, the mobile terminal judges whether a flag bit is set, and if the flag bit is set, the mobile terminal does not update the charging icon and still maintains the charging icon displayed when the charger is inserted. Then, the mobile terminal pulls down the GPIO port to re-enable the VBUS circuit connection, which is equivalent to the insertion of a charger. At this time, the mobile terminal judges whether a flag bit is set, if the flag bit is set, the mobile terminal does not trigger the charging audio dynamic event, and the plugging times are +1. Then, whether the time of the timer is reached is judged, for example, 1min in the figure, if yes, the mobile terminal resets the flag bit, and clears the plugging times. When the direct charging is started, the mobile terminal judges whether the plugging and unplugging times are 2, if so, the mobile terminal reports information such as manufacturer, model and retry time of the charger to the big data platform.
From this, after mobile terminal inserts the charger, if the charging port misdetection of charger appears and shakes hands the detection failure for SDP port (non-DCP port) or accp, lead to the condition that the type of charging mistake discernment charges for BUCK, can carry out the noninductive self-identification operation of user, pull out the operation of inserting again to battery charging outfit through the simulation user promptly, it detects or the accp detection of shaking hands to trigger BC1.2 again, can reduce the misidentification probability, make mobile terminal correctly get into quick charge after inserting the charger, mobile terminal's the speed of charging has been improved, and then user's the experience of charging has been promoted.
Referring to fig. 8, fig. 8 is a timing chart of a software implementation of a charging method according to an embodiment of the present disclosure. As shown in fig. 8, when the charging port of the mobile terminal detects that the charging device is inserted, the charging control logic module of the kernel driver layer identifies the charging device, that is, BC1.2 detection and accp handshake detection are performed through direct _ charge _ check or icm _ dc _ state, and if BC1.2 detection is an SDP type (non-DCP type) or accp handshake detection fails, the kernel driver layer of the mobile terminal obtains charging related information and synchronizes the charging related information to the power _ supply battery node of the kernel driver layer; the charging correlation information comprises charging plug-pull state information, a current charging type and battery electric quantity information; the charging plug state information is used for indicating whether the mobile terminal and the charging equipment are plugged in place or not, and the current charging type is used for indicating whether the charging type of the mobile terminal is BUCK charging or not. The power _ supply battery node saves the charging relevant information to obtain first battery node information, and then the first battery node information is updated to each attribute node below the kernel layer/sys/class/power _ supply/battery.
The Battery service module of the frame layer of the mobile terminal acquires the first battery node information and generates a first battery state updating broadcast based on the first battery node information. Specifically, the power _ supported battery node generates a uevent event according to the charging correlation information and reports the event to the native layer; the native layer receives the event report of the kernel layer, processes the event report through the health, namely reads the node information of the kernel layer power _ supply, and transmits the processed data to the BatteryService of the Framework layer for processing through the BatteryMonitor, updateValue (); the Framework layer receives a BATTERY state updating event reported by an native layer Battery monitor, updates information data such as BATTERY capacity, plugging state and the like through a process value Locke () of a Battery service and the Battery Statsservice (namely, acquiring first BATTERY node information), and then sends an interest.ACTION _ BATTERY _ CHANGED broadcast (namely, a first BATTERY state updating broadcast) upwards by the Battery service.
A SystemUI module of an application layer of the mobile terminal receives the first battery state updating broadcast, updates contents in the broadcast according to the first battery state and acquires a current charging type; if the current charging type is BUCK charging, the SystemUI module issues a GPIO (general purpose input/output) pulling action instruction to the kernel driving layer; and the kernel driving layer receives the GPIO action pulling-up instruction and pulls up the VBUS port of the mobile terminal so as to switch off the VBUS power supply circuit.
After the VBUS power supply circuit is turned off, the kernel driving layer synchronizes first indication information to the power _ supply battery node; the first indication information comprises turn-off information, and the turn-off information is used for indicating that the VBUS power supply circuit is turned off; the power _ supply battery node updates the first battery node information to obtain second battery node information based on the first indication information; the Battery service module acquires information of a second battery node and generates a second battery state updating broadcast based on the information of the second battery node; the SystemUI module receives the second battery state updating broadcast, updates the content in the broadcast according to the second battery state and acquires the current charging type; if the current charging type is BUCK charging, the SystemUI module sends a low GPIO action instruction to the kernel driving layer; and the kernel driving layer receives the GPIO action pulling-down instruction, and pulls down the VBUS port of the mobile terminal so as to reconnect the VBUS power supply circuit. The system UI module issues a GPIO 153 raising/lowering action instruction (hardware pin name USB _ MOS _ CTL) to control the VBUS to be turned off/on.
Therefore, clear upper and lower layer data identification and interaction are set inside the mobile terminal, the 'unplugging and plugging' of the charger is triggered by switching off and reconnecting the VBUS power supply circuit through the kernel driving layer under the condition that a user is not sensitive, then the charging type identification processes of BC1.2\ ACCP and the like are carried out again, the false identification probability of the charging equipment is reduced, and the charging rate and the charging experience are improved.
In this embodiment of the present application, the charging correlation information further includes flag bit information, the first battery node information further includes flag bit information, and the first battery state update broadcast further includes flag bit information; the flag bit information is used for indicating whether the preset flag bit is set. When the current charging type is BUCK charging, before a system UI module issues a GPIO (general purpose input/output) pulling action instruction to a kernel driving layer, the kernel driving layer acquires flag bit information, and if the flag bit information indicates that a preset flag bit is not set, the kernel driving layer sets the preset flag bit. For example, the preset flag is set to true.
The first indication information further comprises flag bit updating information, and the flag bit updating information is used for indicating that a preset flag bit is set; the second battery node information further comprises flag bit update information; the second battery status update broadcast also includes flag bit update information. The application layer receives a second battery state updating broadcast, and the application layer displays a first charging icon if the preset flag bit is determined to be set based on the second battery state updating broadcast; the first charging icon is used for indicating that the mobile terminal is performing BUCK charging. For example, the first charging icon may be a single lightning icon.
After the quick charging condition is detected to be passed, the kernel driving layer acquires charging correlation updating information and synchronizes the charging correlation updating information to the power _ supply battery node; the charging correlation updating information comprises charging plug-pull state information, a current charging type and battery electric quantity information. And the power _ supply battery node saves the charging related updating information and updates the second battery node information to obtain third battery node information.
The Battery service module acquires the third battery node information and generates a third battery state updating broadcast based on the third battery node information; the application layer receives the third battery state updating broadcast and determines that a preset zone bit is set based on the third battery state updating broadcast; the application layer displays a second charging icon; the second charging icon is used for indicating that the mobile terminal is performing quick charging. For example, the second charge icon may be a dual lightning icon.
Therefore, whether the charging icon of the upper interface needs to be changed or not can be determined by judging whether the kernel driving layer is provided with the preset zone bit or not, and the quick charging icon can be correctly displayed when the mobile terminal enters the quick charging mode.
After the whole process of quick charging identification is met, the charging control logic module is responsible for controlling and adjusting the voltage and the current output by the charging equipment, and the steps comprise a series of actions such as boosting, stepping voltage regulation, current boosting and the like.
In the embodiment of the present application, as shown in fig. 8, when it is determined that the current charging type is the USB charging mode (BUCK charging) and the preset flag bit is not set, the kernel driver layer triggers a retry on the charger, and if the type identification of the charging device is correct, the mobile terminal enters direct charging (fast charging). At this time, the mobile terminal obtains information such as manufacturer information, model information, occurrence time and the like of the charging device and reports the information to the big data platform.
The embodiment of the application provides a clear upper and lower layer design \ identification \ interaction, on-off control and retry mechanism, so that when BC1.2 is mistakenly identified as BUCK charging, quick charging can be started through automatic trigger retry (charging type state monitoring, charging disconnection \ connection instruction issuing by the upper layer, charging retry and identification by the bottom layer, and large data reporting misrecognition and statistical analysis) under the condition of no sense of a user, the misrecognition rate of the charging equipment is reduced, and the charging rate and charging experience are improved.
The embodiment of the present application further provides a chip system, as shown in fig. 9, the chip system 90 includes at least one processor 901 and at least one interface circuit 902. The processor 901 and the interface circuit 902 may be interconnected by wires. For example, the interface circuit 902 may be used to receive signals from other devices (e.g., a memory of an electronic device). Also for example, the interface circuit 902 may be used to send signals to other devices, such as the processor 901. Illustratively, the interface circuit 902 may read instructions stored in the memory and send the instructions to the processor 901. The instructions, when executed by the processor 901, may cause the electronic device to perform the various steps in the embodiments described above. Of course, the chip system may further include other discrete devices, which is not specifically limited in this embodiment of the present application.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are run on the electronic device, the electronic device is enabled to execute each function or step executed by the mobile phone in the foregoing method embodiment.
The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute each function or step executed by the mobile phone in the above method embodiments.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. A method of charging, comprising:
when a charging port of a mobile terminal detects that a charging device is inserted, the mobile terminal performs first quick charging detection on the charging device; the first quick charge detection is used for determining that a charging port of the charging equipment is a DCP port, or the first quick charge detection is used for determining that a quick charge protocol handshake detection between the mobile terminal and the charging equipment is successful;
if the first quick charging detection fails, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and triggers first power supply reconnection after the VBUS power supply circuit is turned off; wherein the first supply reconnect is reconnecting the VBUS supply circuit;
after the mobile terminal completes the first power supply reconnection, the mobile terminal performs the first quick charging detection again on the charging equipment;
and if the first quick charging detection is successful, the mobile terminal detects the quick charging condition of the charging equipment, and the charging equipment quickly charges the mobile terminal after the quick charging condition is detected to pass.
2. The method of claim 1, wherein the first fast charge detection is used to determine that a charging port of the charging device is a DCP port, the method further comprising:
if the first quick charging detection is successful, the mobile terminal and the charging equipment perform second quick charging detection; the second quick charge detection is used for determining that the quick charge protocol handshake detection of the mobile terminal and the charging device is successful;
if the second quick charging detection fails, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and triggers second power supply reconnection after the VBUS power supply circuit is turned off; wherein the second supply reconnects to reconnect the VBUS supply circuit;
after the mobile terminal completes the second power supply reconnection, the second quick charging detection is carried out on the charging equipment again;
and if the second quick charging detection is carried out again successfully, the mobile terminal carries out quick charging condition detection on the charging equipment, and after the quick charging condition detection is passed, the charging equipment carries out quick charging on the mobile terminal.
3. The charging method according to claim 1 or 2, wherein the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, comprising:
the mobile terminal detects whether the current charging type of the mobile terminal is BUCK charging;
and if the current charging type is the BUCK charging, the mobile terminal pulls up a VBUS port of the mobile terminal to turn off the VBUS power supply circuit.
4. The charging method of claim 3, wherein triggering a first power supply reconnection after turning off the VBUS power supply circuit comprises:
and after the VBUS power supply circuit is turned off, the VBUS port of the mobile terminal is pulled down to trigger the first power supply reconnection.
5. The charging method according to claim 4, wherein the mobile terminal pulls up a VBUS port of the mobile terminal to turn off the VBUS power supply circuit, and the method comprises:
if the preset zone bit of the mobile terminal is not set, the mobile terminal sets the preset zone bit and pulls up a VBUS port of the mobile terminal to turn off the VBUS power supply circuit;
wherein after the pulling up the VBUS port of the mobile terminal to turn off the VBUS power supply circuit, the method further comprises:
if the preset flag bit is set, the mobile terminal displays a first charging icon; the first charging icon is used for indicating that the mobile terminal is carrying out BUCK charging;
wherein the pulling down the VBUS port of the mobile terminal to trigger the first power supply reconnection comprises:
if the preset flag bit is set, the mobile terminal pulls down a VBUS port of the mobile terminal to trigger the first power supply reconnection.
6. The charging method according to claim 5, wherein after the mobile terminal pulls down a VBUS port of the mobile terminal to trigger the first power supply reconnection, the method further comprises:
and if the preset flag bit is set, the mobile terminal does not send out audio charging prompt.
7. The charging method according to claim 5 or 6, wherein after the detection of the quick-charge condition is passed, the method further comprises:
if the preset flag bit is set, the mobile terminal displays a second charging icon; the second charging icon is used for indicating that the mobile terminal is performing quick charging.
8. The charging method according to any one of claims 5-7, wherein after the mobile terminal sets the preset flag bit, before the pulling up the VBUS port of the mobile terminal to turn off the VBUS power supply circuit, the method further comprises:
the mobile terminal is plugged and unplugged for times +1;
after the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power supply reconnection, the method further comprises:
the mobile terminal is the plugging times +1;
wherein after the mobile terminal is rapidly charged by the charging device, the method further comprises:
if the plugging times are larger than or equal to the preset retry times, the mobile terminal acquires the information of the charging equipment and reports the information of the charging equipment to a server; the information of the charging equipment comprises equipment information of the charging equipment and the plugging times.
9. The charging method according to claim 1 or 2, wherein the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, comprising:
the method comprises the steps that a kernel driving layer of the mobile terminal obtains charging relevant information, and the charging relevant information is synchronized to a power _ supply battery node of the kernel driving layer; the charging associated information comprises charging plug state information, a current charging type and battery electric quantity information; the charging plugging and unplugging state information is used for indicating whether the mobile terminal and the charging equipment are plugged in place or not, and the current charging type is used for indicating whether the charging type of the mobile terminal is BUCK charging or not;
the power _ supply battery node saves the charging associated information to obtain first battery node information;
the BatteryService module of the frame layer of the mobile terminal acquires the first battery node information and generates a first battery state updating broadcast based on the first battery node information;
a SystemUI module of an application layer of the mobile terminal receives the first battery state updating broadcast, and acquires the current charging type according to the content in the first battery state updating broadcast;
if the current charging type is the BUCK charging, the SystemUI module sends a GPIO (general purpose input/output) pulling action instruction to the kernel driving layer;
and the kernel driving layer receives the pull-up GPIO action instruction, and pulls up a VBUS port of the mobile terminal so as to turn off the VBUS power supply circuit.
10. The charging method of claim 9, wherein triggering a first power supply reconnection after turning off the VBUS power supply circuit comprises:
after the VBUS power supply circuit is turned off, the kernel driving layer synchronizes first indication information to the power _ supply battery node; wherein the first indication information comprises turn-off information, and the turn-off information is used for indicating that the VBUS power supply circuit is turned off;
the power _ supply battery node updates the first battery node information to obtain second battery node information based on the first indication information;
the BatteryService module acquires the information of the second battery node and generates a second battery state updating broadcast based on the information of the second battery node;
the SystemUI module receives the second battery state updating broadcast, and obtains the current charging type according to the content in the second battery state updating broadcast;
if the current charging type is the BUCK charging, the SystemUI module sends a low GPIO action pulling instruction to the kernel driving layer;
and the kernel driving layer receives the GPIO pulling-down action instruction, pulls down a VBUS port of the mobile terminal, and reconnects the VBUS power supply circuit.
11. The charging method of claim 10, wherein the charging-related information further comprises flag bit information, the first battery node information further comprises the flag bit information, and the first battery status update broadcast further comprises the flag bit information; the flag bit information is used for indicating whether a preset flag bit is set or not;
before the current charging type is the BUCK charging and the systemou module issues a command for raising a GPIO action to the kernel driver layer, the method further includes:
the kernel driving layer acquires the zone bit information, and if the zone bit information indicates that the preset zone bit is not set, the kernel driving layer sets the preset zone bit;
the first indication information further comprises flag bit update information, and the flag bit update information is used for indicating that the preset flag bit is set; the second battery node information further includes the flag bit update information; the second battery status update broadcast further comprises the flag bit update information;
the application layer receives the second battery state updating broadcast and determines that the preset zone bit is set based on the second battery state updating broadcast;
the application layer displays a first charging icon; the first charging icon is used for indicating that the mobile terminal is performing BUCK charging.
12. The charging method of claim 11, wherein after the fast charge condition detection passes, the method further comprises:
the kernel driving layer acquires charging correlation updating information and synchronizes the charging correlation updating information to the power _ supply battery node; the charging associated updating information comprises charging plug state information, a current charging type and battery electric quantity information;
the power _ supply battery node saves the charging correlation updating information and updates the second battery node information to obtain third battery node information;
the BatteryService module acquires the third battery node information and generates a third battery state updating broadcast based on the third battery node information;
the application layer receives the third battery state updating broadcast and determines that the preset flag bit is set based on the third battery state updating broadcast;
the application layer displays a second charging icon; the second charging icon is used for indicating that the mobile terminal is performing quick charging.
13. The charging method according to claim 1, wherein the step of, if the first fast charge detection is successful, the mobile terminal detecting a fast charge condition of the charging device includes:
if the first quick charging detection is successful, the mobile terminal determines whether the charging protocol type of the charging equipment is a preset type;
if the charging protocol type of the charging equipment is the preset type, the mobile terminal determines whether the charging equipment meets a preset quick charging condition;
if the charging equipment meets the preset quick charging condition, the mobile terminal determines that the charging equipment passes the detection of the quick charging condition;
the preset quick-charging condition comprises at least one of a preset voltage condition, a preset current condition and a preset impedance condition.
14. The charging method according to claim 8, further comprising, after the rapidly charging the mobile terminal by the charging device:
and resetting the preset zone bit by the kernel driving layer, and clearing the plugging times.
15. The charging method according to claim 14, further comprising:
when the charging port of the mobile terminal detects that the charging equipment is inserted, the kernel driving layer determines preset reset time;
and if the preset reset time is reached, resetting the preset zone bit by the kernel driving layer and clearing the plugging times.
16. A mobile terminal, characterized in that the mobile terminal comprises: a charging interface, a battery, a memory, and one or more processors; the charging interface, the battery, the memory and the processor are coupled; wherein the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the mobile terminal to perform the method of any of claims 1-15.
17. A computer-readable storage medium having stored therein instructions which, when run in a mobile terminal, cause the mobile terminal to perform the method of any one of claims 1 to 15.
18. A computer program product, which, when run on a computer, causes the computer to perform the method of any one of claims 1-15.
CN202211216452.4A 2022-09-30 2022-09-30 Charging method, mobile terminal and storage medium Active CN115622177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211216452.4A CN115622177B (en) 2022-09-30 2022-09-30 Charging method, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211216452.4A CN115622177B (en) 2022-09-30 2022-09-30 Charging method, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN115622177A true CN115622177A (en) 2023-01-17
CN115622177B CN115622177B (en) 2023-10-27

Family

ID=84861103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211216452.4A Active CN115622177B (en) 2022-09-30 2022-09-30 Charging method, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN115622177B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116914878A (en) * 2023-02-23 2023-10-20 荣耀终端有限公司 Electronic equipment and charging method
CN117013660A (en) * 2023-09-12 2023-11-07 荣耀终端有限公司 Charging icon display method and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035053A (en) * 2010-01-19 2011-04-27 王春生 Charging method of charging pile for supplying charging service to electromobile
CN103326432A (en) * 2013-06-20 2013-09-25 广东欧珀移动通信有限公司 Battery charging control method and system of electronic equipment
CN105846263A (en) * 2016-03-23 2016-08-10 广东欧珀移动通信有限公司 USB adapter cable, charging testing method and charging testing system of mobile terminal
CN107302251A (en) * 2017-08-11 2017-10-27 天津瑞发科半导体技术有限公司 A kind of intelligent movable power supplies and the method that usb data communication is carried out with it
CN107404133A (en) * 2016-05-20 2017-11-28 中兴通讯股份有限公司 Charging method, charger and terminal
CN108448177A (en) * 2018-03-14 2018-08-24 维沃移动通信有限公司 A kind of charging method and terminal
CN113824195A (en) * 2021-10-28 2021-12-21 北京小米移动软件有限公司 Charging control method and device, terminal and computer readable storage medium
WO2022109837A1 (en) * 2020-11-25 2022-06-02 华为技术有限公司 Electronic device, charging base and charging method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035053A (en) * 2010-01-19 2011-04-27 王春生 Charging method of charging pile for supplying charging service to electromobile
CN103326432A (en) * 2013-06-20 2013-09-25 广东欧珀移动通信有限公司 Battery charging control method and system of electronic equipment
CN105846263A (en) * 2016-03-23 2016-08-10 广东欧珀移动通信有限公司 USB adapter cable, charging testing method and charging testing system of mobile terminal
CN107404133A (en) * 2016-05-20 2017-11-28 中兴通讯股份有限公司 Charging method, charger and terminal
CN107302251A (en) * 2017-08-11 2017-10-27 天津瑞发科半导体技术有限公司 A kind of intelligent movable power supplies and the method that usb data communication is carried out with it
CN108448177A (en) * 2018-03-14 2018-08-24 维沃移动通信有限公司 A kind of charging method and terminal
WO2022109837A1 (en) * 2020-11-25 2022-06-02 华为技术有限公司 Electronic device, charging base and charging method
CN113824195A (en) * 2021-10-28 2021-12-21 北京小米移动软件有限公司 Charging control method and device, terminal and computer readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116914878A (en) * 2023-02-23 2023-10-20 荣耀终端有限公司 Electronic equipment and charging method
CN117013660A (en) * 2023-09-12 2023-11-07 荣耀终端有限公司 Charging icon display method and electronic equipment
CN117013660B (en) * 2023-09-12 2024-03-08 荣耀终端有限公司 Charging icon display method and electronic equipment

Also Published As

Publication number Publication date
CN115622177B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
WO2021052263A1 (en) Voice assistant display method and device
CN112399390B (en) Bluetooth connection method and related device
CN115622177B (en) Charging method, mobile terminal and storage medium
CN111405681B (en) Wi-Fi Aware link establishment method, wi-Fi Aware link establishment system, electronic equipment and storage medium
EP3089046B1 (en) Electronic device operating method and electronic device for supporting the same
WO2021185105A1 (en) Method for switching between sim card and esim card, and electronic device
WO2021042894A1 (en) Method for recovering sim card of electronic device from card drop, and electronic device
WO2020073288A1 (en) Method for triggering electronic device to execute function and electronic device
KR20150141039A (en) Wearable eletronic apparatus, system and controllin method thereof
WO2023284415A1 (en) Power key mistouch detection method and electronic device
CN114115770B (en) Display control method and related device
CN114579389A (en) Application management method, device, equipment and storage medium
EP4283826A1 (en) Charging circuit, charging control method and electronic device
CN115589051B (en) Charging method and terminal equipment
CN114996168A (en) Multi-device cooperative test method, test device and readable storage medium
US10237087B2 (en) Method for controlling transmission speed and electronic device thereof
CN114077519B (en) System service recovery method and device and electronic equipment
CN116231815B (en) Method for controlling charging and electronic equipment
CN116679900B (en) Audio service processing method, firmware loading method and related devices
CN113380240A (en) Voice interaction method and electronic equipment
EP4195042A1 (en) Display method and electronic device
CN114006969B (en) Window starting method and electronic equipment
CN113271577B (en) Media data playing system, method and related device
CN115513571B (en) Control method of battery temperature and terminal equipment
CN116684520B (en) Shutdown method, electronic equipment, storage medium and chip

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