Charging detection method, electronic equipment and power adapter

By isolating the control of PMIC and SC during the charging detection process and using different voltage control modules at different time periods, the problem of error recognition and failure of high-power fast charging identification in the prior art is solved, and a higher Charge detection success rate and efficiency.

CN119275957AActive Publication Date: 2025-01-07HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410009509.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-02
Publication Date
2025-01-07
Estimated Expiration
2044-01-02

AI Technical Summary

Technical Problem

The existing charging detection methods have problems with errors and failures when identifying high-power fast charging, which leads to the charger being unable to perform high-power fast charging normally, affecting the battery life of the device.

Method used

By isolating the control of PMIC and SC during the charging detection process, only one signal source controls the voltage of D+ and D- ports at the same time, avoiding signal conflicts, and using different voltage control modules in different time periods to improve detection accuracy sex.

Benefits of technology

It improves the recognition accuracy of high-power fast charging and the success rate of charging detection, ensures that the mobile phone can enter the high-power fast charging state normally, and improves charging efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119275957A_ABST
    Figure CN119275957A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of charging, and discloses a charging detection method, electronic equipment and a power adapter. In order to accurately identify the high-power fast charge, the electronic equipment isolates the control of the PMIC and the SC, so that one device in the PMIC and the SC controls the level of the D + port and the level of the D-port at the same time, that is, only one signal source can control the D + port and the D-port at the same time, and the conflict caused by the fact that the PMIC and the SC control the voltage of the D + port at the same time is avoided. Thus, it can be guaranteed that signals of a D + port and a D-port in BC1.2 detection and high-voltage charging handshake detection conform to expectation, conflicts of two-path voltage control are avoided, the accuracy of the processes that the BC1.2 detects that a charger is of a DCP type and high-voltage charging handshake succeeds is improved, and electronic equipment accurately enters high-power fast charging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of charging technology, and in particular to a charging detection method, an electronic device and a power adapter. Background Art

[0002] As the functions of electronic devices such as mobile phones continue to be enriched and improved, people's actual use time of electronic devices is getting longer and longer, so people's requirements for device life are getting higher and higher. For this reason, the battery capacity of electronic devices is constantly increasing, and people's demand for fast charging is also increasing.

[0003] Currently, when users use chargers to charge mobile phones and other electronic devices, they need to perform charging tests first, such as identifying whether the charger can perform high-power fast charging on the electronic device, such as charging capacity of 9 volts (V) 2 amperes (A), etc. Among them, before the mobile phone charges the charger with high power fast charging, it is necessary to identify the type of the charger as a dedicated charging port (DCP) type to determine that the charger supports fast charging. In addition, after the mobile phone identifies the type of charger as the DCP type, it is necessary to successfully perform subsequent charging detection processes on the charger, such as high voltage detector and controller protocol (HVDCP) handshake and anti-counterfeiting detection, etc., to ensure that the charger has the ability to charge at high power and fast and that the charger is a standard charger and has safety before entering high-power fast charging.

[0004] Specifically, on the one hand, when the mobile phone performs charging detection on the charger, such as charger type identification and HVDCP handshake, it is usually necessary to control and detect the voltage of the charging protocol communication pins in the mobile phone, such as the D+ port and the D- port. However, in actual applications, the voltage of the D+ port and the D- port of the mobile phone may not meet the requirements due to conflicts between multiple signal sources, resulting in the inability to normally identify high-power fast charging. On the other hand, if the mobile phone restarts during the anti-counterfeiting detection process, the charger will not be able to exit the anti-counterfeiting detection, and thus cannot accurately identify high-power fast charging.

[0005] In this way, in actual applications, high-power fast charging may be mistakenly identified as low-power charging such as Buck charging. For example, Buck charging supports charging of 5V500 mA or 5V2A, which has a slower charging speed. Therefore, in order to ensure that the charger can normally perform high-power fast charging on electronic devices, it is necessary to ensure accurate identification of high-power fast charging. Summary of the invention

[0006] The embodiments of the present application provide a charging detection method, an electronic device, and a power adapter, which can improve the accuracy of identifying high-power fast charging, and facilitate the mobile phone to accurately enter high-power fast charging.

[0007] In the first aspect, an embodiment of the present application provides a charging detection method, which is applied to an electronic device, the method comprising: detecting that a power adapter is inserted into a first charging interface of the electronic device, the first charging interface comprising a first charging protocol communication pin; performing a first charging detection on the power adapter to identify whether the power adapter is of a first type (e.g., a DCP type), wherein the voltage of the first charging protocol communication pin in the first charging detection detection is controlled by a first voltage control module; corresponding to detecting that the power adapter is of the first type, performing a second charging detection on the power adapter, wherein the voltage of the first charging protocol communication pin in the second charging detection detection is controlled by a second voltage control module. For example, the electronic device can be a mobile phone, and the power adapter can be a charger for the mobile phone, such as a standard charger. In this way, the electronic device isolates the control of the PMIC and the SC, so that one device in the PMIC and the SC controls the level of the D+ port and the D- port at the same time, that is, only one signal source can control the D+ port and the D- port at the same time. For example, in the process of performing BC1.2 detection, the electronic device controls the voltage of the D+ port only through the PMIC to avoid conflicts caused by the simultaneous control of the voltage of the D+ port by the PMIC and the SC. In this way, the success rate of charging detection steps such as BC1.2 detection can be improved, thereby improving the accuracy of identifying high-power fast charging, which is conducive to the accurate entry of mobile phones into high-power fast charging.

[0008] In a possible implementation of the first aspect, the method further includes: the first charging protocol communication pin includes a first D+ port and a first D- port. That is, the first D+ port and the first D- port are the D+ port and the D- port in the charging port on the mobile phone side.

[0009] In a possible implementation of the first aspect above, the second charging detection includes at least one of the following: performing a high-voltage charging handshake on the power adapter, performing a ping detection on the power adapter, obtaining information of the power adapter, controlling the power adapter to enter an anti-counterfeiting detection state, performing an anti-counterfeiting detection on the power adapter, and controlling the power adapter to exit the anti-counterfeiting detection state. For example, the above-mentioned high-voltage charging handshake can be a high voltage charging (high voltage detector and controller protocol, HVDCP) handshake.

[0010] In a possible implementation of the first aspect above, the first voltage control module and the second voltage control module are the same or different; and the first voltage control module is a power management integrated circuit PMIC or SC (a control module, such as a chip) in an electronic device, and the second voltage control module is PMIC or SC. That is, the present application can use different voltage control modules to control the D+ port and the D- port in different time periods of the entire charging detection process, such as using PMIC in the BC1.2 detection, and using SC in high-power fast charging identification processes such as HVDCP handshake detection.

[0011] In a possible implementation of the first aspect, the method further includes: corresponding to the first voltage control module being different from the second voltage control module, detecting that the switching condition is met, switching the voltage control module controlling the first charging protocol communication pin from the second voltage control module to the first voltage control module; wherein the switching condition includes at least one of the following: failure to perform a high-voltage charging handshake on the power adapter, success in performing a high-voltage charging handshake on the power adapter and failure in ping detection, success in performing a high-voltage charging handshake on the power adapter, success in ping detection and failure in anti-counterfeiting detection. In this way, the mobile phone (i.e., electronic device) can use PMIC to control the voltage of the D+ port and the D- port during subsequent low-power charging.

[0012] In a possible implementation of the first aspect, the method further includes: corresponding to detecting that the power adapter is of the first type, using a second voltage control module to control the voltage of the first D+ port to be a first voltage for a first duration, so that the power adapter is reset, wherein the first voltage is less than or equal to a first preset voltage. Then, resetting the power adapter can make the power adapter exit the abnormal state, thereby facilitating improving the success rate of the mobile phone in charging detection of the power adapter.

[0013] In a possible implementation of the first aspect above, the power adapter includes a second charging port, the second charging port includes a second charging protocol communication pin, and the second charging protocol communication pin includes a second D+ port and a second D- port; and after the power adapter is reset, the second D+ port and the second D- port are short-circuited; corresponding to the second charging port being inserted into the first charging port, the first D+ port is connected to the second D+ port and the first D- port is connected to the second D- port. It can be understood that when the charger (i.e., the power adapter) is reset, the D+ port and the D- port in the charger will be short-circuited, and the D+ port and the D- port on the charger side are both low level. In this way, the charger can reset the charger before the mobile phone executes the HVDCP handshake, and the situation where the HVDCP handshake fails due to the D+ port and the D- port in the charger not being short-circuited will not occur, which is conducive to improving the success rate of the HVDCP handshake.

[0014] In a possible implementation of the first aspect, the method further includes: corresponding to executing a high-voltage charging handshake on the power adapter, using a second voltage control module to control the voltage of the first D+ port to be a second voltage, and continuing for a second time, to detect whether the high-voltage charging handshake condition is met, wherein the high-voltage charging handshake condition includes: the voltage of the first D+ port is greater than or equal to the second preset voltage and the voltage of the first D- port is less than or equal to the first preset voltage (such as the first preset voltage can be 0.32V, i.e., a low level). For example, in the high-voltage charging handshake process, after the electronic device (such as a mobile phone) pulls up the D+ port for a period of time, the power adapter (such as a charger) will normally disconnect the short circuit between the D+ port and the D- port on the power adapter side. Therefore, in the handshake process, after the mobile phone pulls up the D+ port and keeps it for a period of time, the mobile phone detects that the D+ port is high and the D- port is low, indicating that the charger correctly disconnects the short circuit between the D+ port and the D- port. Therefore, the mobile phone detects that the above-mentioned high-voltage charging handshake condition (such as the HVDCP handshake condition) is met, indicating that the handshake of the mobile phone to the charger is successful. Therefore, the accuracy of the high-voltage charging handshake can be further improved by determining the high-voltage charging handshake condition.

[0015] In a possible implementation of the first aspect, the obtaining of the power adapter information includes: sending a first instruction to the power adapter, wherein the first instruction is used to obtain the charging capability of the power adapter, and the first instruction is used to instruct the power adapter to exit the anti-counterfeiting detection state, and the information of the power adapter includes the charging capability of the power adapter. For example, the first instruction is used to read the charging capability in the 0x7E register in the charger.

