Charging control method and device, and storage medium

By receiving and judging the rationality of the charger output voltage and identifying the adapter type, the problem of copycat charger identification is solved, ensuring the safety and speed of the charging process.

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

Patent Information

Application Number
CN202310763735.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify and prevent counterfeit chargers, resulting in safety hazards during fast charging.

Method used

By receiving the communication frame sent by the adapter, determine whether the output voltage is reasonable, thereby determining whether the adapter is a target type fast charging adapter, and avoiding fast charging on the counterfeit adapter.

Benefits of technology

Effectively identify and avoid using counterfeit adapters to ensure safe and fast charging of the battery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119209785A_ABST
    Figure CN119209785A_ABST
Patent Text Reader

Abstract

The invention discloses a charging control method and device, and a storage medium, and the method comprises the steps: receiving a first communication frame sent by an adapter, and enabling the first communication frame to be used for querying whether the output voltage of the adapter is reasonable or not; obtaining a first output voltage, wherein the first output voltage is an output voltage under the condition that the adapter sends the first communication frame; based on the first output voltage, whether the adapter is an adapter of a target type is judged, and the adapter of the target type is used for fast charging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to terminal control technology, and in particular to a charging control method and device, and a storage medium. Background Art

[0002] With the development of fast charging (fast charging) technology, the fast charging power has grown from the initial 20 watts (W) to 100 W. In order to ensure the safety of fast charging, it is necessary to identify the adapter against counterfeiting to avoid the potential safety hazards caused by the fast charging protocol running on counterfeit adapters. Summary of the invention

[0003] The embodiments of the present application provide a charging control method and device, and a storage medium, which can realize safe and fast charging of a battery.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a charging control method, the method comprising:

[0006] receiving a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable;

[0007] Obtaining a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame;

[0008] Based on the first output voltage, it is determined whether the adapter is a target type of adapter, and the target type of adapter is used for fast charging.

[0009] An embodiment of the present application provides an electronic device, the electronic device comprising:

[0010] A receiving unit configured to receive a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable;

[0011] an obtaining unit, configured to obtain a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame;

[0012] The first judgment unit is configured to judge whether the adapter is a target type adapter based on the first output voltage, and the target type adapter is used for fast charging.

[0013] An embodiment of the present application provides an electronic device, including a power management chip, a battery, and a processor, wherein the processor is configured to:

[0014] receiving a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable;

[0015] Obtaining a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame;

[0016] Based on the first output voltage, it is determined whether the adapter is a target type of adapter, and the target type of adapter is used for fast charging.

[0017] An embodiment of the present application provides an electronic device, including a first battery, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the above-mentioned charging control method are implemented.

[0018] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned charging control method is implemented.

[0019] The chip provided in the embodiment of the present application is used to implement the above-mentioned charging control method. The chip includes: a processor, which is used to call and run a computer program from a memory so that a device equipped with the chip executes the above-mentioned charging control method.

[0020] The charging control method, device, and storage medium provided in the embodiments of the present application receive a first communication frame sent by an adapter, where the first communication frame is used to inquire whether the output voltage of the adapter is reasonable; obtain a first output voltage, where the first output voltage is the output voltage of the adapter when the first communication frame is sent; based on the first output voltage, determine whether the adapter is a target type of adapter, where the target type of adapter is used for fast charging, and can effectively determine whether the currently inserted adapter is a copycat adapter from the perspective of the voltage output by the adapter during the voltage regulation process, thereby effectively avoiding fast charging on the copycat adapter and ensuring safe and fast charging of the battery. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1A is an optional structural diagram of an electronic device provided in an embodiment of the present application;

[0022] Figure 1B is an optional structural diagram of an electronic device provided in an embodiment of the present application;

[0023] Figure 2 It is an optional flow chart of the charging control method provided in the embodiment of the present application;

[0024] Figure 3 is an optional structural diagram of an electronic device provided in an embodiment of the present application;

[0025] Figure 4It is an optional flow chart of the charging control method provided in the embodiment of the present application;

[0026] Figure 5 It is an optional flow chart of the charging control method provided in the embodiment of the present application;

[0027] Figure 6 is an optional structural diagram of an electronic device provided in an embodiment of the present application;

[0028] Figure 7 is an optional schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0029] Figure 8 is an optional schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0030] Fig. 9 It is an optional schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0032] The embodiments of the present application can provide a charging control method, device and storage medium. In practical applications, the charging control method can be implemented by an electronic device, and each functional entity in the electronic device can be collaboratively implemented by hardware resources of computer devices (such as terminal devices, network devices, etc.), such as computing resources such as processors, and communication resources (such as for supporting various communication methods such as optical cables and cellular).

[0033] Of course, the embodiments of the present application are not limited to being provided as methods and hardware, and there may be multiple implementation methods, such as being provided as a storage medium (storing instructions for executing the charging control method provided by the embodiments of the present application).

[0034] The following describes various embodiments of the charging control method, device, and storage medium provided in the embodiments of the present application.

[0035] The present application embodiment provides a charging control method for an electronic device. The structure of the electronic device in the present application embodiment can be as follows: Figure 1A As shown, the electronic device 100 includes a battery 101 and a processor 102, wherein the battery is used to store electricity and provide power to other parts of the electronic device including the processor 102, and the battery can also input a charging signal provided by an external power source to charge the battery.

[0036] In the embodiment of the present application, the electronic device is also provided with a charging interface that can be inserted into an adapter, i.e., a power adapter. When the charging interface of the electronic device is inserted into the adapter, the adapter can input a charging signal to the battery 101 in the electronic device through the charging interface. In addition, the adapter can interact with the electronic device through the charging interface to perform charging-related communication frames.

[0037] The communication frames for interaction between the adapter and the electronic device include but are not limited to the first communication frame in the voltage regulation process, wherein the first communication frame is used by the adapter to inquire the electronic device whether the output voltage of the adapter is reasonable.

[0038] like Figure 1B As shown, the electronic device may further include: a power management integrated circuit (PMIC) 103. The power management integrated circuit 103 is used to manage the power system in the electronic device, and can control and monitor the input and output of various voltages and currents in the power system.

[0039] Processor 102 is used to perform the following processing: receiving a first communication frame sent by an adapter, the first communication frame is used to inquire whether the output voltage of the adapter is reasonable; reading a first output voltage, the first output voltage is the output voltage of a power management integrated circuit under the first communication frame, and the first output voltage represents the output voltage of the adapter; based on the first output voltage, determining whether the adapter is a target type of adapter, and the target type of adapter is used for fast charging.

[0040] based on Figure 1A or the electronic device shown in 1B, the charging control method provided in the embodiment of the present application can be as follows Figure 2 As shown, the method may include:

[0041] S201. An electronic device receives a first communication frame sent by an adapter, where the first communication frame is used to inquire whether an output voltage of the adapter is reasonable.

[0042] When the electronic device is plugged into the adapter, the adapter will perform voltage regulation during the fast charging process to ensure that the voltage output by itself matches the voltage of the battery. After the voltage regulation is completed, the output voltage of the adapter matches the voltage of the battery. The battery voltage can be the voltage obtained by the battery fuel gauge chip sampling the battery. The processor in the electronic device can read the fuel gauge chip through a serial bus (such as an integrated circuit bus (Inter-Integrated Circuit, I2C)) to obtain the battery voltage.

