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

Charging method, mobile terminal and storage medium Download PDF

Info

Publication number
CN115622177B
CN115622177B CN202211216452.4A CN202211216452A CN115622177B CN 115622177 B CN115622177 B CN 115622177B CN 202211216452 A CN202211216452 A CN 202211216452A CN 115622177 B CN115622177 B CN 115622177B
Authority
CN
China
Prior art keywords
charging
mobile terminal
information
vbus
power supply
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211216452.4A
Other languages
Chinese (zh)
Other versions
CN115622177A (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

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

Abstract

The application provides a charging method, a mobile terminal and a storage medium, and relates to the technical field of charging. 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, and the first quick charging detection is used for determining that a charging port of the charging equipment is a DCP port, or a quick charging protocol handshake detection between the mobile terminal and the charging equipment is successful; if the first quick charge 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 turning off the VBUS power supply circuit; and after reconnecting the VBUS power supply circuit, re-performing a first fast charge detection on the charging device; if the first quick charge detection is successful, the mobile terminal detects the quick charge condition of the charging equipment, and after the quick charge condition detection is passed, the charging equipment rapidly 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 rapidly charge electronic devices such as a mobile phone, the following problems may be encountered: the quick charge is mistakenly identified as Buck charge (normal usb charge), and the charging speed is very slow.
Aiming at the problems, the existing solution is that a user can normally identify the charger as fast charging with high probability under the condition that the charger is not damaged by re-plugging the charger, and then fast charging is carried out on the electronic equipment. However, the method needs to manually plug and pull the charger, so that the charging step is increased, and the charging experience of a user is affected.
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 problem that the charging speed is too slow when the mobile terminal is rapidly charged and is mistakenly identified as Buck charging (common usb charging), and can perform self-identification and secondary retry without sense of a user, thereby reducing the mistaken identification rate of the charging type, improving the charging speed of the mobile terminal and further improving the charging experience of the user.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical scheme:
in a first aspect, a charging method is provided, which can be applied to a mobile terminal. When the charging port of the mobile terminal detects that the charging equipment is inserted, the mobile terminal firstly carries out first quick charging detection on the charging equipment, and the first quick charging detection is used for determining that the charging port of the charging equipment is a DCP port or determining that the handshake detection of a quick charging protocol of the mobile terminal and the charging equipment is successful; if the first quick charge 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 (namely triggers reconnection of the first power supply) after the VBUS power supply circuit is turned off; after the mobile terminal completes the first power supply reconnection, carrying out first quick charge detection on the charging equipment again; if the first quick charge detection is successful, the mobile terminal detects the quick charge condition of the charging equipment, and after the quick charge condition detection is passed, the charging equipment rapidly charges the mobile terminal.
By adopting the technical scheme, when the first quick charge 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 when the handshake detection of the quick charge protocol of the mobile terminal and the charging equipment fails, the pulling-out and insertion of the charging equipment are simulated through internal triggering to switch off and reconnect the VBUS power supply circuit, the user is not required to manually operate, the false recognition rate of the charging type is reduced, and the charging speed of the mobile terminal is improved.
The first fast charge detection is used for determining that a charging port of the charging device is a DCP port. Or the first fast charge detection is used for determining that the fast charge protocol handshake detection of the mobile terminal and the charging device is successful.
In one possible implementation, the first fast charge detection is used to determine that the charging port of the charging device is a DCP port. The first aspect describes how the mobile terminal simulates the process of unplugging and plugging the charging device for fast charging in case the first fast charge detection fails (i.e. the charging port of the charging device is not a DCP port). In the case that the first fast charge detection is successful (i.e. the charging port of the charging device is a DCP port), the mobile terminal may not necessarily perform fast charging. Specifically, after determining that the charging port of the charging device is a DCP port, the mobile terminal needs to determine whether the handshake detection of the fast charging protocol of the mobile terminal and the charging device is successful. If the handshake detection of the quick charge protocol of the mobile terminal and the charging equipment is successful, the mobile terminal can perform the subsequent quick charge detection step. Of course, if the handshake detection of the mobile terminal and the quick charge protocol of the charging device fails, the mobile terminal cannot perform quick charge. In this case, the mobile terminal may simulate the unplug and plug operation of the charging device for quick charging.
Specifically, in this implementation manner, 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 the DCP port, the mobile terminal and the charging equipment perform second quick charge detection, and the handshake detection of the quick charge protocol of the mobile terminal and the charging equipment is determined to be successful; if the second quick charge 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 turning off the VBUS power supply circuit as a second power supply reconnection; after the mobile terminal completes the second power supply reconnection, carrying out second quick charge detection on the charging equipment again; if the second quick charge detection is successful, the mobile terminal detects the quick charge condition of the charging equipment, and after the quick charge condition detection is passed, the charging equipment rapidly charges the mobile terminal. It will be appreciated that the first fast charge detection needs to be performed again before the second fast charge detection is performed again on the charging device, and the charging port of the charging device is determined to be the DCP port. If the first fast charge detection is failed again, that is, the charging port of the charging device is a non-DCP port, the step of restarting the second fast charge detection cannot be performed; at this time, the first quick charge detection needs to be performed again.
In one possible implementation manner, the switching off the VBUS power supply circuit of the mobile terminal may include: the mobile terminal detects whether the current charging type of the mobile terminal is BUCK charging or not; if the current charging type is BUCK charging, the mobile terminal pulls up the VBUS port of the mobile terminal to turn off the VBUS power supply circuit. In the implementation manner, 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, namely, the charging equipment is pulled out in a simulated manner, and a user does not need manual operation.
In one possible implementation, triggering the first power reconnection after turning off the VBUS power supply circuit includes: 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, namely reconnection of the VBUS power supply circuit. Triggering a second power reconnection after turning off the VBUS power supply circuit, comprising: and 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 reconnection of the VBUS power supply circuit. After the VBUS power supply circuit of the mobile terminal is turned off by pulling up the VBUS port of the mobile terminal, namely, the charging equipment is pulled up in a simulation 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 plugged in a simulation mode, a user does not need manual operation, and the charging step is reduced.
In one possible implementation, the mobile terminal pulls up the VBUS port of the mobile terminal to turn off the VBUS supply circuit, comprising: judging whether the mobile terminal is provided with a preset flag bit, if the preset flag bit of the mobile terminal is not set, setting the preset flag 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 a preset flag bit is set, the mobile terminal displays a first charging icon for indicating that the mobile terminal is performing 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 reconnection. Through setting up the zone bit of predetermineeing, confirm whether mobile terminal needs change the icon that charges, can make the icon that charges continuously show in the charging process, 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 reconnection, the method further includes: if the preset flag bit is set, the mobile terminal does not send out an audio charging prompt. The charging device can not make a sound suddenly in the charging process, so that the whole re-detection process is user-friendly, and the charging experience of the user can be improved.
In one possible implementation, after the fast charge condition detection passes, the method further includes: 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 flag 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 is correctly displayed.
In one possible implementation, 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 in the number of plugging times of +1; after the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power reconnection, the method further comprises: the mobile terminal is in the number of plugging times of +1; wherein, after the mobile terminal is rapidly charged by the charging device, the method further comprises: if the number of plugging times is greater than or equal to the preset retry number, the mobile terminal acquires 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 of the charging equipment and the plugging times. The method can more accurately determine whether the mobile terminal enters the quick charge by re-triggering the quick charge detection according to the retry times (the plug times) in the charging process, and can directly determine whether to report the big data according to the retry times after entering the quick charge, thereby improving the data reporting efficiency.
In one possible implementation manner, the above mobile terminal turns off a VBUS power supply circuit of the mobile terminal, including: the method comprises the steps that a kernel driving layer of a mobile terminal obtains charging plug state information, current charging type and battery electric quantity information, and the charging plug state information, the current charging type and the battery electric quantity information are used as charging association information to be synchronized into a power_supply battery node of the kernel driving layer; the charging plug state information is used for indicating whether the mobile terminal and the charging equipment are plugged in place, 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 related information to obtain first battery node information; the method comprises the steps that a BatteryService module of a frame layer of a mobile terminal obtains first battery node information, and generates a first battery state update broadcast based on the first battery node information; the method comprises the steps that a SystemUI module of an application layer of the mobile terminal receives a first battery state update broadcast, and obtains a current charging type according to content in the first battery state update broadcast; if the current charging type is BUCK charging, the SystemUI module issues a high GPIO action instruction to the kernel driving layer; and the kernel driving layer receives the GPIO pulling action instruction, and pulls up the VBUS port of the mobile terminal to turn off the VBUS power supply circuit.
In one possible implementation, triggering the first power 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 based on the first indication information to obtain second battery node information; the BatteryService module obtains information of a second battery node, and generates a second battery state update broadcast based on the information of the second battery node; the SystemUI module receives the second battery state updating broadcast, and acquires the current charging type according to the content in the second battery state updating broadcast; if the current charging type is BUCK charging, the SystemUI module issues a low GPIO action instruction to the kernel driving layer; the kernel driving layer receives the action instruction of pulling down the GPIO and pulls down the VBUS port of the mobile terminal so as to reconnect the VBUS power supply circuit. Explicit identification and interaction of upper and lower layers are arranged in the mobile terminal, under the condition that a user does not feel, a VBUS power supply circuit is turned off and reconnected through a kernel driving layer to trigger're-plugging' of a charger, and then the identification process of charging types such as BC1.2\ACCP and the like is carried out again, so that the false identification probability of charging equipment is reduced, and the charging rate and the charging experience are improved.
In one possible implementation, the charging association information further includes flag bit information, the first battery node information further includes flag bit information, and the first battery status 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 and before the system UI module issues a high GPIO action instruction to the kernel driving layer, the method further comprises the following steps: the kernel driving layer acquires the zone bit information, determines whether a preset zone bit is set according to 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 update information, wherein the flag bit update information is used for indicating that a preset flag bit is set; the second battery node information also comprises flag bit update information; the second battery status update broadcast further includes flag bit update information; the application layer receives a second battery state update broadcast, and determines that a preset flag bit is set based on the second battery state update 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 a preset zone bit or not, so that the charging icon is continuously displayed in the charging process, and the charging experience is improved.
In one possible implementation, after the fast charge condition detection passes, the method further includes: the kernel driving layer acquires charging association updating information and synchronizes the charging association updating information to the power_supply battery node; the charging association update information comprises charging plug state information, current charging type and battery power information; the power_supply battery node stores charging association updating information, and updates the second battery node information to obtain third battery node information; the BatteryService module obtains third battery node information and generates third battery state update broadcast based on the third battery node information; the application layer receives a third battery state updating broadcast, and determines that a 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 being rapidly charged. The quick charging icon can be correctly displayed when the mobile terminal enters quick charging by judging that the kernel driving layer is provided with a preset flag bit.
In one 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 charge 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 of the charging equipment is an SCP type; if the charging protocol type of the charging equipment is a preset type, namely 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; if the charging equipment meets the preset quick charging condition, the mobile terminal determines that the charging equipment passes through the quick charging condition detection.
If the second rapid charging detection is successful, the rapid charging condition detection is performed as described above, and the specific process of rapid charging condition detection is the same as above, and will not be described herein.
In one possible implementation, after the mobile terminal is rapidly charged by the charging device, the method further includes: the kernel driving layer resets the preset zone bit and clears the plugging times. After the mobile terminal is plugged into the charging equipment next time, the preset mark and the plugging times can be reset, so that subsequent flow errors are avoided.
In one possible implementation, the method may further include: when a 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 flag bit by the kernel driving layer, and resetting the plug times. The timer can be started after the charging equipment is inserted, and the charging equipment can be prevented from repeatedly retrying and unsuccessfully entering the dead cycle by setting the preset reset time, so that the integral power consumption is prevented from being influenced.
In a second aspect, the present application provides a mobile terminal comprising: 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 first aspects above.
In a third aspect, the present application provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the charging method of any one of the first aspects above.
In a fourth aspect, the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the charging method of any of the first aspects above.
It will be appreciated 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 perform the corresponding methods provided above, and therefore, the advantages achieved by the method are referred to the advantages in the corresponding methods provided above, and are not repeated herein.
Drawings
Fig. 1 is a schematic diagram of a charging device and a mobile terminal according to an embodiment of the present application;
fig. 2 is a flowchart of a charger identification according to an embodiment of the present application;
fig. 3 is a schematic diagram of a hardware structure of a mobile phone according to an embodiment of the present application;
fig. 4 is a schematic software structure of a mobile phone according to an embodiment of the present application;
Fig. 5 is a flowchart of a charging method according to an embodiment of the present application;
fig. 6 is a schematic display diagram of a charging icon according to an embodiment of the present application;
fig. 7 is a flowchart of another implementation of a charging method according to an embodiment of the present application;
FIG. 8 is a timing diagram of a software implementation of a charging method according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a chip system according to an embodiment of the present application.
Detailed Description
The following description of the technical solutions according to the embodiments of the present application will be given with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but 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 defining "a first", "a second", etc. may explicitly or implicitly include one or more such 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 personal computer, a notebook computer and other devices.
For example, take the mobile terminal as the mobile phone 100 shown in fig. 1; the charging device in the embodiment of the application refers to a standard charger 200 of a mobile phone, and the standard charger 200 can rapidly charge the mobile phone 100. Detecting a charging device insertion at the charging port 110 of the mobile terminal specifically refers to detecting a standard charger 200 insertion at the charging port 110 of the mobile phone 100. It should be noted that, currently, the charging port of most electronic devices (such as a mobile phone, a tablet computer or other electronic products) is a Type-C interface. The Type-C interface is a USB interface, also known as the 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 detects the charging port 110, that is, the USB port, first BC 1.2. The main purpose of BC1.2 detection is to determine the type of the USB port, specifically, by detecting information such as voltage and current acquired from the USB port by the mobile phone, and determining the type of the port of the USB port according to the acquired voltage and current information.
Among them, BC1.2 (Battery Charging v 1.2) is a protocol established by the BC (Battery Charging) group under USB-IF, mainly for standardizing battery charging requirements, which was originally implemented based on the USB2.0 protocol. The USB2.0 protocol specifies that the peripheral draws a maximum of 500ma of current from the USB charger, and the current limit of 500ma cannot meet the ever-increasing fast-charge demand. Therefore, BC1.2 introduces a charging port identification mechanism, mainly comprising several USB port types: dedicated charging interface (Dedicated Charging Port, DCP): the DCP does not support a data protocol, supports quick charging, can provide large current, and is mainly used for special chargers such as wall charging and the like; standard downstream interface (Standard Downstream Port, SDP): the SDP port supports the USB protocol, and the maximum current is 500mA, so that the SDP can be considered as a common USB interface; charging downstream interface (Charging Downstream Port, CDP): CDP supports both data protocols and fast charging.
Referring to fig. 2, fig. 2 is a flowchart of a charger identification according to an embodiment of the present application. As shown in fig. 2, after the charger is inserted, 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 of the DCP type, the charger handshake detection, mainly accp handshake detection, is continued to determine whether the charger supports a specific charging protocol. The handshake detection specifically refers to: and the mobile phone carries out a quick charge protocol handshake with the charger according to a preset quick charge protocol handshake sequence. If the accp handshake detection is successful, continuing the following charging protocol type detection, wherein the charging protocol type detection specifically comprises: and the mobile phone judges whether the charger is of SCP type or not by reading the charger type register. If the type is not SCP type, the charger carries out other non-quick charging for the mobile phone, if the type is SCP type, a super quick charging icon is displayed on a mobile phone interface, and detection of quick charging conditions and the like is continued. If the charger is detected to meet the quick charging condition, the quick charging (also called direct charging) can be performed, and the output voltage, current and the like of the charger are regulated; if the charger is detected not to meet the quick charging condition, the charger performs other non-quick charging for the mobile phone.
In the above charger identification process, two types of problems may occur: firstly, when the BC1.2 port detection is carried out on the USB port, if the USB port is determined to be of an SDP type according to the BC1.2 detection result, the subsequent detection action can not be carried out any more, and only Buck charging (common USB charging, charging capacity is 5V500 mA) can be carried out, so that the mobile phone has very low charging power and very slow charging speed. Secondly, when the USB port is identified as the DCP type and accp handshake detection is performed on the charger, if accp handshake fails, a subsequent detection action cannot be entered, quick charging cannot be entered, and finally only 5V2A charging or Buck charging (according to whether the charger supports pd protocol and capability negotiation) is performed, the charging capability is not higher than 5V2A, and the charging speed is very slow.
In summary, after the mobile phone is plugged into the standard charger, the mobile phone can not successfully enter into the quick charging, and the situation that the BC1.2 detection result is SDP type (not DCP type) or the BC1.2 detection result is DCP type, but accp handshake detection fails, so that the mobile phone finally performs buck charging is very probable. Therefore, how to correctly enter into fast charging after the mobile phone is plugged into a standard charger is a problem to be solved.
In some existing solutions, the above problem can be solved in the following way: the user can re-plug the charger and re-trigger the identification processes such as BC1.2 detection/accp handshake detection, and the like, so that the USB port can be correctly identified as the DCP type with high probability and accp handshake detection is successful under the condition that the charger is not damaged, and then the quick charging is performed. However, by adopting the method, the charger needs to be manually plugged and unplugged, so that the charging step is increased, and the charging experience of a user is affected.
The embodiment of the application provides a charging method, a mobile terminal and a storage medium, which can perform self-identification and retry operation without sense of user when a charger is mistakenly identified as buck charging without manual plugging operation, so that a mobile phone can correctly enter quick charging after a standard charger is inserted.
In the charging method provided by the embodiment of the application, when the charging port of the mobile terminal detects that the charger is inserted, the mobile terminal carries out quick charging detection on the charger, determines whether the charging port of the charger is a DCP port or whether handshake detection of a quick charging protocol of the mobile terminal and the charger is successful, and if the charging port of the charger is not the DCP port or the handshake detection of the quick charging protocol of the mobile terminal and the charger is unsuccessful, the mobile terminal turns off a VBUS power supply circuit and reconnects the VBUS power supply circuit after turning off the VBUS power supply circuit. Then, the mobile terminal carries out quick charge detection on the charger again, and after the quick charge detection carried out again is successful and the quick charge condition detection is passed, the charger can move the terminal to carry out quick charge. In the charging method, after the mobile terminal is inserted into the charger and the quick charge detection fails, the mobile terminal is turned off and reconnected with the VBUS power supply circuit to simulate the pulling-out and reinsertion operation of the charger by a user, the quick charge detection is carried out again, and the user-friendly retry operation and self-identification are carried out so as to enable the charger to correctly enter the quick charge. The VBUS pin on the charging port is a power supply pin, and the disconnection of the VBUS power supply circuit, namely the power supply of the power supply, is equivalent to the removal of the charger, and the reconnection of the VBUS power supply circuit, namely the reconnection of the power supply, is equivalent to the reinsertion of the charger.
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 (Ultra-mobile Personal Computer, UMPC), a handheld computer, a wearable electronic device (for example, a smart watch, a smart bracelet, and a 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 above.
The following describes in detail the implementation of the embodiment of the present application with reference to the drawings. Taking the mobile terminal as a mobile phone as an example, the hardware structure of the mobile terminal (such as the mobile phone 300) is described. The hardware structure of the mobile terminal may refer to the detailed description of the mobile terminal 300 in the embodiment of the present application, which is not described herein. 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: processor 310, external memory interface 320, internal memory 321, usb interface 330, charge management module 340, power management module 341, battery 342, antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, audio module 370, speaker 370A, receiver 370B, microphone, headset interface, sensor module 380, keys 390, motor 391, indicator 392, camera 393, display screen 394, and subscriber identification module (subscriber identification module, SIM) card interface 395, and the like.
The sensor module 380 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, acceleration sensors, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, and the like.
It should be understood that the structure illustrated in this embodiment is not limited to the specific configuration of the mobile phone 300. In other embodiments, the handset 300 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 310 may include one or more processing units, such as: the processor 310 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals 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 the processor 310 has just used or recycled. If the processor 310 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided and the latency of the processor 310 is reduced, thereby improving the efficiency of the system.
In some embodiments, processor 310 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and is not limited to the structure of the mobile phone 300. In other embodiments, the mobile phone 300 may also use different interfacing manners, or a combination of multiple interfacing manners in the above embodiments.
The charge management module 340 is configured to receive a charge input from a charger. The charger is a wired charger in the embodiment of the present application, 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 described above). The battery 342 is charged by the charge management module 340, and the electronic device may be powered by the power management module 341.
The power management module 341 is configured to connect the battery 342, the charge management module 340 and the processor 310. The power management module 341 receives input from the battery 342 and/or the charge management module 340 to power the processor 310, the internal memory 321, the external memory, the display screen 394, the camera 393, the wireless communication module 360, and the like. The power management module 341 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance), and other parameters. 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 also be disposed in the same device.
The wireless communication function of the mobile phone 300 may be implemented by the antenna 1, the antenna 2, the mobile communication module 350, the wireless communication module 360, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in handset 300 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into 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 for wireless communication including 2G/3G/4G/5G, etc. applied to the handset 300. The mobile communication module 350 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 350 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation.
The wireless communication module 360 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied to the handset 300.
The wireless communication module 360 may be one or more devices that integrate at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the 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 it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, the antenna 1 of the handset 300 is coupled to the mobile communication module 350 and the antenna 2 is coupled to the wireless communication module 360 so that the electronic device 300 can communicate with the network and other devices through wireless communication technology. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The handset 300 implements display functions through the GPU, the display screen 394, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 310 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 394 is used for displaying images, videos, and the like. The display 394 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (flex), a mini, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like.
The mobile phone 100 may implement photographing functions through an ISP, a camera 393, a video codec, a GPU, a display 394, an application processor, and the like. The ISP is used to process the data fed back by camera 393. Camera 393 is used to capture still images or video. In some embodiments, the handset 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 other digital signals besides digital image signals. For example, when the handset 300 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, etc. Video codecs are used to compress or decompress digital video. The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 320 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capabilities of the handset 300. The external memory card communicates with the processor 310 through an external memory interface 320 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 321 may be used to store computer executable program code comprising instructions. The processor 310 executes various functional applications of the handset 300 and data processing by executing instructions stored in the internal memory 321. For example, in an embodiment of the present application, the processor 310 may be configured to execute instructions stored in the internal memory 321, and the internal memory 321 may include a storage program area and a storage data area.
The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 300 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 321 may include a high-speed random access memory, and may also include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The handset 300 may implement audio functions through an audio module 370, speaker 370A, receiver 370B, microphone, headphone interface, and application processor, among others. 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 of the functional modules of the audio module 370 may be disposed in the processor 310. Speaker 370A, also known as a "horn," is used to convert audio electrical signals into sound signals. A receiver 370B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. Microphones, also known as "microphones" and "microphones", are used to convert sound signals into electrical signals.
The earphone interface is used for connecting a wired earphone. The earphone interface may be a USB interface 330 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The keys 390 include a power on key, a volume key, etc. Key 390 may be a mechanical key. Or may be a touch key. The motor 391 may generate a vibration alert. The motor 391 may be used for incoming call vibration alerting as well as for touch vibration feedback. The indicator 392 may be an indicator light, which may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc. The SIM card interface 395 is for interfacing with a SIM card. The SIM card may be inserted into the SIM card interface 395 or removed from the SIM card interface 395 to enable contact and separation with the handset 300. The handset 300 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 395 may support Nano SIM cards, micro SIM cards, and the like.
The methods in the following embodiments may be implemented in the mobile phone 300 having the above-described 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. In the embodiment of the application, taking an Android system with a layered architecture as an example, a software structure of the mobile phone 300 is illustrated.
Fig. 4 is a software architecture block diagram of a mobile phone 300 according to an embodiment of the present application. The layered architecture may divide the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an Application layer (Application layer), an Application Framework layer (Framework layer), a native layer (native), and a Kernel driver layer (Kernel). For example, as shown in fig. 4, the 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 of a System (System) UI and general applications. Common applications may be cameras, gallery, calendar, conversation, map, navigation, WLAN, bluetooth, music, video, short message, and desktop applications (Launcher). Applications of the System UI may include a navigation bar and a status bar of the mobile phone 300, and the like. The mobile phone status bar comprises a mobile phone charging icon and is used for indicating the charging status of the mobile phone; percentage of battery power; low electricity alerts, etc. The System UI is mainly used for monitoring System broadcast and making corresponding update to the UI, such as update display of charging icon, update display of battery power, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs 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 (BatteryService), and a battery statistics service (BatteryStatsService). 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 acquire 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, phonebooks, etc. The view system described above may be used to build a display interface for an application. Each display interface may be composed of one or more controls. In general, controls may include interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets (widgets), and the like. The resource manager provides various resources, such as localization strings, icons, pictures, layout files, video files, and the like, to the application program. The notification manager enables the application to display notification information in a status bar, can be used for conveying notification type messages, and can automatically disappear after a short stay without user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, 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, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
The BatteryService provides an interface for acquiring battery information, charging state and the like, for example, acquiring charging plug state information, current charging type and battery power information, wherein the charging plug state information indicates whether a mobile phone and a charger are plugged in place or not, and the current charging type indicates the charging type of the mobile phone. The main function of the BatteryService is to monitor the battery information change message and forward the message to everywhere in the Android system in the form of system broadcast. BatteryStatsService is mainly used for electricity statistics.
The native layer includes a healed process that primarily listens to battery events from the kernel driver layer and passes battery data up to the BatteryService of the framework layer.
The kernel driving layer comprises a battery related driver and a charge and discharge management related driver, is responsible for interacting with hardware, registering a Power supply attribute, and generating a uevent event to report to the Native layer. Specifically, when the hardware state changes, the kernel driving layer triggers related interrupts, calls corresponding interrupt functions, and updates and modifies corresponding Power supply node values. The kernel driving layer also comprises a charging control logic module, which is used for inserting a charger, performing logic flows such as quick charging detection and the like through the charging control logic module, and updating the obtained relevant state information and values into each attribute node of the kernel layer; and the logic flows such as fast charge detection are carried out again when the related instruction (pull high/pull low VBUS port instruction) returned by the application program layer is received.
In the embodiment of the application, the working principle of the method for realizing the embodiment of the application by each software layer in the mobile phone is introduced by taking the mobile phone as an example and combining with the figure 4. After the mobile phone detects that the mobile terminal is inserted into the charger, logic flows such as charge plug state detection, BC1.2 detection, accp handshake detection, charge type detection and the like are carried out through direct_charge_check or icm_dc_state of the charge control logic module, and then relevant state information and values obtained through detection are updated into a Power supply battery node of the kernel layer, and a uevent event is generated and reported to the active layer. The native layer receives the report of the uevent event of the kernel layer, and processes the report through a healthd process, namely reads the information of the Power supply battery node of the kernel layer, and then uploads the information of the battery node to the BatteryService of the frame layer for processing. And the BatteryService receives the information of the battery node update reported by the active layer, and generates a battery state update broadcast based on the information of the battery node update. The system UI of the application layer acquires the charging plug state information, the current charging type, the battery power information and the like by monitoring the battery state update broadcast sent by the BatteryService, and is used for events such as icon display update of an upper interface and the like. The system UI also sends a high/low GPIO action instruction to the kernel driving layer according to the current charging type in the battery state updating broadcast, after receiving the instruction sent by the system UI, the charging control logic module of the kernel driving layer pulls up/down the VBUS port, and then the processes of BC1.2 detection, accp handshake detection and the like are carried out again, and fast charging is carried out after the BC1.2 detection\accp handshake detection and identification is normal, so that the misidentification of the charging type is reduced, the charging experience is improved, and the secondary retry which is not perceived by a user is realized.
Referring to fig. 5, fig. 5 is a flowchart illustrating implementation of a charging method according to an embodiment of the present application. As shown in fig. 5, the charging method may include S501-S507.
S501, when a 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 to determine that a charging port of the charging device is a DCP port.
In the embodiment of the application, if the first fast charge detection is successful, the charging port of the charging device is a DCP port, and if the first fast charge detection is failed, the charging port of the charging device is not the DCP port. And determining whether the charging port of the charging device is a DCP port or not, namely performing BC1.2 detection on the charging 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 execute S504. If the charging port of the charging device is not the DCP port, i.e. 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 a first power supply reconnection after turning off the VBUS power supply circuit. Wherein the first supply is reconnected to the reconnected 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, i.e., the first quick charge detection fails, it means that the mobile terminal cannot be quickly charged, but the BUCK charging can be performed. Therefore, in the embodiment of the present application, before executing S502, the mobile terminal may first detect whether the current charging type of the mobile terminal is BUCK charging. The mobile terminal may perform S502 if the current charge type of the mobile terminal is BUCK charging.
If the first quick charge detection fails, the mobile terminal turns off the VBUS power supply circuit and triggers reconnection of the VBUS power supply circuit after turning off the VBUS power supply circuit, wherein turning off the VBUS power supply circuit indicates that the analog user pulls out the charging equipment, and reconnecting the VBUS power supply circuit indicates that the analog user reinserts the charging equipment. The embodiment of the application can reconnect the reconnection VBUS power supply circuit as the first power supply.
Specifically, the mobile terminal may turn off the VBUS power supply circuit by pulling up the VBUS port of the mobile terminal. Accordingly, after the VBUS power supply circuit is turned off, the mobile terminal may trigger the first power supply reconnection (i.e. reconnection to the VBUS power supply circuit) by pulling down the VBUS port of the mobile terminal. The VBUS port is pulled up to be the level of the VBUS port, and the VBUS port of the mobile terminal is pulled down to be the level of the VBUS port.
Wherein, the one-time disconnection-reconnection of the VBUS power supply circuit is equivalent to the one-time charger plugging and unplugging of a user. From the description of the above embodiments, it is apparent that: the user can re-trigger the identification processes such as BC1.2 detection/accp handshake detection and the like by re-plugging the charger. Under the condition that the charger is not damaged, the USB port can be correctly identified as the DCP type with high probability, accp handshake detection is successful, and then quick charging is performed. In the embodiment of the present application, the mobile terminal may simulate the user to plug the charger in a manner that the user does not feel 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). In this way, the mobile terminal can be enabled to re-recognize the charging port as a 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 process of unplugging and plugging the charging device for fast charging in case the first fast charge detection fails (i.e. the charging port of the charging device is not a DCP port). In the case that the first fast charge detection is successful (i.e. the charging port of the charging device is a DCP port), the mobile terminal may not necessarily perform fast charging. Specifically, after determining that the charging port of the charging device is a DCP port, the mobile terminal needs to determine whether the handshake detection of the fast charging protocol of the mobile terminal and the charging device is successful. If the handshake detection of the mobile terminal and the quick charge protocol of the charging equipment is successful, the mobile terminal can perform quick charge. Of course, if the handshake detection of the mobile terminal and the quick charge protocol of the charging device fails, the mobile terminal cannot perform quick charge. In this case, the mobile terminal may simulate the unplug and plug operation of the charging device for quick charging.
S503, after the mobile terminal completes the first power supply reconnection, the mobile terminal carries out first quick charge detection on the charging equipment again. The first fast charge detection is used to determine 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 reconnection of the VBUS power supply circuit, the mobile terminal performs first fast charging detection again on the charging equipment, namely the mobile terminal performs BC1.2 detection again, and the type of a charging port of the charging equipment is determined.
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, i.e. the first fast charging detection fails, the mobile terminal may continue to execute S502.
In some embodiments, the mobile terminal may record the number of times the first fast charge detection fails, and after the nth fast charge detection fails, the mobile terminal may send a prompt message to the user. The prompt message is used for indicating the rapid charging failure, and can also indicate the user to manually plug the charging interface so as to try to perform rapid charging. n is more than or equal to 2, and n is an integer.
S504, the mobile terminal and the charging equipment perform second quick charge detection. The second fast charging detection is used for determining that the handshake detection of the fast charging protocol of the mobile terminal and the charging equipment is successful.
Specifically, if the charging port of the charging device is determined to be the DCP port through the first quick charging detection, the accp handshake detection is continuously performed on the charging device, that is, the mobile terminal and the charging device perform the 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 handshake detection of the mobile terminal and the charging equipment is successful, namely, the second quick charge detection is successful, the quick charge protocol handshake detection of the mobile terminal and the charging equipment is successful, and the second quick charge detection failure is failure, and the quick charge protocol handshake detection of the mobile terminal and the charging equipment is failure.
After S504, if the handshake detection of the fast charge protocol between the mobile terminal and the charging device fails, i.e. the second fast charge detection fails, the mobile terminal executes S505. If the handshake detection of the quick charge protocol of the mobile terminal and the charging device is successful, that is, the second quick charge detection is successful, the mobile terminal executes S507.
S505, the mobile terminal turns off the VBUS power supply circuit of the mobile terminal, and triggers the second power supply reconnection after turning off the VBUS power supply circuit. Wherein the second supply is reconnected to reconnect the VBUS supply circuit.
In the embodiment of the application, if the second fast charge detection fails, the mobile terminal turns off the VBUS power supply circuit and triggers reconnection of the VBUS power supply circuit after turning off the VBUS power supply circuit. The embodiment of the application can reconnect the VBUS power supply circuit as the second power supply after the VBUS power supply circuit is disconnected after the second fast charge detection failure. Specifically, when the second fast charging detection fails, the mobile terminal turns off the VBUS power supply circuit through pulling up the VBUS port, and then, the VBUS port of the mobile terminal is pulled down, that is, the level of the VBUS port is pulled down, so as to trigger the second power supply reconnection.
It should be noted that, the second power reconnection in S505 and the first power reconnection in S502 are both to reconnect the VBUS power supply circuit after the VBUS power supply circuit of the mobile terminal is turned off. The first power supply reconnection and the second power supply reconnection in the embodiment of the application are only used for distinguishing different reconnection VBUS power supply circuits.
S506, after the mobile terminal completes the second power supply reconnection, the mobile terminal carries out second quick charge detection on the charging equipment again. The second fast charging detection is used for determining that the handshake detection of the fast charging protocol of the mobile terminal and the charging equipment is successful.
In the embodiment of the application, after the mobile terminal is reconnected with the VBUS power supply circuit and the second power supply reconnection is completed, the second quick charge detection is performed on the charging equipment again, that is, the mobile terminal performs accp handshake detection again, and whether the charging equipment supports a charging protocol is determined. It can be understood that the mobile terminal also needs to perform the first fast charge detection again, i.e. 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 device is the DCP port, the first fast charging detection performed again is successful, and then the second fast charging detection is performed again, so as to determine whether the charging device supports the charging protocol. If the first fast charging detection performed again fails, the mobile terminal needs to perform the first fast charging detection again, and the mobile terminal cannot directly enter the second fast charging detection.
After S506, if the handshake detection of the fast charge protocol between the mobile terminal and the charging device is successful, that is, the second fast charge detection is successful, the mobile terminal executes S507. If the handshake detection of the quick charge protocol between the mobile terminal and the charging device fails, that is, the second quick charge detection fails, the mobile terminal executes S505.
S507, the mobile terminal detects the quick charge condition of the charging equipment, and after the quick charge condition is detected, the charging equipment rapidly charges the mobile terminal.
In the embodiment of the application, after the second quick charge detection is successful, the detection of the quick charge condition of the charging equipment needs to be continued, and the mobile terminal can successfully enter the quick charge only after the quick charge condition detection is also passed.
Specifically, after the second quick charge 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 the preset quick charge condition. The preset type is a super quick charge (SuperCharge, SCP) type, namely the mobile terminal determines whether the charging protocol type of the charging equipment is an SCP type, and if the charging equipment is the SCP type, the mobile terminal continuously determines whether the charging equipment meets the preset quick charge condition; if the SCP type is not adopted, the mobile terminal enters other non-fast charging modes. The mobile terminal determines the charging protocol type of the charging equipment by reading the charging equipment type register. The preset quick charge 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 can carry out quick charging on the mobile terminal through quick charging condition detection. Generally, the charging device needs to meet the preset voltage condition, the preset current condition and the preset impedance condition at the same time, and then the mobile terminal can determine that the charging device can perform quick charging on the mobile terminal through quick charging condition detection.
Therefore, after the mobile terminal is inserted into the charging device, if the charging port of the charging device is erroneously detected as a non-DCP port or the charging port of the charging device is a DCP port but accp handshake detection fails, so that the situation that the charging type is erroneously identified as BUCK charging can be performed, self-identification operation without sense of a user can be performed, namely, the operation that the user pulls out and inserts the charging device is simulated, BC1.2 detection or accp handshake detection is retriggered, namely, the first quick charging detection or the second quick charging detection in the embodiment can reduce the error identification probability, the mobile terminal correctly enters 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 of 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, i.e. 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 turning off the VBUS power supply circuit. Wherein the first supply is reconnected to the reconnected VBUS supply circuit. After the mobile terminal completes the first power reconnection, the first quick charge detection (namely, the handshake detection of the quick charge protocol of the mobile terminal and the charging equipment is determined to be successful) can be performed on the charging equipment again. If the first quick charge detection is successful, the mobile terminal can detect the quick charge condition of the charging equipment, and after the quick charge condition is detected, the charging equipment can charge the mobile terminal quickly.
If the handshake detection of the quick charge protocol of the mobile terminal and the charging equipment is successful, that is, the first quick charge detection is successful, the mobile terminal can directly perform quick charge condition detection on the charging equipment, and after the quick charge condition detection is passed, the charging equipment rapidly charges the mobile terminal.
Therefore, after the mobile terminal is inserted into the charging equipment, if accp handshake detection of the charging equipment fails, the charging type is wrongly identified as BUCK charging, the accp handshake detection can be triggered again by simulating the operation of pulling out and inserting the charging equipment by a user, the probability of misidentification can be reduced, the mobile terminal can correctly enter quick charging after being inserted into a charger, and the charging speed of the mobile terminal is improved.
In the embodiment of the application, when the mobile terminal is charged rapidly through the charging equipment, a charging icon corresponding to the 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, and the charging type is erroneously identified as a charging for a BUCK, a charging icon corresponding to the charging for the BUCK is displayed on a display interface of the mobile terminal, which is generally a single lightning icon. As shown in fig. 6, fig. 6 is a schematic display diagram of a charging icon according to an embodiment of the present application, in which, in a status bar of a mobile phone, a battery power icon 600 is displayed when not charged, a corresponding single lightning icon 601 is displayed when a buck charging, and a corresponding double lightning icon 602 is displayed when a quick charging.
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 mobile terminal can correctly display the charging icon on the display interface according to whether the flag bit is set or not by setting the flag bit, and the charging icon is not required to be correctly displayed by manually carrying out the plugging operation of the charger by a user.
Specifically, when the current charging type is BUCK charging, judging whether the mobile terminal is provided with a preset flag bit, if the preset flag bit of the mobile terminal is not set, setting the preset flag bit by the mobile terminal, and pulling up a VBUS port of the mobile terminal to turn off a VBUS power supply circuit. The preset flag bit may be true, and the preset flag bit is set and stored in the mobile terminal. It is to be understood that the preset flag bit may be other values, which is not limited herein. At this time, the mobile terminal displays a first charging icon corresponding to the charging of the BUCK, for example, displays a lightning single icon. Then, after pulling up the VBUS port of the mobile terminal to turn off the VBUS power supply circuit, the mobile terminal judges whether a preset flag bit is set, and if the preset flag bit is set, the mobile terminal continues to display a first charging icon at the moment, wherein 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 by the mobile terminal, since the VBUS power supply circuit is immediately reconnected, the turn-off time is short, and the charging icon may not be changed, so that the charging icon may be continuously displayed in the charging process. Before the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power reconnection, it needs to be determined that the 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 the preset flag bit is set, the mobile terminal does not send out an audio charging reminder. The audio charging prompt may be charging prompt music, for example, after the charger is inserted successfully, the mobile terminal may send out the charging prompt music to prompt the user to start charging, which is generally; the audio charging prompt may also refer to an audio dynamic effect event, for example, after the charger is successfully inserted, the charging prompt music is sent out by the mobile terminal, and meanwhile, the charging dynamic effect is displayed on the display interface of the mobile terminal. It will be appreciated that when successful insertion of the charging device is detected, an audio charging alert is typically triggered; after the first power reconnection is triggered, when the preset flag bit is determined to be set, the audio charging prompt is not required to be sent. That is, although the application simulates that the user pulls out and inserts the charging equipment, the application does not send out audio charging prompt as the charging equipment is actually inserted, thus the application does not suddenly send out sound in the charging process, the whole re-detection process is that the user does not feel any feel, and the charging experience of the user can be improved.
After the quick charging conditions are detected, 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 being quickly charged. At this time, the mobile terminal also does not issue an audio charging alert.
In the embodiment of the application, whether the mobile terminal enters the quick charge through re-triggering the quick charge detection can be determined according to the retry times by recording the retry times in the charging process. If it is determined that the mobile terminal enters the quick charge through the quick charge detection again, but not when the mobile terminal enters the quick charge through the quick charge detection after the insertion of the charging equipment is detected for the first time, the mobile terminal acquires 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 of the charging equipment and retry times; the device information of the charging device includes the manufacturer, model, etc. of the charger. The server can be a large data platform, and the large data platform can record and analyze the reported data to provide input and reference for the follow-up charger manufacturer model 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 in and pulled out for the number of times +1. It should be understood that the number of plugging indicates the number of retries, and does not indicate the actual plugging operation to the charging device, and is used as a plugging variable. After the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power supply reconnection or the second power supply reconnection, the mobile terminal is the number of plugging times +1. Therefore, after the charging device re-triggers the quick charging detection, if the subsequent steps are all successful once, the number of plugging times of the mobile terminal is 2. It can be appreciated that if there is a situation that the operation is not in place in the subsequent steps, the value of the mobile terminal may be greater than 2; for example, the previous step sets the flag bit, and when the flag bit is not detected in the subsequent step of judging the flag bit, the step of setting the flag bit needs to be returned again, and then the number of plugging times at the moment needs to be +1. That is, the mobile terminal may determine that the mobile terminal enters the quick charge by re-performing the quick charge detection by determining the value of the number of plugging times, that is, after the mobile terminal is quickly charged by the charging device, if the number of plugging times is greater than or equal to 2, the mobile terminal is determined to enter the quick charge by re-performing the quick charge detection. That is, after the charging device rapidly charges the mobile terminal, if the mobile terminal determines that the number of plugging times is greater than or equal to 2, the mobile terminal obtains information of the charging device and reports the information of the charging device to the server. After the quick charge is carried out, whether large data reporting is carried out is directly determined according to the retry number value, so that the data reporting efficiency can be improved.
In the embodiment of the application, after the mobile terminal is rapidly charged by the charging equipment, the preset flag bit is required to be reset, and the plugging times are cleared to return to the initial state of charging. In this way, after the mobile terminal is plugged into the charging device next time, the preset mark and the plugging times can be reset, so that subsequent flow errors can not be caused.
In the embodiment of the application, in order to prevent the charging equipment from repeatedly retrying and unsuccessfully entering a dead cycle (namely still being of a BUCK charging type) so as to influence the power consumption of the whole mobile terminal, a preset reset time is set, after the mobile terminal is inserted into the charging equipment, timing is started, if the mobile terminal does not enter quick charging yet after the mobile terminal reaches the preset reset time, a preset flag bit is reset, and the plugging times are cleared so as to restart quick charging detection of the mobile terminal. For example, a Timer (Timer) may be started after the charging device is plugged in, and when the preset time is reached, the flag bit is reset, and the number of plugging times is cleared, that is, the mobile terminal only allows for a non-sensing retry (for example, 1 min) within a certain time. Wherein at most N retries may be performed, N depending on the timing set by the charge control logic. Therefore, by setting the preset reset time, the charging equipment can be prevented from repeatedly retrying and unsuccessfully entering the dead cycle, and the overall power consumption is reduced.
Referring to fig. 7, fig. 7 is a flowchart illustrating another implementation of a charging method according to an embodiment of the present application. 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 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, determines whether the charger is of an SCP type, if not, the mobile terminal enters other non-quick charging, and if so, the mobile terminal continues to determine whether the charger meets the direct charging (quick charging) condition. If the charger does not meet the direct charging condition, the mobile terminal enters other non-quick charging, and if the charger meets the direct charging condition, the mobile terminal enters the direct charging.
If handshake detection between the mobile terminal and the charger fails, the mobile terminal determines a current charging mode and whether a flag bit is set. If the current charging mode of the mobile terminal is the USB charging mode and the flag bit is not set, the mobile terminal equipment sets the flag bit and the plugging frequency is +1. At this time, the mobile terminal pulls up the GPIO port to cut off the VBUS circuit connection, which is equivalent to the charger pulling out. At this time, the mobile terminal judges whether a flag bit is set, 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, re-enables the VBUS circuit connection, equivalent to charger insertion. At this time, the mobile terminal judges whether to set the flag bit, if the flag bit is set, the mobile terminal does not trigger the charging audio active event, and the number of plugging times is +1. Then, judging whether the time of the timer is up to 1min in the figure, if so, resetting the flag bit by the mobile terminal, and resetting the plugging times. When the direct charging is carried out, the mobile terminal judges whether the plugging times are 2, if yes, the mobile terminal reports information such as charger manufacturer, model, retry time and the like to the big data platform.
Therefore, after the mobile terminal is inserted into the charger, if the charging port of the charger is erroneously detected as an SDP port (non-DCP port) or accp handshake detection fails, the charging type is erroneously identified as BUCK charging, self-identification operation without sense of a user can be performed, namely, the BC1.2 detection or accp handshake detection is triggered again by simulating the operation of pulling out and inserting the charging equipment by the user, the error identification probability can be reduced, 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.
Referring to fig. 8, fig. 8 is a timing diagram of a software implementation of a charging method according to an embodiment of the application. As shown in fig. 8, when the charging port of the mobile terminal detects that the charging device is plugged in, the charging control logic module of the kernel driving layer identifies the charging device, that is, BC1.2 detection and accp handshake detection are performed through direct_charge_check or icm_dc_state, if BC1.2 detection is SDP type (non-DCP type) or accp handshake detection fails, the kernel driving layer of the mobile terminal acquires charging related information, and synchronizes the charging related information to the power_supply battery node of the kernel driving layer; the charging related information comprises charging plug state information, current charging type and battery power information; the charging plug state information is used for indicating whether the mobile terminal and the charging equipment are plugged in place, and the current charging type is used for indicating whether the charging type of the mobile terminal is BUCK charging. The power_supply battery node stores charging association 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 BatteryService module of the frame layer of the mobile terminal obtains the first battery node information, and generates a first battery status update broadcast based on the first battery node information. Specifically, the power_supply battery node generates a uevent event according to the charging association information, and reports the uevent event to the active layer; the native layer receives the report of the uevent event of the kernel layer, and processes the report through the healthd, namely, reads the information of each node of the power_supply of the kernel layer, and transmits the processed data to the BatteryService of the frame layer for processing through the BatteryMonitor; the frame layer receives a BATTERY state update event reported by an update value () from the active layer, updates information data such as BATTERY power and plug state (i.e., acquires first BATTERY node information) through a processValuesLocked () of the Battery service and the BatteryStatservice, and then the BatteryService sends an interval_Battery_change broadcast (i.e., a first BATTERY state update broadcast) upward.
The method comprises the steps that a SystemUI module of an application layer of the mobile terminal receives a first battery state update broadcast, and obtains a current charging type according to content in the first battery state update broadcast; if the current charging type is BUCK charging, the SystemUI module issues a pull-up GPIO action instruction to the kernel driving layer; and the kernel driving layer receives the GPIO pulling action instruction, and pulls up the VBUS port of the mobile terminal to turn 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 based on the first indication information to obtain second battery node information; the BatteryService module obtains information of a second battery node, and generates a second battery state update broadcast based on the information of the second battery node; the SystemUI module receives the second battery state updating broadcast, and acquires the current charging type according to the content in the second battery state updating broadcast; if the current charging type is BUCK charging, the SystemUI module issues a low GPIO action instruction to the kernel driving layer; the kernel driving layer receives the action instruction of pulling down the GPIO 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 pull-up/pull-down GPIO 153 action instruction (hardware pin name usb_mos_ctl) to control VBUS to be turned off/on.
Therefore, explicit identification and interaction of upper and lower layers are arranged in the mobile terminal, under the condition that a user does not feel, a VBUS power supply circuit is turned off and reconnected through a kernel driving layer to trigger're-plugging' of a charger, and then the identification process of charging types such as BC1.2\ACCP and the like is carried out again, so that the false identification probability of charging equipment is reduced, and the charging rate and the charging experience are improved.
In the embodiment of the application, the charging related information further comprises flag bit information, the first battery node information further comprises flag bit information, and the first battery state update broadcast further comprises flag bit information; the flag bit information is used for indicating whether a preset flag bit is set. And before the system UI module issues a high GPIO action instruction to the kernel driving layer, 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. For example, a preset flag bit is set to true.
The first indication information further comprises flag bit update information, wherein the flag bit update information is used for indicating that a preset flag bit is set; the second battery node information also comprises flag bit update information; the second battery status update broadcast also includes flag update information. The application layer receives a second battery state updating broadcast, and if the preset flag bit is determined to be 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. For example, the first charging icon may be a single lightning icon.
After the fast charge condition detection is passed, the kernel driving layer acquires charge related update information and synchronizes the charge related update information to the power_supply battery node; the charging association update information comprises charging plug state information, current charging type and battery power information. And the power_supply battery node stores charging association updating information, and updates the second battery node information to obtain third battery node information.
The BatteryService module obtains third battery node information and generates third battery state update broadcast based on the third battery node information; the application layer receives the third battery state updating broadcast, and determines that a 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 being rapidly charged. For example, the second charging icon may be a double lightning icon.
Therefore, whether the charging icon of the upper interface needs to be changed 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 quick charging.
When the whole quick charge identification process is met, the charging control logic module is responsible for controlling and adjusting the voltage and current output by the charging equipment, and the series of actions including boosting, stepping voltage regulation, current lifting and the like are performed.
In the embodiment of the present application, as shown in fig. 8, when determining that the current charging type is a USB charging mode (BUCK charging) and a preset flag bit is not set, the kernel driving layer triggers retry of the charger, and if the charging device type is identified correctly, the mobile terminal enters direct charging (fast charging). At this time, the mobile terminal acquires information such as manufacturer information, model information, occurrence time and the like of the charging equipment, and reports the information to the big data platform.
The embodiment of the application provides a clear upper and lower layer design\recognition\interaction, switch control and retry mechanism, ensures that when BC1.2 is mistakenly recognized as BUCK charging, the charging equipment can enter quick charging through automatic triggering retry (charging type state monitoring, upper layer issuing charging disconnection\connection instruction, bottom layer charging retry and recognition, big data reporting mistaken recognition and statistic analysis) under the condition of no sense of a user, so as to reduce the mistaken recognition rate of the charging equipment and improve the charging rate and charging experience.
The embodiment of the present application also 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 apparatus). For another example, interface circuitry 902 may be used to send signals to other devices (e.g., processor 901). The interface circuit 902 may, for example, read instructions stored in a 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 of the embodiments described above. Of course, the system-on-chip may also include other discrete devices, which are not particularly limited in accordance with embodiments of the present application.
The embodiment of the application also provides a computer storage medium, which comprises computer instructions, when the computer instructions run on the electronic equipment, the electronic equipment is caused to execute the functions or steps executed by the mobile phone in the embodiment of the method.
The embodiment of the application also provides a computer program product which, when run on a computer, causes the computer to execute the functions or steps executed by the mobile phone in the above method embodiment.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of specific embodiments 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 application 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 (17)

