Charging control method, electronic device, storage medium and computer program product

By acquiring and selecting the charging protocol with the maximum charging power, electronic devices solve the problems of low charging efficiency and pin conflicts during the charging process, achieving efficient and stable charging operation.

CN121965868APending Publication Date: 2026-05-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-10-25
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

When electronic devices are charging, they cannot use the maximum charging power, resulting in low charging efficiency, which affects the user experience, and may also cause charging abnormalities due to charging protocol pin conflicts.

Method used

After the electronic device is connected to the charger, it acquires and determines the maximum charging power of multiple charging protocols, selects the target charging protocol for charging based on the power and type, and optimizes the charging process through a handshake operation to avoid pin occupation conflicts.

Benefits of technology

It improves charging efficiency, ensures that electronic devices can be charged using the maximum charging power, reduces charging time, avoids pin conflicts, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121965868A_ABST
    Figure CN121965868A_ABST
Patent Text Reader

Abstract

The invention discloses a charging control method, electronic equipment, a storage medium and a computer program product, and belongs to the technical field of terminals. The method is applied to the electronic equipment and comprises the following steps: after the electronic equipment is connected with a charger, acquiring a plurality of charging protocols supported between the electronic equipment and the charger; determining the maximum charging power supported by each charging protocol in the plurality of charging protocols; selecting a target charging protocol from the plurality of charging protocols according to the maximum charging power supported by each charging protocol and the protocol type of each charging protocol; and charging the electronic equipment according to the target charging protocol. In the application, the electronic device can determine the maximum charging power supported by each charging protocol, so that a relatively good charging protocol can be selected to charge the electronic device according to the maximum charging power supported by each charging protocol and the protocol type, thereby improving the charging efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a charging control method, electronic device, storage medium, and computer program product. Background Technology

[0002] With the widespread use of electronic devices, the demand for fast charging has also increased. Electronic devices and chargers typically support multiple charging protocols, such as Super Charge Protocol (SCP), Programmable Power Supply (PPS), Universal Fast Charging Specification (UFCS), and QC. When using a charger with multiple charging protocols to charge an electronic device, the device can choose one of them for direct charging (fast charging).

[0003] Currently, in order to avoid the charging protocol handshake time (charging protocol negotiation time) being too long and affecting the display of the charging icon or the time to enter the direct charging mode of electronic devices, electronic devices can handshake with the charger through the charging protocol in a certain priority order.

[0004] However, once a handshake based on a high-priority charging protocol is successful, the electronic device will not perform a handshake based on subsequent charging protocols. If the maximum charging power supported by the successfully handshake charging protocol is lower than that of other charging protocols, the charger may be unable to use the maximum charging power to charge the electronic device, even though it could have used high-power fast charging. This reduces charging efficiency and affects the user experience. Summary of the Invention

[0005] This application provides a charging control method, an electronic device, a storage medium, and a computer program product, which can be used to solve the problem of low charging efficiency caused by electronic devices being unable to use their maximum charging power. The technical solution is as follows:

[0006] Firstly, a charging control method is provided for use in electronic devices, the method comprising:

[0007] After the electronic device is connected to the charger, the system acquires multiple charging protocols supported between the electronic device and the charger; determines the maximum charging power supported by each charging protocol; selects a target charging protocol from the multiple charging protocols based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol; and charges the electronic device according to the target charging protocol.

[0008] In this way, since the electronic device can determine the maximum charging power supported by each charging protocol, the best charging protocol can be selected to charge the electronic device based on the maximum charging power supported by each protocol and the protocol type, thereby improving charging efficiency.

[0009] As an example of this application, the operation of an electronic device to determine the maximum charging power supported by each of a plurality of charging protocols includes:

[0010] Each of the multiple charging protocols performs a charging handshake operation with the charger separately;

[0011] During the charging handshake operation, the maximum charging power supported by the charging protocol used for the handshake operation is obtained.

[0012] In this way, by performing a charging handshake operation with the charger separately for each charging protocol, the maximum charging power supported by each charging protocol can be obtained, thereby improving the reliability of determining the maximum charging power supported by each charging protocol.

[0013] As an example of this application, the operation of an electronic device to determine the maximum charging power supported by each of a plurality of charging protocols includes:

[0014] Obtain the first charging protocol, which is one of the multiple charging protocols that has not undergone a charging handshake operation;

[0015] A charging handshake operation is performed with the charger via the first charging protocol;

[0016] During the charging handshake operation, obtain the maximum charging power supported by the first charging protocol.

[0017] If the first charging protocol meets the protocol selection criteria, the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation among the multiple charging protocols is determined to be 0. This protocol selection criterion is used to filter the charging protocols that enable fast charging of electronic devices.

[0018] Since the electronic device can determine the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation as 0 when the first charging protocol meets the protocol selection conditions, the charging handshake operation between the electronic device and the charger is reduced, and the efficiency of determining the maximum charging power supported by each charging protocol is improved.

[0019] As an example of this application, when the electronic device determines that the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation among the multiple charging protocols is 0, it can also determine whether the first charging protocol meets the protocol selection conditions.

[0020] For example, if the charging handshake operation is successful via the first charging protocol and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is not the target type, it is determined that the first charging protocol meets the protocol selection conditions; or,

[0021] If the charging handshake operation is successful via the first charging protocol, and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is the target type, and the maximum charging power supported by the first charging protocol is greater than or equal to the first threshold corresponding to the first charging protocol, then the first charging protocol is determined to meet the protocol selection conditions; or...

[0022] If the charging handshake operation is successful through the first charging protocol and the maximum charging power supported by the first charging protocol is greater than 0, and if the first charging protocol is the target type and the maximum charging power supported by the first charging protocol is less than the first threshold, and each charging protocol has performed a charging handshake operation, then the first charging protocol is determined to meet the protocol selection conditions.

[0023] In this way, by setting a first threshold for each charging protocol and using each first threshold as one of the protocol selection conditions for determining whether to enter the protocol selection process, the speed of the charging handshake operation of electronic devices is accelerated, and the problem of excessively long charging handshake operation time is improved.

[0024] As an example of this application, after the electronic device performs a charging handshake operation with the charger through the first charging protocol, it can also perform the operation of acquiring the first charging protocol if the first charging protocol does not meet the protocol selection conditions, until the first charging protocol meets the protocol selection conditions, or until each of the multiple charging protocols has been acquired.

[0025] In some embodiments, after the electronic device performs a charging handshake with the charger via a first charging protocol, this handshake operation may fail. In such cases, if no charging protocol exists that allows the electronic device to successfully perform the handshake, it can be determined that the electronic device cannot charge the battery via fast charging. Therefore, the electronic device can continue to charge the battery via normal charging (buck charging).

[0026] It should be noted that if the charging handshake operation fails through the first charging protocol, the electronic device can also reset the first charging protocol, or in other words, reset the charging operation pin.

[0027] Thus, if the first charging protocol does not meet the protocol selection criteria, the electronic device can poll multiple charging protocols, thereby ensuring the reliability of the selected charging protocol.

[0028] As an example of this application, the operation of an electronic device selecting a target charging protocol from multiple charging protocols based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol includes:

[0029] Obtain a second charging protocol, which is one of multiple charging protocols, or the second charging protocol is a charging protocol that meets the protocol selection criteria, which are used to filter charging protocols for fast charging electronic devices.

[0030] If the type of the second charging protocol is not the target type, the second charging protocol is determined to be the target charging protocol;

[0031] If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is greater than or equal to the second threshold corresponding to the second charging protocol, then the second charging protocol is determined to be the target charging protocol.

[0032] If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is less than the second threshold, and there are unacquired charging protocols, then the operation of acquiring the second charging protocol is performed until all charging protocols have been acquired.

[0033] If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is less than the second threshold, and the maximum charging power supported by all charging protocols has been obtained, then the target charging protocol is determined based on the maximum charging power supported by the obtained charging protocols.

