Charging protocol determination method and device, computer equipment and storage medium

By obtaining the power of the charging protocol supported by the power adapter and electronic devices, and determining the target charging protocol, the problem of inaccurate determination of the charging protocol in traditional methods is solved, and charging efficiency and safety is improved.

CN119171555APending Publication Date: 2024-12-20GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310728755.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The traditional charging protocol determination method has the problem of inaccurate determination, and the inability to accurately select the appropriate charging protocol, resulting in limited charging efficiency and safety.

Method used

By obtaining the power of each charging protocol supported by the power adapter and electronic device, determine the target charging power and the target charging protocol to which it belongs, ensure that the protocol supported by both the power adapter and electronic device are charged.

Benefits of technology

The charging protocol is more accurately determined, which improves charging efficiency and security, and avoids the reduction in charging speed and security risks caused by protocol mismatch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119171555A_ABST
    Figure CN119171555A_ABST
Patent Text Reader

Abstract

The invention relates to a charging protocol determination method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: under the condition that the electronic equipment is electrically connected with an external power adapter, acquiring first charging power of each first charging protocol supported by the power adapter; determining target charging power based on the first charging power of each first charging protocol and second charging power of each second charging protocol supported by the electronic equipment; determining a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic equipment and the power adapter, and the power adapter is used for charging the electronic equipment by adopting the target charging protocol. By adopting the method, the charging protocol can be determined more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of charging, and in particular to a charging protocol determination method, device, computer equipment, and computer-readable storage medium. Background Art

[0002] With the rapid development of charging technology, there have been significant improvements in charging speed, charging safety and intelligent charging management. Fast charging technology has also emerged, which has been widely recognized by users and has become a standard feature of smart devices such as mobile phones. During the charging process, the adapter can determine a charging protocol from multiple charging protocols and use the determined charging protocol for charging.

[0003] However, the traditional method of determining the charging protocol usually selects a fixed charging protocol or randomly determines the charging protocol, which has the problem of inaccurate determination of the charging protocol. Summary of the invention

[0004] Embodiments of the present application provide a charging protocol determination method, device, electronic device, computer-readable storage medium, and computer program product, which can more accurately determine the charging protocol.

[0005] In a first aspect, the present application provides a charging protocol determination method, which is applied to an electronic device. The method comprises:

[0006] When the electronic device is electrically connected to an external power adapter, obtaining a first charging power of each first charging protocol supported by the power adapter;

[0007] Determining a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device;

[0008] Determine a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0009] In a second aspect, the present application also provides a charging protocol determination device, which is applied to an electronic device. The device includes:

[0010] an acquisition module, configured to acquire, when the electronic device is electrically connected to an external power adapter, a first charging power of each first charging protocol supported by the power adapter;

[0011] a target charging power determination module, configured to determine a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device;

[0012] A target charging protocol determination module is used to determine a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0013] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0014] When the electronic device is electrically connected to an external power adapter, obtaining a first charging power of each first charging protocol supported by the power adapter;

[0015] Determining a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device;

[0016] Determine a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0017] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0018] When the electronic device is electrically connected to an external power adapter, obtaining a first charging power of each first charging protocol supported by the power adapter;

[0019] Determining a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device;

[0020] Determine a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0021] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0022] When the electronic device is electrically connected to an external power adapter, obtaining a first charging power of each first charging protocol supported by the power adapter;

[0023] Determining a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device;

[0024] Determine a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0025] The above-mentioned charging protocol determination method, device, electronic device, computer-readable storage medium and computer program product, when the electronic device and the external power adapter are electrically connected, obtain the first charging power of each first charging protocol supported by the power adapter. Then, based on the first charging power of each first charging protocol supported by the power adapter and the second charging power of each second charging protocol supported by the electronic device, the target charging power can be accurately determined, so that the target charging protocol to which the target charging power belongs can be accurately determined. The target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter can use this more accurate target charging protocol to charge the electronic device.

[0026] Embodiments of the present application provide a charging protocol determination method, device, power adapter, computer-readable storage medium, and computer program product, which can more accurately determine the charging protocol.

[0027] In a sixth aspect, the present application provides a charging protocol determination method, which is applied to a power adapter. The method comprises:

[0028] When an external electronic device is electrically connected to the power adapter, the first charging power of each first charging protocol supported by the power adapter is obtained, and the first charging power of each first charging protocol is sent to the electronic device, so that the electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter;

[0029] The target charging protocol sent by the electronic device is received, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

[0030] In a seventh aspect, the present application provides a charging protocol determination device, which is applied to a power adapter. The device includes:

[0031] a sending module, configured to obtain, when an external electronic device is electrically connected to the power adapter, a first charging power of each first charging protocol supported by the power adapter, and send the first charging power of each first charging protocol to the electronic device, so that the electronic device determines a target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter;

[0032] The receiving module is used to receive the target charging protocol sent by the electronic device, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

[0033] In an eighth aspect, the present application further provides a power adapter. The power adapter includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0034] When an external electronic device is electrically connected to the power adapter, the first charging power of each first charging protocol supported by the power adapter is obtained, and the first charging power of each first charging protocol is sent to the electronic device, so that the electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter;

[0035] The target charging protocol sent by the electronic device is received, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

[0036] In a ninth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0037] When an external electronic device is electrically connected to the power adapter, the first charging power of each first charging protocol supported by the power adapter is obtained, and the first charging power of each first charging protocol is sent to the electronic device, so that the electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter;

[0038] The target charging protocol sent by the electronic device is received, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

[0039] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0040] When an external electronic device is electrically connected to the power adapter, the first charging power of each first charging protocol supported by the power adapter is obtained, and the first charging power of each first charging protocol is sent to the electronic device, so that the electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter;

[0041] The target charging protocol sent by the electronic device is received, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

[0042] The above-mentioned charging protocol determination method, device, power adapter, computer-readable storage medium and computer program product, when an external electronic device and a power adapter are electrically connected, obtain the first charging power of each first charging protocol supported by the power adapter, and send the first charging power of each first charging protocol to the electronic device, so that the electronic device can more accurately determine the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, thereby more accurately determining the target charging protocol to which the target charging power belongs, and the target charging protocol is a charging protocol supported by both the electronic device and the power adapter; then, the power adapter receives the target charging protocol sent by the electronic device, and can use the more accurate target charging protocol to charge the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 A diagram showing an application environment of a charging protocol determination method in one embodiment;

[0045] Figure 2 A flowchart of a method for determining a charging protocol in one embodiment;

[0046] Figure 3 A flowchart of a method for determining a charging protocol in another embodiment;

[0047] Figure 4 A flowchart of a method for determining a charging protocol in another embodiment;

[0048] Figure 5 A flowchart of a method for determining a charging protocol in another embodiment;

[0049] Figure 6 A flowchart of a method for determining a charging protocol in another embodiment;

[0050] Figure 7 It is a structural block diagram of a charging protocol determination device in one embodiment;

[0051] Figure 8 It is a structural block diagram of a charging protocol determination device in another embodiment;

[0052] Fig. 9 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] The charging protocol determination method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. When the electronic device 102 is electrically connected to the external power adapter 104, the first charging power of each first charging protocol supported by the power adapter 104 is obtained; based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device 102, the target charging power is determined; the target charging protocol to which the target charging power belongs is determined; the target charging protocol is a charging protocol supported by both the electronic device 102 and the power adapter 104, and the power adapter 104 is used to charge the electronic device 102 using the target charging protocol.