[0016] In a possible implementation of the first aspect above, the above-mentioned control of the power adapter to enter the anti-counterfeiting detection state includes: sending a second instruction to the power adapter, wherein the second instruction is used to instruct the power adapter to enter the anti-counterfeiting detection state, and the second instruction is also used to instruct the power adapter to exit the anti-counterfeiting detection state when the first exit condition is met; the first exit condition includes: the power adapter does not receive a third instruction sent by the electronic device within the timing duration of the preset timer, and the third instruction is used to instruct the power adapter to exit the anti-counterfeiting detection state. For example, the second instruction is used to write the anti-counterfeiting key index to the 0xCE register in the charger to trigger the charger to forcibly exit the anti-counterfeiting detection state. For example, the timing duration of the preset timer is 10 seconds.

[0017] In a possible implementation of the first aspect, the method further includes: sending a third instruction to the power adapter, the third instruction being used to instruct the power adapter to turn off the preset timer that has not stopped timing and exit the anti-counterfeiting detection state. For example, the third instruction is used to write an exit parameter, such as 0xFF, to the 0xCE register in the charger to trigger the charger to normally exit the anti-counterfeiting detection state.

[0018] In a possible implementation of the first aspect, the method further includes: corresponding to the anti-counterfeiting detection of the power adapter being successful and the power adapter exiting the anti-counterfeiting detection state, charging at a first power through the power adapter; wherein the power adapter is a standard power adapter for the electronic device. For example, the first power corresponds to high-power fast charging, such as the first power can support 66W charging.

[0019] In a possible implementation of the first aspect, the method further includes: corresponding to the failure of the anti-counterfeiting detection of the power adapter and the power adapter exiting the anti-counterfeiting detection state, or detecting that the switching condition is met, charging at the second power through the power adapter, wherein the second power is less than the second power. For example, the first power may correspond to 5V2A charging, such as the first power is 10W.

[0020] In a possible implementation of the first aspect, the method further includes: corresponding to the first voltage control module being different from the second voltage control module, detecting that the electronic device has finished charging at the first power, switching the voltage control module that controls the first charging protocol communication pin from the second voltage control module to the first voltage control module. In this way, the electronic device can use the first voltage control module such as PMIC to control the voltage of the D+ port and the D- port by default during the next charging detection process.

[0021] In the second aspect, an embodiment of the present application provides a charging detection method, which is applied to a power adapter, the power adapter includes a second charging port, the second charging port includes a second charging protocol communication pin, and the second charging protocol communication pin includes a second D+ port; the method includes: detecting that the second charging port is inserted into the first charging port of the electronic device, wherein the first charging port includes a first charging protocol communication pin, and the first charging protocol communication pin includes a first D+ port; corresponding to the power adapter being of the first type, detecting that the voltage of the second D+ port is the first voltage, and lasts for a first time (such as 10ms), resetting the power adapter, wherein the first voltage is applied to the voltage of the first D+ port, and the first voltage is less than or equal to the first preset voltage. That is, the power adapter detects that the D+ port is the first voltage and lasts for the first time, and resets the power adapter. It can be understood that when the charger (i.e., the power adapter) is reset, the D+ port and the D- port in the charger will be short-circuited, and the D+ port and the D- port on the charger side are both low. In this way, the charger can be reset before the mobile phone (i.e., the electronic device) performs the high-voltage charging handshake, and the high-voltage charging handshake failure will not occur due to the D+ port and the D- port in the charger not being short-circuited, which is beneficial to improving the success rate of the high-voltage charging handshake.

[0022] In a possible implementation of the second aspect, the second charging port further includes a second D-port; in response to the power adapter being reset, the second D+port and the second D-port are short-circuited. At this time, both the second D+port and the second D-port are at a low level.

[0023] In a possible implementation of the second aspect above, the method above also includes: receiving a first instruction sent by an electronic device; in response to the first instruction, reading the charging capability of the power adapter and exiting the anti-counterfeiting detection state, the information of the power adapter including the charging capability of the power adapter.

[0024] In a possible implementation of the second aspect above, the method includes: receiving a second instruction sent by an electronic device; in response to the second instruction, entering an anti-counterfeiting detection state, and controlling a preset timer to start timing; detecting whether a first exit condition is met; corresponding to meeting the first exit condition, exiting the anti-counterfeiting detection condition; wherein the first exit condition includes: not receiving a third instruction sent by the electronic device within the timing duration of the preset timer, the third instruction being used to instruct the power adapter to exit the anti-counterfeiting detection state.

[0025] In a possible implementation of the second aspect, the method further includes: in response to not satisfying the first exit condition, exiting the anti-counterfeiting detection state and closing a preset timer that has not stopped timing.

[0026] In a possible implementation of the second aspect above, the first instruction is used to instruct the electronic device to read the charging capability of the power adapter from the first register of the power adapter (such as the 0x7E register); the second instruction is used to instruct the electronic device to write an anti-counterfeiting key index to the second register of the power adapter (such as the 0xCE register); the third instruction is used to instruct the electronic device to write an exit parameter to the second register, and the exit parameter is used to instruct the power adapter to exit the anti-counterfeiting detection state.

[0027] In a possible implementation of the second aspect, the above-mentioned entry into the anti-counterfeiting detection state is achieved by: setting the anti-counterfeiting detection flag in the power adapter to a first state, the first state corresponding to the power adapter entering the anti-counterfeiting detection state; exiting the anti-counterfeiting detection state is achieved by: setting the anti-counterfeiting detection flag in the power adapter to a second state, the second state corresponding to the power adapter exiting the anti-counterfeiting detection state. When the charger (i.e., the power adapter) enters or exits the anti-counterfeiting detection, the value of the anti-counterfeiting flag can be set to indicate through the anti-counterfeiting flag that the slave appliance has entered or exited the anti-counterfeiting detection process.

[0028] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device, for executing the charging detection method in the first aspect and its various possible implementations.

[0029] In a fourth aspect, an embodiment of the present application provides a power adapter, comprising: a memory for storing instructions executed by one or more processors of an electronic device, and a processor, which is one of the processors of the electronic device, for executing the charging detection method in the second aspect and its various possible implementation methods.

[0030] In a fifth aspect, an embodiment of the present application provides a charging system, which includes the electronic device in the third aspect and the power adapter in the fourth aspect, and the power adapter is used to charge the electronic device.

[0031] Among them, for the beneficial effects of the second to fifth aspects, reference can be made to the relevant descriptions of the first and second aspects, and they will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1A According to some embodiments of the present application, a schematic diagram of a charging scenario is shown;

[0033] Figure 1B According to some embodiments of the present application, it is shown Figure 1A A schematic diagram of charging port connection in a charging scenario is shown;

[0034] Figure 2 According to some embodiments of the present application, a flow chart of a charger identification method is shown;

[0035] Figure 3 According to some embodiments of the present application, a schematic flow chart of a charging detection method is shown;

[0036] Figure 4 According to some embodiments of the present application, a schematic flow chart of a charging detection method is shown;

[0037] Figure 5 According to some embodiments of the present application, a schematic flow chart of a charging detection method is shown;

[0038] Figure 6 According to some embodiments of the present application, a schematic flow chart of a charging detection method is shown;

[0039] Figure 7 According to some embodiments of the present application, a schematic diagram of the structure of a mobile phone is shown;

[0040] Figure 8According to some embodiments of the present application, a schematic structural diagram of a charger is shown. DETAILED DESCRIPTION

[0041] Illustrative embodiments of the present application include, but are not limited to, a charging detection method, an electronic device, and a power adapter.

[0042] The embodiment of the present application provides a charging detection method, which can be applied to the scenario where the power adapter charges the electronic device. For example, the electronic device can be a charging device such as a mobile phone, a tablet, a personal business assistant, a notebook, etc., and the power adapter can be a charger (such as a standard charger) or other charging devices capable of reverse charging.

[0043] Generally speaking, in order to ensure the safety and stability of charging, the standard chargers of electronic devices support high-power fast charging of mobile phones, while other chargers generally cannot provide high-power fast charging for mobile phones.

[0044] Reference Figure 1A As shown, it is a schematic diagram of a charging scenario. Taking the electronic device as a mobile phone 100 as an example, the charger 200 (such as a standard charger) of the mobile phone 100 can be used to quickly charge the mobile phone 100, such as high-power fast charging (also known as direct charging or super fast charging). Among them, the charger 200 charges the mobile phone 100 when inserted into the mobile phone 100. At this time, the charging port 210 of the charger 200 is inserted into the charging port 110 of the mobile phone 100. The charging port 210 and the charging port 110 can be universal serial bus (USB) interfaces, such as Type-C interfaces. Among them, Type-C, also known as USB Type-C, is a universal connection standard. The Type-C interface supports USB standard charging, data transmission, display output and other functions.

[0045] In some embodiments, when the mobile phone 100 detects that the charger 200 is inserted, the charger identification can be performed first, and when the high-power fast charge is correctly identified, the charger 200 performs high-power fast charge for the mobile phone 100. The charger identification process depends on the status of some ports in the charging port 110 of the mobile phone 100.

[0046] For ease of understanding, a schematic structural diagram of the charging port 110 is first introduced below.

[0047] In some embodiments, reference Figure 1B As shown, Figure 1A The charging port connection diagram in the charging scenario is shown in FIG. Figure 1BAs shown, the charging port 110 of the mobile phone 100 may include four ports: voltage bus (VBUS), D+, D-, and GND (ground). Correspondingly, the charging port 210 of the charger 200 also has four ports: VBUS, D+, D-, and GND, which are used to connect to the corresponding ports in the charging port 110 of the mobile phone 100.

[0048] Among them, the VBUS and GND ports represent the positive and negative poles of the voltage respectively, and are power lines used to supply power to the mobile phone 100 from the external charger 200. The D+ and D- ports represent the charging protocol communication pins. It can be understood that the above-mentioned high-power fast charging identification process needs to detect the status of the D+ port and the D- port, and the charger type of the charger 200 is identified based on the status of the D+ port and the D- port, such as the voltage of the D+ port and the D- port. In addition, the mobile phone 100 also includes a power management integrated circuit (power management ic, PMIC) and SC (a control circuit), and both PMIC and SC can control the signal of the D+ port such as the level.