[0034] As an example, after determining the second charging protocol as the target charging protocol, that is, after determining the second charging protocol as the target charging protocol when the type of the second charging protocol is not the target type, or, if the second charging protocol is the target type and the maximum charging power supported by the second charging protocol is greater than or equal to the second threshold, then after determining the second charging protocol as the target charging protocol, if the second charging protocol is not the charging protocol currently occupying the charging handshake pin, the electronic device can reset the charging protocol currently occupying the charging handshake pin, and then re-perform the charging handshake operation with the charger through the second charging protocol. After the charging handshake is successful, the electronic device is charged according to the target charging protocol.

[0035] Thus, by further determining the target charging protocol based on the maximum charging power and type supported by the charging protocol, the accuracy of determining the target charging protocol is improved.

[0036] As an example of this application, the operation of an electronic device determining a target charging protocol based on the maximum charging power supported by all charging protocols, after having obtained the maximum charging power supported by all the obtained charging protocols, includes:

[0037] If the maximum charging power supported by all charging protocols has been obtained, and the maximum charging power supported by the second charging protocol is the obtained maximum power value, then the second charging protocol is determined to be the target charging protocol.

[0038] If the maximum charging power supported by all charging protocols has been obtained, and the maximum charging power supported by the second charging protocol is not the obtained maximum power value, then the third charging protocol is determined to be the target charging protocol, and the third charging protocol is the charging protocol corresponding to the obtained maximum power value.

[0039] In some embodiments, when the electronic device determines that the maximum charging power supported by the currently acquired charging protocol is the maximum power value that can be acquired, it can record the currently acquired charging protocol and the corresponding maximum charging power. If a new maximum power value is acquired, the new maximum power value can be used to overwrite the previously recorded power value. Of course, other recording methods may also exist, and this application embodiment does not specifically limit them.

[0040] In this way, by selecting the charging protocol corresponding to the maximum power value as the target charging protocol, it is ensured that electronic devices can be charged with the maximum charging power, thereby improving the charging efficiency of electronic devices.

[0041] As an example of this application, the target charging protocol is a third charging protocol; before the electronic device charges the electronic device according to the target charging protocol, it can also reset the charging protocol currently occupying the charging handshake pin if the third charging protocol is not the charging protocol currently occupying the charging handshake pin; and re-perform the charging handshake operation with the charger through the third charging protocol.

[0042] Based on this, the operation of charging an electronic device according to the target charging protocol includes:

[0043] After a successful charging handshake, the electronic device is quickly charged using a third charging protocol.

[0044] In this way, by resetting the charging handshake pin, pin occupancy conflicts are avoided.

[0045] Secondly, a charging control device is provided, which has the function of implementing the charging control method described in the first aspect. The charging control device includes at least one module for implementing the charging control method provided in the first aspect. The device includes:

[0046] The acquisition module is used to acquire multiple charging protocols supported between the electronic device and the charger after the electronic device is connected to the charger.

[0047] The determination module is used to determine the maximum charging power supported by each of the multiple charging protocols.

[0048] The selection module is used to select the target charging protocol from multiple charging protocols based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol.

[0049] A charging module is used to charge electronic devices according to a target charging protocol.

[0050] As an example of this application, the electronic device determination module is used for:

[0051] Each of the multiple charging protocols performs a charging handshake operation with the charger separately;

[0052] During the charging handshake operation, the maximum charging power supported by the charging protocol used for the handshake operation is obtained.

[0053] As an example of this application, the determination module is used for:

[0054] Obtain the first charging protocol, which is one of the multiple charging protocols that has not undergone a charging handshake operation;

[0055] A charging handshake operation is performed with the charger via the first charging protocol;

[0056] During the charging handshake operation, obtain the maximum charging power supported by the first charging protocol.

[0057] If the first charging protocol meets the protocol selection criteria, the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation among the multiple charging protocols is determined to be 0. This protocol selection criterion is used to filter the charging protocols that enable fast charging of electronic devices.

[0058] As an example of this application, the determination module is also used for:

[0059] If the charging handshake operation is successful via the first charging protocol, and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is not the target type, the first charging protocol is determined to meet the protocol selection conditions; or...

[0060] If the charging handshake operation is successful via the first charging protocol, and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is the target type, and the maximum charging power supported by the first charging protocol is greater than or equal to the first threshold corresponding to the first charging protocol, then the first charging protocol is determined to meet the protocol selection conditions; or...

[0061] If the charging handshake operation is successful through the first charging protocol and the maximum charging power supported by the first charging protocol is greater than 0, and if the first charging protocol is the target type and the maximum charging power supported by the first charging protocol is less than the first threshold, and each charging protocol has performed a charging handshake operation, then the first charging protocol is determined to meet the protocol selection conditions.

[0062] As an example of this application, the determination module is also used for:

[0063] If the first charging protocol does not meet the protocol selection criteria, the operation of acquiring the first charging protocol is performed until the first charging protocol meets the protocol selection criteria, or until each of the multiple charging protocols has been acquired.

[0064] As an example in this application, the selection module is used for:

[0065] Obtain a second charging protocol, which is one of multiple charging protocols, or the second charging protocol is a charging protocol that meets the protocol selection criteria, which are used to filter charging protocols for fast charging electronic devices.

[0066] If the type of the second charging protocol is not the target type, the second charging protocol is determined to be the target charging protocol;

[0067] If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is greater than or equal to the second threshold corresponding to the first charging protocol, then the second charging protocol is determined to be the target charging protocol.

[0068] If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is less than the second threshold, and there are unacquired charging protocols, then the operation of acquiring the second charging protocol is performed until all charging protocols have been acquired.

[0069] If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is less than the second threshold, and the maximum charging power supported by all charging protocols has been obtained, then the target charging protocol is determined based on the maximum charging power supported by the obtained charging protocols.

[0070] As an example in this application, the selection module is used for:

[0071] If the maximum charging power supported by all charging protocols has been obtained, and the maximum charging power supported by the second charging protocol is the obtained maximum power value, then the second charging protocol is determined to be the target charging protocol.

[0072] If the maximum charging power supported by all charging protocols has been obtained, and the maximum charging power supported by the second charging protocol is not the obtained maximum power value, then the third charging protocol is determined to be the target charging protocol, and the third charging protocol is the charging protocol corresponding to the obtained maximum power value.

[0073] As an example of this application, the target charging protocol is a third charging protocol;

[0074] The device also includes:

[0075] The reset module is used to reset the charging protocol currently occupying the charging handshake pin if the third charging protocol is not the charging protocol currently occupying the charging handshake pin.

[0076] The handshake module is used to re-engage the charging handshake with the charger via a third charging protocol.

[0077] Based on this, the charging module is used for:

[0078] After a successful charging handshake, the electronic device is quickly charged using a third charging protocol.

[0079] Thirdly, an electronic device is provided, comprising a processor and a memory. The memory stores a program that supports the electronic device in executing the charging control method provided in the first aspect, and stores data related to implementing the charging control method described in the first aspect. The processor is configured to execute the program stored in the memory. The electronic device may further include a communication bus for establishing a connection between the processor and the memory.

[0080] Fourthly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the charging control method described in the first aspect.

[0081] Fifthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to execute the charging control method described in the first aspect.

[0082] The technical effects achieved by the second, third, fourth, and fifth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0083] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0084] Figure 2 This is a block diagram of a software system for an electronic device provided in an embodiment of this application;

[0085] Figure 3 This is a schematic diagram of a power arbitration process provided in an embodiment of this application;

[0086] Figure 4 This is a schematic diagram of a protocol selection process provided in an embodiment of this application;

[0087] Figure 5 This is a schematic diagram of another power arbitration process provided in an embodiment of this application;

[0088] Figure 6 This is a schematic diagram of another protocol selection process provided in an embodiment of this application;

[0089] Figure 7 This is a schematic flowchart of a charging control method provided in an embodiment of this application;

[0090] Figure 8 This is a schematic diagram of the structure of a charging control device provided in an embodiment of this application. Detailed Implementation