[0055] The electronic device 102 may be a terminal or a server; the terminal may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices; IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, smart cars, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

[0056] The power adapter 104 is a power supply conversion device for small portable electronic devices and electronic appliances, and is generally composed of components such as a housing, a transformer, an inductor, a capacitor, a control IC, and a PCB board. The power adapter can be a fixed power adapter or a mobile power adapter. A fixed power adapter can be a power supply and a charging cable fixed to the wall, and a mobile power adapter can be a mobile power bank, etc.

[0057] The electronic device and the power adapter are electrically connected, either through a physical charging cable or a wireless charging connection.

[0058] In one embodiment, Figure 2 As shown, a charging protocol determination method is provided, and the method is applied to Figure 1 The electronic device in the example is used to illustrate, and the following steps are included:

[0059] Step S202: When the electronic device is electrically connected to an external power adapter, obtain a first charging power of each first charging protocol supported by the power adapter.

[0060] The first charging protocol is a charging protocol supported by the power adapter. Optionally, the first charging protocol includes at least one of the UFCS (Universal Fast Charging Specification, terminal fusion fast charging technology) charging protocol, the PPS (Programmable Power Supply, a fast charging technical specification) charging protocol and the SVOOC (SUPERVOOC) charging protocol; the first charging protocol may also include other charging protocols, such as the QC fast charging protocol.

[0061] The first charging power is the charging power when the first charging protocol is used for charging. The first charging power may be the rated power, that is, the maximum charging power of the first charging protocol when charging. Exemplarily, the first charging power of the power adapter supporting the UFCS charging protocol is 150W (watts), the first charging power supporting the PPS charging protocol is 120W, and the first charging power supporting the SVOOC charging protocol is 65W.

[0062] Optionally, when the electronic device is electrically connected to an external power adapter, the electronic device sends a power request (get power info command) to the power adapter; and receives the first charging protocols supported by the power adapter and the first charging power of each first charging protocol sent by the power adapter in response to the power request.

[0063] Optionally, when the electronic device is electrically connected to an external power adapter, the electronic device sends a power request (get power info command) to the power adapter; receives a power information packet sent by the power adapter in response to the power request, parses the power information packet, and obtains each first charging protocol supported by the power adapter and the first charging power of each first charging protocol.

[0064] Optionally, when the electronic device is electrically connected to an external power adapter, if the power adapter passes authorization verification, each first charging protocol supported by the power adapter and the first charging power of each first charging protocol are obtained.

[0065] Step S204: determining a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device.

[0066] The second charging protocol is a charging protocol supported by the electronic device. Optionally, the second charging protocol includes at least one of the UFCS (Universal Fast Charging Specification, terminal fusion fast charging technology) charging protocol, the PPS (Programmable Power Supply, a fast charging technical specification) charging protocol and the SVOOC (SUPERVOOC) charging protocol; the second charging protocol may also include other charging protocols, such as the QC fast charging protocol.

[0067] Optionally, each second charging protocol supported by the electronic device and each first charging protocol supported by the power adapter may be the same, may be different, or may be partially the same and partially different. Optionally, both the electronic device and the power adapter support the UFCS charging protocol.

[0068] Exemplarily, the power adapter and the electronic device both support the UFCS charging protocol, the PPS charging protocol, and the SVOOC charging protocol; or, the power adapter supports the UFCS charging protocol, and the electronic device supports the UFCS charging protocol and the PPS protocol; or, the power adapter supports the PPS charging protocol, and the electronic device supports the UFCS charging protocol.

[0069] The second charging power is the charging power when the second charging protocol is used for charging. The second charging power may be a rated power, that is, the maximum charging power of the second charging protocol when charging. Exemplarily, the second charging power of the electronic device supporting the UFCS charging protocol is 80W (watts), the second charging power supporting the PPS charging protocol is 30W, and the second charging power supporting the SVOOC charging protocol is 65W.

[0070] The target charging power is the maximum charging power of the power adapter for charging the electronic device. Optionally, the target charging power is one of the first charging powers or the second charging powers.

[0071] Optionally, the electronic device obtains each second charging protocol supported by the electronic device itself and the second charging power of each second charging protocol, matches the first charging power of each first charging protocol supported by the power adapter with the second charging power of each second charging protocol supported by the electronic device, and determines the target charging power based on the matching result.

[0072] The matching result may be each third charging protocol supported by both the electronic device and the power adapter, or may be the third charging power of each third charging protocol supported by both the electronic device and the power adapter, but is not limited thereto.

[0073] Optionally, the electronic device compares each first charging protocol supported by the power adapter with each second charging protocol supported by the electronic device, determines a charging protocol supported by both the electronic device and the power adapter, and determines a target charging power from the first charging power and the second charging power respectively corresponding to the charging protocols supported by both the electronic device and the power adapter.

[0074] Step S206, determining a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0075] Among them, the target charging protocol is the target protocol for the power adapter to charge the electronic device. Exemplarily, the power adapter supports the UFCS charging protocol, the PPS charging protocol and the SVOOC charging protocol, the first charging power of the UFCS charging protocol is 50W, the first charging power of the PPS charging protocol is 50W, and the first charging power of the SVOOC charging protocol is 40W; the electronic device supports the UFCS charging protocol, the PPS charging protocol and the SVOOC charging protocol, the second charging power of the UFCS charging protocol is 30W, the second charging power of the PPS charging protocol is 10W, and the second charging power of the SVOOC charging protocol is 20W; based on the first charging power of each first charging protocol supported by the power adapter and the second charging power of each second charging protocol supported by the electronic device, the target charging power is determined to be the second charging power of 30W, then the target charging protocol to which the target charging power belongs is the UFCS charging protocol.

[0076] It can be understood that the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, that is, the target charging protocol is one of the first charging protocols supported by the power adapter and one of the second charging protocols supported by the electronic device, and the first charging protocols supported by the power adapter and the second charging protocols supported by the electronic device have at least partially identical charging protocols.

[0077] Optionally, after the electronic device determines the target charging protocol to which the target charging power belongs, the target charging protocol is sent to the power adapter to instruct the power adapter to charge the electronic device using the target charging protocol included in the charging instruction.

[0078] It is understandable that, when the power adapter uses the target charging protocol to charge the electronic device, the charging power is less than or equal to the target charging power.

[0079] Optionally, the first charging protocol and the second charging protocol are both charging protocols of the UFCS mode of terminal fusion fast charging technology, and the charging protocols of the UFCS mode include the UFCS charging protocol, the PPS charging protocol and the SVOOC charging protocol. Then the target charging protocol is also the charging protocol of the UFCF mode, and the power adapter can be a UFCS adapter, which can avoid the problem of the power adapter using the ordinary charging protocol to charge the electronic device and reduce the charging speed. Among them, the charging power of the UFCS mode charging protocol is greater than the charging power of the ordinary charging protocol.

[0080] The above-mentioned charging protocol determination method obtains the first charging power of each first charging protocol supported by the power adapter when the electronic device is electrically connected to the external power adapter. Then, based on the first charging power of each first charging protocol supported by the power adapter and the second charging power of each second charging protocol supported by the electronic device, the target charging power can be accurately determined, thereby accurately determining the target charging protocol to which the target charging power belongs. The target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter can use this more accurate target charging protocol to charge the electronic device.