[0049] Among them, PMIC and SC can be implemented by chips, such as PMIC and SC can be inherited in the power management chip of the mobile phone 100. PMIC and SC can also be referred to as voltage control modules hereinafter. In addition, although Figure 1B Not shown in the figure, in actual application, the PMIC and the SC may also be connected to the D+ port and the D- port in the charging port 110 respectively.

[0050] In some embodiments, reference Figure 2 , which is a flow chart of a charger identification method. When the mobile phone 100 detects that the charger 200 is plugged into the charging port 110, the mobile phone 100 needs to identify the high-power fast charging of the charger 200.

[0051] Specifically, Figure 2 The charging detection process shown generally includes the following steps 201 to 212:

[0052] 201: BC1.2 detection. For example, the mobile phone 100 performs BC1.2 detection on the charger 200.

[0053] 202: Determine whether the charger type is a dedicated charging port (DCP).

[0054] Among them, BC1.2 detection is used to determine whether the charger type is DCP.

[0055] BC1.2 (Battery Charging v1.2) is a charging interface standard for electronic devices. The main purpose of BC1.2 detection is to determine the USB port type (i.e. charger type), specifically by detecting the voltage, current and other information obtained by the mobile phone from the USB port, and judging the port type of the USB port based on the obtained voltage and current information. For example, the charger type can be DCP or standard downstream port (SDP). Among them, DCP does not support data protocol, supports fast charging, can provide high current, and the corresponding charging method is power adapter or mobile power charging. The SDP port supports USB protocol and is an ordinary USB interface with a maximum current of 500mA. The corresponding charging method is host charging.

[0056] It can be understood that if the charger is of DCP type (such as the first type), it means that the charger supports fast charging, such as high-power fast charging or low-power charging. If the charger is of non-DCP type such as SDP, it means that the charger does not support fast charging and can only perform normal charging at a slower speed.

[0057] BC1.2 detection can identify the charger type based on the status of the D+ and D- ports. If the D+ and D- ports are in a short-circuited state, it can be determined that the charging method of the mobile phone 100 belongs to the DCP charging method (i.e., the power adapter or mobile power charging method), that is, the charger type is DCP. If the D+ and D- ports are not in a short-circuited state, it can be determined that the charging method of the terminal device belongs to the SDP charging method (i.e., the host charging method), that is, the charger type is SDP.

[0058] Specifically, the mobile phone 100 can apply a high level such as 0.6V to the D+ port for a period of time (which can be 1 to 100ms, such as 50 milliseconds, etc.), and detect whether the D- port is at a high level. At this time, if the D- port is detected to be at a high level, it means that the D+ port and the D- port are short-circuited, and the charger type is DCP; if the D- port is detected to be at a low level, it means that the D+ port and the D- port are not short-circuited, and the charger type is not DCP. Further, the mobile phone 100 can apply a low level such as 0V to the D- port for a period of time (which can be 1 to 100ms, such as 50 milliseconds, etc.), and detect whether the D+ port is at a low level. At this time, if the D+ port is detected to be at a low level, it means that the D+ port and the D- port are short-circuited, and the charger type is DCP; if the D- port is detected to be at a high level, it means that the D+ port and the D- port are not short-circuited, and the charger type is not DCP.

[0059] In some implementations, the high level in the embodiment of the present application may be a level greater than or equal to a preset voltage 1 (referred to as a first preset voltage), for example, the value of the preset voltage 1 may be 0.6V but is not limited thereto. The low level may be a level less than or equal to a preset voltage 2, for example, the value of the preset voltage 2 may be 0.32V but is not limited thereto.

[0060] It is understandable that if the mobile phone executes BC1.2 and detects that the charger is not a DCP type, it executes S210 to enter buck charging without further identifying high-power fast charging. After BC1.2 detection, subsequent detection can be further performed to complete the identification of high-power fast charging.

[0061] 203: Determine whether the high voltage detector and controller protocol (HVDCP) handshake is successful. That is, the mobile phone 100 performs the HVDCP handshake on the charger 200 and determines whether the HVDCP handshake is successful.

[0062] For example, the high-voltage charging handshake in the present application may be an HVDCP handshake, but is not limited thereto and may also be other handshake processes.

[0063] Specifically, the HVDCP handshake process can be to pull up the level of the D+ port, and after a period of time (such as 1 second), detect whether the D- port is at a low level. If the D- port is detected to be at a low level, the HVDCP handshake is successful, otherwise the HVDCP handshake fails. For example, the HVDCP handshake can pull D+ up by 0.6V for a period of time (such as 0.5 to 2 seconds, which can be 1 second), and then detect that the D- port is 0V (i.e., a low level), indicating that the HVDCP handshake is successful. In actual applications, when the D- level is detected to be less than 0.32V, the D- port is considered to be at a low level.

[0064] HVDCP is a handshake protocol for fast charging, which allows the charger to detect the current output capability and voltage of the mobile phone without using any external circuit. When the charger is charging the mobile phone, it needs to detect the current output capability and voltage of the mobile phone, which requires the HVDCP handshake to succeed in order to allow the charger to charge the mobile phone.

[0065] Among them, during the above HVDCP handshake, as long as it is determined that the D- port is at a low level, the HVDCP handshake is determined to be successful. However, usually under normal circumstances, during the HVDCP handshake process, after the mobile phone pulls up the level of D+ for a period of time, the charger will disconnect the short circuit of the D+ port and the D- port, and the voltage on the D- in the charger will drop, and then the mobile phone detects the voltage drop on D-, such as the D- port becomes a low level, while the D+ port in the mobile phone is still at a high level (such as 0.6V). Then, in the above HVDCP handshake process, after the mobile phone pulls up the D+ port for a period of time, if the D+ port and D- of the charger are in a short-circuited state, the D+ port and D- port of the charger are both at a low level, that is, the D+ port in the mobile phone is at a low level, which causes the HVDCP handshake result to be misjudged, and then causes the subsequent charging detection steps to fail. Similarly, before the HVDCP handshake detection, if the charger is in other logically abnormal states, it will also cause the HVDCP handshake to fail.

[0066] It can be understood that BC1.2 detection and HVDCP handshake rely on the mobile phone to control the signals (i.e., levels) of the D+ port and the D- port. The PMIC and SC of the mobile phone can both control the D+ port, but the control boundaries between the two are not clear, which can easily cause conflicts. Specifically, in BC1.2 detection, the D+ port and the D- port are usually controlled by the PMIC, but in the HVDCP handshake detection process, the PMIC and the SC may control the D+ port and the D- port at the same time. For example, when the D+ port is required to be pulled up by 0.6V during the HVDCP handshake process, the PMIC outputs a level of 0.6V to the D+ port, and the SC outputs a level of 0V to the D+ port, resulting in the actual level of the D+ port being only 0.3V, causing a conflict. In this way, the D+ port signal cannot be output as expected, which in turn causes the HVDCP handshake to fail. Similarly, if the D+ port is also controlled by the PMIC and the SC at the same time during the BC1.2 detection process, it will cause the charger type to be identified incorrectly.

[0067] If the HVDCP handshake fails, the mobile phone 100 executes S210 to enter low-power charging, such as buck charging. If the HVDCP handshake succeeds, the mobile phone 100 enters the charging detection step in 204.

[0068] 204: Determine whether the ping is successful. That is, the mobile phone 100 performs a ping (a network diagnostic tool) test on the charger 200 to determine whether the ping is successful.

[0069] For example, during the ping detection process, the mobile phone sends a ping request to the charger and determines whether a ping response is received within a period of time (such as 50ms). If the mobile phone receives a ping response, the ping is successful, otherwise the ping fails.

[0070] It is understandable that if the HVDCP handshake fails and is a misidentification, the subsequent ping will inevitably fail. If the ping fails, the mobile phone 100 executes 209 to enter low-power charging, such as buck charging. If the ping succeeds, the mobile phone 100 enters the subsequent charging detection step in 205.

[0071] 205 : Obtain information of the charger. For example, the mobile phone 100 obtains information of the charger 200 .

[0072] The charger information includes charging capability, voltage, current, etc. For example, the mobile phone reads the 0x7E register of the charger to identify the charging capability of the charger.

[0073] 206: Writing the anti-counterfeiting key index. For example, the mobile phone 100 writes the anti-counterfeiting key index for the charger 200.

[0074] For example, the mobile phone writes the secret key index to the charger's register 0xCE, causing the charger to enter an anti-counterfeiting state.

[0075] In some embodiments, when the charger enters the anti-counterfeiting detection, the value of the anti-counterfeiting flag can be set to indicate that the slave appliance has entered the anti-counterfeiting detection process through the anti-counterfeiting flag. For example, the value of the anti-counterfeiting flag can be set to 1 when the charger enters the anti-counterfeiting detection. Similarly, the value of the anti-counterfeiting flag can be set to 0 when the charger exits the anti-counterfeiting detection. Of course, for entering and exiting the anti-counterfeiting detection, the value of the anti-counterfeiting flag can also be set to other values, which are not specifically limited here. In addition, a new anti-counterfeiting flag can be added when the charger enters the anti-counterfeiting detection; the anti-counterfeiting flag can be cleared when the charger exits the anti-counterfeiting detection.

[0076] 207 : Anti-counterfeiting detection. For example, the mobile phone 100 performs an anti-counterfeiting detection on the charger 200 .

[0077] It is understandable that the anti-counterfeiting detection performed by the mobile phone on the charger is usually to identify whether the charger is a charger. If the anti-counterfeiting detection is successful, it means that the charger is a charger, and the mobile phone is allowed to be charged at high power. On the contrary, if the anti-counterfeiting detection fails, it means that the charger is not a charger, and high power fast charging is usually not allowed for the mobile phone.

[0078] 208: Exit the anti-counterfeiting detection state. For example, the mobile phone 100 triggers the charger 200 to exit the anti-counterfeiting detection state.