[0091] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0092] It should be understood that "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0093] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0095] With the widespread use of electronic devices, users have increasingly higher demands for charging capabilities. For example, more and more users require their electronic devices to be able to fast charge (also known as direct charging, fast charging, etc.), that is, to restore the power of electronic devices in a short time. Currently, different chargers support different charging protocols, and some chargers do not even support standard fast charging protocols. Therefore, when a charger is charging an electronic device, the device needs to sequentially perform a charging handshake with the charger using different charging protocols according to priority. Only after successfully completing the charging handshake with one of the charging protocols will the device be fast charged using that protocol.

[0096] However, once a handshake based on a high-priority charging protocol is successful, the electronic device will not perform a handshake based on subsequent charging protocols. If the maximum power supported by the successfully handshake charging protocol is lower than that of other charging protocols, the charger may be unable to charge the electronic device at its maximum power, even though it could have used high-power fast charging. This reduces charging efficiency and affects the user experience.

[0097] Of course, in some application scenarios, electronic devices may also poll each charging protocol for a charging handshake. However, due to protocol conflicts caused by pin occupation between different charging protocols, such as when there is a conflict between charging protocol 1 and charging protocol 2, if the electronic device successfully hands over the charger through charging protocol 1 and then hands over the charger through charging protocol 2, it may cause a protocol conflict and lead to charging abnormalities.

[0098] To improve charging efficiency, this application provides a charging control method. In this method, after an electronic device is connected to a charger, it can acquire multiple charging protocols supported by the device and the charger, and determine the maximum charging power supported by each charging protocol. Based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol, a target charging protocol is selected from the multiple charging protocols. The electronic device is then charged according to the target charging protocol. Since the electronic device can determine the maximum charging power supported by each charging protocol, the optimal charging protocol can be selected to charge the electronic device based on the maximum charging power supported by each protocol and the protocol type, thereby improving charging efficiency.

[0099] Before providing a detailed explanation of the charging control method provided in the embodiments of this application, the electronic equipment involved in the embodiments of this application will be described first.

[0100] As an example, the method provided in this application embodiment can be applied to various types of electronic devices that support fast charging, and the electronic devices can be, but are not limited to, tablet computers, desktop computers, laptop computers, handheld computers, laptops, in-vehicle devices, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), mobile phones, smartwatches, etc. This application embodiment does not limit this.

[0101] Figure 1 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. See also... Figure 1 The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0102] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0103] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0104] The controller can serve as the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0105] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0106] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0107] USB port 130 is a USB standard compliant interface, which can be a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect chargers to charge electronic devices, and can also be used for data transfer between electronic devices and peripheral devices. It can also be used to connect headphones for audio playback. USB port 130 can also be used to connect other terminals, such as AR devices.

[0108] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments of this application, the electronic device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0109] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0110] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0111] The wireless communication function of electronic devices can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0112] Electronic devices implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0113] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N displays 194, where N is an integer greater than 1.

[0114] Electronic devices can achieve shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0115] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.

[0116] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0117] Electronic devices can implement audio functions, such as music playback and recording, through audio modules 170, speakers 170A, receivers 170B, microphones 170C, headphone jacks 170D, and application processors.

[0118] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0119] Temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, the electronic device reduces the performance of the processor located near temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device heats battery 142 to prevent abnormal shutdown of the electronic device due to low temperature. In still other embodiments, when the temperature is below yet another threshold, the electronic device boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0120] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can be corresponding to touch operations applied to different applications (such as taking photos, playing audio, etc.). Touch operations applied to different areas of the display screen 194 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0121] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0122] The software system of the electronic device will be explained next.

[0123] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software system of an electronic device.

[0124] Figure 2 This is a block diagram of a software system for an electronic device provided in an embodiment of this application. See also... Figure 2A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer.

[0125] The application layer can include a series of application packages. For example... Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0126] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 2 As shown, the application framework layer can include a window manager, content providers, a view system, a phone manager, a resource manager, and a notification manager. The window manager manages window programs. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture the screen. The content provider stores and retrieves data, making this data accessible to the application. This data can include videos, images, audio, made and received phone calls, browsing history and bookmarks, and phone books. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build the application's display interface, which can consist of one or more views, such as a view displaying SMS notification icons, a view displaying text, and a view displaying images. The phone manager provides communication functions for electronic devices, such as managing call status (including connection and disconnection). The resource manager provides the application with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager allows the application to display notification information in the status bar, which can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager is used to notify users of download completions and message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications. Furthermore, the notification manager can appear as dialog boxes on the screen, such as displaying text messages in the status bar, emitting sounds, causing electronic devices to vibrate, or flashing indicator lights.

[0127] The Android Runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0128] The system library can include multiple functional modules, such as a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing libraries are used for 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.

[0129] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0130] The following example, using a scene of capturing a photograph, illustrates the workflow of the electronic device's software and hardware.

[0131] When touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the raw input event. Taking a single-click operation as an example, where the corresponding control is the camera application icon, the camera application calls the interface of the application framework layer to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.

[0132] Based on the execution entity provided in the above embodiments, the charging control method provided in the embodiments of this application will be described next.

[0133] In this embodiment, after the electronic device is connected to the charger, it can first perform buck charging and determine whether it meets the conditions for fast charging. If so, a power arbitration process is initiated. In the power arbitration process, the electronic device can obtain the maximum charging power supported by different charging protocols through protocol handshake. During the power arbitration process, if all charging protocols have completed the handshake or a certain charging protocol meets the exit conditions, the power arbitration process is exited, and a protocol selection process is initiated. In the protocol selection process, the electronic device can select the final charging protocol based on the maximum power and type supported by different charging protocols. The power arbitration process and the protocol selection process will be described below.

[0134] Please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating a power arbitration process according to an exemplary embodiment. It is provided as an example and not as a limitation. The method is illustrated by way of application to a charging device and may include some or all of the following:

[0135] Step 301: After connecting to the charger, charge the battery of the electronic device normally.

[0136] In other words, each time an electronic device is connected to a charger, it does not immediately enter fast charging mode for fast charging, but first performs normal charging (also known as buck charging).

[0137] It should be noted that the electronic device and the charger can be connected via a charging cable, specifically a Type-C interface. The method of charging the electronic device via a charging cable is called wired charging. Of course, the charger and electronic device can also be connected in other ways, such as contact connection. This application does not impose specific limitations on the connection method between the electronic device and the charger.

[0138] Step 302: Determine whether the electronic device meets the fast charging conditions. If yes, proceed to step 303 below. If no, continue to proceed to step 301.

[0139] Sometimes, the charging protocols supported by an electronic device may not include fast charging protocols, or the charging protocols supported by the charger may not include fast charging protocols, or the shared charging protocols between the electronic device and the charger may not include fast charging protocols, or the charging cable connecting the charger and the electronic device may not support fast charging. In these cases, the electronic device may not meet the fast charging conditions, thus preventing it from fast charging. Therefore, to accurately charge the electronic device, it can determine whether it meets the fast charging conditions. If it does, it enters the power arbitration process, i.e., the electronic device begins to execute step 303 below. If the fast charging conditions are not met, the electronic device can continue to charge its battery normally.

[0140] Step 303: Obtain the first charging protocol among multiple charging protocols.

[0141] It should be noted that these multiple charging protocols are multiple charging protocols jointly supported by the electronic device and the charger. For example, if the electronic device supports charging protocol 1, charging protocol 2, charging protocol 3 and charging protocol 4, and the charger supports charging protocol 2, charging protocol 3 and charging protocol 4, then the multiple charging protocols include charging protocol 2, charging protocol 3 and charging protocol 4.

[0142] In some embodiments, the electronic device may randomly select any one of a plurality of charging protocols that has not undergone a charging handshake as the first charging protocol. Alternatively, the electronic device may select the first charging protocol in other ways. For example, a priority relationship may be pre-defined among the multiple charging protocols. In this case, the electronic device may select the highest-priority charging protocol that has not undergone a charging handshake as the first charging protocol, in descending order of priority.

[0143] For example, the plurality of charging protocols may include at least one proprietary protocol and at least one non-proprietary protocol. Typically, the priority of each proprietary protocol in the at least one proprietary protocol can be set to be higher than the priority of each non-proprietary protocol in the at least one non-proprietary protocol. The at least one proprietary protocol may refer to a charging protocol unique to the electronic device and essentially unusable by other electronic devices; the at least one non-proprietary protocol refers to a charging protocol that can be used by most electronic devices.

