Charging type detection method, charging system, electronic equipment and computer storage medium

By measuring the voltages of each pin of the charging plug and judging the charging type, the problem of poor accuracy of the existing charging type detection methods is solved, and accurate matching of the charging current and efficient charging are achieved.

CN120165474APending Publication Date: 2025-06-17SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510340888.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The existing charging type detection methods have poor accuracy, resulting in improper matching of charging current, affecting charging efficiency and user experience.

Method used

By connecting the charging plug with the charging socket and supplying power, measure the voltage of each pin of the charging plug in a preset order, and judge the charging type according to the voltage value, and set the corresponding charging current.

Benefits of technology

Accurate judgment of charging type is achieved, ensuring the correct matching of charging current, and improving charging efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120165474A_ABST
    Figure CN120165474A_ABST
Patent Text Reader

Abstract

The invention provides a charging type detection method, a charging system, electronic equipment, a computer storage medium and a chip module. The charging type detection method comprises the following steps: butting a charging plug and a charging socket and supplying power; measuring the voltage of each pin of the charging plug according to a preset sequence, and judging the charging type according to the voltage measurement value of each pin; and setting a charging current according to the judged charging type so as to carry out charging. By measuring the voltage of each pin of the charging plug and judging the charging type according to the voltage value, each pin of the charging plug can be ensured to be connected with each pin of the charging socket, so that the charging type can be accurately obtained, and the whole detection process is simple and high in efficiency; the problem that an existing charging type detection method is poor in accuracy is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of charging detection of electronic devices, and particularly to a charging type detection method, a charging system, an electronic device, a computer storage medium, and a chip module. Background Art

[0002] With the development of mobile wireless communication technology, more and more mobile devices are widely used in various scenarios. Various mobile devices usually use their own batteries to supply power to the internal circuit system to ensure the normal operation of the functions of the mobile devices. Therefore, it is necessary to use a charger to charge the mobile devices to ensure that the battery power can meet the operation requirements.

[0003] Existing chargers have a variety of configured port types, such as DCP (Dedicated Charging Port), SDP (Standard Downstream Port), NON-DCP (Non-standard dedicated charging Port), etc. Different port types are set with different charging currents. Therefore, when a mobile device is docked with a charger, it is necessary to first determine the port type, that is, detect the charging type, so as to ensure that the input charging current is correct and avoid damage to the mobile device caused by excessive current.

[0004] However, most of the existing charging type detection methods are implemented based on hardware. Due to problems such as port structure design or wire materials, it is extremely easy to cause incorrect charging type detection, resulting in the matching charging current can only charge with a safe charging current and cannot adapt to a higher current that meets the battery requirements of the mobile device, thus making the charging efficiency low and affecting the user experience. Summary of the Invention

[0005] The purpose of the present invention is to provide a charging type detection method, a charging system, an electronic device, a computer storage medium, and a chip module, so as to at least solve the problem of poor accuracy of the existing charging type detection method.

[0006] To solve the above technical problems, the present invention provides a charging type detection method, including: Docking the charging plug with the charging socket and supplying power; Measuring the voltages of each pin of the charging plug in a preset order, and judging the charging type according to the voltage measurement values of each pin; Setting the charging current according to the judged charging type for charging.

[0007] Optionally, in the charging type detection method, both the charging plug and the charging socket are of USB type; the method for docking the charging plug with the charging socket and supplying power includes: Dock the charging plug with the charging socket; Initialize the voltage detection channels of the DP pin and the DM pin, and turn on the voltage detection.

[0008] Optionally, in the charging type detection method, the method for measuring the voltages of each pin of the charging plug in a preset order and determining the charging type according to the measured voltage values of each pin includes: Pull up the voltage of the DP pin; Measure the voltage of the DM pin; If the voltage of the DM pin is high level, determine that the charging type is DCP type; If the voltage of the DM pin is low voltage, measure the voltage of the DP pin; If the voltage of the DP pin is low level, determine that the charging type is SDP type.

[0009] Optionally, in the charging type detection method, the method for measuring the voltages of each pin of the charging plug in a preset order and determining the charging type according to the measured voltage values of each pin further includes: If the voltage of the DP pin is high level, check whether the voltage of the VBUS pin is high level; If the voltage of the VBUS pin is low level, determine that the charging type is unknown type; If the voltage of the VBUS pin is high level, re-measure the voltage of the DM pin to determine the charging type.