[0079] The mobile phone writes 0xFF to the charger's register 0xCE to make the charger exit the anti-counterfeiting detection state. It can be understood that after the charger's register 0xCE is written with 0xFF, the charger can set the value of the anti-counterfeiting flag to 0, or clear the anti-counterfeiting flag, to exit the anti-counterfeiting detection state.

[0080] 209: Determine whether the anti-counterfeiting detection is successful.

[0081] When the charger 200 exits the anti-counterfeiting detection state, if the anti-counterfeiting detection is successful, the mobile phone 100 correctly identifies the charger 200 as a high-power fast charge, so that the mobile phone 100 executes 210 to enter high-power fast charge. On the contrary, if the anti-counterfeiting detection fails, the mobile phone 100 identifies the charger 200 as a non-high-power fast charge, that is, a low-power charge such as buck charge, so that the mobile phone 100 executes 211.

[0082] However, when performing anti-counterfeiting detection, that is, when the charger is in the anti-counterfeiting detection state, if the mobile phone is restarted but the charger is not unplugged, the charger will always be in the anti-counterfeiting additional test state and cannot exit normally, resulting in subsequent errors in the interaction between the mobile phone and the charger, and unable to correctly enter high-power fast charging.

[0083] 210: Entering high-power fast charging. For example, mobile phone 100 enters high-power fast charging.

[0084] For example, high-power fast charging can support 66W charging for the charger.

[0085] 211: Entering low-power charging. For example, the mobile phone 100 enters low-power charging.

[0086] For example, low-power charging can be a process in which the charger charges the mobile phone 100 according to the charging capacity of 5V2A. At this time, the charging power of the charger is 10W, etc. Obviously, the charging power of the charger under high-power fast charging is greater than the charging power of the charger under low-power charging. For example, the above low-power charging can be buck charging.

[0087] 212: Charging ends. For example, the mobile phone 100 performs high-power fast charging and charging ends, or the mobile phone 100 enters low-power charging and charging ends.

[0088] It can be understood that the correct identification of high-power fast charging requires the following conditions to be met at the same time: BC1.2 detects that the charger type is DCP; HVDCP handshake detection is successful; ping is successful; anti-counterfeiting detection is successful. However, in the above charger identification process, the following problems may occur: First, BC1.2 detection and HVDCP handshake rely on the mobile phone to control the D+ and D- port signals. While the PMIC and SC of the mobile phone can both control D+, the control boundary between the two is not clear, which can easily cause conflicts, resulting in the D+ port signal not being output as expected, resulting in incorrect charger type identification or HVDCP handshake failure, and unable to enter high-power fast charging. Second, before the HVDCP handshake detection, if the charger is in an abnormal state such as not short-circuiting the D+ port and the D- port or not exiting the anti-counterfeiting detection, the HVDCP handshake will fail. Third, the anti-counterfeiting detection process may be interrupted by the restart of the mobile phone, and the closed-loop logic of the charger entering and exiting the anti-counterfeiting detection cannot be completed, resulting in the charger being unable to exit after entering the anti-counterfeiting state, and subsequently unable to respond normally to mobile phone commands, and thus unable to enter high-power fast charging.

[0089] To sum up, after the mobile phone is inserted into the standard charger, problems such as BC1.2 detection misidentification, HVDCP handshake detection failure, ping detection failure, and inability to exit anti-counterfeiting detection may occur, making it impossible to accurately identify high-power fast charging and unable to perform high-power charging normally.

[0090] In order to accurately identify high-power fast charging, an embodiment of the present application provides a charging detection method, in which the electronic device isolates the control of the PMIC and the SC so that one device in the PMIC and the SC controls the level of the D+ port and the D- port at the same time, that is, only one signal source can control the D+ port and the D- port at the same time. Specifically, during the execution of BC1.2 detection and HVDCP handshake, the electronic device controls the voltage of the D+ port through one device in the PMIC and the SC at the same time to avoid conflicts caused by the simultaneous control of the voltage of the D+ port by the PMIC and the SC. For example, when the electronic device performs BC1.2 detection after detecting that the charger is inserted into the charging port, a high level (such as 0.6V) is applied to the D+ port through the PMIC for a period of time, and a low level (such as 0V) is applied to the D- port through the PMIC and for a period of time. After DC1.2 detects that the charger is of DCP type, when performing HVDCP handshake detection, the electronic device will stop outputting signals to the D+ port through the PMIC, but input a high level (such as 0.6V) to the D+ port through the SC to pull the level of the D+ port high and last for one second. In this way, it can be ensured that the signals of the D+ port and the D- port in the BC1.2 detection and HVDCP handshake detection meet expectations, avoiding conflicts in the two-way voltage control, which is conducive to improving the accuracy of BC1.2 detection of the charger as DCP type and the HVDCP handshake success process. Furthermore, after the HVDCP handshake is successful, the mobile phone can perform ping detection and anti-counterfeiting detection operations on the charger normally, thereby improving the accuracy of identifying high-power fast charging, which is conducive to the accurate entry of the mobile phone into high-power fast charging.

[0091] In some embodiments, the present application may use different voltage control modules to control the D+ port and the D- port in different time periods of the entire charging detection process, such as the mobile phone uses PMIC in the BC1.2 detection above, and uses SC in high-power fast charging identification processes such as HVDCP handshake detection. At this time, if the anti-counterfeiting detection fails and low-power charging is identified, the mobile phone can also switch to PMIC to control the D+ port and the D- port. In addition, in some embodiments, the mobile phone of the present application can use SC to control the D+ port and the D- port in the BC1.2 detection, and use PMIC to control the D+ port and the D- port in the subsequent high-power fast charging identification process. Of course, in the process of charging detection in the present application, PMIC and SC can also be switched in other ways, so that one of the PMIC and SC devices controls the D+ port and the D- port at the same time, and the present application does not make specific limitations on this.

[0092] In some other embodiments, the present application controls the D+ port and the D- port through a voltage control module in the PMIC or SC throughout the entire charging detection process, such as controlling the D+ port and the D- port through the PMIC to avoid conflicts in the control of the D+ port and the D- port.

[0093] In order to further improve the success rate of HVDCP handshake, in this application, before the electronic device enters the HVDCP handshake detection, the mobile phone can first trigger the charger reset. For example, the mobile phone can pull down the level of the D+ port on the mobile phone side for a period of time (such as 10ms), so that the D+ port on the charger side is also low, and then the charger can reset the charger after detecting that the D+ port on the charger side is pulled down for a period of time, so that the D+ port and D- port of the charger are short-circuited. In this way, the mobile phone can perform HVDCP handshake detection when the charger is short-circuited between the D+ port and the D- port, which is conducive to improving the success rate of the HVDCP handshake.

[0094] In addition, in order to further improve the success rate of the HVDCP handshake, in some embodiments, the present application may set the HVDCP handshake condition, such as the condition including: the D+ port of the mobile phone is at a high level (such as 0.6V) and the D- port is at a low level (0V). Specifically, in the process of executing the HVDCP handshake detection, the mobile phone pulls up the D+ port and holds it for a period of time (such as 10ms), and then the levels of the D+ port and the D- port can be detected respectively. If the HVDCP handshake condition is met, it indicates that the HVDCP handshake is successful, otherwise it indicates that the HVDCP handshake fails. It can be understood that in the HVDCP handshake process, after the mobile phone pulls up D+ and holds it for a period of time, the mobile phone detects that the D+ port on the mobile phone side is at a high level and the D- port is at a low level, indicating that the charger correctly disconnects the short circuit of the D+ port and the D- port. Therefore, the mobile phone detects that the above-mentioned HVDCP handshake condition is met, indicating that the HVDCP handshake of the mobile phone to the charger is successful. Thus, the accuracy of the HVDCP handshake can be further improved by determining the above-mentioned HVDCP handshake condition.

[0095] Furthermore, in order to improve the success rate of exiting anti-counterfeiting detection, in some embodiments, the present application adds an anti-counterfeiting exit mechanism. Specifically, the present application can set one or more anti-counterfeiting exit conditions. When the anti-counterfeiting detection cannot be exited normally, when it is detected that one or more anti-counterfeiting exit conditions are met, the charger can be forced to exit the anti-counterfeiting detection. Thus, it can be ensured that the charger can correctly exit the anti-counterfeiting detection to improve the accuracy of high-power fast charging identification.

[0096] For example, the present application may set anti-counterfeiting exit condition 1, including: when the mobile phone is detected to obtain the charging capacity of the charger, the charger exits anti-counterfeiting. For example, the charger may automatically exit the anti-counterfeiting detection state when it detects that the mobile phone reads the charging capacity information in the charger's 0x7E register.

[0097] For another example, the present application may set anti-counterfeiting exit condition 2, including: after the mobile phone sets the anti-counterfeiting encryption index for the charger, if the charger has not exited the anti-counterfeiting detection after a preset time (such as 5 to 60 seconds, 10 seconds, etc.), the charger automatically forces the exit of the anti-counterfeiting detection. Specifically, an anti-counterfeiting timeout timer of a preset time can be pre-set in the charger. Then, when the mobile phone sets the anti-counterfeiting encryption index for the charger, such as when the mobile phone writes the anti-counterfeiting encryption index into the register 0xCE in the charger, the charger can start the anti-counterfeiting timeout timer. During the timing of the anti-counterfeiting timeout timer, if the mobile phone writes 0xFF to the register 0xCE of the charger, indicating that the mobile phone instructs the charger to exit the anti-counterfeiting detection, the charger stops the timer and exits the anti-counterfeiting detection state. Conversely, when the anti-counterfeiting timeout timer times out, the charger can automatically force the exit of the anti-counterfeiting state.

[0098] Then, when at least one of the above-mentioned exit anti-counterfeiting condition 1 or exit anti-counterfeiting condition 2 is met, the charger can set the value of the anti-counterfeiting flag to 0 or clear the anti-counterfeiting flag to trigger the charger to automatically exit the anti-counterfeiting detection.

[0099] In this way, this application improves the success rate of mobile phones in correctly identifying high-power fast charging for chargers, especially standard chargers, by improving the success rate of BC1.2 detection, HVDCP handshake, and exiting anti-counterfeiting detection, so that the mobile phone can correctly enter high-power fast charging after being inserted into the standard charger, thereby ensuring charging efficiency.