[0043] When the adapter performs voltage regulation, the output voltage Vbus is regulated based on the initial voltage as the initial output voltage Vbus, and each time the adapter is regulated, the current output voltage Vbus is regulated based on the regulation step to obtain the regulated output voltage Vbus. Each time the adapter determines an output voltage, it sends a first communication frame to the electronic device to inquire whether the current output voltage is reasonable through the first communication frame. In some embodiments, the first communication frame may be a communication frame vbus_ok that inquires about vbusok.

[0044] After receiving the first communication frame, the electronic device determines whether the output voltage corresponding to the first communication frame is reasonable. If it is reasonable, a response frame indicating that the current output voltage is reasonable is returned to the adapter, and the adapter completes voltage regulation; if it is unreasonable, a response frame indicating that the current output voltage is unreasonable is returned to the adapter. When the adapter receives the response frame, it continues voltage regulation, obtains a new output voltage based on the current output voltage, and continues to send new first communication frames to the electronic device to inquire whether the new output voltage is reasonable, until a response frame indicating that the output voltage is reasonable is received. It can be understood that the output voltage corresponding to the first first communication frame sent by the adapter, that is, the first communication frame sent for the first time, is the initial output voltage; if the second first communication frame is sent, the output voltage corresponding to the second first communication frame is the primary output voltage obtained by the initial voltage and the adjustment step; if the third first communication frame is sent, the output voltage corresponding to the third first communication frame is the secondary output voltage obtained by the primary output voltage and the adjustment step, and so on.

[0045] When the adapter sends a first communication frame to the electronic device, the electronic device receives the first communication frame sent by the adapter and determines whether the output voltage corresponding to the current first communication frame, that is, the current output voltage of the adapter, is reasonable. The output voltage corresponding to the first communication frame may be an initial output voltage, a primary output voltage, a secondary output voltage, etc.

[0046] It is understandable that before receiving the first communication frame, the electronic device can detect the protocol type of the adapter and determine that the protocol type of the adapter is a protocol that supports fast charging, such as a dedicated charging port (DCP) type, thereby determining that the adapter is an adapter that supports fast charging.

[0047] It is understandable that before receiving the first communication frame, the electronic device can detect the value of the first identifier, and determine whether the adapter was determined to be a counterfeit adapter before being inserted due to the intermittent insertion of the electronic device based on the value of the first identifier, wherein the first identifier is used to mark whether the currently inserted adapter is a counterfeit adapter. In some embodiments, the first identifier can be marked as adapter_copycat.

[0048] Here, when the adapter is inserted into the electronic device, the electronic device detects the output voltage (Vbus) pin of the adapter, and then considers that the adapter is inserted. At this time, the first identifier defaults to indicate that the adapter is not a copycat adapter. When the electronic device detects that the adapter is inserted, it detects whether the adapter is a copycat adapter, and sets the value of the first identifier according to the detection result to indicate that the current adapter is a copycat adapter, and resets when the adapter is detected as a copycat adapter, resulting in the adapter being unable to receive the communication frame sent by the electronic device. When the adapter cannot receive the communication frame of the electronic device, it resets to achieve an interruption of the connection between the electronic device and the adapter, and the adapter and the electronic device are again detected by the electronic device within the first time length after the interruption. The output voltage (Vbus) pin of the adapter is considered to be inserted again and the insertion is caused by the intermittent connection of the electronic device. The first time length can be 800 milliseconds (ms), 1m, etc. The first time length can be set in the electronic device or pre-set to a fixed value.

[0049] It is understandable that when the electronic device determines that the adapter is not a copycat adapter based on the first identifier, it sends a fast charging pulse string to the adapter to activate the adapter to enter the fast charging protocol process. Here, the electronic device can send a set number of pulse strings to the adapter on the data pin. After the adapter receives the set number of pulse strings, it enters the fast charging process and sends a confirmation communication frame to the electronic device. The confirmation communication frame is used to instruct the adapter to enter the fast charging process. If the electronic device determines that the adapter is a copycat adapter based on the first identifier, it will not send a fast charging pulse string, and the adapter will not enter the fast charging process. Among them, the set number can be 20, 30, 40, etc., which is agreed or set by the protocol.

[0050] S202: The electronic device obtains a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame.

[0051] When the electronic device receives the first communication frame, it obtains the voltage output by the voltage pin of the adapter, that is, the output voltage of the adapter when outputting the first communication frame, wherein the output voltage of the adapter when sending the first communication frame is the output voltage asked by the first communication frame whether it is reasonable.

[0052] It is understandable that the electronic device can read the first output voltage once each time a first communication frame is received, or obtain the first output voltage once after receiving a set number of first communication frames, and the first output voltage changes with the output voltage of the adapter.

[0053] In one example, when the electronic device receives the first communication frame for the first time, it obtains the first output voltage once. At this time, the first output voltage is related to the initial output voltage of the adapter.

[0054] In one example, the electronic device obtains the first output voltage each time the electronic device receives the first communication frame.

[0055] In one example, the electronic device obtains the first output voltage each time it receives a non-first first communication frame.

[0056] In one example, when the electronic device receives the first communication frame N times, the electronic device obtains the first output voltage once when the electronic device receives the first communication frame twice.

[0057] It is understandable that, for different first communication frames, the magnitude of the first output voltage read by the electronic device is different.

[0058] S203: The electronic device determines whether the adapter is a target type of adapter based on the first output voltage, and the target type of adapter is used for fast charging.

[0059] For a first output voltage obtained by the electronic device, the electronic device determines whether the adapter is a target type adapter based on the first output voltage. Here, the target type adapter is an adapter that can safely perform fast charging based on the running first protocol. It is understandable that a non-target type adapter can be understood as a copycat adapter, and a copycat adapter has safety hazards. It is understandable that a copycat adapter is an illegal adapter that cannot safely perform fast charging, and a target type adapter is a legal adapter that can safely perform fast charging.

[0060] It is understandable that, based on the number of times the electronic device reads the first output voltage is one or more times, the electronic device may determine whether the adapter is a target type adapter one or more times. If the electronic device determines whether the adapter is a target type adapter multiple times, if one of the determination results is that the adapter is not a target type adapter, the electronic device confirms that the adapter is not a target type adapter, and if multiple determination results are all that the adapter is a target type adapter, the electronic device confirms that the adapter is a target type adapter.

[0061] The charging control method provided in the embodiment of the present application receives a first communication frame sent by an adapter, where the first communication frame is used to inquire whether the output voltage of the adapter is reasonable; obtains a first output voltage, where the first output voltage is the output voltage of the adapter when the first communication frame is sent; based on the first output voltage, determines whether the adapter is a target type of adapter, where the target type of adapter is used for fast charging, and can effectively determine whether the currently inserted adapter is a copycat adapter from the perspective of the voltage output by the adapter during the voltage regulation process, thereby effectively avoiding fast charging on the copycat adapter and ensuring safe and fast charging of the battery.