[0081] When the power adapter is a UFCS adapter, the optimal target charging protocol for charging between the electronic device and the power adapter is determined to avoid compatibility issues with the UFCS adapter caused by the use of the normal charging protocol instead of the fast charging protocol; and, the target charging protocol determined for the UFCS adapter is the PPS charging protocol or the SVOOC charging protocol, which can avoid the electronic device and the power adapter from having to re-handshake and communicate for the PPS charging protocol or the SVOOC charging protocol, thereby saving approximately 1 second and improving charging efficiency.

[0082] In one embodiment, based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, a target charging power is determined, including: based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, a third charging power of each third charging protocol is determined; each third charging protocol is a charging protocol supported by both the electronic device and the power adapter; and the target charging power is determined from the third charging power of each third charging protocol.

[0083] Among them, the third charging protocol is a charging protocol supported by both the electronic device and the power adapter. The third charging power is the charging power when the third charging protocol is used for charging. It can be understood that both the electronic device and the power adapter support the third charging protocol, and the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter can be the same or different.

[0084] Optionally, the electronic device matches each first charging protocol supported by the power adapter and each second charging protocol supported by the electronic device to determine each third charging protocol supported by both the electronic device and the power adapter; for each third charging protocol, the charging power corresponding to the third charging protocol supported by both the electronic device and the power adapter is used as the third charging power of the third charging protocol.

[0085] In other optional embodiments, the electronic device may also determine the third charging power of the third charging protocol in other ways, which are not limited here.

[0086] Optionally, the electronic device determines a maximum third charging power from the third charging powers of the third charging protocols as the target charging power.

[0087] Optionally, the electronic device determines the second largest third charging power as the target charging power from among the third charging powers of the third charging protocols.

[0088] Optionally, the electronic device may also determine the target charging power in other ways, which are not limited here.

[0089] In this embodiment, the electronic device determines the third charging powers of each third charging protocol supported by both the electronic device and the power adapter based on the first charging powers of each first charging protocol supported by the power adapter and the second charging powers of each second charging protocol supported by the electronic device, thereby accurately determining the target charging power from the third charging powers of each third charging protocol supported by both the electronic device and the power adapter.

[0090] In one embodiment, Figure 3 As shown, another charging protocol determination method is provided, which is applied to Figure 1 The electronic device in the example is used to illustrate, and the following steps are included:

[0091] Step S302: When the electronic device is electrically connected to an external power adapter, obtain a first charging power of each first charging protocol supported by the power adapter.

[0092] Step S304: Based on the first charging protocols and the second charging protocols supported by the electronic device, determine the third charging protocols supported by both the electronic device and the power adapter.

[0093] Optionally, the electronic device matches each first charging protocol supported by the power adapter with each second charging protocol supported by the electronic device to determine each third charging protocol supported by both the electronic device and the power adapter.

[0094] Exemplarily, if the first charging protocols supported by the power adapter include the UFCS charging protocol, that is, A_UFCS.support=true, and the second charging protocols supported by the electronic device include the UFCS charging protocol, that is, P_UFCS.support=true, then A_UFCS.support==P_UFCS.support, indicating that both the electronic device and the power adapter support the UFCS charging protocol.

[0095] Step S306: for each third charging protocol, determine the third charging power of the third charging protocol based on the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter.

[0096] Optionally, based on the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter, a third charging power of the third charging protocol is determined, including: determining the smaller charging power as the third charging power of the third charging protocol from the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter.

[0097] Exemplarily, the third charging protocol supported by both the electronic device and the power adapter includes the UFCS charging protocol. The charging power of the UFCS charging protocol supported by the electronic device is 60W, and the charging power of the UFCS charging protocol supported by the power adapter is 120W. Then 60W is determined as the third charging power of the UFCS charging protocol.

[0098] It is understandable that both the electronic device and the power adapter support the third charging protocol. Determining a smaller charging power as the third charging power of the third charging protocol can avoid the third charging power being larger and exceeding the charging power of the electronic device or the power adapter, thereby damaging the components of the electronic device or the power adapter.

[0099] Optionally, the electronic device may also determine a smaller charging power from the charging power of a third charging protocol supported by the electronic device and the charging power of a third charging protocol supported by the power adapter, and reduce the smaller charging power to obtain the target charging power.

[0100] Optionally, the electronic device may also average the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter, and use the average value as the third charging power of the third charging protocol.

[0101] In other optional embodiments, the electronic device may also determine the third charging power of the third charging protocol in other ways, which are not limited here.

[0102] Step S308: determining a target charging power from the third charging powers of the respective third charging protocols.

[0103] Step S310, determining a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0104] In this embodiment, the electronic device determines the third charging protocol supported by both the electronic device and the power adapter based on each first charging protocol supported by the power adapter and each second charging protocol supported by the electronic device. For each third charging protocol, the electronic device accurately determines the third charging power of the third charging protocol supported by both the electronic device and the power adapter based on the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter. Further, the electronic device determines the smaller charging power as the third charging power of the third charging protocol from the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter, which can avoid the third charging power being larger and exceeding the charging power of the electronic device or the power adapter, thereby damaging the components of the electronic device or the power adapter, and more accurately determining the third charging power.

[0105] In one embodiment, the target charging power is determined from the third charging powers of each third charging protocol, including: for each third charging protocol, adding the third charging power of the third charging protocol as an element part to the power configuration structure array; after adding the third charging power of each third charging protocol as an element part to the power configuration structure array, traversing each element in the power configuration structure array, and determining the target charging power based on the third charging power in each element.

[0106] The power configuration structure array is a structure array used to calculate the target charging power. The power configuration array may include at least one element, each element including a third charging power of a third charging protocol.

[0107] Optionally, for each third charging protocol, the electronic device adds the third charging power of the third charging protocol as an element to the power configuration structure array, that is, the third charging power of one third charging protocol is taken as an element.

[0108] Optionally, for each third charging protocol, the electronic device adds the third charging power of the third charging protocol as part of an element to the power configuration structure array; the element also includes a matching result of the charging power of the third charging protocol and the third charging protocol.

[0109] Among them, the matching result of the charging power of the third charging protocol is the matching result between the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter.

[0110] If the charging power of the third charging protocol supported by the power adapter is greater than or equal to the charging power of the third charging protocol supported by the electronic device, it means that the power supported by the power adapter can meet the standard charging power required by the electronic device. The matching result indicates that the charging power of the third charging protocol matches, and the charging power of the third charging protocol supported by the electronic device is used as the third charging power of the third charging protocol; if the charging power of the third charging protocol supported by the power adapter is less than the charging power of the third charging protocol supported by the electronic device, it means that the power supported by the power adapter cannot meet the standard charging power required by the electronic device. The matching result indicates that the charging power of the third charging protocol does not match, and the charging power of the third charging protocol supported by the power adapter is used as the third charging power of the third charging protocol.