[0100] It should be understood that in other embodiments, the exit anti-counterfeiting conditions include but are not limited to the above-mentioned exit anti-counterfeiting condition 1 and exit anti-counterfeiting condition 2, and can also be set to other conditions according to actual needs. The embodiments of the present application do not make specific limitations on this.

[0101] The following mainly takes the electronic device as a mobile phone 100 and the power adapter as a charger 200 as an example to illustrate the charging detection and charging process between the charger 200 and the mobile phone 100.

[0102] Embodiment 1

[0103] Reference Figure 3 FIG. 1 is a flow chart of a charging detection method provided in an embodiment of the present application, and the method comprises the following steps:

[0104] 301 : The mobile phone 100 detects that the charger 200 is connected to the mobile phone 100 .

[0105] 302: The mobile phone 100 performs BC1.2 detection based on the PMIC and determines whether the charger 200 is of the DCP type.

[0106] Specifically, the mobile phone 100 performs BC1.2 detection based on PMIC, which means that the mobile phone 100 controls and detects the voltage of the D+ port and the D- port on the mobile phone side through the PMIC. For example, after the mobile phone 100 applies a high level to the D+ port on the mobile phone side for a period of time, it is detected that the D- port on the mobile phone side is at a high level, and after the mobile phone 100 applies a low level to the D- port on the mobile phone side for a period of time, it is detected that the D+ port on the mobile phone side is at a low level, then it is determined that the charger 200 is a DCP type.

[0107] It can be understood that the control and detection process of the voltage of the D+ port and the voltage of the D+ port by the mobile phone 100 in step 302 is as mentioned above and will not be described in detail here.

[0108] In some implementations, when the mobile phone 100 of the present application performs BC1.2 detection, the voltage control module that controls the voltage of the D+ port and the D- port in the charging port 110 is PMIC by default, but is not limited thereto.

[0109] It can be understood that in the present application, the mobile phone 100 mainly controls the voltage of the D+ port on the mobile phone side during the charging detection process, and the following implementation only needs to explain the control of the D+ port by the PMIC or SC.

[0110] If it is detected that the charger 200 is not of the DCP type, then 317 is executed to enter low-power charging (such as buck charging), and the voltages of the D+ port and the D- port in the mobile phone 100 are still controlled by the PMIC during the subsequent low-power charging process. Otherwise, if it is detected that the charger 200 is of the DCP type, then 303 is executed.

[0111] 303: The mobile phone 100 switches the voltage control module from PMIC to SC. That is, the mobile phone 100 switches the voltage control module controlling the D+ port and the D- port from PMIC to SC.

[0112] That is, the mobile phone 100 turns off the voltage output of the PMIC to the D+ port and the D- port on the mobile phone side, such as setting the port of the PMIC connected to the D+ port (denoted as port 1) to a high configuration (hiz) or disconnecting the connection between port 1 and the D+ port on the mobile phone side, and the voltage of the D+ port is controlled by the SC.

[0113] 304: The mobile phone 100 performs HVDCP handshake with the charger 200 based on the SC, and determines whether the HVDCP handshake is successful.

[0114] In some embodiments, the SC can control the D+ port to be at a high level (recorded as a second level, such as 0.6V) and last for a second duration (such as 1s). For example, during the HVDCP handshake, the mobile phone 100 applies a high level to the D+ port on the mobile phone side for a period of time (such as 10ms). If the D- port on the mobile phone side is detected to be at a low level, it indicates that the HVDCP handshake is successful. Otherwise, if the D- port is not at a low level, it indicates that the HVDCP handshake fails.

[0115] If the HVDCP handshake fails, the process proceeds to step 315 to enter low-power charging, such as buck charging. If the HVDCP handshake succeeds, the process proceeds to step 305.

[0116] 305 : The mobile phone 100 sends a ping request to the charger 200 .

[0117] 306: The mobile phone 100 determines whether a ping response from the charger 200 is received within the third time period.

[0118] If no ping response is received within the third time period, that is, the ping fails, then 315 is executed. If a ping response is received within the third time period, that is, the ping succeeds, then 307 is executed. For example, the third time period may be 50 ms. In addition, the specific value of the third time period may be set according to actual needs and is not limited to the above example.

[0119] 307 : The mobile phone 100 reads the charger information from the charger 200 .

[0120] Exemplarily, the charger information may include charging capability, voltage, current, and the like.

[0121] In some embodiments, the mobile phone 100 sends a first instruction to the charger 200 to obtain information about the charger. For example, in response to the first instruction, the charger 200 can read the charging capability stored in the 0x7E register (ie, the first register) and read other information such as the current and voltage of the charger.

[0122] 308 : The mobile phone 100 writes the anti-counterfeiting key index to the charger 200 .

[0123] In some embodiments, the mobile phone 100 sends a second instruction to the charger 200 to write the anti-counterfeiting key index. For example, in response to the second instruction, the charger 200 may write the anti-counterfeiting key index in the register 0xCE.

[0124] It can be understood that the anti-counterfeiting key index is written into the register 0xCE to instruct the charger 200 to enter the anti-counterfeiting detection state.

[0125] 309: The charger 200 sets the anti-counterfeiting detection flag to the first state and enters the anti-counterfeiting detection state.

[0126] For example, the first state indicates that the charger 200 sets the value of the anti-counterfeiting detection flag to 1, or sets the anti-counterfeiting detection flag to trigger the charger 200 to enter the anti-counterfeiting detection state.

[0127] 310 : The mobile phone 100 performs anti-counterfeiting detection on the charger 200 .

[0128] 311: The mobile phone 100 writes exit parameters to the charger 200.

[0129] In some embodiments, the mobile phone 100 sends a third instruction to the charger 200 to write an exit parameter such as 0xFF to the register 0xCE, wherein the exit parameter is used to instruct the charger 200 to exit the anti-counterfeiting detection state.

[0130] 312: The charger 200 sets the anti-counterfeiting detection flag to the second state and exits the anti-counterfeiting detection state.

[0131] For example, the second state indicates that the charger 200 sets the value of the anti-counterfeiting detection flag to 0, or clears the anti-counterfeiting detection flag, so as to trigger the charger 200 to exit the anti-counterfeiting detection state.

[0132] 313: The mobile phone 100 determines whether the anti-counterfeiting detection is successful.

[0133] If the anti-counterfeiting detection is successful, it means that the charger is a standard charger, and high-power charging is performed in step 314. Otherwise, it means that the charger 200 is a non-standard charger, and low-power charging is performed in step 315.

[0134] 314: Mobile phone 100 enters high-power fast charging.

[0135] 315: The mobile phone 100 switches the voltage control module from SC to PMIC and enters low-power charging, so that the mobile phone 100 can use PMIC to control the voltage of the D+ port and the D- port during the subsequent low-power charging process, avoiding voltage control conflicts caused by using SC.

[0136] 316: The mobile phone 100 detects that the high-power fast charging has ended and switches the voltage control module from SC to PMIC.

[0137] That is, the mobile phone 100 turns off the voltage output of the SC to the D+ port and the D- port, such as setting the port connected to the D+ port of the SC (referred to as port 2) to high configuration (hiz) or disconnecting the connection between port 2 and the D+ port on the mobile phone side, and the voltage of the D+ port is controlled by the PMIC. In the next charging detection process, the mobile phone 100 can use the PMIC to control the voltage of the D+ port and the D- port by default, avoiding voltage control conflicts caused by the use of the SC.

[0138] 317: Mobile phone 100 enters low-power charging.

[0139] At this time, the mobile phone 100 can continue to use the PMIC to control the voltages of the D+ port and the D- port.

[0140] Thus, in the charging detection method provided by the present application, the D+ port and the D- port are always controlled by a voltage control module in the PMIC or SC during the charging detection process, so that the control conflict between the D+ port and the D- port can be avoided. Thus, the success rate of BC1.2 detection, HVDCP handshake and other detections is guaranteed, which is conducive to improving the success rate of correctly identifying high-power fast charging.

[0141] Embodiment 2

[0142] In some embodiments, the present application can further improve the success rate of HVDCP handshake to improve the success rate of correctly identifying high-power fast charging. Based on the above embodiments, the present application further improves the HVDCP handshake-related processes of the above embodiments.

[0143] Figure 4 FIG. 2 is a schematic diagram of an implementation flow of a charging detection method according to an embodiment of the present application. Figure 4 As shown, the process includes the following steps:

[0144] 401: The mobile phone 100 detects that the charger 200 is connected to the mobile phone 100.

[0145] 402: The mobile phone 100 performs BC1.2 detection based on the PMIC and determines whether the charger 200 is of the DCP type.

[0146] If it is determined to be yes, execute 418, otherwise execute 403. For example, after the mobile phone 100 applies a high level to the D+ port on the mobile phone side for a period of time, it is detected that the D- port on the mobile phone side is at a high level, and after the mobile phone 100 applies a low level to the D- port on the mobile phone side for a period of time, it is detected that the D+ port on the mobile phone side is at a low level, then it is determined that the charger 200 is a DCP type.

[0147] 403: The mobile phone 100 switches the voltage control module from PMIC to SC. That is, the mobile phone 100 switches the voltage control module controlling the D+ port and the D- port from PMIC to SC.

[0148] Among them, the above 401-403 are the same as 301-303 in Example 1, and are not described here in detail.

[0149] 404: The mobile phone 100 applies a first voltage to the D+ port through the SC for a first duration.

[0150] It can be understood that the mobile phone 100 applies the first voltage to the D+ port, which means pulling the D+ port down, that is, setting the D+ port to a low level. The first voltage is less than or equal to the first preset voltage. For example, the first preset voltage is a voltage less than or equal to 0.32V, such as 0V. In addition, the above-mentioned first duration can be any value in 1 to 100ms, such as 10ms.

[0151] 405 : The charger 200 detects that the D+ port has a first voltage and lasts for a first period of time, and resets the charger.

[0152] Specifically, when the mobile phone 100 pulls down the D+ port on the mobile phone side to a first voltage such as 0V and maintains it for a first period of time, since the D+ port of the charger 200 is connected to the D+ port of the mobile phone 100, as long as the pulling-down function of the D+ port of the charger 200 is normal, the D+ port in the charger 200 will be pulled down to the first voltage and maintained for the first period of time, thereby resetting the charger 200.