[0062] In some embodiments, S202 obtains a first output voltage, including:

[0063] A second output voltage is read, where the second output voltage is the output voltage of the power management integrated circuit in the first communication frame, and the second output voltage is used to characterize the first output voltage.

[0064] The electronic device reads the output voltage of the PMIC in the current first communication frame through an analog-to-digital converter (ADC) to obtain a second output voltage. It is understandable that the output voltage of the PMIC in the current first communication frame can represent the current output voltage of the adapter, and the second output voltage is the same as the current first output voltage of the adapter or there is a first voltage error, and the magnitude of the first voltage error can be 0.1 volts (V), 0.3V, 0.5V, etc., wherein the magnitude of the first voltage error can be set according to actual needs.

[0065] In one example, the output voltage of the adapter, ie, the first output voltage, is vbus, the second output voltage is vbus_volt, and vbus is equal to vbus_volt, or the absolute value of the voltage difference between vbus and vbus_volt is smaller than the first voltage error ΔV1.

[0066] In the embodiment of the present application, the charging path between the battery and the charging interface (or adapter) includes two: a first charging path and a second charging path, wherein the charging current transmitted by the first charging path is greater than the charging current of the second charging path, wherein the first charging path may also be referred to as a fast charging path, and the second charging path may also be referred to as a normal charging path, wherein the first charging path is a path between the charging interface, the fast charging module and the battery, and the second charging path is a path between the charging interface, the PMIC and the battery. It is understandable that the charging path is a path between the battery and the power pin of the charging interface.

[0067] When the electronic device or the charging interface of the electronic device is inserted into the adapter, the adapter is directly connected to the PMIC of the electronic device through the charging interface, but there is no current on the first charging path and the second charging path. The electronic device obtains the output of the power pin of the adapter, that is, the output voltage, by sampling the output voltage of the PMIC.

[0068] It should be noted that a fast charging switch may be provided in the PMIC. When the adapter is inserted into an electronic device, the first charging path and the second charging path are connected. When the electronic device determines to perform fast charging, the fast charging switch in the PMIC is turned on, so that the first charging path is disconnected, and the current output by the adapter is provided to the battery through the second charging path.

[0069] In the embodiment of the present application, the electronic device obtains the first output voltage in the following manner:

[0070] The electronic device receives a second communication frame sent by the adapter, where the second communication frame carries the first output voltage.

[0071] The first communication frame and the second communication frame may be the same communication frame or different communication frames.

[0072] In some embodiments, the implementation of S203 determining whether the adapter is a target type adapter based on the first output voltage includes:

[0073] S2031, determining whether the first communication frame is a first communication frame received for the first time;

[0074] S2032: if the first communication frame is a first communication frame received for the first time, determine whether the adapter is an adapter of the target type according to the first output voltage;

[0075] S2033. If the first communication frame is not the first communication frame received for the first time, determine whether the adapter is an adapter of the target type by using the first output voltage and the third output voltage, and the third output voltage is the output voltage of the power management integrated circuit in the first communication frame before the first communication frame.

[0076] When the electronic device determines whether the adapter is a target type adapter based on the first output voltage, the determination basis based on whether the first communication frame is the first communication frame received by the electronic device for the first time is different.

[0077] If the current first communication frame is the first communication frame received by the electronic device for the first time, the electronic device determines whether the adapter is a target type adapter through the first output voltage. At this time, the basis for determining whether the adapter is a target type adapter is the first output voltage.

[0078] If the current first communication frame is not the first communication frame received by the electronic device for the first time, the electronic device determines whether the adapter is an adapter of the target type through the first output voltage and the third output voltage. At this time, the basis for determining whether the adapter is an adapter of the target type is the first output voltage and the third output voltage. In one example, if the current first communication frame is the fourth time the first communication frame is received, the third output voltage is the first output voltage when the third first communication frame is received, that is, the output voltage of the adapter when the electronic device receives the third first communication frame.

[0079] In an embodiment of the present application, the electronic device may set a voltage recording identifier (for example, marked as pre_vbus_volt) to record the output voltage of the adapter in the previous first communication frame, that is, the previous first output voltage. Here, after receiving a first communication frame, the first output voltage in the first communication frame may be recorded in the voltage recording identifier, so that when the next first communication frame is received, the voltage recorded by the voltage recording identifier may be used as the third output voltage.

[0080] In the embodiment of the present application, different methods may be used to determine whether an adapter is an adapter of the target type for a first communication frame received for the first time and a first communication frame not received for the first time, thereby improving the accuracy of determining the type of the adapter.

[0081] In some embodiments, determining whether the adapter is a target type adapter based on the first output voltage in S2032 includes:

[0082] If the first output voltage satisfies a first voltage condition, the adapter is determined to be an adapter of the target type, and the first voltage condition is determined based on an agreed initial voltage of voltage regulation; if the first output voltage does not satisfy the first voltage condition, the adapter is determined not to be an adapter of the target type.

[0083] When the electronic device determines whether the adapter is a target type adapter by the first output voltage, the electronic device determines whether the adapter is a target type adapter based on whether the first output voltage satisfies the first voltage condition. If the first output voltage satisfies the first voltage condition, the electronic device determines that the adapter is a target type adapter, and if the first output voltage does not satisfy the first voltage condition, the electronic device determines that the adapter is not a target type adapter. Here, the first voltage condition is a condition determined based on the initial voltage of the agreed voltage adjustment.

[0084] In one example, the first voltage condition is that the first output voltage is the agreed initial voltage of the voltage regulation. For example, the agreed initial voltage of the voltage regulation is 8V, if the first output voltage received under the first communication frame is 8V for the first time, then the first output voltage satisfies the first voltage condition, otherwise, the first output voltage does not satisfy the first voltage condition.

[0085] In one example, the first voltage condition is that the first output voltage is within a first voltage range determined by an agreed initial voltage of voltage regulation and a first voltage error. For example, if the agreed initial voltage of voltage regulation is 8V and the first voltage error is 0.5V, the first condition is that the first output voltage is within a first voltage range of 7.5V to 8.5V. If the first output voltage is 8.3V between 7.5V and 8.5V, the first output voltage satisfies the first voltage condition. If the first output voltage is 8.7V, which is not between 7.5V and 8.5V, the first output voltage does not satisfy the first voltage condition.

[0086] In the embodiment of the present application, if the first output voltage corresponding to the first communication frame received for the first time satisfies the first voltage condition, it can be considered that the initial voltage output by the adapter for the first time satisfies the initial voltage agreed upon in the first protocol, that is, the initial voltage of the adapter regulating the voltage may comply with the initial voltage specified in the first protocol, and the current adapter is determined to be an adapter that complies with the first protocol, and therefore, the current adapter is an adapter of the target type. In the embodiment of the present application, the first protocol can also be understood as a fast charging protocol, including SVOOC, UFCS and other protocols, and the embodiment of the present application does not limit the specific protocol of the fast charging protocol.

[0087] In the embodiment of the present application, whether the adapter is a copycat adapter is determined based on the initial voltage amplitude during the voltage regulation process, thereby enhancing the ability to identify copycat adapters.