[0010] Optionally, in the charging type detection method, the method for re-measuring the voltage of the DM pin to determine the charging type if the voltage of the VBUS pin is high level includes: Set the loop count threshold; If the voltage of the VBUS pin is high level, re-measure the voltage of the DM pin to determine the charging type, and increment the loop count by 1; Determine whether the current loop count reaches the loop count threshold; If the current loop count does not reach the loop count threshold, re-measure the voltage of the DM pin to determine the charging type, and increment the loop count by 1; If the current loop count reaches the loop count threshold and the charging type determination result has not been obtained yet, determine that the charging type is unknown type.

[0011] Optionally, in the charging type detection method, the method for re-measuring the voltage of the DM pin to determine the charging type if the voltage of the VBUS pin is high level further includes: Set the delay time; If the voltage of the VBUS pin is high level, start timing; If the current timing time reaches the delay time, re-measure the voltage of the DM pin to determine the charging type.

[0012] Optionally, in the charging type detection method, the charging type includes DCP type, SDP type and unknown type; the method of setting the charging current according to the determined charging type for charging includes: If the charging type is DCP type, set the charging current matching the DCP type for charging; If the charging type is SDP type, set the charging current matching the SDP type for charging; If the charging type is unknown type, set the safe charging current for charging.

[0013] Optionally, in the charging type detection method, the charging type detection method further includes: After obtaining the judgment result of the charging type, turn off the voltage detection.

[0014] To solve the above technical problems, the present invention also provides a charging system for implementing the charging type detection method described in any one of the above. The charging system includes a charger and a mobile device; the charging socket of the charger and the charging plug of the mobile device are both of USB type; the DP pin and the DM pin of the charging socket of the charger are connected.

[0015] Optionally, in the charging system, the voltage of the DP pin of the charging plug of the mobile device is adjustable; the voltages of the DP pin and the DM pin of the charging plug of the mobile device can be measured.

[0016] To solve the above technical problems, the present invention also provides an electronic device, including a memory, a processor and an executable program stored on the memory and capable of being run by the processor; when the processor runs the executable program, it executes the charging type detection method described in any one of the above.

[0017] To solve the above technical problems, the present invention also provides a computer storage medium storing an executable program; when the executable program is executed, it implements the charging type detection method described in any one of the above.

[0018] To solve the above technical problems, the present invention also provides a chip or a chip module, which is coupled to the memory and used to execute the computer program stored in the memory to execute the charging type detection method described in any one of the above.

[0019] The charging type detection method, charging system, electronic device, computer storage medium and chip module provided by the present invention include: docking a charging plug with a charging socket and supplying power; measuring the voltages of each pin of the charging plug in a preset order, and judging the charging type according to the measured voltage values of each pin; setting a charging current according to the judged charging type to perform charging. By measuring the voltages of each pin of the charging plug and judging the charging type according to the voltage values, it can be ensured that each pin of the charging plug is connected to each pin of the charging socket, so that the charging type can be accurately obtained, and the whole detection process is simple and efficient, solving the problem of poor accuracy of the existing charging type detection method. Description of the Drawings

[0020] Figure 1 It is a schematic structural diagram of a commonly used USB jack of a charger and a mobile device in an existing charging system; Figure 2 It is a flowchart of the charging type detection method provided by this embodiment; Figure 3 It is a logic diagram of the charging type detection process provided by this embodiment; Figure 4 It is a schematic circuit structure diagram of the charging system corresponding to DCP provided by this embodiment; Figure 5 It is a schematic circuit structure diagram of the charging system corresponding to SDP provided by this embodiment. Detailed Embodiments

[0021] The following further elaborates in detail on the charging type detection method, charging system, electronic device, computer storage medium and chip module proposed by the present invention in combination with the accompanying drawings and specific embodiments. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise scales, only for conveniently and clearly assisting in explaining the purpose of the embodiments of the present invention. In addition, the structures shown in the accompanying drawings are often part of the actual structures. In particular, the accompanying drawings need to show different emphases, and sometimes different scales are used.

[0022] It should be noted that the "first", "second", etc. in the description, claims and drawings of the present invention are used to distinguish similar objects in order to describe the embodiments of the present invention, rather than to describe a specific order or sequence. It should be understood that such structures can be interchanged under appropriate circumstances. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or devices.