[0153] It is understood that when the D+ port of the charger 200 is pulled low and lasts for a preset reset time, the charger 200 will automatically reset. For example, the preset reset time can be any value in 10 to 100 ms, such as 10 ms.

[0154] In some other embodiments, in 405 , the charger 200 detects that the D+ port has the first voltage for a period of time, and the period of time may be less than the first duration.

[0155] In some embodiments, when the charger 200 is reset, the D+ port and the D- port in the charger 200 can be short-circuited, and the D+ port and the D- port are both at a low level. In this way, the charger 200 can be reset before the mobile phone 100 performs the HVDCP handshake, and the HVDCP handshake failure will not occur due to the D+ port and the D- port in the charger 200 not being short-circuited, which is conducive to improving the success rate of the HVDCP handshake.

[0156] 406: The mobile phone 100 performs HVDCP handshake with the charger 200 based on the SC, and determines whether the HVDCP handshake is successful according to the HVDCP handshake condition.

[0157] In some embodiments, when the mobile phone 100 performs an HVDCP handshake, the D+ port can be set to a second voltage through the SC, and last for a second duration, and detect whether the HVDCP handshake condition is met. For example, the second voltage is greater than or equal to the second preset voltage. For example, the second preset voltage is a voltage greater than or equal to 0.6V, such as 0.6V. In addition, the above-mentioned second duration can be 0.5 to 2 seconds, such as 1 second. Specifically, the above-mentioned HVDCP handshake condition includes: the voltage of the D+ port of the mobile phone 100 is greater than or equal to the second preset voltage, and the voltage of the D+ port of the mobile phone 100 is less than or equal to the first preset voltage, that is, the D+ port is a high level and the D- port is a low level.

[0158] In some embodiments, in the HVDCP handshake process, after the mobile phone 100 pulls up the D+ port for a period of time, the charger 200 will normally disconnect the short circuit between the D+ port and the D- port. Therefore, in the HVDCP handshake process, after the mobile phone pulls up the D+ port and keeps it for a period of time, the mobile phone detects that the D+ port is at a high level and the D- port is at a low level, indicating that the charger correctly disconnects the short circuit between the D+ port and the D- port. Therefore, the mobile phone detects that the above HVDCP handshake conditions are met, indicating that the HVDCP handshake between the mobile phone and the charger is successful. Therefore, the accuracy of the HVDCP handshake can be further improved by determining the above HVDCP handshake conditions.

[0159] If the HVDCP handshake fails, the process goes to step 417 . Otherwise, the process goes to step 407 .

[0160] 407 : The mobile phone 100 sends a ping request to the charger 200 .

[0161] 408: The mobile phone 100 determines whether a ping response from the charger 200 is received within the third time period.

[0162] If the ping fails, execute 418, otherwise execute 409. If no ping response is received within the third time period, the ping fails. If a ping response is received within the third time period, the ping succeeds. For example, the third time period may be 50 ms.

[0163] 409: The mobile phone 100 reads the charger information from the charger 200.

[0164] 410 : The mobile phone 100 writes the anti-counterfeiting key index to the charger 200 .

[0165] 411: The charger 200 sets the anti-counterfeiting detection flag to the first state and enters the anti-counterfeiting detection state.

[0166] 412 : The mobile phone 100 performs anti-counterfeiting detection on the charger 200 .

[0167] 413: The mobile phone 100 writes exit parameters to the charger 200.

[0168] 414: the anti-counterfeiting detection flag of the charger 200 is in the second state, and the anti-counterfeiting detection state is exited.

[0169] For example, the charger 200 sets the value of the anti-counterfeiting detection flag to 0, or clears the anti-counterfeiting detection flag, to trigger the charger 200 to exit the anti-counterfeiting detection state.

[0170] 415: Whether the anti-counterfeiting detection performed by the mobile phone 100 is successful.

[0171] If the anti-counterfeiting detection is successful, it means that the charger is a standard charger, and high-power charging is performed in step 416. Otherwise, it means that the charger 200 is a non-standard charger, and low-power charging is performed in step 417.

[0172] 416: Mobile phone 100 enters high-power fast charging.

[0173] 417: The mobile phone 100 switches the voltage control module from SC to PMIC and enters low-power charging.

[0174] For example, low-power charging can charge a buck.

[0175] 418: The mobile phone 100 detects that the high-power fast charging has ended and switches the voltage control module from SC to PMIC.

[0176] 419: Mobile phone 100 enters low-power charging.

[0177] The descriptions of 407-419 are the same as those of 305-317 in the first embodiment and are not repeated here.

[0178] In this way, the charging detection method provided in the embodiment of the present application can improve the success rate of the HVDCP handshake, thereby improving the success rate of the mobile phone correctly entering high-power fast charging.

[0179] Embodiment 3

[0180] In some embodiments, the present application can further improve the success rate of normal exit of anti-counterfeiting detection to improve the success rate of correctly identifying high-power fast charging. Based on the above embodiments, the embodiments of the present application further improve the process related to exiting anti-counterfeiting detection in the above embodiments.

[0181] Figure 5 FIG. 2 is a schematic diagram of an implementation flow of a charging detection method according to an embodiment of the present application. Figure 5 As shown, the process includes the following steps:

[0182] 501: The mobile phone 100 detects that a charger is connected to the mobile phone, or detects that the mobile phone 100 is restarted when the charger is connected to the mobile phone but is not charging.

[0183] Among them, the description of the above 501 can refer to the relevant description of 301 in Example 1, and the similarities are not repeated here. In addition, the difference of 501 is that the mobile phone 100 detects that the mobile phone 100 is restarted when the charger 200 is inserted into the charger port 11 and is not charging. For example, the mobile phone 100 detects that the mobile phone 100 is restarted before the charger 200 is inserted into the charger port 11 and before the exit parameter is sent to the charger 200. At this time, the restart of the mobile phone 100 causes the mobile phone 100 to be unable to send the exit parameter to the charger 200, and the charger 200 usually cannot exit the anti-counterfeiting detection state normally. In addition, when the mobile phone 100 does not start charging but restarts, it usually re-enters the charging detection process, such as entering 502.

[0184] 502: The mobile phone 100 performs BC1.2 detection based on the PMIC and determines whether the charger 200 is of the DCP type.

[0185] If it is determined that S524 is executed, otherwise S503 is executed. For example, after the mobile phone 100 applies a high level to the D+ port on the mobile phone side for a period of time, it is detected that the D- port on the mobile phone side is at a high level, and after the mobile phone 100 applies a low level to the D- port on the mobile phone side for a period of time, it is detected that the D+ port on the mobile phone side is at a low level, then it is determined that the charger 200 is a DCP type.

[0186] 503: The mobile phone 100 switches the voltage control module from PMIC to SC.

[0187] 504: The mobile phone 100 applies a first voltage to the D+ port through the SC and lasts for a first duration.

[0188] 505: The charger 200 detects that the D+ port has a first voltage and lasts for a first time period, and resets the charger 200.

[0189] 506: The mobile phone 100 performs HVDCP handshake with the charger 200 based on the SC, and determines whether the HVDCP handshake is successful according to the HVDCP handshake condition.

[0190] For example, in the HVDCP handshake process, after the mobile phone 100 pulls up the D+ port for a period of time, the mobile phone detects that the D+ port on the mobile phone side is at a high level and the D- port is at a low level, indicating that the HVDCP handshake is successful. Conversely, if the D+ port on the mobile phone side is not at a high level and the D- port is at a low level, the HVDCP handshake fails.

[0191] If the HVDCP handshake fails, the process goes to S525 ; otherwise, the process goes to 507 .

[0192] 507 : The mobile phone 100 sends a ping request to the charger 200 .

[0193] 508: The mobile phone 100 determines whether a ping response from the charger 200 is received within the third time period.

[0194] For example, the third time length is 50 ms.

[0195] If the ping fails, execute S522 ; otherwise, execute 509 .

[0196] The above 502-508 are the same as 402-403 in the second embodiment, and are not described here in detail. Based on 502-508, the mobile phone 100 determines that the charger 200 is of DCP type, the HVDCP handshake is successful, and the ping is successful.

[0197] 509 : The mobile phone 100 sends a first instruction from the charger 200 to the charger 200 .

[0198] The first instruction is used by the mobile phone 100 to obtain charger information from the charger 200, such as charging capacity, current and voltage.

[0199] 510: The charger 200 reads the charging capability in the first register and sets the anti-counterfeiting detection flag to the second state.

[0200] For example, the first register is the 0x7E register, and the second state corresponds to the charger 200 exiting the anti-counterfeiting detection state. That is, in 510, the charger 100 reads the 0x7E register and automatically exits the anti-counterfeiting detection state.

[0201] It can be understood that, assuming that the charger 200 did not exit the anti-counterfeiting detection state during the last charging detection process due to factors such as the restart of the mobile phone 100, then during this charging detection process, the charger 200 may not be able to read the charger's voltage, current and other information normally under normal circumstances. In the embodiment of the present application, when the charger 200 reads the 0x7E register, if the current charger 200 is abnormally in the anti-counterfeiting detection state, the charger 200 sets the anti-counterfeiting detection flag to the second state, which can trigger the charger 200 to exit the range detection state. In this way, it can be ensured that the charger 200 correctly executes the information returned to the mobile phone 100, and normally executes the subsequent charging detection process.

[0202] In this way, even if the charger 200 cannot exit the anti-counterfeiting detection state due to the restart of the mobile phone before the charging detection is completed, the charger 200 can be instructed to exit the anti-counterfeiting detection state after the ping is successful during the subsequent re-entry into the charging detection process to ensure the success rate of the subsequent anti-counterfeiting detection.

[0203] 511: The charger 200 reads information other than the charging capability from the charger information.

[0204] 512: The charger 200 sends charger information to the mobile phone 100.

[0205] 513: The mobile phone 100 writes the anti-counterfeiting key index to the charger 200.

[0206] The description of 513 may refer to the description of 308 in the above embodiment 1. In some embodiments, the mobile phone 100 sends a second instruction to the charger 200 to enable the charger 200 to write the anti-counterfeiting key index.