[0088] In some embodiments, S2032 determines whether the adapter is a target type of adapter by using the first output voltage and the third output voltage, including: determining a voltage difference between the first output voltage and the third output voltage; if the voltage difference satisfies a second voltage condition, determining that the adapter is an adapter of the target type, and the second voltage condition is determined based on an agreed voltage regulation step; if the voltage difference does not satisfy the second voltage condition, determining that the adapter is not an adapter of the target type.

[0089] When the electronic device determines whether the adapter is a target type adapter by the first output voltage and the third output voltage, the electronic device determines whether the adapter is a target type adapter based on whether the voltage difference between the first output voltage and the third output voltage satisfies the second voltage condition. If the voltage difference between the first output voltage and the third output voltage satisfies the second voltage condition, the electronic device determines that the adapter is a target type adapter, and if the voltage difference between the first output voltage and the third output voltage does not satisfy the second voltage condition, the electronic device determines that the adapter is not a target type adapter. Here, the second voltage condition is determined based on the agreed voltage regulation step size.

[0090] In one example, the second voltage condition is that the voltage difference between the first output voltage and the third output voltage is the agreed adjustment step. For example, the agreed adjustment step is 180mV. If the first output voltage under the current first communication frame is 7.64V and the third output voltage is 7.82V, and the voltage difference between the first output voltage and the third output voltage is 0.18V, i.e., 180mV, then it is considered that the voltage difference between the first output voltage and the third output voltage meets the second voltage condition; if the first output voltage under the current first communication frame is 7.65V and the third output voltage is 7.82V, and the voltage difference between the first output voltage and the third output voltage is 0.17V, then it is considered that the voltage difference between the first output voltage and the third output voltage does not meet the second voltage condition.

[0091] In one example, the second voltage condition is that the voltage difference between the first output voltage and the third output voltage belongs to the second voltage range determined based on the agreed adjustment step. For example: the agreed adjustment step is 180mV, the second voltage range is 160mV to 200mV, and the second voltage condition is that the voltage difference between the first output voltage and the third output voltage is between 160mV and 200mV; if the first output voltage under the current first communication frame is 7.65V and the third output voltage is 7.82V, and the voltage difference between the first output voltage and the third output voltage is 0.17V and is within the second voltage range, then it is considered that the voltage difference between the first output voltage and the third output voltage meets the second voltage condition; if the first output voltage under the current first communication frame is 7.60V and the third output voltage is 7.82V, and the voltage difference between the first output voltage and the third output voltage is 0.22V and is not within the second voltage range, then it is considered that the voltage difference between the first output voltage and the third output voltage does not meet the second voltage condition.

[0092] In an embodiment of the present application, if the voltage difference between the first output voltage and the third output voltage corresponding to the first communication frame that is not received for the first time satisfies the second voltage condition, it can be considered that when the adapter adjusts the output voltage, the adjustment size of the adjusted output voltage satisfies the adjustment step agreed upon by the fast charging protocol. In other words, the adjustment size of the adapter's voltage adjustment may comply with the adjustment step specified in the fast charging protocol, then it is determined that the current adapter is an adapter that complies with the fast charging protocol, and therefore, the current adapter is an adapter of the target type.

[0093] In some embodiments, the electronic device further performs the following processing:

[0094] If it is determined that the adapter completes voltage regulation, a first number is obtained, where the first number is the number of the first communication frames received; based on the first number, it is determined whether the adapter is an adapter of the target type.

[0095] After the electronic device determines that the adapter has completed voltage regulation, it returns a response frame to the adapter indicating that the output voltage is reasonable, ie, regulation is completed, and determines the number of first communication frames received by the adapter.

[0096] The electronic device can record the first output voltage and determine the number of received first communication frames based on the number of recorded first output voltages. It can also set an identifier to record the number of received first communication frames. When the number of received first communication frames is recorded by the first identifier, the initial value of the first identifier can be 0 and when the first communication frame is received once, the value of the first identifier is increased by 1.

[0097] In some embodiments, the electronic device further implements the following processing:

[0098] Read the voltage of the battery; and determine whether the adapter has completed voltage regulation based on the voltage of the battery and the first output voltage.

[0099] The electronic device reads the battery voltage vbatt_volt of the fuel gauge, and after determining a first output voltage, determines whether the first output voltage and the battery voltage meet the third voltage condition. If the first output voltage and the battery voltage meet the third voltage condition, the electronic device determines that the output voltage of the adapter is reasonable, the adapter completes voltage regulation, and sends a response frame indicating that the output voltage is reasonable to the adapter. If the first output voltage and the battery voltage do not meet the third voltage condition, the electronic device determines that the output voltage of the adapter is unreasonable, the adapter needs to continue voltage regulation, and sends a response frame indicating that the output voltage is unreasonable to the adapter.

[0100] The third voltage condition is an agreed charging condition, that is, the voltage difference between the voltage output by the adapter and the battery voltage is within a third voltage range. The third voltage range can be agreed upon by the first protocol, such as 100mV to 150mV, or 100mV to 200mV.

[0101] In one example, the third voltage range is 100mV to 150mV. If the battery voltage is 7.3V and the first output voltage is 7.5V, the voltage difference of the first output voltage, 0.2V, is not within the third voltage range. At this time, the first output voltage is unreasonable. If the battery voltage is 7.3V and the first output voltage is 7.4V, the voltage difference of the first output voltage, 0.1V, is not within the third voltage range. At this time, the first output voltage is reasonable.

[0102] When the electronic device obtains the first number, it determines whether the adapter is an adapter of the target type according to the first number. The electronic device determines whether the adapter is an adapter of the target type according to the first number in a manner including but not limited to one of the following:

[0103] Judgment method 1: judging whether the adapter is an adapter of the target type based on the first number, includes: if the first number is greater than a first threshold, determining that the adapter is not an adapter of the target type.

[0104] Judgment method 2: judging whether the adapter is the target type of adapter based on the first number, including: if the first number is the second number, determining that the adapter is the target type of adapter, the second number is determined based on the battery voltage and a third voltage condition, the third voltage condition is used to determine whether the adapter completes voltage regulation; if the first number is not the second number, determining that the adapter is not the target type of adapter.

[0105] In the first judgment method, the electronic device judges whether the first number is greater than the first threshold, wherein the first threshold is the agreed maximum number of times the adapter adjusts the voltage. If the first number is greater than the first threshold, it is considered that the number of times the adapter adjusts the voltage is greater than the agreed maximum number, and the adapter is considered to be a copycat adapter; if the first number is less than the first threshold, the adapter is considered to be a target type adapter.

[0106] In the second judgment method, the electronic device determines the second quantity based on the battery voltage, the agreed initial voltage and the third voltage condition, and the second quantity is the number of times the first output voltage that satisfies the third voltage condition with the battery voltage is obtained based on the agreed initial voltage. In one example, the agreed initial voltage is 8V, the battery voltage is 7.3V, and the third voltage condition is that the difference between the first output voltage and the battery voltage is between 100mV and 150mV, then the first output voltage is between 7.4V and 7.55V to satisfy the third voltage condition, and the second quantity is 2 or 3 times that 8V is adjusted to between 7.4V and 7.55V, then the second quantity includes 2 and 3, and it is considered that according to the agreement, the adapter obtains the first output voltage that satisfies the third voltage condition through 2 or 3 inquiries. If the first quantity is 1, it is considered that according to the agreement, the adapter cannot obtain the first output voltage that satisfies the third condition through 1 inquiry. At this time, the adapter obtains the first output voltage that satisfies the third voltage condition through 1 inquiry, then the adapter at this time is not the target type adapter, and may be a copycat adapter.