[0023] Taking the commonly used USB jacks of chargers and mobile devices in existing charging systems as an example, such as Figure 1 shown, both the USB plug (male) and the USB jack (female) have four pins: VBUS (power), D- (DM, data -), D+ (DP, data +), and GND (ground).

[0024] According to the provisions of USB2.0 BC1P2 (Battery Charger Specification V1.2), when VBUS is at a high level, the detection of the charging type is triggered and a delay time is waited for, and a session (BC1P2 session) is started on D- / D+; after the session is completed, the detection result of the charging type can be obtained.

[0025] And as Figure 1 shown, the pin lengths of VBUS and GND of the USB plug are slightly longer than those of D- and D+, which means that when VBUS of the USB plug and the USB jack is connected, D- and D+ are not yet connected. If a BC1P2 protocol session is initiated at this time, since the data interface is not physically connected, the negotiation process will surely fail, resulting in an incorrect detection of the charging type, and thus it is impossible to configure a matching charging current, and only a safe charging current (500 mA) can be used for charging, reducing the charging efficiency.

[0026] In addition, in the existing method for detecting the charging type, it is automatically initiated by the hardware every time VBUS becomes high, and the software can only control how long after VBUS becomes high to start the detection, that is, the software can only control the delay time. Although the delay time can be set to the maximum delay time of 448 ms to reduce the probability of detection failure, in actual applications, due to reasons such as human operation or wire differences, it will still lead to an incorrect detection of the charging type and affect the charging efficiency.

[0027] To solve this problem, this embodiment provides a method for detecting the charging type, as Figure 2 shown, including: S1, docking the charging plug with the charging jack and supplying power; S2, measuring the voltages of each pin of the charging plug in a preset order, and judging the charging type according to the measured voltage values of each pin; S3, setting the charging current according to the judged charging type for charging.

[0028] The charging type detection method provided by this embodiment measures the voltages of each pin of the charging plug and determines the charging type according to the voltage values, which can ensure that each pin of the charging plug is connected to each pin of the charging socket, so as to accurately obtain the charging type. Moreover, the whole detection process is simple and efficient, solving the problem of poor accuracy of the existing charging type detection methods.

[0029] In practical applications, the voltage measurement of each pin can be performed by the software on the charger side or by the software on the mobile device side. In addition, the software-based charging type detection provided by this embodiment can be performed on the basis of the existing hardware-based charging type detection completed, so as to ensure the accuracy of the charging type judgment result through two detections.

[0030] The following takes the charging plug and the charging socket both being of the USB type as an example to illustrate the specific implementation manner of the charging type detection method provided by this embodiment.

[0031] Specifically, in this embodiment, step S1, the method of docking the charging plug with the charging socket and supplying power includes: S11, dock the charging plug with the charging socket.

[0032] In practical applications, after the charging plug is docked with the charging socket, the hardware will automatically judge the voltage of the VBUS pin and automatically perform the charging type detection when the voltage is high. Therefore, only the first detection of the charging type will be performed in this step.

[0033] However, as mentioned above, hardware detection is very prone to detection errors. Therefore, in this embodiment, the following steps are also required for secondary detection to ensure the accuracy of the charging type detection result.

[0034] S12, initialize the voltage detection channels of the DP pin and the DM pin and turn on the voltage detection.

[0035] In practical applications, the initialization also includes turning on the USB and initializing the ADC reference voltage, etc. The specific implementation manner is well known to those skilled in the art and will not be elaborated in this application.

[0036] Further, in this embodiment, as Figure 3 shown, step S2, measure the voltages of each pin of the charging plug in a preset order and judge the charging type according to the voltage measurement values of each pin: S21, pull up the voltage of the DP pin.

[0037] In practical applications, the voltage of the DP pin here should be the voltage at the DP pin of the charging plug on the mobile device side. Therefore, the voltage at the DP pin of the charging plug on the mobile device side should be controllable, that is, the voltage magnitude can be adjusted.

[0038] S22. Measure the voltage of the DM pin.

[0039] In practical applications, software can be used to measure the voltage of the DM pin. Specifically, it can be achieved by using the software on the mobile device side to measure the voltage of the DM pin of the charging plug on the mobile device side.