[0207] 514: The charger 200 sets the anti-counterfeiting detection flag to the first state, enters the anti-counterfeiting detection state, and starts a preset timer.

[0208] Among them, the timing duration of the preset timer (ie, the anti-counterfeiting timeout timer) can be a preset duration, such as a value of the preset duration ranging from 5 to 60 seconds, such as 10 seconds.

[0209] 515 : The mobile phone 100 performs anti-counterfeiting detection on the charger 200 .

[0210] 516 : The charger 200 detects whether the first exit condition is met.

[0211] The first exit condition includes: the charger 200 does not receive a third instruction sent by the mobile phone 100 within the timing duration of the preset timer, and the third instruction is used to instruct the charger 200 to exit the anti-counterfeiting detection state. For example, the third instruction is used by the mobile phone 100 to write an exit parameter to the charger 200, such as writing 0xFF to the register 0XCE, to trigger the charger 200 to exit the anti-counterfeiting detection state.

[0212] If it is detected that the first exit condition is not met, that is, the charger receives the third instruction within the timing duration of the preset timer, then enter 517 to allow the charger 200 to normally exit the anti-counterfeiting detection state. If it is detected that the first exit condition is met, that is, the charger 200 does not receive the third instruction sent by the mobile phone 100 within the timing duration of the preset timer, then enter 518 to force the charger 200 to exit the anti-counterfeiting detection state.

[0213] 517: The charger 200 writes the exit parameters.

[0214] It can be understood that after the charger 200 writes the exit parameter such as 0xFF, the charger 200 can execute 519 to normally exit the detection state.

[0215] 518: The charger 200 resets the preset timer that has not stopped timing.

[0216] It can be understood that when the preset timer reaches the preset time, the charger 200 has not received the third instruction sent by the mobile phone 100, indicating that the mobile phone 100 cannot normally instruct the charger 200 to exit the anti-counterfeiting detection state. At this time, the charger 200 executes 519 to force the anti-counterfeiting detection state to exit under abnormal circumstances.

[0217] It can be understood that the charger 200 resets the preset timer so that the preset timer can be normally timed when the charger 200 enters the charger identification process next time.

[0218] Among them, the above 517 and 518 are parallel processes.

[0219] 519: The charger 200 sets the anti-counterfeiting detection flag to the second state and exits the anti-counterfeiting detection state.

[0220] For example, the charger 200 sets the value of the anti-counterfeiting detection flag to 0, or clears the anti-counterfeiting detection flag, to trigger the charger 200 to exit the anti-counterfeiting detection state.

[0221] 520: The mobile phone 100 determines whether the anti-counterfeiting detection is successful.

[0222] If the anti-counterfeiting detection is successful, execute 521 to enter high-power fast charging, otherwise execute 522 to enter low-power charging.

[0223] 521: Mobile phone 100 enters high-power fast charging.

[0224] 522: The mobile phone 100 switches the voltage control module from SC to PMIC and enters low-power charging.

[0225] 523: The mobile phone 100 detects that the high-power fast charging has ended, and switches the voltage control module controlling the D+ port and the D- port from SC to PMIC.

[0226] 524: Mobile phone 100 enters low-power charging.

[0227] For example, low-power charging can charge a buck.

[0228] Among them, the description of 509-524 is the same as 305-317 in Example 1 and is not repeated here.

[0229] In this way, the charging detection method provided in the embodiment of the present application can improve the success rate of the charger exiting the anti-counterfeiting detection state, thereby improving the success rate of the mobile phone correctly entering high-power fast charging.

[0230] Embodiment 4

[0231] In some embodiments, based on the above embodiments, the overall process of the charging detection method in the present application is described. Figure 6 FIG. 2 is a schematic diagram of an implementation flow of a charging detection method according to an embodiment of the present application. Figure 6 As shown, the process includes the following steps:

[0232] 601: BC1.2 detection. That is, the mobile phone 100 performs BC1.2 detection on the charger 200.

[0233] 602: Determine whether the charger is a DCP, that is, whether the charger 200 is a DCP type.

[0234] If the charger is detected as a non-DCP type, the process proceeds to step 617 to enter low-power charging, such as buck charging. If the charger is detected as a DCP type, the process proceeds to step 602.

[0235] 603: Turn off the D+ port output of the PMIC, and let the SC control the D+ port output. That is, the mobile phone 100 turns off the voltage output of the PMIC to the D+ port and the D- port, and uses the voltage output of the D+ port and the D- port of the SC.

[0236] 604: The D+ port is pulled high for 10ms. That is, the mobile phone 100 pulls the D+ port on the mobile phone side high for 10ms.

[0237] 605: Determine whether the HVDCP handshake is successful. That is, the mobile phone 100 performs the HVDCP handshake on the charger 200 and determines whether the HVDCP handshake is successful.

[0238] If the HVDCP handshake fails, the mobile phone 100 executes 615 and then enters low-power charging, such as buck charging. If the HVDCP handshake succeeds, the mobile phone 100 enters the charging detection step in 605.

[0239] 606: Determine whether the ping is successful. That is, the mobile phone 100 performs a ping test on the charger 200 to determine whether the ping is successful.

[0240] If the ping fails, the mobile phone 100 executes 615 and then enters low-power charging. If the ping succeeds, the mobile phone 100 enters the subsequent charging detection step in 607.

[0241] 607: Obtain charger information. That is, the mobile phone 100 obtains the charger 200 information.

[0242] In some embodiments, during the process of acquiring information of the charger 200, the charger 200 may exit the anti-counterfeiting detection state when reading the charging capability in the register 0X7E.

[0243] 608: Write the anti-counterfeiting key index. That is, the mobile phone 100 writes the anti-counterfeiting key index for the charger 200.

[0244] In some embodiments, after the charger 200 writes the anti-counterfeiting key index into the register 0xCE, it may enter the anti-counterfeiting detection state and start a preset timer.

[0245] 609: Anti-counterfeiting detection. That is, the mobile phone 100 performs anti-counterfeiting detection on the charger 200.

[0246] 610: exit the anti-counterfeiting detection state. That is, the mobile phone 100 triggers the charger 200 to exit the anti-counterfeiting detection state.

[0247] In some embodiments, the charger 200 may detect an exit parameter sent by the mobile phone 100 when the preset timer has not stopped, and exit the anti-counterfeiting detection state after writing the exit parameter into the register 0xCE.

[0248] In other embodiments, the charger 200 may exit the anti-counterfeiting detection state when the charger 200 fails to detect the exit parameter sent by the mobile phone 100 within the timing duration of a preset timer.

[0249] 611: Determine whether the anti-counterfeiting detection is successful.

[0250] After the charger 200 exits the anti-counterfeiting detection state, if the anti-counterfeiting detection is successful, execute 612 to enter high-power fast charging, and if the anti-counterfeiting detection fails, execute 615 to enter low-power charging.

[0251] 612: Entering high-power fast charging. That is, the mobile phone 100 enters high-power fast charging.

[0252] 613: Charging is completed. That is, the mobile phone 100 detects that high-power fast charging is completed.

[0253] 614: Turn off the D+ port output of the SC and control the D+ port output by the PMIC. For example, the mobile phone 100 turns off the voltage output of the SC to the D+ port and the D- port, and uses the voltage output of the D+ port and the D- port of the PMIC. In the next charging detection process, the mobile phone 100 can use the PMIC to control the voltage of the D+ port and the D- port by default.

[0254] 615: Turn off the D+ port output of the SC and control the D+ port output by the PMIC. For example, the mobile phone 100 turns off the voltage output of the SC to the D+ port and the D- port, and uses the voltage output of the D+ port and the D- port of the PMIC. This allows the mobile phone 100 to use the PMIC to control the voltage of the D+ port and the D- port during the subsequent buck charging process.

[0255] 616: Entering low-power charging. That is, the mobile phone 100 enters low-power charging. At this time, the mobile phone 100 switches the voltage control module from SC to PMIC to enter low-power charging.

[0256] 617: Entering low-power charging. That is, the mobile phone 100 enters low-power charging. At this time, the mobile phone 100 enters low-power charging while maintaining the voltage control module as PMIC.

[0257] The description of 601-617 can refer to the description of 201-212 above, and the similarities are not repeated here. The difference is that 603, 604, 614, 615 and steps related to the charger 200 exiting the anti-counterfeiting detection are added. In this way, based on these different steps, the success rate of BC1.2 detection, HVDCP handshake, and exiting the anti-counterfeiting detection state can be improved.

[0258] In this way, the embodiment of the present application can improve the success rate of correctly identifying the charger for high-power fast charging by improving the success rate of BC1.2 detection, HVDCP handshake, ping detection and anti-counterfeiting detection in charging detection, thereby ensuring that the mobile phone has a high charging efficiency. In this way, the misidentification rate of the charger can be reduced, and the charging speed and charging experience can be improved.

[0259] Next, taking a mobile phone as an example, the hardware structure of the electronic device is described.

[0260] like Figure 7 , which is a schematic diagram of the structure of a mobile phone provided in an embodiment of the present application. The mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0261] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0262] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0263] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

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

[0265] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices. Specifically, the USB interface 130 may include a D+ port and a D- port, etc.

[0266] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0267] The charging management module 140 is used to receive charging input from a charger (or power adapter). The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the mobile phone 100. While the charging management module 140 is charging the battery 142, it can also power the electronic device through the power management module 141.

[0268] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device. For example, the power management module 141 may include a PMIC and a SC to control the voltage of the D+ port and the D- port in the USB interface 130. For example, the present application can perform a charging detection process through processing 110, and the specific processing 110 can control the power management module 141 to charge the charger, such as identifying a high-power fast charge.

[0269] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0270] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0271] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0272] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0273] In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0274] The mobile phone 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0275] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0276] The mobile phone 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0277] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0278] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0279] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0280] The audio module 170 may include a speaker, a receiver, a microphone, an earphone interface, and an application processor. The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0281] The key 190 includes a power key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The mobile phone 100 can receive key input and generate key signal input related to the user settings and function control of the mobile phone 100.

[0282] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.