[0107] In the embodiment of the present application, whether the adapter is a copycat adapter is monitored by the number of times the first communication frame is sent during the voltage regulation process, thereby further enhancing the ability to identify copycat adapters.

[0108] In the embodiment of the present application, if the electronic device determines that the adapter is a target type of adapter, then it is determined that the adapter is not a knockoff adapter; if it is determined that the adapter is not a target type of adapter, then it is determined that the adapter is a knockoff adapter.

[0109] In some embodiments, the electronic device further performs the following processing:

[0110] If it is determined that the adapter is not an adapter of the target type, the first data path of the battery is disconnected, and the charging path of the battery includes a first data path and a second data path, the first data path is used to transmit a first frame in a first protocol, and the second data path is used to transmit a second frame in a second protocol, wherein the charging current applicable to the first protocol is greater than the charging current applicable to the second protocol.

[0111] If the electronic device determines that the adapter is a knockoff adapter, the first data path of the battery is disconnected.

[0112] In an embodiment of the present application, the data paths between the battery and the charging interface (or adapter) include two: a first data path and a second data path, wherein the first data path is used to transmit a first frame in a first protocol, and the second data path is used to transmit a second frame in a second protocol, wherein the charging current applicable to the first protocol is greater than the charging current applicable to the second protocol, the first protocol may also be referred to as a fast charging protocol, the first data path may also be referred to as a fast charging data path, the second protocol may also be referred to as a normal charging protocol, and the second data path may also be referred to as a normal charging data path.

[0113] When the electronic device is plugged into the adapter, the second data path is connected and the first data path is disconnected by default. When the electronic device determines that the adapter is not a knockoff adapter based on the first identifier, the first data path is connected and the second data path is disconnected to transmit the communication frame in the fast charging process. It can be understood that the data path is the path between the battery and the data pin of the charging interface.

[0114] In the embodiment of the present application, the connection path between the PMIC and the battery in the electronic device is as follows: Figure 3 As shown, it includes a charging interface 301, a switch 302, a PMIC303, a fast charging module 304, and a battery 305. The charging interface is connected to the switch 302 through DPDM, wherein one end of the switch 302 is connected to the charging interface PMIC301, and one end of the switch 302 is switched between PMIC403 and the fast charging module 304. PMIC303 and the fast charging module 304 are respectively connected to the battery 305. The path between the charging interface 301, the switch 302, the fast charging module 304 and the battery 305 is a first path (i.e., a fast charging path), wherein the first path includes a first data path and a first charging path, and the path between the charging interface 301, the switch 302, the PMIC303, and the battery 305 is a second path (general charging path), wherein the second path includes a second data path and a second charging path. The switch 302 is used to control the first data path and the second data path. When one end of the switch 302 is switched to the fast charging module 304, the first data path is connected. When one end of the switch 302 is switched to the PMIC 303, the second data path is connected. The PMIC 303 includes a fast charging switch for controlling the first charging path and the second charging path. If the fast charging switch is turned off, the first charging path is turned on, and the charging current flows to the battery through the first charging path, and the charging current does not pass through the second charging path. If the fast charging switch is turned on, the first charging path is disconnected, and the charging current flows to the battery through the second charging path, and the charging current does not pass through the first charging path.

[0115] In the embodiment of the present application, the physical connection of the first path is connected by default, and when it is determined that the protocol of the adapter is a fast charging protocol capable of fast charging, that is, the first protocol, a physical connection of the second path is established.

[0116] It is understandable that when the electronic device receives the first communication frame, it performs voltage regulation in the fast charging process. At this time, the first data path is in a connected state and the second data path is in a disconnected state.

[0117] When the electronic device determines that the adapter is not the target type of adapter, the fast charging process is no longer executed, and the first data path is disconnected.

[0118] In some embodiments, the electronic device further performs the following processing:

[0119] If it is determined that the adapter is not an adapter of the target type, the first identifier is marked as a first value, and the first identifier of the first value is used to indicate that the adapter is not an adapter of the target type.

[0120] When the electronic device determines that the adapter is not the target type of adapter, the fast charging process is no longer executed, and the first identifier is marked as the first value, indicating that the adapter is a counterfeit adapter.

[0121] Here, the default first identifier is the second value, and the first identifier of the second value is used to indicate that the adapter is a target type adapter.

[0122] The first value and the second value are different values. In one example, the first value is true (True) and the second value is false (False). In one example, the first value is false (False) and the second value is true (True).

[0123] In some embodiments, when the electronic device determines that the adapter is not an adapter of the target type, the electronic device further implements the following processing:

[0124] Detecting insertion of the adapter again within the first time period, and identifying a value of the first identifier;

[0125] If the first identifier is a first value, the first data path of the battery is disconnected and the second data path of the battery is connected, and the charging current used for transmitting by the first data path is greater than the charging current used for transmitting by the second data path.

[0126] The electronic device resets the fast charging module based on the identification that the adapter is a knockoff adapter, thereby disconnecting the adapter from the electronic device intermittently, and the adapter is connected to the electronic device again within the first time period. In some embodiments, the first time period is 800ms.

[0127] When the adapter is connected to the electronic device again, the electronic device detects the Vbus pin of the adapter, identifies the type of the adapter protocol, and determines the value of the first identifier. If the value of the first identifier is the first value, the second data path formed by the PMIC and the battery is connected, and the first data path between the fast charging module and the battery is disconnected for normal charging.

[0128] Below, taking the electronic device as a mobile phone and taking the read second output voltage as the first output voltage as an example, the charging control method provided in the embodiment of the present application is further explained.

[0129] With the development of fast charging (fast charging) technology, the fast charging power has developed from the initial 20W to 100W. In order to ensure the safety of fast charging, some fast charging adapters need to be identified to prevent counterfeiting, and they cannot run the fast charging protocol, but at the same time, their normal charging (general charging) function needs to be guaranteed.

[0130] In the related technology, there are two methods to prevent counterfeiting based on the SVOOC fast charging protocol:

[0131] The first is adapter authentication. The mobile phone encrypts the random number using a specific encryption algorithm and sends it to the adapter. The adapter uses the same encryption algorithm to send the random number to the mobile phone. The mobile phone compares the local random number with the random number sent by the adapter. If they are consistent, the adapter authentication is OK.

[0132] The second is to judge the charging current. The mobile phone will apply for charging current from the adapter, and then the mobile phone will collect the actual current output of the adapter. If the actual current output is greater than a certain amplitude of the applied current, the adapter is considered to be a counterfeit. The other is to detect whether the battery current exceeds a certain current threshold after the battery voltage exceeds a certain voltage value. If the battery current exceeds the current threshold, the adapter is also considered to be a counterfeit.