[0144] Step 304: Perform a charging handshake operation with the charger through the first charging protocol and obtain the maximum charging power supported by the first charging protocol.

[0145] Since different charging protocols support different maximum charging powers, in order to select a suitable charging protocol, the electronic device can obtain the maximum charging power supported by the first charging protocol during the charging handshake operation with the charger.

[0146] For example, the maximum charging power supported by the UFCS protocol is usually 33W, the maximum charging power supported by FCP is usually 18W, and the maximum charging power supported by SCP can be higher than 100W.

[0147] In some embodiments, electronic devices can interact with chargers via certain pins through a first charging protocol to perform a charging handshake operation. In this embodiment, these pins are referred to as charging handshake pins.

[0148] Step 305: Determine whether the charging handshake operation with the charger via the first charging protocol was successful. If yes, proceed to step 306 below. If no, continue to proceed to step 303 above.

[0149] Since the charging handshake operation between an electronic device and a charger via a charging protocol is not always successful, and the electronic device cannot use the charging protocol to charge itself if the handshake operation fails, the electronic device can determine whether the handshake operation with the charger via the first charging protocol was successful in order to select the appropriate charging protocol.

[0150] In some embodiments, if the electronic device successfully completes a charging handshake with the charger using the first charging protocol, the electronic device can proceed to the next step, i.e., continue executing step 306 below. If the charging handshake with the charger fails to complete successfully using the first charging protocol, or if the charging handshake fails, the electronic device can acquire a new charging protocol that has not undergone a charging handshake, i.e., the electronic device can return to step 303 above.

[0151] Of course, if the charging handshake operation between the electronic device and the charger fails through the first charging protocol, and there is currently no charging protocol that does not involve a charging handshake operation, then the electronic device cannot perform fast charging and can continue to perform normal charging of the battery.

[0152] It should be noted that regardless of whether the charging handshake operation with the charger via the first charging protocol is successful, the electronic device can obtain the maximum charging power supported by the first charging protocol.

[0153] Step 306: Determine whether the maximum charging power supported by the first charging protocol is greater than 0. If yes, then perform the operation in step 307 below. If no, then perform the operation in step 303 above.

[0154] Because the charging IC (chip) of the electronic device does not support fast charging mode, or because the electronic device malfunctions, the maximum charging power supported by the first charging protocol acquired by the electronic device may be less than or equal to 0. When the maximum power supported by the first charging protocol is less than or equal to 0, the electronic device cannot achieve fast charging using the first charging protocol. Therefore, the electronic device can reselect a first charging protocol, i.e., the electronic device can return to the operation in step 303 above. Of course, if there is currently no charging protocol that has not undergone a handshake operation, the electronic device can continue to perform normal charging.

[0155] Step 307: Determine whether the type of the first charging protocol is the target type. If yes, then perform the operation of step 308 below. If no, then perform the operation of step 312 below.

[0156] It should be noted that when the type of the first charging protocol is target type, the first charging protocol can support the power arbitration process.

[0157] As an example, among the multiple charging protocols, there are those that support power arbitration procedures. These are considered the target type. After the electronic device performs a charging handshake with the charger using a target type charging protocol, it needs to complete the power arbitration procedure. Of course, in addition to those supporting power arbitration, there are also charging protocols that do not support it. These are not considered the target type. After the electronic device performs a charging handshake with a non-target type charging protocol, it will not perform the power arbitration procedure. Therefore, the electronic device can directly execute step 312 below.

[0158] In some embodiments, the plurality of charging protocols may include at least one proprietary protocol and at least one non-proprietary protocol. Typically, the type of the at least one proprietary protocol is usually the target type, and the type of the at least one non-proprietary protocol is usually not the target type; however, this application does not impose specific limitations on this.

[0159] Step 308: Determine whether the maximum charging power supported by the first charging protocol is greater than or equal to the first threshold corresponding to the first charging protocol. If yes, then perform the operation of step 312 below. If no, then perform the operation of step 309 below.

[0160] To avoid excessively long charging handshake operations on a single charging protocol, the electronic device can set an exit threshold for each charging protocol. For ease of understanding of the embodiments of this application, in the power arbitration process, the exit threshold corresponding to each charging protocol is referred to as the first threshold. Typically, the exit thresholds for different charging protocols are different.

[0161] As an example, if the maximum charging power supported by the first charging protocol is greater than or equal to its corresponding first threshold, it means that the maximum charging power supported by the first charging protocol meets the requirements for improving the charging efficiency of the electronic device. Therefore, the electronic device can directly enter the process of step 312 below.

[0162] If the maximum charging power supported by the first charging protocol is less than its corresponding first threshold, it indicates that using the first charging protocol to charge the electronic device may reduce the charging efficiency. Therefore, if there is still a charging protocol that has not performed a charging handshake operation, the electronic device can reselect the first charging protocol, that is, the electronic device can perform the operation of step 309 below.

[0163] Step 309: Determine if there is a charging protocol that has not performed a charging handshake operation. If yes, proceed to step 310 below; otherwise, proceed to step 311 below.

[0164] Step 310: Determine whether at least one valid charging protocol has been obtained. If yes, perform the operation in step 312 below. If no, perform the operation in step 301 above.

[0165] It should be noted that a valid charging protocol refers to a charging protocol that supports a maximum charging power greater than 0. In other words, a valid charging protocol is one that enables a successful charging handshake between the electronic device and the charger, and whose maximum supported charging power is greater than 0, as obtained by the electronic device.

[0166] Since the electronic device can determine that the first charging protocol is a valid protocol if the maximum charging power supported by the first charging protocol is greater than 0 during the execution of step 306, the electronic device will usually determine the result as yes when executing step 310. Therefore, the electronic device may also skip step 310 and directly execute the following step 312 after determining in step 309 that there is no charging protocol that has not performed a charging handshake operation.

[0167] Step 311: Reset the charging protocol currently in the charging handshake operation and return to the operation in step 303 above.

[0168] Since the charging protocol used for the current charging handshake does not occupy the corresponding pins when the charging handshake fails, no protocol reset is required in this case. However, when the charging handshake is successful, in order to avoid pin conflicts, the electronic device needs to reset the charging protocol that was successfully used for the current charging handshake and then obtain a new charging protocol.

[0169] Step 312: Proceed to the protocol selection process.

[0170] It should be noted that the specific steps of the protocol selection process can be found below. Figure 4 or Figure 6 The process shown in this application embodiment is not specifically limited in this respect.

[0171] As an example, as can be seen from the power arbitration process described above, an electronic device may enter the protocol selection process without having completed a charging handshake with the charger through all charging protocols. For charging protocols that have not undergone a charging handshake, the electronic device will not consider selecting these charging protocols as fast charging protocols. Therefore, the electronic device can set the maximum charging power supported by the charging protocols that have not undergone a charging handshake to 0.

[0172] Next, the procedure for selecting protocols on electronic devices will be explained. Please refer to [link / reference]. Figure 4 This method is applied in electronic devices, and the method may include some or all of the following:

[0173] Step 401: The electronic device acquires the second charging protocol.

[0174] It should be noted that the second charging protocol is any one of multiple charging protocols.

[0175] In some embodiments, the electronic device may randomly select one of a plurality of charging protocols as the second charging protocol, or it may select one of the charging protocols as the second charging protocol according to the priority of the plurality of charging protocols in descending order. This application embodiment does not impose specific limitations on this.

[0176] Step 402: Determine whether the maximum power supported by the second charging protocol is greater than 0. If yes, then perform the operation of step 403 below. If no, then perform the operation of step 401 above.

[0177] As mentioned above, among multiple charging protocols, there may be charging protocols that have not undergone a charging handshake operation. For charging protocols that have not undergone a charging handshake operation, electronic devices can set their maximum supported charging power to 0. Such charging protocols will not be used as fast charging protocols (they will not be used as charging protocols for fast charging of electronic devices). Therefore, in order to select a suitable charging protocol, electronic devices can determine whether the maximum supported charging power of the second charging protocol is greater than 0.