[0040] S23. If the voltage of the DM pin is high level, determine that the charging type is DCP type.

[0041] In practical applications, after determining that the charging type is DCP type, the detection process of the charging type can be directly ended, and the corresponding charging current can be matched according to the DCP type for charging.

[0042] Preferably, considering that a hardware-based charging type detection has been performed previously, therefore, the detection results of the two charging types can also be compared. If both are DCP type, it can be determined that the charging type is DCP type, and the corresponding charging current can be matched according to the DCP type. If the two detection results are inconsistent, and the first hardware detection result reports an error (unknown type), considering that there may be misjudgment in the first hardware detection process, the corresponding charging current can still be matched with the DCP type. If the two detection results are inconsistent, and the first hardware detection result is not an unknown type, in order to ensure the safety of the charging process, an alarm prompt can be issued for personnel to confirm.

[0043] S24. If the voltage of the DM pin is low voltage, measure the voltage of the DP pin.

[0044] In practical applications, software can be used to measure the voltage of the DP pin. Specifically, it can be achieved by using the software on the mobile device side to measure the voltage of the DP pin of the charging plug on the mobile device side.

[0045] S25. If the voltage of the DP pin is low level, determine that the charging type is SDP type.

[0046] In practical applications, after determining that the charging type is SDP type, the detection process of the charging type can be directly ended, and the corresponding charging current can be matched according to the SDP type for charging.

[0047] Preferably, considering that a hardware-based charging type detection has been performed previously, the detection results of the two charging types can also be compared. If both are of the SDP type, it can be determined that the charging type is the SDP type, and the corresponding charging current can be matched according to the SDP type. If the two detection results are inconsistent and the first hardware detection result reports an error (unknown type), considering that misjudgment may occur during the first hardware detection, the corresponding charging current can still be matched with the SDP type. If the two detection results are inconsistent and the first hardware detection result is not of the unknown type, in order to ensure the safety of the charging process, an alarm prompt can be issued for personnel to confirm.

[0048] In addition, in this embodiment, step S2, measuring the voltages of each pin of the charging plug in a preset order and determining the charging type according to the measured voltage values of each pin further includes: S26, if the voltage of the DP pin is high, check whether the voltage of the VBUS pin is high.

[0049] In practical applications, software can be used to measure the voltage of the VBUS pin. Specifically, it can be achieved by measuring the voltage of the VBUS pin of the charging plug at the mobile device end using the software on the mobile device.

[0050] S27, if the voltage of the VBUS pin is low, determine that the charging type is unknown.

[0051] In practical applications, if the voltage of the VBUS pin is low, it indicates that the USB connection is disconnected. Therefore, it can be determined that the charging type is unknown.

[0052] S28, if the voltage of the VBUS pin is high, re-measure the voltage of the DM pin to determine the charging type.

[0053] In practical applications, first, a loop count threshold can be set to control the number of re-detections, so as to not only avoid the detection falling into an infinite loop but also improve the detection efficiency. At the same time, the initial value of the loop count is set to 0. In a specific embodiment, the loop count threshold can be set to 20. Of course, in other embodiments, the value of the loop count threshold can also be reasonably set according to actual needs.

[0054] Preferably, a delay time can also be set to ensure a stable connection between the charging socket of the charger and the charging plug of the mobile device and stable circuit communication. In a specific embodiment, the delay time can be set to 100 ms. Of course, in other embodiments, the value of the delay time can also be reasonably set according to actual needs.

[0055] Then, if the voltage of the VBUS pin is high, start timing until the current timing reaches the delay time, start re-measuring the voltage of the DM pin, and make a judgment on the charging type, that is, return to step S22. At the same time, increment the loop count by 1.

[0056] If the detection result of the charging type is still not obtained in this re-measurement process and it is determined that VBUS is high, then determine whether the current loop count reaches the loop count threshold. If the current loop count does not reach the loop count threshold, delay for another delay time and start again from step S22 to measure the voltage of the DM pin, make a judgment on the charging type, and increment the loop count by 1. Repeat the detection in this way until the current loop count reaches the loop count threshold and the judgment result of the charging type is still not obtained, then determine that the charging type is an unknown type.