1. A charging method, 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 fast charge detection is used for determining that a charging port of the charging equipment is a DCP port, or the first fast charge detection is used for determining that the handshake detection of the mobile terminal and the fast charge protocol of the charging equipment is successful;
if the first quick charge detection fails, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and triggers a first power supply reconnection after turning off the VBUS power supply circuit; wherein the first power supply reconnection reconnects to the VBUS power supply circuit;
after the mobile terminal completes the first power supply reconnection, carrying out the first quick charge detection on the charging equipment again;
If the first quick charge detection is successful, the mobile terminal detects the quick charge condition of the charging equipment, and after the quick charge condition detection is passed, the charging equipment rapidly charges the mobile terminal;
under the condition that the first quick charge detection is used for determining that a charging port of the charging equipment is a DCP port, if the first quick charge detection is successful, the mobile terminal and the charging equipment perform second quick charge detection; the second fast charging detection is used for determining that the handshake detection of the fast charging protocol of the mobile terminal and the charging equipment is successful; if the second quick charge detection fails, the mobile terminal turns off a VBUS power supply circuit of the mobile terminal, and triggers a second power supply reconnection after turning off the VBUS power supply circuit; wherein the second power supply is reconnected to the VBUS power supply circuit; after the mobile terminal completes the second power supply reconnection, carrying out the second quick charge detection on the charging equipment again; and if the second quick charge detection is successful, the mobile terminal detects the quick charge condition of the charging equipment, and after the quick charge condition detection is passed, the charging equipment rapidly charges the mobile terminal.
2. The charging method of claim 1, wherein the mobile terminal turns off a VBUS supply circuit of the mobile terminal, comprising:
the mobile terminal detects whether the current charging type of the mobile terminal is BUCK charging or not;
and if the current charging type is BUCK charging, the mobile terminal pulls up a VBUS port of the mobile terminal so as to turn off the VBUS power supply circuit.
3. The charging method of claim 2, wherein triggering the first power reconnection after switching 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.
4. The charging method of claim 3, wherein the mobile terminal pulling the VBUS port of the mobile terminal high to turn off the VBUS supply circuitry comprises:
if the preset flag bit of the mobile terminal is not set, the mobile terminal sets the preset flag bit and pulls up the 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 performing BUCK charging;
wherein the pulling down the VBUS port of the mobile terminal to trigger the first power reconnection includes:
and if the preset flag bit is set, the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power reconnection.
5. The charging method of claim 4, wherein after the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power reconnection, the method further comprises:
if the preset flag bit is set, the mobile terminal does not send out an audio charging prompt.
6. The charging method according to claim 4 or 5, characterized in that after the fast charge condition detection 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 being rapidly charged.
7. The charging method according to any one of claims 4-6, 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 in the number of plugging times of +1;
after the mobile terminal pulls down the VBUS port of the mobile terminal to trigger the first power reconnection, the method further includes:
the mobile terminal is the plugging frequency +1;
wherein after the mobile terminal is rapidly charged by the charging device, the method further comprises:
if the number of plugging times is greater than or equal to the preset retry number, 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.
8. The charging method of claim 1, wherein the mobile terminal turns off a VBUS supply circuit of the mobile terminal, comprising:
the method comprises the steps that a kernel driving layer of the mobile terminal obtains charging related information and synchronizes the charging related information to a power_supply battery node of the kernel driving layer; the charging related information comprises charging plug state information, current charging type and battery power information; the charging plug state information is used for indicating whether the mobile terminal and the charging equipment are plugged in place, and the current charging type is used for indicating whether the charging type of the mobile terminal is BUCK charging;
The power_supply battery node stores the charging related information to obtain first battery node information;
the BatteryService module of the frame layer of the said mobile terminal obtains the said first battery node information, and produce the first battery state and update the broadcast based on the said first battery node information;
the system UI module of the 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 BUCK charging, the SystemUI module sends a pulling high GPIO action instruction to the kernel driving layer;
and the kernel driving layer receives the pulling-up GPIO action instruction and pulls up the VBUS port of the mobile terminal so as to turn off the VBUS power supply circuit.
9. The charging method of claim 8, wherein triggering the first power reconnection after shutting down 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; the first indication information comprises turn-off information, wherein 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 based on the first indication information to obtain second battery node information;
the BatteryService module obtains the information of the second battery node and generates a second battery state update broadcast based on the information of the second battery node;
the SystemUI module receives the second battery state update broadcast and acquires the current charging type according to the content in the second battery state update broadcast;
if the current charging type is BUCK charging, the SystemUI module issues a low GPIO action instruction to the kernel driving layer;
and the kernel driving layer receives the GPIO pulling-down action instruction, pulls down the VBUS port of the mobile terminal, and reconnects the VBUS power supply circuit.
10. The charging method of claim 9, 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 zone bit information is used for indicating whether a preset zone bit is set or not;
and before the system UI module issues a high GPIO action instruction to the kernel driving layer, the method further comprises the following steps:
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, wherein the flag bit update information is used for indicating that the preset flag bit is set; the second battery node information further comprises the flag bit update information; the second battery state update broadcast further includes the flag bit update information;
the application layer receives the second battery state updating broadcast, and determines that the preset flag 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.
11. The charging method according to claim 10, characterized in that after the fast charge condition detection is passed, the method further comprises:
the kernel driving layer acquires charging association updating information and synchronizes the charging association updating information to the power_supply battery node; the charging association updating information comprises charging plug state information, current charging type and battery power information;
The power_supply battery node stores the charging association updating information, and updates the second battery node information to obtain third battery node information;
the BatteryService module obtains the third battery node information and generates a third battery status update 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 being rapidly charged.
12. The charging method according to claim 1, wherein 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 charge detection performed again 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 through the quick charging condition detection;
the preset quick charge condition comprises at least one of a preset voltage condition, a preset current condition and a preset impedance condition.
13. The charging method according to claim 7, further comprising, after the mobile terminal is rapidly charged by the charging device:
and resetting the preset flag bit by the kernel driving layer, and resetting the plugging times.
14. The charging method according to claim 13, characterized in that the method further comprises:
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 flag bit by the kernel driving layer, and resetting the plug times.
15. A mobile terminal, the mobile terminal comprising: a charging interface, a battery, a memory, and one or more processors; the charging interface, the battery, 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 method of any of claims 1-14.
16. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein instructions, which when run in a mobile terminal, cause the mobile terminal to perform the method of any of claims 1 to 14.
17. A computer program product, characterized in that the computer program product, when run on a computer, causes the computer to perform the method according to any of claims 1-14.
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 CN115622177A (en) 2023-01-17
CN115622177B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115864609B (en) * 2023-02-23 2023-06-30 荣耀终端有限公司 Electronic equipment and charging method
CN117013660B (en) * 2023-09-12 2024-03-08 荣耀终端有限公司 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