[0283] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0284] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the mobile phone 100 by inserting the SIM card interface 195 or pulling the SIM card interface 195 out. The mobile phone 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.

[0285] Next, taking the power adapter as a charger as an example, the structure of the charger is described.

[0286] like Figure 8 As shown, a schematic diagram of the structure of a charger is provided in an embodiment of the present application.

[0287] Processing unit 1101 , memory 1102 , and communication interface 1103 . For example, the processor 1101 , the memory 1102 , and the communication interface 1103 may be connected via a line 1104 .

[0288] Among them, the processor 1101 is used to read the information of the charger, write the anti-counterfeiting inspection key index, write the exit parameters, set the anti-counterfeiting detection flag, etc. The memory 1102 includes registers 0x7E, registers 0xCE, etc., which are used to store the charging capacity of the charger 200, the anti-counterfeiting inspection key index, the exit parameters, etc. The communication interface 1103 can be a USB interface, such as a USB Type C interface. The communication interface 1103 can be used to connect the mobile phone 100 and charge the mobile phone 100, and can also transmit data with the mobile phone 100, such as transmitting charging capacity, anti-counterfeiting inspection key index, exit parameters and other data. For example, the communication interface 1103 may include a D+ port and a D- port. Of course, the structure may also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0289] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the mobile phone in the above-mentioned method embodiment.

[0290] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the mobile phone in the above method embodiment.

[0291] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.

[0292] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0293] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0294] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or by other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to, a floppy disk, an optical disk, an optical disk, a read-only memory, a magneto-optical disk, a read-only memory, a random access memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a magnetic card or an optical card, a flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier wave, infrared signal digital signal, etc.) using the Internet in an electrical, optical, acoustic or other form of propagation signal. Therefore, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.

[0295] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0296] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.

[0297] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0298] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims

1. A charging detection method, characterized in that: Applied to electronic equipment, the method comprises: Detecting that a power adapter is plugged into a first charging interface of the electronic device, wherein the first charging interface includes a first charging protocol communication pin; Performing a first charging detection on the power adapter to identify whether the power adapter is of a first type, wherein the voltage of the first charging protocol communication pin is controlled by a first voltage control module in the first charging detection; Corresponding to detecting that the power adapter is of the first type, a second charging detection is performed on the power adapter, wherein in the second charging detection, the voltage of the first charging protocol communication pin is controlled by a second voltage control module.

2. The method according to claim 1, characterized in that The first charging protocol communication pin includes a first D+ port and a first D- port.

3. The method according to claim 2, characterized in that The second charging detection includes at least one of the following: performing a high-voltage charging handshake on the power adapter, performing a ping detection on the power adapter, obtaining information of the power adapter, controlling the power adapter to enter an anti-counterfeiting detection state, performing an anti-counterfeiting detection on the power adapter, and controlling the power adapter to exit the anti-counterfeiting detection state.

4. The method according to claim 3, characterized in that The first voltage control module and the second voltage control module are the same or different; Furthermore, the first voltage control module is a power management integrated circuit PMIC or SC in the electronic device, and the second voltage control module is the PMIC or the SC.

5. The method according to claim 4, characterized in that The method further comprises: Corresponding to the first voltage control module being different from the second voltage control module, it is detected that a switching condition is met, and the voltage control module controlling the first charging protocol communication pin is switched from the second voltage control module to the first voltage control module; Among them, the switching conditions include at least one of the following: failure to execute a high-voltage charging handshake on the power adapter, success in executing a high-voltage charging handshake on the power adapter and failure in a ping detection, success in executing a high-voltage charging handshake on the power adapter, success in a ping detection and failure in an anti-counterfeiting detection.

6. The method according to claim 2, characterized in that The method further comprises: In response to detecting that the power adapter is of the first type, the second voltage control module is used to control the voltage of the first D+ port to be a first voltage and last for a first period of time, so that the power adapter is reset, wherein the first voltage is less than or equal to a first preset voltage.

7. The method according to claim 6, characterized in that The power adapter includes a second charging port, the second charging port includes a second charging protocol communication pin, and the second charging protocol communication pin includes a second D+ port and a second D- port; Furthermore, after the power adapter is reset, the second D+ port and the second D- port are short-circuited; Corresponding to the second charging port being inserted into the first charging port, the first D+ port is connected to the second D+ port and the first D- port is connected to the second D- port.

8. The method according to claim 3, characterized in that The method further comprises: Corresponding to executing a high-voltage charging handshake on the power adapter, the second voltage control module is used to control the voltage of the first D+ port to be a second voltage for a second period of time, and detect whether a high-voltage charging handshake condition is met. The high-voltage charging handshake conditions include: The voltage of the first D+ port is greater than or equal to a second preset voltage and the voltage of the first D- port is less than or equal to a first preset voltage.

9. The method according to claim 3, characterized in that: The obtaining the information of the power adapter includes: A first instruction is sent to the power adapter, wherein the first instruction is used to obtain the charging capability of the power adapter, and the first instruction is used to instruct the power adapter to exit the anti-counterfeiting detection state, and the information of the power adapter includes the charging capability of the power adapter.

10. The method according to claim 3, characterized in that: The controlling the power adapter to enter the anti-counterfeiting detection state includes: Sending a second instruction to the power adapter, wherein the second instruction is used to instruct the power adapter to enter an anti-counterfeiting detection state, and the second instruction is also used to instruct the power adapter to exit the anti-counterfeiting detection state when a first exit condition is met; The first exit condition includes: The power adapter does not receive a third instruction sent by the electronic device within the timing duration of a preset timer, and the third instruction is used to instruct the power adapter to exit the anti-counterfeiting detection state.

11. The method according to claim 10, characterized in that The method further comprises: The third instruction is sent to the power adapter, where the third instruction is used to instruct the power adapter to turn off the preset timer that has not stopped timing and exit the anti-counterfeiting detection state.

12. The method according to any one of claims 4 to 11, characterized in that The method further comprises: Corresponding to the anti-counterfeiting detection of the power adapter being successful and the power adapter exiting the anti-counterfeiting detection state, charging is performed at a first power through the power adapter; Wherein, the power adapter is a standard power adapter for the electronic device.

13. The method according to claim 5, characterized in that The method further comprises: Corresponding to the anti-counterfeiting detection of the power adapter failing and the power adapter exiting the anti-counterfeiting detection state, or detecting that the switching condition is met, charging is performed at the second power through the power adapter.

14. The method according to claim 12, characterized in that The method further comprises: Corresponding to the first voltage control module being different from the second voltage control module, when it is detected that the electronic device has finished charging at the first power, the voltage control module controlling the first charging protocol communication pin is switched from the second voltage control module to the first voltage control module.

15. A charging detection method, characterized in that: Applied to a power adapter, the power adapter includes a second charging port, the second charging port includes a second charging protocol communication pin, and the second charging protocol communication pin includes a second D+ port; The method comprises: Detecting that the second charging port is plugged into a first charging port of an electronic device, wherein the first charging port includes a first charging protocol communication pin, and the first charging protocol communication pin includes a first D+ port; Corresponding to the power adapter being of the first type, detecting that the voltage of the second D+ port is a first voltage and lasts for a first time period, resetting the power adapter, wherein the first voltage is applied by the voltage of the first D+ port, and the first voltage is less than or equal to a first preset voltage.

16. The method according to claim 15, characterized in that The second charging port also includes a second D-port; Corresponding to the resetting of the power adapter, the second D+ port and the second D- port are short-circuited.

17. The method according to claim 16, characterized in that The method further comprises: receiving a first instruction sent by the electronic device; In response to the first instruction, the charging capability of the power adapter is read, and the anti-counterfeiting detection state is exited, and the information of the power adapter includes the charging capability of the power adapter.

18. The method according to claim 17, characterized in that The method comprises: receiving a second instruction sent by the electronic device; In response to the second instruction, enter the anti-counterfeiting detection state and control a preset timer to start timing; Check whether the first exit condition is met; Corresponding to satisfying the first exit condition, exiting the anti-counterfeiting detection condition; The first exit condition includes: not receiving a third instruction sent by the electronic device within the timing duration of the preset timer, and the third instruction is used to instruct the power adapter to exit the anti-counterfeiting detection state.

19. The method according to claim 18, characterized in that The method further comprises: Corresponding to the first exit condition not being met, the anti-counterfeiting detection state is exited, and the preset timer that has not stopped timing is closed.

20. The method according to claim 19, characterized in that The first instruction is used to instruct the electronic device to read the charging capability of the power adapter from the first register of the power adapter; The second instruction is used to instruct the electronic device to write an anti-counterfeiting key index into a second register of the power adapter; The third instruction is used to instruct the electronic device to write an exit parameter into the second register, and the exit parameter is used to instruct the power adapter to exit the anti-counterfeiting detection state.

21. The method according to any one of claims 18 to 20, characterized in that The entry into the anti-counterfeiting detection state is achieved by: Setting the anti-counterfeiting detection flag in the power adapter to a first state, wherein the first state corresponds to the power adapter entering an anti-counterfeiting detection state; The exit from the anti-counterfeiting detection state is achieved by: The anti-counterfeiting detection flag in the power adapter is set to a second state, and the second state corresponds to the power adapter exiting the anti-counterfeiting detection state.

22. An electronic device, characterized in that: include: A memory for storing instructions executed by one or more processors of an electronic device, and a processor, which is one of the processors of the electronic device, for executing the charging detection method according to any one of claims 1 to 14.

23. A power adapter, characterized in that: include: A memory for storing instructions executed by one or more processors of an electronic device, and a processor, which is one of the processors of the electronic device, for executing the charging detection method described in any one of claims 15 to 21.

24. A charging system, characterized in that: The charging system comprises the electronic device described in claim 22 and the power adapter described in claim 23, wherein the power adapter is used to charge the electronic device.

Citation Information

Patent Citations

  • Mobile power bank leasing system

    CN110009820A

  • Charging control method and device, terminal equipment and storage medium

    CN115441528A

  • Charging method, mobile terminal and storage medium

    CN115622177A

  • Charging exception processing method, device and system, storage medium and program product

    CN117175752A

  • Terminal device charging method and apparatus, and storage medium

    US20220329087A1