[0133] The above anti-counterfeit judgment method determines whether the adapter is a counterfeit adapter from the perspective of the device's encryption algorithm and current, and cannot effectively identify all counterfeit adapters.

[0134] The charging control method provided in the embodiment of the present application starts from the voltage regulation aspect to determine whether the adapter is a copycat adapter, thereby improving the ability to identify copycat adapters.

[0135] The charging control method provided in the embodiment of the present application is as follows: Figure 4 As shown, including:

[0136] S401. Insert the mobile phone into the adapter and identify the protocol type of the adapter as DCP type.

[0137] When the mobile phone is inserted into the adapter, the PMIC of the mobile phone will detect that an external output voltage (vbus) pin has been inserted, and then the PMIC will perform protocol detection with the adapter based on the battery detection protocol. If the adapter protocol is identified as the DCP type, the fast charging pulse string handshake with the adapter can be initiated based on the DCP. The fast charging pulse string handshake is used to initiate the fast charging process.

[0138] S402: The mobile phone determines whether adapter_copycat is true.

[0139] After determining that it is a DCP protocol, the mobile phone determines whether the inserted adapter is a copycat adapter (adapter_copycat), that is, whether adapter_copycat is equal to true. If adapter_copycat is equal to false, it means that the inserted adapter is not a copycat, and S403 is executed; if adapter_copycat is equal to true, it means that the inserted adapter is a copycat, and this insertion is caused by the mobile phone's active interruption. The copycat adapter cannot be fast charged and needs to be normally charged, and the mobile phone executes S404.

[0140] Among them, when the mobile phone starts to insert the adapter, it does not know that the adapter is a copycat, that is, adacopy_cat = false. Then after the fast charging protocol is carried out, it is found that it is a copycat adapter, and adacopy_cat will be set to true, and exiting the fast charging protocol will cause a disconnection. At this time, the adapter is not unplugged. In the first time (about 800ms), the adapter will be re-input, and the PMIC will re-detect the insertion of the external vbus, and the detected adapter_copycat is equal to true.

[0141] S403: The mobile phone establishes a physical connection between the fast charging module and the adapter.

[0142] Based on the adapter_copycat indication that the adapter is not a copycat adapter, the mobile phone switches the fast charging switch to connect with the adapter, thereby establishing a physical connection between the fast charging module in the mobile phone and the adapter through the DPD M communication line. If the inserted adapter is indeed a fast charging adapter, the adapter sends a fast charging communication frame to the mobile phone through the established physical connection. If the mobile phone detects the fast charging communication frame, it executes the fast charging communication protocol process. If the mobile phone does not detect the fast charging communication frame, the general charging process is executed. The fast charging communication frame sent by the adapter to the mobile phone may include at least one of the following: fast charging allowed communication frame, battery curve communication frame, adapter ID communication frame, charging current communication frame, voltage output OK communication frame, adapter verification communication frame, battery voltage communication frame.

[0143] S404, the mobile phone performs the general charging process.

[0144] S405. The mobile phone receives the adapter ID communication frame sent by the adapter.

[0145] The adapter will send its own ID related information communication frame to the mobile phone.

[0146] S406: The mobile phone receives the adapter verification communication frame sent by the adapter.

[0147] The adapter will interact with the mobile phone to verify the communication frame for the adapter identification.

[0148] S407: The mobile phone sends a battery curve communication frame to the adapter.

[0149] The mobile phone will send a battery communication curve communication frame to the adapter. The battery curve communication frame includes a charging curve. The adapter can adjust its output according to the charging curve after receiving the charging curve. The charging curve is a voltage-current pair, such as (4204mv, 5000ma), (4304mv 4000ma). When the battery voltage is less than 4204mv, the adapter outputs 5000ma. When the battery voltage is greater than 4204mv but less than 4304mv, the adapter outputs 4000ma.

[0150] At this time, the fast charge protocol has been partially executed and will enter the voltage regulation process. The so-called voltage regulation means that the adapter adjusts its output voltage vbus to make it meet the requirement that vbus is greater than the mobile phone battery voltage within 100mv-200mv. In order to avoid floating voltage of the battery, the normal charging path will be closed at this time, that is, it will be disconnected (suspend PMIC).

[0151] S408: The mobile phone receives the voltage output OK communication frame sent by the adapter, and determines whether the adapter is a knockoff adapter based on the output voltage carried in the voltage output OK communication frame.

[0152] The adapter will send a vbus_ok communication frame to the mobile phone to inquire whether the current output voltage vbus is appropriate. ask_vbus_ok_count is used to record the number of times the adapter asks for voltage. Each time the mobile phone receives a voltage output OK communication frame, the value of ask_vbus_ok_count increases by 1.

[0153] The mobile phone records the adapter output voltage the last time the adapter asked the vbus_ok command through Pre_vbus_volt. Pre_vbus_volt is used to calculate the voltage amplitude change between the two times.

[0154] The process of the mobile phone judging whether the adapter is a knockoff adapter based on the output voltage carried in the voltage output OK communication frame is as follows Figure 5 As shown, including:

[0155] S4081. The mobile phone receives a voltage-inquiry output OK communication frame sent by the adapter, and determines whether the received voltage-inquiry output OK communication frame is the first voltage-inquiry output OK communication frame.

[0156] If yes, execute S4082, if no, execute S4083.

[0157] S4082: The mobile phone determines whether the output voltage of the PMIC satisfies a first voltage condition.

[0158] When the adapter sends the voltage output OK communication frame vbus_ok for the first time, the adapter's output vbus is 8V, so the mobile phone will judge this number, that is, when ask_vbus_ok_count=1, the mobile phone reads the pmic's vbus voltage vbus_volt through ADC, where the PMIC's vbus voltage vbus_volt should be the same as the adapter's vbus, but considering the accuracy error, the mobile phone has a 500mv margin, so the first voltage condition is between 7.5V and 8.5V.

[0159] If vbus_volt>8.5V or vbus_volt<7.5V at this time, then the first voltage adjustment of this adapter does not meet the first voltage condition, and it is considered that the first voltage adjustment of the adapter is incorrect, and it can be determined that the adapter is a copycat adapter, so the fast charging module is disabled to exit the fast charging, and the flag adapter_copycat is set to true. Among them, disabling the fast charging module during the voltage adjustment process will cause the adapter to disconnect, and the adapter will reconnect later, and execute S401.

[0160] If vbus_volt is between 7.5V and 8.5V, the first voltage adjustment of the adapter satisfies the first voltage condition, and the mobile phone continues to execute S4084. Since it is the first time to ask whether the output voltage is OK, the mobile phone directly sets pre_vbus_volt = vbus_volt.

[0161] S4083, the mobile phone determines whether the voltage difference between the current vbus_volt and the previous vbus_volt meets the second voltage condition.

[0162] If it is not the first time to ask whether the vbus voltage is ok, the mobile phone reads the current vbus voltage vbus_volt through ADC, and then determines whether the absolute value of vbus_volt-pre_vbus_volt meets the second voltage condition, where the second voltage condition is between 100mv and 200mv. The SVOOC protocol stipulates that the step size of each voltage adjustment is 180mv. Considering the error, each voltage adjustment cannot be less than 100mv or greater than 200mv, that is, the size of each adjustment bus_volt-pre_vbus_volt meets the second voltage condition. If bus_volt-pre_vbus_volt does not meet the second voltage condition, then the adapter is considered to be a copycat adapter, and the fast charging module is disabled to exit fast charging and the flag a adapter_copycat=true is set, and S401 is executed.