[0111] Exemplarily, the third charging protocol supported by both the electronic device and the power adapter is the UFCS charging protocol, that is, protocol = UFCS; the charging power of the UFCS charging protocol supported by the electronic device is P_UFCS.power, and the charging power of the UFCS charging protocol supported by the power adapter is A_UFCS.power, and the electronic device compares P_UFCS.power and A_UFCS.power; if A_UFCS.power is greater than or equal to P_UFCS.power, then power_match = true, indicating that the charging powers of the third charging protocol match, and the third charging powers of each third charging protocol supported by both the electronic device and the power adapter are power_value = P_UFCS.power, so the electronic device compares the third charging protocol, the matching result of the charging power of the third charging protocol, and the third charging value of the third charging protocol. The electric power is added to the power configuration structure array as the element {Protocol=UFCS, power_match=true, power_value=P_UFCS.power}; if A_UFCS.power is less than P_UFCS.power, power_match=false, indicating that the charging power of the third charging protocol does not match, and the third charging power of each third charging protocol supported by both the electronic device and the power adapter is power_value=A_UFCS.power. Therefore, the electronic device adds the third charging protocol, the matching result of the charging power of the third charging protocol and the third charging power of the third charging protocol as the element {Protocol=UFCS, power_match=false, power_value=P_UFCS.power} to the power configuration structure array.

[0112] In this embodiment, after the electronic device adds the third charging power of each third charging protocol as an element part to the power configuration structure array, it traverses each element in the power configuration structure array, and can accurately determine the target charging power based on the third charging power contained in each element in the power configuration structure array.

[0113] In one embodiment, Figure 4 As shown, another charging protocol determination method is provided, which is applied to Figure 1 The electronic device in the example is used to illustrate, and the following steps are included:

[0114] Step S402: When the electronic device is electrically connected to an external power adapter, obtain a first charging power of each first charging protocol supported by the power adapter.

[0115] Step S404, determining the third charging power of each third charging protocol based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device; each third charging protocol is a charging protocol supported by both the electronic device and the power adapter.

[0116] Step S406: for each third charging protocol, add the third charging power of the third charging protocol as an element part to the power configuration structure array.

[0117] Step S408, after adding the third charging power of each third charging protocol as an element part to the power configuration structure array, traverse each element in the power configuration structure array, take the preset power initial value as the fourth charging power, and judge the size between the third charging power in the current element traversed and the current fourth charging power.

[0118] The initial power value can be set as required. For example, the initial power value can be set to 0, 1W or 2W.

[0119] Optionally, the initial power value is less than a minimum value of a preset charging power range; the preset charging power range is a power range in which the power adapter charges the electronic device.

[0120] Step S410: If the third charging power in the current element being traversed is less than the fourth charging power, continue to traverse the next element in the power configuration structure array.

[0121] Step S412: If the third charging power in the current element being traversed is greater than or equal to the fourth charging power, the third charging power in the current element is used as the new fourth charging power, and the third charging power in the next element is traversed continuously. The process returns to the step of judging the difference between the third charging power in the current element being traversed and the current fourth charging power, until all elements in the power configuration structure array are traversed, and the fourth charging power obtained is used as the target charging power.

[0122] Optionally, the electronic device determines a maximum third charging power from among the third charging powers as the target charging power.

[0123] It can be understood that the third charging power contained in each element in the power configuration structure array is the third charging power of the third charging protocol supported by both the electronic device and the power adapter. The electronic device can determine the maximum third charging power as the target charging power among the third charging powers of each third charging protocol. Then, when the power adapter uses the target charging protocol to which the target charging power belongs to charge the electronic device, it can use a larger charging power to charge and improve the charging efficiency.

[0124] Optionally, the electronic device sets result_protocol to be initialized to null, result_power to be initialized to 0, and the element index index to be initialized to 0. The electronic device traverses the power configuration structure array power_config. If power_config[index].power_value<result_power, indicating that the third charging power power_value of the current element index is greater than or equal to result_power, then the element index is increased by 1, and the traversal of the next element in the power configuration structure array is continued; if power_config[index].power_value>=result_power, indicating that the third charging power power_value of the current element index is greater than or equal to result_power, then result_power is updated, and the third charging power power_value in the current element is used as the new result_power, and at the same time, the charging protocol Result_protocol=Power_config[index].prtocol to which the third charging power of the current element index belongs is recorded, until all elements of the power configuration structure array power_config are traversed, and result_power is obtained as the target charging power, and the charging protocol result_protocol to which the result_power belongs is used as the target charging protocol.

[0125] Step S414, determining a target charging protocol to which the target charging power belongs; both the electronic device and the power adapter support the target charging protocol, and the power adapter is used to charge the electronic device using the target charging protocol.

[0126] In this embodiment, the electronic device traverses each element in the power configuration structure array, and determines the size between the third charging power in the current traversed element and the current fourth charging power. If the third charging power is less than the fourth charging power, the next element is traversed. If the third charging power is greater than or equal to the fourth charging power, the current third charging power is used as the new fourth charging power. Therefore, the maximum third charging power can be determined as the target charging power among the third charging powers of each element in the power configuration structure array. When the power adapter uses the target charging protocol to which the target charging power belongs to charge the electronic device, a larger charging power can be used, thereby improving the charging efficiency.

[0127] In one embodiment, when the electronic device and the external power adapter are electrically connected, the first charging power of each first charging protocol supported by the power adapter is obtained, including: when the electronic device and the external power adapter are electrically connected, if the power adapter passes the authorization verification, a power request is sent to the power adapter to instruct the power adapter to send the first charging power of each supported first charging protocol to the electronic device; and the first charging power of each first charging protocol sent by the power adapter is received.

[0128] It is understandable that there are not only genuine power adapters on the market, but also counterfeit power adapters. Counterfeit power adapters often have safety risks, mismatches in charging protocols and charging speeds, etc. when charging electronic devices. Therefore, it is necessary to authorize and verify the power adapter to improve the safety of charging.

[0129] Optionally, when the electronic device is electrically connected to an external power adapter, if the electronic device has an authorization identifier and passes the authorization verification of a specified brand identifier, indicating that the power adapter is a genuine product authorized by the specified brand identifier, then a power request private to the specified brand identifier is sent to the power adapter to instruct the power adapter to send the first charging power of each first charging protocol supported by the electronic device.

[0130] Optionally, the above method also includes: when the electronic device is electrically connected to an external power adapter, obtaining device information of the power adapter; if the device information indicates that the power adapter has an authorization identifier, sending a verification command to the power adapter to perform authorization verification on the power adapter.

[0131] The device information of the power adapter includes at least one of an authorization identification, a production time or a charging parameter of the power adapter.

[0132] Optionally, when the electronic device is electrically connected to an external power adapter, the electronic device sends a device information request to the power adapter to instruct the power adapter to obtain the device information of the power adapter and send the device information to the electronic device; the device information of the power adapter is parsed, and if the device information indicates that the power adapter has an authorization identifier, a verification command is sent to the power adapter to perform authorization verification on the power adapter.

[0133] Optionally, the power adapter has an authorization mark, indicating that the power adapter is a UFCS adapter; the power adapter does not have an authorization mark, indicating that the power adapter is not a UFCS adapter; wherein, the UFCS adapter supports the UFCS charging protocol, the PPS charging protocol and the SVOOC charging protocol.

[0134] Optionally, the electronic device sends a verification command to the power adapter to instruct the power adapter to obtain verification information and send the verification information to the electronic device; and performs authorization verification on the power adapter based on the verification information. The verification information may include information such as a random number of the power adapter.