[0178] Step 403: Determine whether the type of the second charging protocol is the target type. If yes, then perform the operation of step 404 below. If no, then perform the operation of step 412 below.

[0179] Since multiple charging protocols include those of the target type and those of other types, the electronic device can directly identify non-target charging protocols as fast charging protocols. For the target type, the electronic device can select the protocol that maximizes charging efficiency. Therefore, the electronic device needs to determine whether the second charging protocol is the target type. If yes, step 404 is executed; otherwise, it indicates that the currently acquired second charging protocol can be used as a fast charging protocol, and the electronic device can execute step 412.

[0180] Step 404: Determine whether the maximum charging power supported by the second charging protocol is greater than or equal to the second threshold corresponding to the second charging protocol. If yes, then perform the operation of step 412 below. If no, then perform the operation of step 405 below.

[0181] It should be noted that, for ease of understanding of the embodiments of this application, in the protocol selection process, the exit threshold corresponding to each charging protocol is referred to as the second threshold.

[0182] As an example, if the maximum charging power supported by the second charging protocol is greater than or equal to its corresponding second threshold, the second charging protocol already enables the electronic device to achieve high charging efficiency, and the electronic device does not need to perform any further operations. Therefore, the electronic device can directly execute the operation in step 412 below. However, if the maximum charging power supported by the second charging protocol is less than its corresponding second threshold, it indicates that the second charging protocol may not contribute sufficiently to the charging efficiency. Therefore, it is necessary to further determine whether there are other charging protocols that can improve charging efficiency, i.e., the electronic device can continue to perform other determination steps.

[0183] Step 405: Determine whether the maximum charging power supported by the second charging protocol is the maximum power value that has been obtained. If yes, then perform the operation in step 406 below. If no, then perform the operation in step 407 below.

[0184] In order to improve the charging efficiency of electronic devices, if the maximum charging power supported by the second charging protocol is less than its corresponding second threshold, the electronic device needs to acquire the charging protocol with the largest supported maximum charging power as much as possible. Therefore, the electronic device can determine whether the maximum charging power supported by the currently acquired second charging protocol is the maximum power value already acquired.

[0185] In some embodiments, if the electronic device has acquired multiple second charging protocols, the electronic device can perform the operation of step 405. If the electronic device has acquired only one second charging protocol, the electronic device can directly perform the operation of step 406 below.

[0186] Step 406: Record the type of the second charging protocol and the maximum supported charging power, and perform the operation in step 407 below.

[0187] Step 407: Determine whether all second charging protocols have been acquired and at least one valid charging protocol has been acquired. If yes, then perform the operation in step 408 below. If no, then perform the operation in step 401 above.

[0188] It should be noted that a valid charging protocol is one that supports a maximum charging power greater than 0.

[0189] As described above, when the maximum charging power supported by the second charging protocol is greater than 0, the electronic device process can proceed to step 407. When the electronic device executes step 407, at least one valid charging protocol must exist. Therefore, the conditions for determining "no" in step 407 include not acquiring all second charging protocols, and acquiring at least one valid charging protocol.

[0190] Step 408: Determine whether the third charging protocol corresponding to the maximum power value is the charging protocol currently occupying the charging handshake pin. If yes, then perform the operation in step 411 below. If no, then perform the operation in step 409 below.

[0191] Since the maximum charging power supported by the charging protocol currently occupying the charging handshake pin may be the maximum power value that has been obtained or may not be, in order to accurately select the corresponding charging protocol, the electronic device can determine whether the charging protocol corresponding to the maximum power value obtained (referred to as the third charging protocol in this application embodiment) is the charging protocol currently occupying the charging handshake pin.

[0192] Step 409: Reset the charging protocol of the currently occupied charging handshake pin.

[0193] Since the charging handshake pin is not occupied by the third charging protocol, the electronic device needs to perform a pin reset in order to avoid pin occupation conflicts, and then perform the operation of step 410 below.

[0194] Step 410: Handshake with the charger via the third charging protocol and perform the operation described in step 411 below.

[0195] As an example, if the charging handshake operation between the electronic device and the second charging protocol fails, and if an unacquired second charging protocol exists, the electronic device can continue to perform the operation in step 401 above. If no unacquired second charging protocol exists, the electronic device will not perform fast charging on the battery, but will continue with normal charging.

[0196] As an example, if the charging handshake between the electronic device and the third charging protocol fails, the electronic device will not perform fast charging on the battery, but will continue with normal charging.

[0197] Step 411: Determine the third charging protocol as the target charging protocol and execute the operation in step 413.

[0198] In some embodiments, the third charging protocol determined by the electronic device may be the second charging protocol obtained in this instance, or it may be the second charging protocol obtained in a previous instance.

[0199] Step 412: Determine the second charging protocol as the target charging protocol and execute the operation in step 413.

[0200] As an example, if the second charging protocol is the target charging protocol, and if the second charging protocol is not the charging protocol currently occupying the charging handshake pin, the electronic device can reset the charging protocol currently occupying the charging handshake pin and re-engage with the charger using the second charging protocol. After the charging handshake operation is successful, step 413 is executed.

[0201] As an example, if the charging handshake operation between the electronic device and the second charging protocol fails, and if an unacquired second charging protocol exists, the electronic device can continue to perform the operation in step 401 above. If no unacquired second charging protocol exists, the electronic device will not perform fast charging on the battery, but will continue with normal charging.

[0202] Step 413: Fast charge the electronic device using the target charging protocol.

[0203] In this embodiment, since the electronic device can determine the maximum charging power supported by each charging protocol, the optimal charging protocol can be selected based on the maximum charging power and protocol type of each protocol, thereby improving charging efficiency. Furthermore, after determining the optimal charging protocol, if the optimal charging protocol is not the currently occupied charging handshake pin, the electronic device can reset the charging protocol, thus resolving the pin occupancy conflict problem between charging protocols.

[0204] It should be noted that, in the embodiments of this application, the electronic device can not only execute the power arbitration process and protocol selection process in the manner described above, but also implement them in other ways. The other implementation methods will be explained below.

[0205] In some embodiments, the multiple charging protocols include charging protocols of the target type and charging protocols of other types. That is, among the multiple charging protocols, some protocols support power arbitration procedures for the electronic device, while the remaining protocols do not. In this embodiment, charging protocols that support power arbitration procedures have higher priority than those that do not. Thus, the electronic device can first perform a power arbitration procedure based on the charging protocol of the target type, and then execute the protocol selection procedure. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of another power arbitration process provided in an embodiment of this application. The method is applied in an electronic device and includes at least the following steps.

[0206] The operations of steps 501-502 can be referred to the operations of steps 301-302 above, and will not be described in detail in this embodiment.

[0207] Step 503: Obtain the fourth charging protocol from the target type charging protocol set.

[0208] It should be noted that the fourth charging protocol is any one of the target type charging protocols in the set that has not undergone a charging handshake operation.

[0209] To improve the efficiency of electronic devices in selecting charging protocols, a set of target type charging protocols can be set in the electronic device. This set of target type charging protocols can exist in the form of a set or a list. This application embodiment does not impose specific limitations on this.

[0210] In addition, the target type charging protocol set includes at least one charging protocol, and the at least one charging protocol includes all charging protocols of the target type supported by the electronic device.

[0211] As an example, an electronic device can randomly select a charging protocol from the target type charging protocol set that has not undergone a charging handshake operation as the fourth charging protocol. Alternatively, the electronic device can select a charging protocol as the fourth charging protocol based on the priority of at least one charging protocol in the target type charging protocol set, in descending order.

[0212] Step 504: Perform a charging handshake operation with the charger through the fourth charging protocol and obtain the maximum charging power supported by the fourth charging protocol.

[0213] Step 505: Determine whether the charging handshake operation with the charger via the fourth charging protocol was successful. If yes, proceed to step 506 below; otherwise, proceed to step 508 below.

[0214] Step 506: Determine whether the maximum charging power supported by the fourth charging protocol is greater than 0. If yes, proceed to step 507 below; otherwise, proceed to step 508 below.