Also Published As

Publication number Publication date
CN115622177A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
CN115622177B (en) Charging method, mobile terminal and storage medium
EP2955907B1 (en) Wearable electronic device, system and control method
EP3089046B1 (en) Electronic device operating method and electronic device for supporting the same
WO2023284415A1 (en) Power key mistouch detection method and electronic device
WO2020073288A1 (en) Method for triggering electronic device to execute function and electronic device
WO2021042894A1 (en) Method for recovering sim card of electronic device from card drop, and electronic device
US20180329675A1 (en) Electronic device and method for controlling audio output according to the type of earphone
EP3855715B1 (en) Display control method and related product
US9876884B2 (en) Electronic device and method of wireless signal transmission and reception therefor
CN114579389A (en) Application management method, device, equipment and storage medium
US10237087B2 (en) Method for controlling transmission speed and electronic device thereof
CN114996168A (en) Multi-device cooperative test method, test device and readable storage medium
CN111433756B (en) Terminal and Type C interface anti-corrosion method
CN116231815B (en) Method for controlling charging and electronic equipment
WO2023197709A1 (en) Device identification method and related apparatus
KR20210101553A (en) Electronic device and method for recognizing audio output device connected to usb type-c connector using the same
CN114489825B (en) Electronic equipment and shutdown method thereof
CN111061410A (en) Screen freezing processing method and terminal
CN114077519B (en) System service recovery method and device and electronic equipment
CN115800557A (en) Wireless charging method, electronic device, storage medium, and program
CN116679900B (en) Audio service processing method, firmware loading method and related devices
EP4195042A1 (en) Display method and electronic device
CN116684520B (en) Shutdown method, electronic equipment, storage medium and chip
CN111638897B (en) System updating method, device, terminal equipment and storage medium
CN116662130A (en) Method for counting application use time length, electronic equipment and readable storage medium

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