[0135] It can be understood that the device information of the power adapter includes a vendor identification code, and the vendor identification code includes bit30 field and bit31 field. If bit30 field and bit31 field are 01, it means that the power adapter is authorized for production by the designated brand manufacturer, that is, the power adapter has an authorization mark; if bit30 field and bit31 field are not 01, it means that the power adapter is not authorized for production by the designated brand manufacturer, that is, the power adapter does not have an authorization mark.

[0136] However, the vendor identification code in the device information of the power adapter is easy to set. Some factories can set the bit30 field and bit31 field of the vendor identification code in the power adapter that is not authorized to be produced to 01. Therefore, after determining that the power adapter has an authorized identification, it is necessary to verify the authorization of the power adapter to more accurately identify whether the power adapter is an adapter authorized to be produced by a designated brand manufacturer.

[0137] Optionally, the electronic device sends an authentication command Verify_Request to the power adapter; wherein the authentication command Verify_Request includes a 16-byte random number A generated by the mobile phone; the electronic device responds to the service information request sent by the power adapter after receiving the authentication command, and sends the device information of the electronic device to the power adapter to instruct the power adapter to generate a first key corresponding to the information of the electronic device, and generates a 16-byte random number B, executes the authentication algorithm sha256 on the random number A, the first key and the random number B to obtain an encrypted number S, and sends a verification response packet to the electronic device; the verification response packet contains the random number B and the 32-byte encrypted number S; the electronic device uses the random number B, the random number A and the second key to execute the authentication algorithm sha256 to obtain an encrypted number S1; if the encrypted number S and the encrypted number S1 are the same, that is, the first key and the second key are the same, the power adapter passes the authorization verification; if the encrypted number S and the encrypted number S1 are not the same, that is, the first key and the second key are different, the power adapter fails the authorization verification.

[0138] Optionally, if the device information of the power adapter indicates that the power adapter does not have an authorization mark, indicating that the power adapter is not an adapter of a designated brand but an adapter of a third-party brand, a third-party charging protocol is determined and sent to the power adapter so that the power adapter uses the third-party charging protocol to charge the electronic device. The charging power of the third-party charging protocol is less than the charging power of the target charging protocol.

[0139] In this embodiment, when the electronic device is electrically connected to an external power adapter, if the power adapter passes the authorization verification, a power request is sent to the power adapter to obtain the first charging power of each first charging protocol supported by the power adapter, thereby improving the safety of charging when it is determined that the power adapter passes the authorization verification.

[0140] In one embodiment, the first charging protocol and the second charging protocol are both charging protocols of the terminal integrated fast charging technology UFCS mode; the above method also includes: if the power adapter fails to pass the authorization verification, determining a charging protocol other than the UFCS mode, and the power adapter is used to charge the electronic device using a charging protocol other than the UFCS mode.

[0141] Optionally, if the power adapter fails the authorization verification, indicating that the power adapter is a counterfeit product, is not a UFCS adapter that supports the UFCS mode, and cannot use the UFCS mode charging protocol, the electronic device determines a non-UFCS mode charging protocol and sends the non-UFCS mode charging protocol to the power adapter to instruct the power adapter to use the non-UFCS mode charging protocol to charge the electronic device.

[0142] Optionally, the dedicated charging port (DCP) of the power adapter is of Type-C type; when the electronic device and the power adapter are electrically connected, the electronic device identifies the dedicated charging port of the power adapter, in which D+D- are connected together (short-circuited), and the electronic device pulls D+ low after D+ sends a string of pulses to the power adapter; if the power adapter is not a UFCS adapter, no response is made, that is, the level of D+ will not be raised; if the power adapter is a UFCS adapter, the short circuit of D+D- is disconnected, and D- is pulled high, and the electronic device detects a response signal that the level of D+ is raised, and sends a ping control command to the power adapter; upon receiving the response signal of the power adapter in response to the ping control command, the power adapter enters the UFCS mode, and the electronic device enters the UFCS mode at the same time.

[0143] Optionally, if the power adapter fails the authorization verification, the electronic device exits the UFCS mode, and the electronic device sends a mode exit instruction and a non-UFCS mode charging protocol to the power adapter to instruct the power adapter to exit the UFCS mode and use a non-UFCS mode charging protocol to charge the electronic device.

[0144] In one embodiment, Figure 5 As shown, a charging protocol determination method is provided, and the method is applied to Figure 1 The following steps are used as an example to illustrate the power adapter in the figure:

[0145] Step S502, when the external electronic device and the power adapter are electrically connected, obtain the first charging power of each first charging protocol supported by the power adapter, and send the first charging power of each first charging protocol to the electronic device, so that the electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter.

[0146] Optionally, when an external electronic device and a power adapter are electrically connected, the power adapter obtains the first charging power of each first charging protocol supported by the power adapter in response to a power request sent by the electronic device, and sends the first charging power of each first charging protocol supported by the power adapter to the electronic device.

[0147] Optionally, when an external electronic device and a power adapter are electrically connected, the first charging power of each first charging protocol supported by the power adapter is obtained, including: when the electronic device and the power adapter are electrically connected, if the power adapter passes the authorization verification, receiving a power request sent by the electronic device; in response to the power request, obtaining the first charging power of each first charging protocol supported by the power adapter.

[0148] Optionally, when the electronic device and the power adapter are electrically connected, the power adapter obtains the device information of the power adapter in response to a device information request sent by the electronic device, and sends the device information of the power adapter to the electronic device, so that the electronic device performs authorization verification on the power adapter based on the device information.

[0149] Step S504: receiving a target charging protocol sent by the electronic device, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

[0150] Optionally, the power adapter sends a target charging protocol to the electronic device, obtains a target charging power in the target charging protocol, and uses the target charging protocol to charge the electronic device at a fifth charging power; the fifth charging power is less than or equal to the target charging power.

[0151] The above-mentioned charging protocol determination method, when an external electronic device and a power adapter are electrically connected, obtains the first charging power of each first charging protocol supported by the power adapter, and sends the first charging power of each first charging protocol to the electronic device, so that the electronic device can more accurately determine the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, thereby more accurately determining the target charging protocol to which the target charging power belongs, and the target charging protocol is a charging protocol supported by both the electronic device and the power adapter; then, the power adapter receives the target charging protocol sent by the electronic device, and can use the more accurate target charging protocol to charge the electronic device.

[0152] In one embodiment, Figure 6 As shown, a charging protocol determination method is provided, and the method is applied to Figure 1 Take the electronic device in as an example, including the following steps: the electronic device is electrically connected to the external power adapter, the electronic device initializes and records the relevant variables of the power adapter attributes; the relevant variables of the initialized power adapter attributes are as follows: A_UFCS: support = false, power = -1; A_PPS: support = false, power = -1; A_SVOOC: support = false, power = -1; where Support indicates that each charging protocol related to the power adapter is assigned a value of false, that is, the power adapter does not support each charging protocol by default, and the power of each charging protocol is unknown, so power is set to -1. (A is the abbreviation of adapter, indicating the power adapter end)

[0153] The electronic device sends a device information request to the power adapter to obtain the device information of the power adapter; the device information of the power adapter is parsed to determine whether the power adapter has an authorization identifier; if the power adapter does not have an authorization identifier, a third-party charging protocol is determined and the third-party charging protocol is sent to the power adapter to instruct the power adapter to use the third-party charging protocol to charge the electronic device.