[0057] Preferably, considering that a hardware-based charging type detection has been performed previously, therefore, the detection results of the two charging types can also be compared. If both are unknown types, it can be determined that the charging type is an unknown type, and the safe charging current is matched according to the unknown type. If the two detection results are inconsistent and the first hardware detection result is DCP or SDP type, considering that the connection between the charging plug and the charging socket may be unstable during the process from the first detection to the second detection, the safe charging current can still be matched according to the unknown type to ensure the safety of the charging process.

[0058] Finally, after obtaining the judgment result of the charging type, turn off the voltage detection. Specifically, it includes restoring the ADC reference voltage, turning off the USB, etc.

[0059] Further, in this embodiment, in step S3, set the charging current according to the judged charging type to perform charging.

[0060] If the finally judged charging type is DCP type, set the charging current matching the DCP type to perform charging; If the finally judged charging type is SDP type, set the charging current matching the SDP type to perform charging; If the finally judged charging type is an unknown type, set the safe charging current (500 mA) to perform charging to ensure the safety of charging.

[0061] The charging type detection method provided in this embodiment performs secondary detection of the charging type based on software, which can ensure the safe and reliable charging process of the charger for the mobile device. Moreover, this charging type detection method has a simple process, high efficiency, and high accuracy, and is applicable to the detection of DCP and SDP charging types. The charging type detection method provided in this embodiment can be combined with the existing hardware-based charging type detection method, thereby further improving the accuracy of the charging type detection result and ensuring charging safety.

[0062] This embodiment also provides a charging system for implementing the above-mentioned charging type detection method. The charging system includes a charger and a mobile device. The charging socket of the charger and the charging plug of the mobile device are both of the USB type.

[0063] The DP pin and the DM pin of the charging socket of the charger are connected. Specifically, as Figure 4 shown, the DP pin and the DM pin of the charging socket of the charger are connected through a resistor.

[0064] Furthermore, in this embodiment, the voltage of the DP pin of the charging plug of the mobile device is adjustable; the voltages of the DP pin and the DM pin of the charging plug of the mobile device can be measured. Specifically, as Figure 4 shown, both the DP pin and the DM pin of the charging plug of the mobile device are connected to the physical layer (PHY) and are respectively connected to a logic operational amplifier circuit, so as to realize voltage regulation.

[0065] The charging system provided in this embodiment is applicable to the detection of DCP and SDP charging types, which can ensure the safe and reliable charging process of the charger for the mobile device. Moreover, this charging type detection method has a simple process, high efficiency, and high accuracy, and can be combined with the existing hardware-based charging type detection method, thereby further improving the accuracy of the charging type detection result and ensuring charging safety.

[0066] In practical applications, the circuit design of the charging plug at the mobile device end and the charging socket (DCP) at the charger end in the charging system can refer to the circuit structure shown in Figure 4 ; the circuit design of the charging plug at the mobile device end and the charging socket (SDP) at the charger end in the charging system can refer to the circuit structure shown in Figure 5 . It should be noted that, on the premise of not violating the main idea of this application, other circuit structures obtained by referring to this application Figure 4 should also fall within the protection scope of this application.

[0067] The charging system provided in this embodiment can measure the voltages of each pin of the charging plug by using the software on the mobile device side, and determine the charging type according to the voltage values, by connecting the DP pin and the DM pin of the charging socket of the charger, making the voltage of the DP pin of the charging plug of the mobile device adjustable, and making the voltages of the DP pin and the DM pin of the charging plug of the mobile device measurable. Thus, the charging type can be accurately obtained, and the entire detection process is simple and efficient, solving the problem of poor accuracy of the existing charging type detection methods.

[0068] In addition, this embodiment also provides an electronic device, including a memory, a processor, and an executable program stored on the memory and capable of being run by the processor; when the processor runs the executable program, it executes the charging type detection method as described above.

[0069] In addition, this embodiment also provides a computer storage medium, which stores an executable program; when the executable program is executed, it implements the charging type detection method as described above.

[0070] In addition, this embodiment also provides a chip or a chip module, which is coupled to the memory and used to execute the computer program stored in the memory to execute the charging type detection method as described above.

[0071] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. In addition, the different parts among the various embodiments can also be combined and used. The present invention does not limit this.