[0163] If bus_volt-pre_vbus_volt satisfies the second voltage condition, pre_vbus_volt=vbus_volt is updated, and S4084 is executed.

[0164] S4084: Determine whether the voltage difference between vbus and the battery voltage satisfies a third voltage condition.

[0165] The mobile phone reads the battery voltage vbatt_volt through PMIC and determines the voltage difference between vbus_volt and vbatt_volt: vbus-vbatt,

[0166] If vbus-vbatt meets the third voltage condition: between 100mv and 200mv, the mobile phone returns a response frame indicating OK to the adapter and executes S4085, otherwise, the mobile phone returns a response frame indicating Not OK to the adapter and executes S4081.

[0167] After the mobile phone returns a response frame indicating OK to the adapter, the adapter sends a current application communication frame to the mobile phone.

[0168] S4085. The mobile phone determines whether the adapter is a knockoff adapter according to the value of ask_vbus_ok_count.

[0169] The mobile phone reads the value of ask_vbus_ok_count. Considering that the mobile phone vbus-vbatt meets the third voltage condition and the value of vbatt_volt is less than 7.3V or greater than 8.3V, the value of ask_vbus_ok_count cannot be 1. Therefore, if the value of ask_vbus_ok_count is 1, the adapter is considered to be a copycat adapter, and the fast charging module is disabled to exit fast charging and set the flag a adapter_copycat=true, and execute S401.

[0170] An electronic device according to an embodiment of the present application, such as Figure 6 As shown, the electronic device 600 includes:

[0171] A receiving unit 601 is configured to receive a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable;

[0172] An obtaining unit 602 is configured to obtain a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame;

[0173] The first judgment unit 603 is configured to judge whether the adapter is a target type adapter based on the first output voltage, and the target type adapter is used for fast charging.

[0174] In some embodiments, the obtaining unit 602 is further configured to read a second output voltage, where the second output voltage is the output voltage of the power management integrated circuit in the first communication frame, and the second output voltage is used to characterize the first output voltage.

[0175] In some embodiments, the first determination unit 603 is further configured to:

[0176] Determining whether the first communication frame is a first communication frame received for the first time;

[0177] If the first communication frame is a first communication frame received for the first time, determining whether the adapter is an adapter of the target type according to the first output voltage;

[0178] If the first communication frame is not the first communication frame received for the first time, whether the adapter is an adapter of the target type is determined by the first output voltage and the third output voltage, and the third output voltage is the output voltage of the power management integrated circuit in the first communication frame before the first communication frame.

[0179] In some embodiments, the first determination unit 603 is further configured to:

[0180] If the first output voltage satisfies a first voltage condition, determining that the adapter is an adapter of the target type, the first voltage condition being determined based on an agreed initial voltage of voltage regulation;

[0181] If the first output voltage does not satisfy the first voltage condition, it is determined that the adapter is not an adapter of the target type.

[0182] In some embodiments, the first determination unit 603 is further configured to:

[0183] determining a voltage difference between the first output voltage and the third output voltage;

[0184] If the voltage difference satisfies a second voltage condition, determining that the adapter is an adapter of the target type, wherein the second voltage condition is determined based on an agreed voltage regulation step size;

[0185] If the voltage difference does not satisfy the second voltage condition, it is determined that the adapter is not an adapter of the target type.

[0186] In some embodiments, the electronic device further includes: a second judgment unit configured to:

[0187] If it is determined that the adapter completes voltage regulation, obtaining a first quantity, where the first quantity is the quantity of the first communication frames received;

[0188] Based on the first number, it is determined whether the adapter is an adapter of the target type.

[0189] In some embodiments, the electronic device further includes: a third judgment unit configured to:

[0190] Read the battery voltage;

[0191] Whether the adapter has completed voltage regulation is determined by the voltage of the battery and the first output voltage.

[0192] In some embodiments, the second determination unit is further configured to:

[0193] If the first number is the second number, determining that the adapter is the target type of adapter, the second number is determined based on the voltage of the battery and a third voltage condition, the third voltage condition being used to determine whether the adapter has completed voltage regulation;

[0194] If the first number is not the second number, it is determined that the adapter is not an adapter of the target type.

[0195] In some embodiments, the electronic device further includes: a first control unit configured to:

[0196] If it is determined that the adapter is not an adapter of the target type, the first data path of the battery is disconnected, and the charging path of the battery includes a first data path and a second data path, the first data path is used to transmit a first frame in a first protocol, and the second data path is used to transmit a second frame in a second protocol, wherein the charging current applicable to the first protocol is greater than the charging current applicable to the second protocol.

[0197] In some embodiments, the electronic device further includes: a second control unit configured to:

[0198] If it is determined that the adapter is not an adapter of the target type, the first identifier is marked as a first value, and the first identifier of the first value is used to indicate that the adapter is not an adapter of the target type.

[0199] In some embodiments, the electronic device further includes: a third control unit configured to:

[0200] Detecting insertion of the adapter again within the first time period, and identifying a value of the first identifier;

[0201] If the first identifier is a first value, the first data path of the battery is disconnected and the second data path of the battery is connected, and the charging current used for transmitting by the first data path is greater than the charging current used for transmitting by the second data path.

[0202] In actual applications, the above-mentioned receiving unit, obtaining unit, first judgment unit, second judgment unit, third judgment unit, first control unit, second control unit, third control unit and other modules can be implemented by a processor located on the electronic device, specifically a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), or a microprocessor implemented as a fast charging module.

[0203] Those skilled in the art should understand that the relevant description of the above-mentioned electronic device in the embodiment of the present application can be understood by referring to the relevant description of the charging control method in the embodiment of the present application.

[0204] Figure 7 An optional implementation of the present application is provided as a structural diagram of an electronic device, such as Figure 8 As shown, the embodiment of the present application provides an electronic device 700, including an electronic chip 701, which can be implemented as a charging control method as described in one or more embodiments above. The electronic chip can be implemented as a processor of an electronic device or as a microprocessor of a fast charging module.

[0205] An embodiment of the present application provides an electronic device, Figure 8 Another optional implementation provided in the embodiment of the present application is a structural diagram of an electronic device, such as Figure 8 As shown, an embodiment of the present application provides an electronic device 800, including:

[0206] A processor 801 and a storage medium 802 storing executable instructions of the processor 801, wherein the storage medium 802 relies on the processor 801 to perform operations through a communication bus 803, and when the instructions are executed by the processor 801, the charging control method performed in one or more of the above embodiments is executed.

[0207] It should be noted that, in actual application, the various components in the terminal are coupled together via the communication bus 803. It is understandable that the communication bus 803 is used to realize the connection and communication between these components. In addition to the data bus, the communication bus 803 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 8 Various buses are labeled as communication buses 803.

[0208] An embodiment of the present application provides a computer storage medium, wherein the computer-readable storage medium is used to store a computer program, wherein the computer program enables a computer to execute the steps of the charging control method described in one or more of the above embodiments.