[0154] If the power adapter has an authorization identifier, the electronic device will perform authorization verification on the power adapter; if the power adapter is not authorized, a non-UFCS mode charging protocol will be determined and the non-UFCS mode charging protocol will be sent to the power adapter to instruct the power adapter to use the non-UFCS mode charging protocol to charge the electronic device.

[0155] If the power adapter has an authorization identifier and the power adapter is authorized, the power information packet of the power adapter is obtained, the power information packet is parsed, the first charging protocol and the corresponding first charging power supported by the power adapter are obtained, and the relevant variables of the power adapter attributes are updated. The relevant variables of the updated power adapter attributes are as follows: A_UFCS:support=true, power=150; A_PPS:support=true, power=120; A_SVOOC:support=true, power=65.

[0156] The electronic device obtains the second charging protocol and the corresponding second charging power supported by the electronic device itself, as follows: P_UFCS: support = true, power = 80; P_PPS: support = true, power = 30; P_SVOOC: support = true, power = 65. (P is the abbreviation of phone, indicating the mobile phone end)

[0157] The electronic device matches the first charging power of each first charging protocol with the second charging power of each second charging protocol; determines whether the electronic device and the power adapter both support the UFCS charging protocol; if the electronic device and the power adapter both support the UFCS charging protocol, determines whether the charging power of the UFCS charging protocol supported by the electronic device and the charging power of the UFCS charging protocol supported by the power adapter match; if they match, that is, the charging power of the UFCS charging protocol supported by the power adapter is greater than or equal to the charging power of the UFCS charging protocol supported by the electronic device, then the charging power of the UFCS charging protocol supported by the electronic device is used as the third charging power, and is added to the power configuration structure array, and enters the 1 node; if they do not match, that is, the charging power of the UFCS charging protocol supported by the power adapter is less than the charging power of the UFCS charging protocol supported by the electronic device, then the charging power of the UFCS charging protocol supported by the power adapter is used as the third charging power, and is added to the power configuration structure array, and enters the 1 node.

[0158] If the electronic device or the power adapter does not support the UFCS charging protocol, or reaches node 1, it is determined whether the electronic device and the power adapter both support the PPS charging protocol; if the electronic device and the power adapter both support the PPS charging protocol, it is determined whether the charging power of the PPS charging protocol supported by the electronic device and the charging power of the PPS charging protocol supported by the power adapter match; if they match, that is, the charging power of the PPS charging protocol supported by the power adapter is greater than or equal to the charging power of the PPS charging protocol supported by the electronic device, then the charging power of the PPS charging protocol supported by the electronic device is used as the third charging power, and is added to the power configuration structure array, and enters node 2; if they do not match, that is, the charging power of the PPS charging protocol supported by the power adapter is less than the charging power of the PPS charging protocol supported by the electronic device, then the charging power of the PPS charging protocol supported by the power adapter is used as the third charging power, and is added to the power configuration structure array, and enters node 2.

[0159] If the electronic device or the power adapter does not support the PPS charging protocol, or reaches node 2, it is determined whether both the electronic device and the power adapter support the SVOOC charging protocol; if both the electronic device and the power adapter support the SVOOC charging protocol, it is determined whether the charging power of the SVOOC charging protocol supported by the electronic device and the charging power of the SVOOC charging protocol supported by the power adapter match; if they match, that is, the charging power of the SVOOC charging protocol supported by the power adapter is greater than or equal to the charging power of the SVOOC charging protocol supported by the electronic device, then the charging power of the SVOOC charging protocol supported by the electronic device is used as the third charging power, and is added to the power configuration structure array, and enters node 3; if they do not match, that is, the charging power of the SVOOC charging protocol supported by the power adapter is less than the charging power of the SVOOC charging protocol supported by the electronic device, then the charging power of the SVOOC charging protocol supported by the power adapter is used as the third charging power, and is added to the power configuration structure array, and enters node 3.

[0160] If the electronic device or power adapter does not support the SVOOC charging protocol, or reaches the 3rd node, then check each element in the power configuration structure array, the initial fourth charging power is 0, the element index is 0; the power configuration structure array Power_config =

[0161] {

[0162] Protocol=UFCS,power_match=true,power_value=80;

[0163] Protocol=PPS,power_match=true,power_value=30;

[0164] Protocol=SVOOC, power_match=true, power_value=65;

[0165] }

[0166] The electronic device determines whether the third charging power is greater than the fourth charging power; if not, the element index is increased by 1; if so, the third charging power in the current element is used as the new fourth charging power, and the element index is increased by 1; it is determined whether the element index is greater than the element length of the power configuration structure array; if not, it continues to determine whether the third charging power is greater than the fourth charging power; if so, the fourth charging power of 80W is used as the target charging power, and the target charging protocol to which the target charging power belongs is determined to be the UFCS charging protocol.

[0167] It is understandable that the order in which the electronic device matches the various charging protocols is not limited.

[0168] In one embodiment, when the power adapter is an authorized adapter and supports the UFCS charging protocol and the charging power is 33W, the electronic device supports the UFCS charging protocol and is tested with a charging power of 150W. It can be determined that the target charging power is 33W, and the electronic device is charged at 33W using the UFCS charging protocol, and cannot enter the UFCW fast charging state.

[0169] In one embodiment, when the power adapter is an authorized adapter, the power adapter supports the UFCS charging protocol and the SVOOC charging protocol, the charging power of the SVOOC charging protocol is 65W, and the charging power of the UFCS charging protocol is 33W. The electronic device supports the UFCS charging protocol and the SVOOC charging protocol, the charging power of the UFCS charging protocol is 150W, and the charging power of the SVOOC charging protocol is 65W. The electronic device and the power adapter are electrically connected, the target charging power is 65W, and the target charging protocol is the SVOOC charging protocol. The SVOOC charging protocol can avoid the subsequent handshake recognition process, and the power adapter enters the fast charging state more quickly, saving the time for the power adapter to enter the fast charging state.

[0170] In one embodiment, a charging protocol determination method is provided, and the method is applied to Figure 1 The electronic device in the example is used to illustrate, and the following steps are included:

[0171] Step A1, when the electronic device is electrically connected to an external power adapter, obtaining device information of the power adapter;

[0172] Step A2, if the device information indicates that the power adapter has an authorization identifier, a verification command is sent to the power adapter to perform authorization verification on the power adapter; if the power adapter passes the authorization verification, steps A3 to A10 are executed; if the power adapter fails the authorization verification, step A11 is executed.

[0173] Step A3: Send a power request to the power adapter to instruct the power adapter to send the first charging power of each supported first charging protocol to the electronic device.

[0174] Step A4: receiving the first charging power of each first charging protocol sent by the power adapter.

[0175] Step A5, based on each first charging protocol and each second charging protocol supported by the electronic device, determine each third charging protocol supported by both the electronic device and the power adapter; wherein the first charging protocol and the second charging protocol are both charging protocols of the terminal fusion fast charging technology UFCS mode, and each third charging protocol is a charging protocol supported by both the electronic device and the power adapter.

[0176] Step A6: for each third charging protocol, a smaller charging power is determined as the third charging power of the third charging protocol from the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter.