[0215] Step 507: Determine whether the maximum charging power supported by the fourth charging protocol is greater than or equal to its corresponding first threshold. If yes, then perform the operation in step 509 below. If no, then perform the operation in step 508 below.

[0216] Step 508: Determine whether the charging handshake operation for all charging protocols in the target type charging protocol set has been completed. If yes, execute the operation in step 509 below. If no, return to the operation in step 503.

[0217] Step 509: Proceed to the protocol selection process.

[0218] Based on the above Figure 5 The power arbitration process shown above allows electronic devices to proceed according to the aforementioned procedures. Figure 4 Follow the protocol selection process shown, and operate in accordance with... Figure 4 During the protocol selection process shown, the electronic device can select a second charging protocol from all valid charging protocols and charging protocols whose type is not the target type. Of course, the electronic device can also choose not to follow this process. Figure 4 Instead of performing the protocol selection procedure shown, other operations are performed to implement the protocol selection procedure. The following explains the operation of another protocol selection procedure; please refer to [link / reference]. Figure 6 .

[0219] Step 601: Determine if a charging protocol of the target type exists. If yes, proceed to step 602 below; otherwise, proceed to step 611 below.

[0220] Because the electronic device is as described above Figure 5 After the power arbitration process shown, a valid charging protocol may not be obtained. This means that the target type charging protocol set does not contain a charging protocol that successfully completed the handshake, or that the target type charging protocol set contains a charging protocol that successfully completed the handshake, but the maximum charging power supported by that protocol is not greater than 0. In this case, the electronic device cannot obtain a charging protocol that meets the fast charging requirements from the target type charging protocol set. Therefore, the electronic device can determine whether a charging protocol of the target type exists. If no charging protocol of the target type exists, the electronic device can directly select a charging protocol from the charging protocols that are not of the target type as the target charging protocol. That is, the electronic device can directly execute the operation in step 611 below.

[0221] It should be noted that a valid charging protocol refers to a charging protocol in the target charging protocol set that has successfully completed a charging handshake and whose maximum supported charging power is greater than 0, as obtained by the electronic device.

[0222] Step 602: Obtain the fifth charging protocol.

[0223] It should be noted that the fifth charging protocol is any one of the at least one valid charging protocols to be acquired.

[0224] As an example, an electronic device can also randomly select at least one valid charging protocol as the fifth charging protocol. Alternatively, it can select a valid charging protocol as the fifth charging protocol in descending order of priority based on the priority of the at least one valid charging protocol.

[0225] Step 603: Determine whether the maximum charging power supported by the fifth charging protocol is greater than its corresponding second threshold. If yes, then perform the operation in step 612 below. If no, then perform the operation in step 604 below.

[0226] Step 604: Determine whether the maximum charging power supported by the fifth charging protocol is the maximum power value that has been obtained. If yes, then perform the operation in step 605 below. If no, then perform the operation in step 606 below.

[0227] Step 605: Record the type of the fifth charging protocol and the maximum supported charging power, and perform the operation in step 606 below.

[0228] Step 606: Determine whether all fifth charging protocols have been acquired. If yes, proceed to step 607 below. If no, proceed to step 602 above.

[0229] Step 607: Determine whether the sixth charging protocol corresponding to the maximum power value is the charging protocol currently occupying the charging handshake pin. If yes, then perform the operation of step 610 below; otherwise, perform the operation of step 608 below.

[0230] Step 608: Reset the charging protocol of the currently occupied charging handshake pin.

[0231] Step 609: Handshake with the charger via the sixth charging protocol.

[0232] Step 610: Determine the sixth charging protocol as the target charging protocol and perform the operation in step 613 below.

[0233] In some embodiments, the sixth charging protocol determined by the electronic device may be the fifth charging protocol obtained in this instance, or it may be the fifth charging protocol obtained in a previous instance.

[0234] Step 611: Determine the seventh charging protocol as the target charging protocol.

[0235] It should be noted that the seventh charging protocol is any charging protocol whose type is not the target type.

[0236] As an example, an electronic device can randomly select a charging protocol whose type is not the target type as the seventh charging protocol, or it can select the seventh charging protocol in descending order of priority based on the priority of the charging protocols whose type is not the target type.

[0237] As an example, after the electronic device identifies the seventh charging protocol as the target charging protocol, if the charging handshake pin is occupied, it can reset the charging handshake pin and perform a charging handshake operation with the charger via the seventh charging protocol. If the charging handshake operation is successful, it will execute step 613 below. If the charging handshake operation with the charger via the seventh charging protocol fails, it will acquire a new seventh charging protocol and return to step 611.

[0238] Since the seventh charging protocol is obtained when the electronic device does not have a valid charging protocol, the electronic device may not have a charging protocol that has successfully completed the charging handshake operation. In this case, the electronic device can directly perform a charging handshake operation with the charger through the seventh charging protocol.

[0239] Of course, the absence of a valid charging protocol could also be due to the electronic device successfully completing a charging handshake, but the charging protocol that successfully completed the handshake does not support fast charging, resulting in the maximum charging power supported by the charging protocol being no greater than 0. In this case, the electronic device can first reset the charging handshake pin and then perform a charging handshake operation with the charger through the seventh charging protocol.

[0240] Step 612: Determine the fifth charging protocol as the target charging protocol.

[0241] As an example, after the electronic device determines the fifth charging protocol as the target charging protocol, if the charging handshake pin of the electronic device is occupied and is occupied by the acquired fifth charging protocol, then the electronic device can directly execute the operation in step 613 below. If the charging handshake pin of the electronic device is occupied and the charging protocol occupying the charging handshake pin is not the currently acquired fifth charging protocol, then the electronic device can first reset the charging handshake pin, and then perform a charging handshake operation with the charger through the acquired fifth charging protocol. After the charging handshake operation is successful, the operation in step 613 below is executed.

[0242] In some embodiments, after a charging handshake operation fails, a new, previously unacquired fifth charging protocol is acquired. If a new fifth charging protocol cannot be acquired, the electronic device will not fast charge the battery but will continue with normal charging.

[0243] Step 613: Fast charge the electronic device using the target charging protocol.

[0244] In this embodiment, since the electronic device can determine the maximum charging power supported by each charging protocol, the optimal charging protocol can be selected based on the maximum charging power and protocol type of each protocol, thereby improving charging efficiency. Furthermore, after determining the optimal charging protocol, if the optimal charging protocol is not the currently occupied charging handshake pin, the electronic device can reset the charging protocol, thus resolving the pin occupancy conflict problem between charging protocols.

[0245] Next, a charging control method provided by an embodiment of this application will be described. Figure 7 This is a flowchart illustrating a charging control method provided in an embodiment of this application, which is applied to an electronic device. See also... Figure 7 The method includes:

[0246] Step 701: After the electronic device is connected to the charger, obtain the multiple charging protocols supported between the electronic device and the charger.

[0247] Because different electronic devices and chargers support different charging protocols, an electronic device can obtain multiple charging protocols supported by both the electronic device and the charger after being connected to the charger.

[0248] In some embodiments, after the electronic device is connected to the charger, the electronic device does not immediately enter the fast charging mode for fast charging, but instead first performs buck charging.

[0249] Step 702: Determine the maximum charging power supported by each of the multiple charging protocols.

[0250] Since different charging protocols support different maximum charging powers, in order to select a suitable charging protocol to improve the charging efficiency of electronic devices, the electronic device can determine the maximum charging power supported by each charging protocol.

[0251] As an example, the operation of an electronic device to determine the maximum charging power supported by each of the multiple charging protocols includes: performing a charging handshake operation with the charger through each of the multiple charging protocols; and during the charging handshake operation, obtaining the maximum charging power supported by the charging protocol performing the charging handshake operation.

[0252] Since the charging handshake operation is essentially an interaction between the electronic device and the charger through the currently selected charging protocol, the electronic device can obtain the maximum charging power supported by the charging protocol during the charging handshake operation.

[0253] It is worth noting that by performing a charging handshake operation with the charger separately for each charging protocol, the maximum charging power supported by each charging protocol can be obtained, thereby improving the reliability of determining the maximum charging power supported by each charging protocol.