[0209] An embodiment of the present application provides a schematic structural diagram of an electronic device 900. Fig. 9 The electronic device 900 shown includes a processor 910. The processor 910 is configured to:

[0210] receiving a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable;

[0211] Reading a first output voltage, where the first output voltage is an output voltage of a power management integrated circuit in the first communication frame, and the first output voltage represents an output voltage of the adapter;

[0212] Based on the first output voltage, it is determined whether the adapter is a target type of adapter, and the target type of adapter is used for fast charging.

[0213] In the embodiment of the present application, the processor 910 can call and run a computer program from the memory to implement the charging control method in the embodiment of the present application.

[0214] Alternatively, if Fig. 9 As shown, the electronic device 900 may further include a memory 920. The processor 910 may call and run a computer program from the memory 920 to implement the charging control method in the embodiment of the present application.

[0215] The memory 920 may be a separate device independent of the processor 910 , or may be integrated into the processor 910 .

[0216] Alternatively, if Fig. 9 As shown, the electronic device 900 may further include a transceiver 930, and the processor 910 may control the transceiver 930 to communicate with other devices, specifically, to receive signals sent by other devices. Here, the transceiver may include at least two antennas.

[0217] It is understandable that the transceiver includes multiple physical paths for receiving or transmitting signals, and the physical elements on one or more physical paths for transmitting signals constitute a transmitter, wherein the MPR values ​​of each physical path in the transmitter are independent.

[0218] Understandable, Figures 7 to 9 The electronic device shown in any of the figures may also include a first battery, which is used to provide power for the electronic device and can increase its own stored power based on an input charging signal.

[0219] Optionally, the electronic device 900 can implement the corresponding processes implemented by the electronic device in each method of the embodiment of the present application, and for the sake of brevity, it will not be repeated here. It should be understood that the processor of the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Arra y, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0220] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0221] It should be understood that the above-mentioned memory is exemplary but not restrictive. For example, the memory in the embodiments of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct RAM bus random access memory (Direct RAM, DR RAM), etc. That is to say, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.

[0222] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program.

[0223] Optionally, the computer-readable storage medium can be applied to the electronic device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. For the sake of brevity, they are not repeated here.

[0224] An embodiment of the present application also provides a computer program product, including computer program instructions.

[0225] Optionally, the computer program can be applied to the electronic device in the embodiments of the present application. When the computer program runs on a computer, the computer executes the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. For the sake of brevity, they are not described here.

[0226] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0227] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0228] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0229] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0230] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0231] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0232] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A charging control method, characterized in that: The method comprises: receiving a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable; Obtaining a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame; Based on the first output voltage, it is determined whether the adapter is a target type of adapter, and the target type of adapter is used for fast charging.

2. The method according to claim 1, characterized in that The obtaining of the first output voltage comprises: A second output voltage is read, where the second output voltage is the output voltage of the power management integrated circuit in the first communication frame, and the second output voltage is used to characterize the first output voltage.

3. The method according to claim 1, characterized in that The determining, based on the first output voltage, whether the adapter is a target type adapter includes: Determining whether the first communication frame is a first communication frame received for the first time; If the first communication frame is a first communication frame received for the first time, determining whether the adapter is an adapter of the target type according to the first output voltage; If the first communication frame is not the first communication frame received for the first time, whether the adapter is an adapter of the target type is determined by the first output voltage and the third output voltage, and the third output voltage is the output voltage of the power management integrated circuit in the first communication frame before the first communication frame.

4. The method according to claim 3, characterized in that The determining, based on the first output voltage, whether the adapter is a target type adapter includes: If the first output voltage satisfies a first voltage condition, determining that the adapter is an adapter of the target type, the first voltage condition being determined based on an agreed initial voltage of voltage regulation; If the first output voltage does not satisfy the first voltage condition, it is determined that the adapter is not an adapter of the target type.

5. The method according to claim 3, characterized in that: The determining whether the adapter is a target type adapter according to the first output voltage and the third output voltage includes: determining a voltage difference between the first output voltage and the third output voltage; If the voltage difference satisfies a second voltage condition, determining that the adapter is an adapter of the target type, wherein the second voltage condition is determined based on an agreed voltage regulation step size; If the voltage difference does not satisfy the second voltage condition, it is determined that the adapter is not an adapter of the target type.

6. The method according to claim 1, characterized in that The method further comprises: If it is determined that the adapter completes voltage regulation, obtaining a first quantity, where the first quantity is the quantity of the first communication frames received; Based on the first number, it is determined whether the adapter is an adapter of the target type.

7. The method according to claim 5, characterized in that The method further comprises: Read the battery voltage; Whether the adapter has completed voltage regulation is determined by the voltage of the battery and the first output voltage.

8. The method according to claim 5, characterized in that The determining, based on the first quantity, whether the adapter is an adapter of the target type includes: If the first number is the second number, determining that the adapter is the target type of adapter, the second number is determined based on the voltage of the battery and a third voltage condition, the third voltage condition being used to determine whether the adapter has completed voltage regulation; If the first number is not the second number, it is determined that the adapter is not an adapter of the target type.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: If it is determined that the adapter is not an adapter of the target type, the first data path of the battery is disconnected, and the charging path of the battery includes a first data path and a second data path, the first data path is used to transmit a first frame in a first protocol, and the second data path is used to transmit a second frame in a second protocol, wherein the charging current applicable to the first protocol is greater than the charging current applicable to the second protocol.

10. The method according to any one of claims 1 to 8, characterized in that The method further comprises: If it is determined that the adapter is not an adapter of the target type, the first identifier is marked as a first value, and the first identifier of the first value is used to indicate that the adapter is not an adapter of the target type.

11. The method according to claim 10, characterized in that The method further comprises: Detecting insertion of the adapter again within the first time period, and identifying a value of the first identifier; If the first identifier is a first value, the first data path of the battery is disconnected and the second data path of the battery is connected, and the charging current used for transmitting by the first data path is greater than the charging current used for transmitting by the second data path.

12. An electronic device, characterized in that: The electronic device comprises: A receiving unit configured to receive a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable; an obtaining unit, configured to obtain a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame; The first judgment unit is configured to judge whether the adapter is a target type adapter based on the first output voltage, and the target type adapter is used for fast charging.

13. An electronic device comprising a power management chip, a battery and a processor, characterized in that: The processor is configured to: receiving a first communication frame sent by an adapter, wherein the first communication frame is used to inquire whether an output voltage of the adapter is reasonable; Obtaining a first output voltage, where the first output voltage is an output voltage when the adapter sends the first communication frame; Based on the first output voltage, it is determined whether the adapter is a target type of adapter, and the target type of adapter is used for fast charging.

14. An electronic device comprising a power management chip, a battery, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps in the charging control method according to any one of claims 1 to 11 are implemented.

15. A storage medium storing an executable program, characterized in that: When the executable program is executed by a processor, the charging control method according to any one of claims 1 to 11 is implemented.

16. A chip, comprising a processor, characterized in that: The processor is configured to execute the charging control method according to any one of claims 1 to 11.