[0177] Step A7, for each third charging protocol, add the third charging power of the third charging protocol as an element part to the power configuration structure array; after adding the third charging power of each third charging protocol as an element part to the power configuration structure array, traverse each element in the power configuration structure array, and use the preset power initial value as the fourth charging power.

[0178] Step A8: Determine the difference between the third charging power in the current element being traversed and the current fourth charging power.

[0179] Step A9: if the third charging power in the current traversed element is less than the fourth charging power, continue to traverse the next element in the power configuration structure array; if the third charging power in the current traversed element is greater than or equal to the fourth charging power, use the third charging power in the current element as the new fourth charging power, continue to traverse the third charging power in the next element, and return to execute step A8 until all elements in the power configuration structure array are traversed, and the obtained fourth charging power is used as the target charging power.

[0180] Step A10, determining a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0181] Step A11, determining a charging protocol in a non-UFCS mode, and the power adapter is used to charge the electronic device using the charging protocol in a non-UFCS mode.

[0182] In one embodiment, a charging protocol determination method is provided, and the method is applied to Figure 1 The following steps are used as an example to illustrate the power adapter in the figure:

[0183] Step B1, when the electronic device and the power adapter are electrically connected, the device information of the power adapter is sent to the electronic device, so that the electronic device determines whether the device information of the power adapter has an authorization identifier; if the device information of the power adapter indicates that the power adapter has an authorization identifier, step B2 is executed; if the device information of the power adapter indicates that the power adapter does not have an authorization identifier, step B5 is executed.

[0184] Step B2, receiving a verification command sent by an electronic device, and in response to the verification command, sending verification information to the electronic device, so that the electronic device performs authorization verification on the power adapter based on the verification information; if the power adapter passes the authorization verification, execute steps B3 to B4; if the power adapter fails the authorization verification, execute step B6.

[0185] Step B3, receiving a power request sent by the electronic device, obtaining, in response to the power request, first charging powers of each first charging protocol supported by the power adapter, and sending the first charging powers of each first charging protocol to the electronic device, so that the electronic device determines a target charging power based on the first charging powers of each first charging protocol and the second charging powers of each second charging protocol supported by the electronic device, and determines a target charging protocol to which the target charging power belongs;

[0186] The electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, including: the electronic device determines each third charging protocol supported by the electronic device and the power adapter based on each first charging protocol and each second charging protocol supported by the electronic device; wherein the first charging protocol and the second charging protocol are both charging protocols of the UFCS mode of the terminal fusion fast charging technology, and each third charging protocol is a charging protocol supported by the electronic device and the power adapter; for each third charging protocol, a smaller charging power is determined as the third charging power of the third charging protocol from the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter; for each third charging protocol, the third charging power of the third charging protocol is added as an element part to the power configuration structure array; after adding the third charging power of each third charging protocol as an element part After being added to the power configuration structure array, each element in the power configuration structure array is traversed, and the preset power initial value is used as the fourth charging power; the size between the third charging power in the current traversed element and the current fourth charging power is judged; if the third charging power in the current traversed element is less than the fourth charging power, the next element in the power configuration structure array is continued to be traversed; if the third charging power in the current traversed element is greater than or equal to the fourth charging power, the third charging power in the current element is used as the new fourth charging power, the third charging power in the next element is continued to be traversed, and the step of judging the size between the third charging power in the current traversed element and the current fourth charging power is returned until all elements in the power configuration structure array are traversed, and the fourth charging power obtained is used as the target charging power; the target charging protocol to which the target charging power belongs is determined; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter.

[0187] Step B4, receiving a target charging protocol sent by the electronic device, where the target charging protocol is used to instruct the power adapter to charge the electronic device using the target charging protocol.

[0188] Step B5, receiving a third-party charging protocol sent by the electronic device, where the third-party charging protocol is used to instruct the power adapter to charge the electronic device using the third-party charging protocol.

[0189] Step B6, receiving a non-UFCS mode charging protocol sent by the electronic device, where the non-UFCS mode charging protocol is used to instruct the power adapter to use the non-UFCS mode charging protocol to charge the electronic device.

[0190] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0191] Based on the same inventive concept, the embodiment of the present application also provides a charging protocol determination device for implementing the charging protocol determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more charging protocol determination device embodiments provided below can refer to the limitations of the charging protocol determination method above, and will not be repeated here.

[0192] In one embodiment, Figure 7 As shown, a charging protocol determination device is provided, which is applied to an electronic device, and the device includes: an acquisition module 702, a target charging power determination module 704 and a target charging protocol determination module 706, wherein:

[0193] The acquisition module 702 is used to acquire the first charging power of each first charging protocol supported by the power adapter when the electronic device is electrically connected to the external power adapter.

[0194] The target charging power determination module 704 is used to determine the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device.

[0195] The target charging protocol determination module 706 is used to determine the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

[0196] The above-mentioned charging protocol determination device, when the electronic device and the external power adapter are electrically connected, obtains the first charging power of each first charging protocol supported by the power adapter. Then, based on the first charging power of each first charging protocol supported by the power adapter and the second charging power of each second charging protocol supported by the electronic device, the target charging power can be accurately determined, thereby accurately determining the target charging protocol to which the target charging power belongs. The target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter can use this more accurate target charging protocol to charge the electronic device.

[0197] In one embodiment, the target charging power determination module 704 is also used to determine the third charging power of each third charging protocol based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device; each third charging protocol is a charging protocol supported by both the electronic device and the power adapter; and the target charging power is determined from the third charging power of each third charging protocol.

[0198] In one embodiment, the target charging power determination module 704 is also used to determine each third charging protocol supported by the electronic device and the power adapter based on each first charging protocol and each second charging protocol supported by the electronic device; for each third charging protocol, the third charging power of the third charging protocol is determined based on the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter.

[0199] In one embodiment, the target charging power determination module 704 is further used to determine a smaller charging power as a third charging power of the third charging protocol from the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter.

[0200] In one embodiment, the target charging power determination module 704 is further used to add the third charging power of the third charging protocol as an element part to the power configuration structure array for each third charging protocol; after adding the third charging power of each third charging protocol as an element part to the power configuration structure array, traverse each element in the power configuration structure array, and determine the target charging power based on the third charging power in each element.

[0201] In one embodiment, the target charging power determination module 704 is further used to use the preset initial power value as the fourth charging power, and to judge the size between the third charging power in the current traversed element and the current fourth charging power; if the third charging power in the current traversed element is less than the fourth charging power, continue to traverse the next element in the power configuration structure array; if the third charging power in the current traversed element is greater than or equal to the fourth charging power, use the third charging power in the current element as the new fourth charging power, continue to traverse the third charging power in the next element, and return to execute the step of judging the size between the third charging power in the current traversed element and the current fourth charging power, until all elements in the power configuration structure array are traversed, and the obtained fourth charging power is used as the target charging power.

[0202] In one embodiment, the acquisition module 702 is also used to send a power request to the power adapter when the electronic device is electrically connected to an external power adapter, if the power adapter passes the authorization verification, to instruct the power adapter to send the first charging power of each supported first charging protocol to the electronic device; and receive the first charging power of each first charging protocol sent by the power adapter.

[0203] In one embodiment, the above-mentioned device also includes an authorization verification module; the above-mentioned acquisition module 702 is also used to obtain the device information of the power adapter when the electronic device and the external power adapter are electrically connected; the authorization verification module is used to send a verification command to the power adapter if the device information indicates that the power adapter has an authorization identifier, so as to perform authorization verification on the power adapter.