[0254] In some embodiments, the electronic device can determine the maximum charging power supported by each charging protocol not only through the methods described above, but also through other methods. For example, the electronic device can acquire a first charging protocol, which is one of a plurality of charging protocols that has not undergone a charging handshake operation; perform a charging handshake operation with the charger through the first charging protocol; during the charging handshake operation, acquire the maximum charging power supported by the first charging protocol; if the first charging protocol meets the protocol selection criteria, determine that the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation among the plurality of charging protocols is 0. The protocol selection criteria are used to filter charging protocols that enable fast charging of the electronic device; in other words, the protocol selection criteria are used to filter charging protocols whose maximum supported charging power can achieve fast charging of the electronic device.

[0255] It is worth noting that, since the electronic device can determine the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation as 0 when the first charging protocol meets the protocol selection conditions, the charging handshake operation between the electronic device and the charger is reduced, and the efficiency of determining the maximum charging power supported by each charging protocol is improved.

[0256] In some embodiments, before the electronic device determines that the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation among the multiple charging protocols is 0, provided that the first charging protocol meets the protocol selection conditions, the electronic device may perform other operations. For example, the electronic device may determine whether the first charging protocol meets the protocol selection conditions.

[0257] As an example, if the charging handshake operation is successful via the first charging protocol and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is not the target type, the first charging protocol is determined to meet the protocol selection conditions. Alternatively, if the charging handshake operation is successful via the first charging protocol and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is the target type and the maximum charging power supported by the first charging protocol is greater than or equal to the first threshold corresponding to the first charging protocol, the first charging protocol is determined to meet the protocol selection conditions. Or, if the charging handshake operation is successful via the first charging protocol and the maximum charging power supported by the first charging protocol is greater than 0, then if the first charging protocol is the target type and the maximum charging power supported by the first charging protocol is less than its corresponding first threshold, and each charging protocol has performed a charging handshake operation, the first charging protocol is determined to meet the protocol selection conditions. Exemplarily, this process can refer to the above. Figure 3 The power arbitration process shown indicates that the electronic device enters the protocol selection process when the first charging protocol meets the protocol selection conditions. Alternatively, this process can also refer to the above. Figure 5 The power arbitration process is shown. This application's embodiments will not elaborate further on this process.

[0258] It is worth noting that by setting a first threshold for each charging protocol and using that first threshold as one of the protocol selection conditions for determining whether to enter the protocol selection process, the speed of the charging handshake operation of electronic devices is accelerated, thus improving the problem of excessively long charging handshake operation time.

[0259] In some embodiments, after the electronic device performs a charging handshake with the charger via a first charging protocol, this handshake operation may fail. In such cases, if no charging protocol exists that allows the electronic device to successfully perform the handshake, it can be determined that the electronic device cannot charge the battery via fast charging. Therefore, the electronic device can continue to charge the battery via normal charging (buck charging).

[0260] It should be noted that if the charging handshake operation fails through the first charging protocol, the electronic device can also reset the first charging protocol, or in other words, reset the charging operation pin.

[0261] In some embodiments, after the electronic device performs a charging handshake operation with the charger through the first charging protocol, if the first charging protocol does not meet the protocol selection conditions, the electronic device may continue to acquire the next first charging protocol until the first charging protocol meets the protocol selection conditions, or until each of the multiple charging protocols has been acquired, that is, the electronic device has used each charging protocol as the first charging protocol.

[0262] As an example, if the charging handshake operation is successful through the first charging protocol and the maximum charging power supported by the first charging protocol is less than 0, the electronic device can determine that the first charging protocol does not meet the protocol selection process; or, if the charging handshake operation is successful through the first charging protocol, the maximum charging power supported by the first charging protocol is greater than 0, the type of the first charging protocol is the target type, the maximum charging power supported by the first charging protocol is less than its corresponding first threshold, and there is a charging protocol that has not undergone the charging handshake operation, the first charging protocol is determined to not meet the protocol selection conditions.

[0263] It is worth noting that if the first charging protocol does not meet the protocol selection criteria, the electronic device can poll multiple charging protocols in a round-robin fashion, thereby ensuring the reliability of the selected charging protocol.

[0264] In some embodiments, before acquiring the next first charging protocol and performing a charging handshake operation, the electronic device can reset the previous first charging protocol, i.e., reset the charging handshake pin, to avoid conflicts between the two charging protocols that could lead to charging abnormalities. Specifically, if the electronic device's charging handshake operation fails, or if the electronic device successfully performs a charging handshake operation using the first charging protocol and the maximum charging power supported by the first charging protocol is not greater than 0, or if the first charging protocol does not meet the protocol selection process and there exists a charging protocol that has not undergone a charging handshake operation, the electronic device can reset the first charging protocol, i.e., reset the charging operation pin.

[0265] Step 703: Select the target charging protocol from multiple charging protocols based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol.

[0266] In some embodiments, the operation of an electronic device selecting a target charging protocol from multiple charging protocols based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol includes: acquiring a second charging protocol, which is one of multiple charging protocols, or the second charging protocol is a charging protocol that meets protocol selection criteria, the protocol selection criteria being used to filter charging protocols whose maximum supported charging power can enable fast charging of the electronic device; if the type of the second charging protocol is not a target type, determining the second charging protocol as the target charging protocol; if the second charging protocol is a target type, and the maximum charging power supported by the second charging protocol is greater than or equal to a second threshold corresponding to the second charging protocol, then determining the second charging protocol as the target charging protocol; if the second charging protocol is a target type, and the maximum charging power supported by the second charging protocol is less than its corresponding second threshold, and there are unacquired charging protocols, then performing the operation of acquiring the second charging protocol until all charging protocols have been acquired; if the second charging protocol is a target type, and the maximum charging power supported by the second charging protocol is less than its corresponding second threshold, and all charging protocols have been acquired, then determining the target charging protocol based on the maximum charging power supported by the acquired charging protocols. For example, this operation can refer to the above description. Figure 4 or Figure 6 The protocol selection process shown in this application will not be described in detail in this embodiment.

[0267] As an example, after determining the second charging protocol as the target charging protocol, that is, after determining the second charging protocol as the target charging protocol when the type of the second charging protocol is not the target type, or, when the second charging protocol is the target type, if the maximum charging power supported by the second charging protocol is greater than or equal to its corresponding second threshold, then after determining the second charging protocol as the target charging protocol, if the second charging protocol is not the charging protocol currently occupying the charging handshake pin, the electronic device can reset the charging protocol currently occupying the charging handshake pin, and then re-perform the charging handshake operation with the charger through the second charging protocol, and after the charging handshake is successful, perform the operation of step 704 below.

[0268] It is worth noting that by further determining the target charging protocol based on the maximum charging power and type supported by the charging protocol, the accuracy of determining the target charging protocol is improved.

[0269] In some embodiments, when the maximum charging power supported by all charging protocols has been obtained, the operation of the electronic device determining the target charging protocol based on the maximum charging power supported by the obtained charging protocols includes: if the maximum charging power supported by the second charging protocol is the obtained maximum power value, determining the second charging protocol as the target charging protocol; if the maximum charging power supported by the second charging protocol is not the currently obtained maximum power value, determining the third charging protocol as the target charging protocol, wherein the third charging protocol is the charging protocol corresponding to the obtained maximum power value.

[0270] In some embodiments, when the electronic device determines that the maximum charging power supported by the currently acquired charging protocol is the maximum power value that can be acquired, it can record the currently acquired charging protocol and the corresponding maximum charging power. If a new maximum power value is acquired, the new maximum power value can be used to overwrite the previously recorded power value. Of course, other recording methods may also exist, and this application embodiment does not specifically limit them.

[0271] It is worth noting that by selecting the charging protocol corresponding to the maximum power value as the target charging protocol, it is ensured that electronic devices can be charged through the maximum charging power, thereby improving the charging efficiency of electronic devices.

[0272] In some embodiments, if the target charging protocol is a third charging protocol, and the third charging protocol is not the charging protocol currently occupying the charging handshake pin, then the charging protocol currently occupying the charging handshake pin is reset; and the charging handshake operation is re-performed with the charger through the third charging protocol.