[0072] The present invention provides a charging type detection method, a charging system, an electronic device, a computer storage medium, and a chip module, including: docking the charging plug with the charging socket and supplying power; measuring the voltages of each pin of the charging plug in a preset order, and determining the charging type according to the voltage measurement values of each pin; setting the charging current according to the determined charging type for charging. By measuring the voltages of each pin of the charging plug and determining the charging type according to the voltage values, it can be ensured that each pin of the charging plug is connected to each pin of the charging socket, so that the charging type can be accurately obtained, and the entire detection process is simple and efficient, solving the problem of poor accuracy of the existing charging type detection methods.

[0073] The above description is only a description of the preferred embodiments of the present invention, and does not limit the scope of the present invention in any way. Any changes and modifications made by those of ordinary skill in the art of the present invention according to the above disclosure are within the protection scope of the claims.

Claims

1. A charging type detection method, characterized in that: include: Connect the charging plug to the charging socket and supply power; Measure the voltage of each pin of the charging plug in a preset order, and determine the charging type according to the voltage measurement value of each pin; The charging current is set according to the determined charging type to perform charging.

2. The charging type detection method according to claim 1, characterized in that: The charging plug and the charging socket are both of USB type; The method for docking the charging plug with the charging socket and supplying power comprises: Connect the charging plug to the charging socket; Initialize the voltage detection channels of the DP pin and DM pin and turn on voltage detection.

3. The charging type detection method according to claim 2, characterized in that: The method of measuring the voltage of each pin of the charging plug in a preset order and determining the charging type according to the voltage measurement value of each pin includes: Pull up the DP pin voltage; Measure the DM pin voltage; If the DM pin voltage is high, the charging type is determined to be DCP type; If the DM pin voltage is low, measure the DP pin voltage; If the DP pin voltage is at a low level, the charging type is determined to be the SDP type.

4. The charging type detection method according to claim 3, characterized in that: The method of measuring the voltage of each pin of the charging plug in a preset order and determining the charging type according to the voltage measurement value of each pin also includes: If the DP pin voltage is high, check whether the VBUS pin voltage is high; If the VBUS pin voltage is low, the charging type is determined to be unknown; If the VBUS pin voltage is at a high level, the DM pin voltage is measured again to determine the charging type.

5. The charging type detection method according to claim 4, characterized in that: If the VBUS pin voltage is at a high level, the DM pin voltage is re-measured to determine the charging type. The method includes: Set the cycle count threshold; If the VBUS pin voltage is high, re-measure the DM pin voltage to determine the charging type and increase the number of cycles by 1; Determine whether the current number of cycles reaches the cycle number threshold; If the current number of cycles does not reach the cycle number threshold, the DM pin voltage is measured again to determine the charging type, and the number of cycles is increased by 1; If the current number of cycles reaches the cycle number threshold and the charging type determination result is still not obtained, the charging type is determined to be an unknown type.

6. The charging type detection method according to claim 5, characterized in that: If the VBUS pin voltage is at a high level, the method of re-measuring the DM pin voltage to determine the charging type also includes: Set the delay time; If the VBUS pin voltage is high, the timing starts; If the current timing time reaches the delay time, the DM pin voltage is measured again to determine the charging type.

7. The charging type detection method according to claim 1, characterized in that: The charging type includes a DCP type, an SDP type, and an unknown type; and the method of setting the charging current according to the determined charging type for charging includes: If the charging type is DCP type, set the charging current that matches the DCP type for charging; If the charging type is SDP type, set the charging current that matches the SDP type for charging; If the charging type is unknown, set a safe charging current for charging.

8. The charging type detection method according to claim 2, characterized in that: The charging type detection method further includes: After obtaining the judgment result of the charging type, turn off the voltage detection.

9. A charging system, used to implement the charging type detection method according to any one of claims 1 to 8, characterized in that: The charging system comprises a charger and a mobile device; the charging socket of the charger and the charging plug of the mobile device are both of USB type; the DP pin and the DM pin of the charging socket of the charger are connected.

10. The charging system according to claim 9, characterized in that: The voltage of the DP pin of the charging plug of the mobile device is adjustable; and the voltages of the DP pin and the DM pin of the charging plug of the mobile device are measurable.

11. An electronic device, characterized in that: It includes a memory, a processor, and an executable program stored in the memory and capable of being run by the processor; when the processor runs the executable program, the charging type detection method according to any one of claims 1 to 8 is executed.