[0204] In one embodiment, the first charging protocol and the second charging protocol are both charging protocols of the terminal integrated fast charging technology UFCS mode; the above-mentioned device also includes a module for determining a charging protocol in a non-UFCS mode; the module for determining a charging protocol in a non-UFCS mode is used to determine a charging protocol in a non-UFCS mode if the power adapter fails to pass the authorization verification, and the power adapter is used to charge the electronic device using a charging protocol in a non-UFCS mode.

[0205] In one embodiment, Figure 8 As shown, a charging protocol determination device is provided, which is applied to a power adapter. The device includes: a sending module 802 and a receiving module 804, wherein:

[0206] The sending module 802 is used to obtain the first charging power of each first charging protocol supported by the power adapter when the external electronic device and the power adapter are electrically connected, and send the first charging power of each first charging protocol to the electronic device, so that the electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter.

[0207] The receiving module 804 is used to receive a target charging protocol sent by the electronic device, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

[0208] The above-mentioned charging protocol determination device, when an external electronic device and a power adapter are electrically connected, obtains the first charging power of each first charging protocol supported by the power adapter, and sends the first charging power of each first charging protocol to the electronic device, so that the electronic device can more accurately determine the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, thereby more accurately determining the target charging protocol to which the target charging power belongs, and the target charging protocol is a charging protocol supported by both the electronic device and the power adapter; then, the power adapter receives the target charging protocol sent by the electronic device, and can use the more accurate target charging protocol to charge the electronic device.

[0209] In one embodiment, the sending module 802 is also used to receive a power request sent by the electronic device when the electronic device and the power adapter are electrically connected and if the power adapter passes the authorization verification; and obtain the first charging power of each first charging protocol supported by the power adapter in response to the power request.

[0210] Each module in the above charging protocol determination device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0211] In one embodiment, a computer device is provided. The computer device may be an electronic device or a power adapter. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and the external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a charging protocol determination method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.

[0212] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0213] The embodiment of the present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the charging protocol determination method.

[0214] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a charging protocol determination method.

[0215] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0216] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0217] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0218] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for determining a charging protocol, characterized in that: Applied to electronic equipment, the method comprises: When the electronic device is electrically connected to an external power adapter, obtaining a first charging power of each first charging protocol supported by the power adapter; Determining a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device; Determine a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

2. The method according to claim 1, characterized in that: The determining the target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device includes: Determine a third charging power of each third charging protocol based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device; each third charging protocol is a charging protocol supported by both the electronic device and the power adapter; A target charging power is determined from the third charging powers of the respective third charging protocols.

3. The method according to claim 2, characterized in that The determining, based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device, the third charging powers of the respective third charging protocols comprises: Based on the first charging protocols and the second charging protocols supported by the electronic device, determining third charging protocols supported by both the electronic device and the power adapter; For each of the third charging protocols, a third charging power of the third charging protocol is determined based on the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter.

4. The method according to claim 3, characterized in that The determining, based on the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter, a third charging power of the third charging protocol includes: From the charging power of the third charging protocol supported by the electronic device and the charging power of the third charging protocol supported by the power adapter, a smaller charging power is determined as the third charging power of the third charging protocol.

5. The method according to claim 2, characterized in that: The determining the target charging power from the third charging powers of the respective third charging protocols includes: For each of the third charging protocols, adding the third charging power of the third charging protocol as an element part to the power configuration structure array; After the third charging powers of the respective third charging protocols are added as element parts to the power configuration structure array, each element in the power configuration structure array is traversed, and the target charging power is determined based on the third charging power in each element.

6. The method according to claim 5, characterized in that The determining the target charging power based on the third charging power in each element includes: Using the preset initial power value as the fourth charging power, determining the difference between the third charging power in the current element being traversed and the current fourth charging power; If the third charging power in the current element being traversed is less than the fourth charging power, continue to traverse the next element in the power configuration structure array; If the third charging power in the current traversed element is greater than or equal to the fourth charging power, the third charging power in the current element is used as the new fourth charging power, and the third charging power in the next element is traversed continuously, and the step of judging the size between the third charging power in the current traversed element and the current fourth charging power is returned to execute, until all elements in the power configuration structure array are traversed, and the obtained fourth charging power is used as the target charging power.

7. The method according to claim 1, characterized in that The step of obtaining, when the electronic device is electrically connected to an external power adapter, a first charging power of each first charging protocol supported by the power adapter includes: When the electronic device is electrically connected to an external power adapter, if the power adapter passes the authorization verification, a power request is sent to the power adapter to instruct the power adapter to send the first charging power of each first charging protocol supported by the power adapter to the electronic device; Receive the first charging power of each first charging protocol sent by the power adapter.

8. The method according to claim 7, characterized in that The method further comprises: When the electronic device is electrically connected to an external power adapter, acquiring device information of the power adapter; If the device information indicates that the power adapter has an authorization identifier, a verification command is sent to the power adapter to perform authorization verification on the power adapter.

9. The method according to claim 7, characterized in that: The first charging protocol and the second charging protocol are both charging protocols of the terminal fusion fast charging technology UFCS mode; The method further comprises: If the power adapter fails the authorization verification, a non-UFCS mode charging protocol is determined, and the power adapter is used to charge the electronic device using the non-UFCS mode charging protocol.

10. A method for determining a charging protocol, characterized in that: Applied to a power adapter, the method comprises: When an external electronic device is electrically connected to the power adapter, the first charging power of each first charging protocol supported by the power adapter is obtained, and the first charging power of each first charging protocol is sent to the electronic device, so that the electronic device determines the target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines the target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter; The target charging protocol sent by the electronic device is received, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

11. The method according to claim 10, characterized in that The step of obtaining, when the external electronic device is electrically connected to the power adapter, a first charging power of each first charging protocol supported by the power adapter includes: When the electronic device and the power adapter are electrically connected, if the power adapter passes the authorization verification, receiving a power request sent by the electronic device; In response to the power request, a first charging power of each first charging protocol supported by the power adapter is obtained.

12. A charging protocol determination device, characterized in that: Applied to electronic equipment, the device comprises: an acquisition module, configured to acquire, when the electronic device is electrically connected to an external power adapter, a first charging power of each first charging protocol supported by the power adapter; a target charging power determination module, configured to determine a target charging power based on the first charging powers of the respective first charging protocols and the second charging powers of the respective second charging protocols supported by the electronic device; A target charging protocol determination module is used to determine a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter, and the power adapter is used to charge the electronic device using the target charging protocol.

13. A charging protocol determination device, characterized in that: Applied to a power adapter, the device comprises: a sending module, configured to obtain, when an external electronic device is electrically connected to the power adapter, a first charging power of each first charging protocol supported by the power adapter, and send the first charging power of each first charging protocol to the electronic device, so that the electronic device determines a target charging power based on the first charging power of each first charging protocol and the second charging power of each second charging protocol supported by the electronic device, and determines a target charging protocol to which the target charging power belongs; the target charging protocol is a charging protocol supported by both the electronic device and the power adapter; The receiving module is used to receive the target charging protocol sent by the electronic device, where the target charging protocol is used to instruct the power adapter to charge the electronic device.

14. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the charging protocol determination method according to any one of claims 1 to 11.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.