[0273] It is worth noting that by resetting the charging handshake pin, pin occupancy conflicts are avoided.

[0274] Step 704: Charge the electronic device according to the target charging protocol.

[0275] In some embodiments, when the target charging protocol is the second charging protocol, the electronic device can be fast-charged using the second charging protocol. When the target charging protocol is the third charging protocol, the electronic device can be fast-charged using the third charging protocol after a successful re-charging handshake operation with the charger via the third charging protocol.

[0276] As can be seen from the above, the electronic device may re-engage with the charger through the second charging protocol. Therefore, the electronic device needs to be fast-charged through the third charging protocol after the re-engagement with the charger through the second charging protocol is successful.

[0277] In this embodiment, after the electronic device is connected to the charger, it can acquire multiple charging protocols supported by the charger and determine the maximum charging power supported by each charging protocol. Based on the maximum charging power and protocol type of each charging protocol, a target charging protocol is selected from the multiple charging protocols. The electronic device is then charged according to the target charging protocol. Since the electronic device can determine the maximum charging power supported by each charging protocol, the optimal charging protocol can be selected based on the maximum charging power and protocol type of each protocol, thereby improving charging efficiency. Furthermore, after determining the optimal charging protocol, if the optimal charging protocol is not the currently occupied charging handshake pin, the electronic device can reset the charging protocol, thus resolving the problem of pin occupancy conflicts between charging protocols.

[0278] Figure 8 This is a schematic diagram of a charging control device provided in an embodiment of this application. The device can be implemented as part or all of an electronic device by software, hardware, or a combination of both. The computer device can be... Figure 1 The electronic device shown. See also Figure 8 The device includes: an acquisition module 801, a determination module 802, a selection module 803, and a charging module 804.

[0279] The acquisition module 801 is used to acquire multiple charging protocols supported between the electronic device and the charger after the electronic device is connected to the charger.

[0280] The determining module 802 is used to determine the maximum charging power supported by each of the multiple charging protocols;

[0281] Selection module 803 is used to select a target charging protocol from multiple charging protocols based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol.

[0282] The charging module 804 is used to charge electronic devices according to a target charging protocol.

[0283] In this embodiment, after the electronic device is connected to the charger, it can acquire multiple charging protocols supported by the charger and determine the maximum charging power supported by each charging protocol. Based on the maximum charging power and protocol type of each charging protocol, a target charging protocol is selected from the multiple charging protocols. The electronic device is then charged according to the target charging protocol. Since the electronic device can determine the maximum charging power supported by each charging protocol, the optimal charging protocol can be selected based on the maximum charging power and protocol type of each protocol, thereby improving charging efficiency. Furthermore, after determining the optimal charging protocol, if the optimal charging protocol is not the currently occupied charging handshake pin, the electronic device can reset the charging protocol, thus resolving the problem of pin occupancy conflicts between charging protocols.

[0284] It should be noted that the charging control device provided in the above embodiments is only illustrated by the division of the above functional modules when controlling charging. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0285] The functional units and modules in the above embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of the embodiments of this application.

[0286] The charging control device and the charging control method provided in the above embodiments belong to the same concept. The specific working process and technical effects of the units and modules in the above embodiments can be found in the method embodiments section, and will not be repeated here.

[0287] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0288] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A charging control method, characterized in that, When applied to electronic devices, the method includes: After the electronic device is connected to the charger, the multiple charging protocols supported between the electronic device and the charger are obtained; Determine the maximum charging power supported by each of the plurality of charging protocols; Based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol, a target charging protocol is selected from the plurality of charging protocols; The electronic device is charged according to the target charging protocol.

2. The method as described in claim 1, characterized in that, Determining the maximum charging power supported by each of the plurality of charging protocols includes: Each of the multiple charging protocols performs a charging handshake operation with the charger; During the charging handshake operation, the maximum charging power supported by the charging protocol used to perform the charging handshake operation is obtained.

3. The method as described in claim 1, characterized in that, Determining the maximum charging power supported by each of the plurality of charging protocols includes: Obtain a first charging protocol, wherein the first charging protocol is one of the plurality of charging protocols that has not undergone a charging handshake operation; A charging handshake operation is performed with the charger using the first charging protocol; During the charging handshake operation, the maximum charging power supported by the first charging protocol is obtained. If the first charging protocol meets the protocol selection conditions, the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation among the plurality of charging protocols is determined to be 0. The protocol selection conditions are used to filter the charging protocols for fast charging the electronic device.

4. The method as described in claim 3, characterized in that, Before determining that the maximum charging power supported by the charging protocol that has not undergone a charging handshake operation among the plurality of charging protocols is 0 when the first charging protocol meets the protocol selection conditions, the method further includes: If the charging handshake operation is successful via the first charging protocol, and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is not the target type, the first charging protocol is determined to meet the protocol selection condition; or... If the charging handshake operation is successful via the first charging protocol, and the maximum charging power supported by the first charging protocol is greater than 0, then if the type of the first charging protocol is the target type, and the maximum charging power supported by the first charging protocol is greater than or equal to the first threshold corresponding to the first charging protocol, then the first charging protocol is determined to meet the protocol selection condition; or... If the charging handshake operation is successfully performed through the first charging protocol, and the maximum charging power supported by the first charging protocol is greater than 0, if the first charging protocol is the target type, and the maximum charging power supported by the first charging protocol is less than the first threshold, and each charging protocol has performed the charging handshake operation, then the first charging protocol is determined to meet the protocol selection conditions.

5. The method as described in claim 3, characterized in that, After the charging handshake operation with the charger via the first charging protocol, the method further includes: If the first charging protocol does not meet the protocol selection conditions, the operation of obtaining the first charging protocol is performed until the first charging protocol meets the protocol selection conditions, or until each of the plurality of charging protocols has been obtained.

6. The method according to any one of claims 1-4, characterized in that, The step of selecting a target charging protocol from the plurality of charging protocols based on the maximum charging power supported by each charging protocol and the protocol type of each charging protocol includes: Obtain a second charging protocol, which is one of the plurality of charging protocols, or the second charging protocol is a charging protocol that meets the protocol selection criteria, which are used to filter charging protocols for fast charging the electronic device. If the type of the second charging protocol is not the target type, then the second charging protocol is determined to be the target charging protocol; If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is greater than or equal to the second threshold corresponding to the second charging protocol, then the second charging protocol is determined to be the target charging protocol. If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is less than the second threshold, and there are unacquired charging protocols, then the operation of acquiring the second charging protocol is performed until all charging protocols have been acquired. If the second charging protocol is the target type, and the maximum charging power supported by the second charging protocol is less than the second threshold, and the maximum charging power supported by all charging protocols has been obtained, then the target charging protocol is determined based on the maximum charging power supported by the obtained charging protocols.

7. The method as described in claim 6, characterized in that, Having obtained the maximum charging power supported by all charging protocols, the target charging protocol is determined based on the obtained maximum charging power supported by the charging protocols, including: If the maximum charging power supported by all charging protocols has been obtained, and the maximum charging power supported by the second charging protocol is the obtained maximum power value, then the second charging protocol is determined to be the target charging protocol. If the maximum charging power supported by all charging protocols has been obtained, and the maximum charging power supported by the second charging protocol is not the obtained maximum power value, then the third charging protocol is determined to be the target charging protocol, and the third charging protocol is the charging protocol corresponding to the obtained maximum power value.

8. The method as described in claim 7, characterized in that, The target charging protocol is the third charging protocol; Before charging the electronic device according to the target charging protocol, the method further includes: If the third charging protocol is not the charging protocol currently occupying the charging handshake pin, the charging protocol currently occupying the charging handshake pin is reset. The third charging protocol is used to re-engage the charger with a charging handshake operation. Charging the electronic device according to the target charging protocol includes: After a successful charging handshake, the electronic device is quickly charged using the third charging protocol.

9. An electronic device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, the electronic device performs the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-8.

11. A computer program product, characterized in that, Includes a computer program, which, when run, causes the method as described in any one of claims 1-8 to be performed.