Detection method and device, electronic equipment and storage medium

By detecting the charging and discharging parameters of electronic equipment, calculating the impedance value of the power path tube and comparing it with the preset range, the problem of abnormal power path tube of the charging chip is solved, and timely positioning and eliminating abnormalities are achieved to ensure the normal operation of the electronic equipment.

CN120214447APending Publication Date: 2025-06-27K TRONICS (SUZHOU) TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510352791.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The abnormal BATFET power path tube BATFET of the charging chip in existing electronic devices will affect the performance of the charging chip, and thus affect the user experience of the electronic device.

Method used

By detecting the charging and discharging parameters of the electronic device, determine whether the power path tube in the charging module is in an abnormal state. The specific method includes obtaining parameters of the system supply voltage, battery voltage and charging current, calculating the impedance value of the power path tube, and comparing it with the preset impedance value range to determine whether it is in an abnormal state.

Benefits of technology

It can timely locate and eliminate abnormal states of the power path tube in the charging module, ensure the normal operation of electronic equipment, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120214447A_ABST
    Figure CN120214447A_ABST
Patent Text Reader

Abstract

The invention relates to a detection method and device, electronic equipment and a storage medium. The method comprises the following steps: determining that charging and discharging detection conditions are met, and obtaining charging and discharging parameters of the electronic equipment; and determining whether a power path tube in the charging module is in an abnormal state or not according to the charging and discharging parameters. According to the embodiment, whether the power path tube in the charging module is in the abnormal state or not is determined, and the charging module in the abnormal state is positioned or eliminated in time, so that normal work of the electronic equipment is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of detection technologies, and in particular, to a detection method, apparatus, electronic device, and storage medium. Background Art

[0002] Existing electronic devices usually have at least one charging chip, such as a Buck (or Buck - Boost) charging chip, which can implement the charging and discharging functions between the adapter and the electronic device.

[0003] Taking a charging chip with dynamic power path management (DPPM) function as an example, it is provided with a power path tube BATFET, which is electrically connected to the battery BAT and the system power supply pin SYS respectively, and controls the current path for charging the battery BAT and / or supplying power from the battery BAT to the power supply pin SYS.

[0004] However, when the power path tube BATFET of the charging chip malfunctions, it will affect the performance of the charging chip, and further affect the user experience of the electronic device. Summary of the Invention

[0005] The present disclosure provides a detection method, apparatus, electronic device, and storage medium to solve the deficiencies of the related technologies.

[0006] According to the first aspect of the embodiments of the present disclosure, a detection method is provided, which is applicable to an electronic device. The electronic device includes a charging module, and the method includes:

[0007] Determine that the charge - discharge detection conditions are met, and obtain the charge - discharge parameters of the electronic device;

[0008] Determine whether the power path tube in the charging module is in an abnormal state according to the charge - discharge parameters.

[0009] Optionally, determining whether the power path tube in the charging module is in an abnormal state according to the charge - discharge parameters includes:

[0010] Determine the impedance value of the power path tube in the charging module according to the charge - discharge parameters;

[0011] Determine whether the charging module is in an abnormal state according to the impedance value and the preset impedance value range.

[0012] Optionally, the charge - discharge parameters include the system power supply voltage, battery voltage, and charging current of the electronic device;

[0013] The system power supply voltage is the voltage value at the system voltage pin of the charging module;

[0014] The battery voltage is the voltage difference between the first battery pin and the second battery pin of the charging module;

[0015] The charging current is the ratio of the voltage difference between the first resistor pin and the second resistor pin of the charging module to the resistance value of the precision resistor.

[0016] Optionally, when there is a set of charge and discharge parameters, determining the impedance value of the power path tube in the charging module according to the charge and discharge parameters includes:

[0017] Obtaining the voltage difference between the system supply voltage and the battery voltage to obtain the voltage value across the power path tube in the charging module;

[0018] Determining the ratio of the voltage value of the power path tube to the charging current as the impedance value of the power path tube in the charging module.

[0019] Optionally, when there are multiple sets of charge and discharge parameters, determining the impedance value of the power path tube in the charging module according to the charge and discharge parameters includes:

[0020] Respectively obtaining the average values of the system supply voltage, battery voltage, and charging current within the charge and discharge parameters to obtain the average system supply voltage, average battery voltage, and average charging current;

[0021] Obtaining the voltage difference between the average system supply voltage and the average battery voltage to obtain the average voltage across the power path tube in the charging module;

[0022] Determining the ratio of the average voltage of the power path tube to the average charging current as the impedance value of the power path tube in the charging module.

[0023] Optionally, after obtaining the charge and discharge parameters of the electronic device, the method further includes:

[0024] Determining that a set of charge and discharge parameters is obtained, and determining whether there is a parameter with a value of 0 in the set of charge and discharge parameters;

[0025] Determining that the set of charge and discharge parameters contains a parameter of 0, then excluding the set of charge and discharge parameters.

[0026] Optionally, before respectively obtaining the average values of the system supply voltage, battery voltage, and charging current within the charge and discharge parameters, the method further includes:

[0027] Determining the number of sets of charge and discharge parameters containing invalid parameters among multiple sets of charge and discharge parameters;

[0028] If it is determined that the number of groups is less than or equal to the preset group number threshold, then after eliminating invalid parameters, perform the step of respectively obtaining the average values of the system power supply voltage, battery voltage, and charging current within the charge and discharge parameters;

[0029] If it is determined that the number of groups is greater than the preset group number threshold, generate an abnormal detection result.

[0030] Optionally, the preset impedance value range is a first preset range in the battery charging scenario. Determining whether the charging module is in an abnormal state according to the impedance value and the preset impedance value range includes:

[0031] Determine whether the impedance value is within the first preset range;

[0032] If it is determined that the impedance value is outside the first preset range, then determine that the power path tube in the charging module is in an abnormal state.

[0033] Optionally, the preset impedance value range is a second preset range in the battery discharging scenario. Determining whether the charging module is in an abnormal state according to the impedance value and the preset impedance value range includes:

[0034] Determine whether the impedance value is within the second preset range;

[0035] If it is determined that the impedance value is outside the second preset range, then determine that the power path tube in the charging module is in an abnormal state;

[0036] Determine whether an abnormal state is detected continuously for a preset number of times. If so, generate an abnormal detection result. If not, re - execute the step of determining that the charge and discharge detection conditions are met and obtaining the charge and discharge parameters of the electronic device.

[0037] Optionally, the method further includes:

[0038] If it is determined that the impedance value is within the first preset range, then determine that the power path tube in the charging module is in a normal working state;

[0039] Or,

[0040] If it is determined that the impedance value is within the second preset range, then determine that the power path tube in the charging module is in a normal working state.

[0041] Optionally, determining that the charge and discharge detection conditions are met includes:

[0042] Detect the charge and discharge state of the charging module, where the charge and discharge state includes a charging state or a discharging state;

[0043] If it is determined that the detected charge and discharge state is a discharging state, determine that the discharging condition in the charge and discharge detection conditions is met;

[0044] Determine that the detected charge and discharge state is the charging state, and perform the steps of determining that the charge and discharge detection conditions are met and obtaining the charge and discharge parameters of the electronic device.

[0045] Optionally, determining that the charge and discharge detection conditions are met includes:

[0046] Detect the external power supply voltage and the type of external charger;

[0047] Determine that the external power supply voltage exceeds the preset power supply voltage threshold and the charger type is the preset type, and determine the maximum charging current of the battery;

[0048] Determine that the battery power is less than the preset power threshold or the battery temperature is within the preset temperature range, and determine that the charging condition in the charge and discharge detection conditions is met.

[0049] According to the second aspect of the embodiments of the present disclosure, a detection device is provided, which is applicable to an electronic device, and the electronic device includes a charging module. The device includes:

[0050] A parameter acquisition module, configured to determine that the charge and discharge detection conditions are met and obtain the charge and discharge parameters of the electronic device;

[0051] A state determination module, configured to determine whether the power path tube in the charging module is in an abnormal state according to the charge and discharge parameters.

[0052] Optionally, the state determination module includes:

[0053] An impedance value determination sub-module, configured to determine the impedance value of the power path tube in the charging module according to the charge and discharge parameters;

[0054] An abnormal state determination sub-module, configured to determine whether the charging module is in an abnormal state according to the impedance value and the preset impedance value range.

[0055] Optionally, the charge and discharge parameters include the system power supply voltage, the battery voltage, and the charging current of the electronic device;

[0056] The system power supply voltage is the voltage value at the system voltage pin of the charging module;

[0057] The battery voltage is the voltage difference between the first battery pin and the second battery pin of the charging module;

[0058] The charging current is the ratio of the voltage difference between the first resistance pin and the second resistance pin of the charging module to the resistance value of the precision resistor.

[0059] Optionally, when the charge and discharge parameters are a set, the impedance value determination sub-module includes:

[0060] A voltage value acquisition unit, configured to acquire a voltage difference between the system power supply voltage and the battery voltage, and obtain a voltage value across the power path tube in the charging module;

[0061] An impedance value acquisition unit, configured to determine a ratio of the voltage value of the power path tube to the charging current as the impedance value of the power path tube in the charging module.

[0062] Optionally, when there are multiple sets of charge and discharge parameters, the impedance value determination sub-module includes:

[0063] An average value acquisition unit, configured to respectively acquire average values of the system power supply voltage, the battery voltage, and the charging current in the charge and discharge parameters, and obtain an average system power supply voltage value, an average battery voltage value, and an average charging current value;

[0064] A voltage average value acquisition unit, configured to acquire a voltage difference between the average system power supply voltage value and the average battery voltage value, and obtain an average voltage value across the power path tube in the charging module;

[0065] An impedance value determination unit, configured to determine a ratio of the average voltage value of the power path tube to the average charging current value as the impedance value of the power path tube in the charging module.

[0066] Optionally, after acquiring the charge and discharge parameters of the electronic device, the parameter acquisition module includes:

[0067] A parameter determination sub-module, configured to determine that a set of charge and discharge parameters is acquired, and determine whether a parameter with a value of 0 is included in the set of charge and discharge parameters;

[0068] A parameter elimination sub-module, configured to determine that the set of charge and discharge parameters includes a parameter of 0, and then eliminate the set of charge and discharge parameters.

[0069] Optionally, the parameter acquisition module further includes:

[0070] An invalid parameter determination sub-module, configured to determine the number of sets of charge and discharge parameters that include invalid parameters;

[0071] A result judgment sub-module, configured to determine that the number of sets is less than or equal to a preset number threshold, and trigger the average value acquisition sub-unit; and determine that the number of sets is greater than the preset number threshold, and generate an abnormal detection result.

[0072] Optionally, the preset impedance value range is a first preset range in a battery charging scenario, and the abnormal state determination sub-module includes:

[0073] An impedance value determination unit, configured to determine whether the impedance value is within the first preset range;

[0074] An abnormal state determination unit, configured to determine that the impedance value is outside the first preset range, and then determine that the power path tube in the charging module is in an abnormal state.

[0075] Optionally, the preset impedance value range is a second preset range in a battery discharge scenario, and the abnormal state determination sub-module includes:

[0076] An impedance value determination unit, configured to determine whether the impedance value is within the second preset range;

[0077] An abnormal state determination unit, configured to determine that the impedance value is outside the second preset range, and then determine that the power path tube in the charging module is in an abnormal state; and determine whether the abnormal state is detected continuously for a preset number of times, if so, generate an abnormal detection result, if not, re-trigger the parameter acquisition module.

[0078] Optionally, the state determination module further includes:

[0079] A correct state determination sub-module, configured to determine that the impedance value is within the first preset range, and then determine that the power path tube in the charging module is in a normal working state; or, determine that the impedance value is within the second preset range, and then determine that the power path tube in the charging module is in a normal working state.

[0080] Optionally, the parameter acquisition module includes:

[0081] A charge and discharge state detection sub-module, configured to detect the charge and discharge state of the charging module, where the charge and discharge state includes a charging state or a discharging state;

[0082] A discharge state detection sub-module, configured to determine that the detected charge and discharge state is a charging state, and trigger the parameter acquisition module.

[0083] Optionally, the parameter acquisition module includes:

[0084] A type determination sub-module, configured to detect the external power supply voltage and the external charger type;

[0085] A current determination sub-module, configured to determine that the external power supply voltage exceeds a preset power supply voltage threshold and the charger type is a preset type, and determine the maximum charging current of the battery;

[0086] A condition determination sub-module, configured to determine that the battery power is less than a preset power threshold or the battery temperature is within a preset temperature range, and determine that the charging condition in the charge and discharge detection conditions is satisfied.

[0087] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including:

[0088] A charging module including a power path tube;

[0089] A processor;

[0090] A memory for storing computer programs executable by the processor;

[0091] Wherein, the processor is configured to execute the computer program in the memory to implement the method according to any one of the first aspect.

[0092] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided. When the executable computer program in the storage medium is executed by a processor, the method according to any one of the first aspect can be implemented.

[0093] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0094] In the solution provided by the embodiments of the present disclosure, it is possible to determine that the charge and discharge detection conditions are met, and obtain the charge and discharge parameters of the electronic device; and determine whether the power path tube in the charging module is in an abnormal state according to the charge and discharge parameters. In this way, in this embodiment, by determining whether the power path tube in the charging module is in an abnormal state, the charging module in the abnormal state can be located or excluded in time, so as to ensure the normal operation of the electronic device.

[0095] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. Description of the Drawings

[0096] The drawings here are incorporated into the specification and constitute a part of this specification, showing the embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.

[0097] Figure 1 It is a schematic diagram of an electronic device shown according to an exemplary embodiment.

[0098] Figure 2 It is a flowchart of a detection method shown according to an exemplary embodiment.

[0099] Figure 3 It is a flowchart of determining whether a charging module is abnormal shown according to an exemplary embodiment.

[0100] Figure 4 It is a flowchart of a detection method shown according to an exemplary embodiment.

[0101] Figure 5 It is a flowchart of another detection method shown according to an exemplary embodiment.

[0102] Figure 6 It is a block diagram of a detection device shown according to an exemplary embodiment. Detailed implementation

[0103] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The exemplary embodiments described below do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims. It should be noted that, without conflict, the features in the following embodiments and implementation manners can be combined with each other.

[0104] When an abnormality occurs in the power path tube BATFET of the charging chip inside the existing electronic device, it will affect the performance of the charging chip.

[0105] For example, in a scenario where the electronic device is not charging and in use, if the electronic device is running at least one application with high power consumption such as a game application, a video playback application, or a short video playback application at the same time, the discharge current of the power path tube BATFET will increase; assuming that the impedance value of the power path tube BATFET becomes larger, its power consumption will also increase, resulting in the output voltage of the battery BAT being pulled down; when the battery voltage of the battery BAT is lower than the shutdown threshold value or the protection threshold value of the electronic device, the electronic device will have problems such as abnormal shutdown or abnormal application shutdown.

[0106] Another example is that when the electronic device is in a charging scenario, if there is a short circuit between the system power supply pin SYS and the positive pole of the power supply BAT, at this time, the impedance value of the power path tube BATFET is small. In this scenario, when the electronic device is in the pre-charging stage (such as when the battery voltage is lower than 3V), the charging current is not controlled at this time, and there may be a charging current exceeding the protection threshold, which will operate on the battery BAT; in the constant voltage (CV) stage, when the battery voltage is at the critical voltage of the constant voltage charging voltage, it will continue to charge, and there may be overcharging of the battery, causing problems such as battery swelling.

[0107] Based on the above technical problems, the embodiments of the present disclosure provide a detection method, device, electronic device, and storage medium, which can be used in an electronic device. The electronic device may include, but is not limited to, a smartphone, a tablet computer, a personal terminal, or a device such as a display screen provided with a charging module.

[0108] See Figure 1 , the electronic device may include: a charging module 11, a processor 12, and a battery BAT. Among them, the charging module 11 includes a charging chip IC with DPPM, a charging interface TYPEC USB, and overvoltage protection OVP.

[0109] The Type-C USB charging interface is used for electrical connection with an external charging device to provide power transmission and data transmission.

[0110] Overvoltage protection (OVP) is used to protect the charging voltage VBUS during the charging process and can be implemented using an NMOS transistor.

[0111] The charging chip may include switching devices Q1, Q2, Q3, and Q4 (i.e., BATFET). Among them, switching device Q1 is used as a charging switch, which is in the conducting state during charging and in the off state during power-off; and it has the effect of preventing the current of battery BAT from flowing back into the Type-C USB charging interface. Switching devices Q2 and Q3 are used as switching transistors for a Buck or Buck-Boost circuit. Switching device Q4 is used as a switching device between the system power supply pin SYS and battery BAT to control the charging and / or discharging of battery BAT.

[0112] It should be noted that the charging chip IC includes a first battery pin BATP and a second battery pin BATN. The first battery pin BATP outputs the positive voltage of battery BAT, and the second battery pin BATN outputs the negative voltage of battery BAT. That is, by the difference between the voltages output by the first battery pin BATP and the second battery pin BATN, the battery voltage VBAT of battery BAT can be obtained.

[0113] The charging chip IC also includes a first resistor pin SRP and a second resistor pin SRN. The first resistor pin SRP outputs the voltage value of one end of the precision resistor Rsense, and the second resistor pin SRN outputs the voltage value of the other end of the precision resistor Rsense. That is, by the difference between the voltages output by the first resistor pin SRP and the second resistor pin SRN, the voltage division of the precision resistor Rsense can be obtained; and then according to the resistance value of the precision resistor Rsense, the current flowing through the precision resistor Rsense can be calculated, that is, the charging current IBAT of battery BAT can be obtained.

[0114] The charging chip IC also includes a system power supply pin SYS for outputting the system power supply voltage VSYS.

[0115] In one example, the charging chip IC can detect the system power supply voltage or the input current to detect the total power demand in real time. When the total power demand of the system exceeds the total power demand threshold, it can communicate with an external charger, and the charger reduces the charging current to ensure its output constant power and avoid power overload.

[0116] In one example, the charging chip IC can dynamically adjust the current between the power distribution system and the battery in a charging scenario, and by adjusting the charging current of the battery and the system power supply current, it can ensure the normal operation of the system to the greatest extent. When the external charger cannot provide the peak current required by the system, the external charger and the battery BAT can be allowed to supply power to the system simultaneously, that is:

[0117] Input Power + Battery Power = Dynamic System Power (1)

[0118] In formula (1), Input Power represents the input power of the external charger, Battery Power represents the power provided by the battery BAT, and Dynamic System Power represents the system power.

[0119] Based on the above hardware, three current paths can be formed among the charging chip, the external charger, and the battery, including:

[0120] The first current path: The current flows through the external charger, the charging interface TYPEC USB, the overvoltage protection OVP, the switching device OVP, the switching device Q1, the switching device Q2, the inductor L, and the output capacitor C in sequence, and finally is provided to the system. This output capacitor is connected to the system output pin SYS. In this scenario, the external charger supplies power to the system, and the input voltage and / or input current are adjusted through a DC / DC converter or an LDO converter to meet the system power supply power demand.

[0121] The second current path: The current flows through the external charger, the charging interface TYPEC USB, the overvoltage protection OVP, the switching device OVP, the switching device Q1, the switching device Q2, the inductor L, the output capacitor C, and the BATFET in sequence, and finally is provided to the system. In this scenario, the external charger supplies power to the battery BAT, and the input voltage and / or input current are adjusted through a DC / DC converter or an LDO converter to meet the charging demand of the battery BAT.

[0122] The third current path: The current flows through the battery, the BATFET, and the output capacitor C in sequence, and finally is provided to the system. In this scenario, when the external charger is not connected or the power supply capacity of the external charger is low, the BATFET switches to the on state, and the system can be powered through the third current path.

[0123] In one example, when an external charger is connected, the external charger can preferentially supply power to the system, and the remaining charging power is then provided to charge the battery BAT. At this time, the charging current can be dynamically adjusted according to the power supply capacity of the charger, that is, while ensuring the normal operation of the system, the battery is charged in the shortest time. When the system load has a large power demand, that is, exceeding the power supply capacity of the external charger, the voltage at the system power supply pin SYS will be pulled down. When it drops to the minimum system voltage (i.e., the DPPM threshold), the charging chip IC can reduce or even stop the charging current of the battery BAT to ensure the normal operation of the system power supply. The above process is called the DPPM mode.

[0124] In one example, if the input power of the external charger still cannot meet the system power supply demand after the charging current of the battery BAT drops to zero, at this time, the BATFET can be controlled to switch to the conducting state, and the system can be powered by both the third current path and the first current path. This operating mode is called the auxiliary power supply mode or the supplementary mode, that is, the mode in which the battery BAT assists the external charger in power supply.

[0125] In one example, the voltage at the system power supply pin SYS can be adjusted according to the converter. For example, if an LDO converter is used, the voltage at the system power supply pin SYS can be set to a constant voltage that meets the system power supply demand; if the converter is a DC / DC converter, the voltage at the system power supply pin SYS is set to follow the battery voltage VBAT, thereby improving the power supply efficiency.

[0126] Based on the above content, it can be seen that after the external charger is connected, the system power supply is replaced from battery power supply to external charger power supply, and on this basis, the external charger supplies power to the battery to ensure fast charging while the system operates normally.

[0127] Based on the above electronic device, the embodiments of the present disclosure further provide a detection method, which can be applied to an electronic device. The electronic device includes a charging module, and the charging module can be implemented by the above charging chip IC. The charging module includes a power path tube BATFET, that is, a switching device Q4. Refer to Figure 2 , including step 21 and step 22.

[0128] In step 21, it is determined that the charge and discharge detection conditions are met, and the charge and discharge parameters of the electronic device are obtained.

[0129] In this step, the processor 12 in the electronic device can be a device with processing functions such as a central processing unit CPU or a microprocessor MCU, which is not limited here. The processor 12 can determine whether the charge and discharge detection conditions are met.

[0130] In one example, taking the battery BAT discharge scenario as an example, the processor 12 can detect the charge and discharge state of the charging module, and the charge and discharge state includes a charging state or a discharging state. The charge and discharge state can be provided by the charging chip IC. For example, when the switching device Q1 is in the on state, it is in the charging state, and when the switching device is in the off state and the switching device Q4 is in the on state, it is in the discharging state.

[0131] In this example, when it is determined that the detected charge and discharge state is the discharging state, the processor can determine that the discharging condition in the charge and discharge detection conditions is met. When it is determined that the detected charge and discharge state is the charging state, the processor can execute the steps of determining that the charge and discharge detection conditions are met and obtaining the charge and discharge parameters of the electronic device, that is, jump to step 21. In this way, in this example, by detecting the charge and discharge state, different detection methods can be executed according to the charging state or the discharging state, achieving the effect of improving the detection result.

[0132] In this example, for the charging state, the processor can detect the external power supply voltage and the type of the external charger. The external charger type includes a preset type, such as the DCP (Dedicated Charging Port) type. It should be noted that the purpose of detecting the external power supply voltage is to ensure that the external power source can provide sufficient power supply capacity to meet the current charging. The purpose of detecting the type of the external charger is to determine that the external charger can provide a charging current of more than 1.5A. Or rather, the purpose of this detection is to determine whether the charging power required by the electronic device can be satisfied.

[0133] When it is determined that the external power supply voltage exceeds the preset power supply voltage threshold (such as 4V) and the charger type is the preset type (DCP), the processor 12 can determine the maximum charging current of the battery BAT (such as 1.5A). Then, when the processor 12 determines that the power of the battery BAT is less than the preset power threshold (such as 80%) or the battery temperature is within the preset temperature range (such as 0 - 80 degrees Celsius), the processor can determine that the charging condition in the charge and discharge detection conditions is met. It should be noted that the processor determines that the power of the battery BAT is less than the preset power threshold to determine that the battery BAT has a charging requirement to ensure that the switching device Q4 is in a normal charging environment. The processor determines the battery temperature also to ensure the temperature change of the battery BAT under normal charging requirements, avoiding extreme temperature conditions that may affect the switching device Q4 and thus affecting the detection effect.

[0134] Based on the above example analysis, the processor determines whether the charging condition is met, hoping to restore the working condition of the switching device Q4 as much as possible in the normal use scenario of the electronic device, achieving the purpose of improving the accuracy of the detection result.

[0135] In one example, when it is determined that the charge and discharge detection conditions are met, the processor can obtain the charge and discharge parameters of the electronic device. Among them, the charge and discharge parameters may include the system power supply voltage VSYS, the battery voltage VBAT, and the charging current IBAT of the electronic device. The system power supply voltage VSYS is the voltage value at the system voltage pin SYS of the charging module, and can be obtained by reading the voltage value at the system voltage pin SYS. The battery voltage VBAT is the voltage difference between the first battery pin BATP and the second battery pin BATN of the charging module, and can be obtained by reading the voltage values of the first battery pin BATP and the second battery pin BATN respectively, and then calculating the difference between the two voltage values. The charging current IBAT is the ratio of the voltage difference between the first resistance pin SRP and the second resistance pin SRN of the charging module to the resistance value of the precision resistor, that is, IBAT = (VSRP - VSRN) / Rsense.

[0136] It should be noted that the above charge and discharge parameters can be provided by the charging chip IC to the processor, and the processor can then calculate the charge and discharge parameters according to the parameters. Or, the processor can detect the voltage values at each pin according to the set detection period, and then calculate the charge and discharge parameters according to the above method. Or, the electronic device is provided with a microprocessor, which can calculate the charge and discharge parameters according to the above method, and then send the above charge and discharge parameters to the processor 12. It can be understood that in the case where the charge and discharge parameters can be obtained, the corresponding solutions fall within the protection scope of the present disclosure.

[0137] In one example, it is sufficient for the processor to obtain a set of charge and discharge parameters, where a set of charge and discharge parameters includes the system power supply voltage VSYS, the battery voltage VBAT, and the charging current IBAT. In another example, the processor can obtain multiple sets of charge and discharge parameters, and the number of sets of charge and discharge parameters can be set according to the specific scenario, such as 30 - 50 sets. It can be understood that obtaining a set of charge and discharge parameters can improve the detection efficiency, while obtaining multiple sets of charge and discharge parameters can improve the accuracy of the detection result by means of statistics or calculating the average value.

[0138] In one example, after each set of charge and discharge parameters is obtained, the processor can determine whether the set of charge and discharge parameters contains a parameter with a value of 0, such as at least one of the system power supply voltage VSYS being 0, the battery voltage VBAT being 0, and the charging current IBAT being 0. When the processor determines that the set of charge and discharge parameters contains a parameter of 0, the set of charge and discharge parameters can be excluded. In this way, in this example, by excluding abnormal charge and discharge parameters, the accuracy of the detection result can be ensured.

[0139] In one example, after obtaining multiple sets of charge and discharge parameters, the processor can determine the number of sets of invalid parameters among the multiple sets of charge and discharge parameters. An invalid parameter refers to a parameter whose value is negative or tends to infinity (such as being greater than or equal to a preset invalid parameter threshold), which may be caused by problems such as acquisition errors or inability to collect data. When it is determined that the number of sets of invalid parameters is less than or equal to a preset number threshold, the processor can jump to step 22, that is, execute the step of obtaining the average value of the charge and discharge parameters. When it is determined that the number of sets of invalid parameters is greater than the preset number threshold, the processor can generate an anomaly detection result, which indicates that the charge and discharge parameters detected during the current detection period are not credible and an accurate detection result cannot be generated. In this way, in this example, by detecting invalid parameters, it can be ensured that the charge and discharge parameters are credible, thereby improving the credibility of the detection result.

[0140] In step 22, determine whether the power path tube in the charging module is in an abnormal state according to the charge and discharge parameters.

[0141] In this step, the processor 12 can determine whether the power path tube in the charging module is in an abnormal state according to the charge and discharge parameters. Refer to Figure 3 , including step 31 and step 32.

[0142] In step 31, determine the impedance value of the power path tube in the charging module according to the charge and discharge parameters.

[0143] In this step, the processor 12 can determine the impedance value of the power path tube in the charging module according to the charge and discharge parameters.

[0144] In one example, when obtaining a set of charge and discharge parameters, the processor can obtain the voltage difference VSYS - VBAT between the system supply voltage VSYS and the battery voltage VBAT to obtain the voltage value across the power path tube BATFET in the charging module. Then, the processor can determine the ratio (VSYS - VBAT) / IBAT of the voltage value VSYS - VBAT of the power path tube BATFET to the charging current IBAT as the impedance value R = (VSYS - VBAT) / IBAT of the power path tube in the charging module. In this way, in this example, by calculating the impedance value of the power path tube through a set of charge and discharge parameters, the calculation efficiency can be improved.

[0145] In another example, when multiple sets of charge and discharge parameters are obtained, the processor can respectively obtain the average values of the system supply voltage VSYS, the battery voltage VBAT, and the charging current IBAT within the charge and discharge parameters, so as to obtain the average system supply voltage VSYS_avg, the average battery voltage VBAT_avg, and the average charging current IBAT_avg. Then, the processor can obtain the voltage difference between the average system supply voltage VSYS_avg and the average battery voltage VBAT_avg, so as to obtain the average voltage VSYS_avg - VBAT_avg across the power path transistor BATFET within the charging module. After that, the processor can determine the ratio of the average voltage of the power path transistor BATFET to the average charging current, (VSYS_avg - VBAT_avg) / IBAT_avg, as the impedance value R = (VSYS_avg - VBAT_avg) / IBAT_avg of the power path transistor within the charging module. In this way, in this example, by calculating the average impedance of the power path transistor through multiple sets of charge and discharge parameters, the accuracy of the calculation result can be improved.

[0146] In step 32, it is determined whether the charging module is in an abnormal state according to the impedance value and a preset impedance value range.

[0147] In this step, a first preset range and a second preset range can be stored in the electronic device. The first preset range refers to the impedance value range of the power path transistor BATFET within the charging module under charging conditions, and the second preset range refers to the impedance value range of the power path transistor BATFET within the charging module under discharging conditions. The first preset range and the second preset range can be obtained through the configuration information of the charging chip IC, or obtained by means of big data statistics.

[0148] In one example, taking the charging scenario as an example, the processor can obtain the first preset range and determine whether the impedance value of the power path transistor is within the first preset range. When it is determined that the impedance value of the power path transistor is outside the first preset range, the processor can determine that the power path transistor within the charging module is in an abnormal state. When it is determined that the impedance value of the power path transistor is within the first preset range, the processor can determine that the power path transistor within the charging module is in a normal state. In some examples, when it is determined that it is in an abnormal state, the processor can perform multiple detections to determine whether it is in an abnormal state for a preset number of consecutive times. If so, an abnormal detection result is generated. In this way, in this example, by determining whether the power path transistor is in an abnormal state, it is beneficial to locate and eliminate the power path transistor in an abnormal state, ensuring the reliable operation of the electronic device.

[0149] In one example, taking the discharge scenario as an example, the processor can obtain a second preset range and determine whether the impedance value of the power path tube is within the second preset range. When it is determined that the impedance value of the power path tube is outside the second preset range, the processor can determine that the power path tube in the charging module is in an abnormal state. When it is determined that the impedance value of the power path tube is within the second preset range, the processor can determine that the power path tube in the charging module is in a normal state. In some examples, when an abnormal state is determined, the processor can perform multiple detections to determine whether it is an abnormal state for a preset number of consecutive times. If it is an abnormal state, the processor continues to determine whether the power path tube has detected an abnormal state for a preset number of consecutive times (such as 3 times). If so, an abnormal detection result is generated; if not, it jumps to step 21. In this way, in this example, by determining whether the power path tube is in an abnormal state, it is beneficial to locate and eliminate the power path tube in the abnormal state and ensure the reliable operation of the electronic device.

[0150] The above-mentioned detection method is described below in combination with the discharge scenario of the electronic device. Refer to Figure 4 , including:

[0151] In step 41, the processor can detect whether the power path tube BATFET in the charging module is in a discharging state; if it is in a charging state, this detection is ended; if it is in a discharging state, it jumps to step 42.

[0152] In step 42, the processor can create a write operation node for recording charge and discharge parameters.

[0153] In step 43, the processor can obtain the system supply voltage VSYS, the battery voltage VBAT, and the charging current IBAT from the charging module.

[0154] In step 44, after the processor obtains a set of charge and discharge parameters each time, it determines whether there is a parameter of 0 in the charge and discharge parameters. If so, this detection is ended; if not, it jumps to step 45.

[0155] In step 45, the processor can determine whether 50 sets of charge and discharge parameters are collected during the timing period. If not, it jumps to step 43; if so, it jumps to step 46.

[0156] In step 46, the processor can obtain the number of sets of charge and discharge parameters containing invalid parameters and determine whether the number is less than or equal to 10 (i.e., the above-mentioned preset invalid parameter threshold). If not, it jumps to step 47; if so, it jumps to step 48.

[0157] In step 47, the processor can determine that this detection fails and generate an abnormal detection result. This abnormal detection result can be fed back to the system application of the electronic device or stored in a specified location for subsequent backtracking use.

[0158] In step 48, the processor may turn off the timer; read the operation nodes, eliminate the charge and discharge parameters containing invalid parameters, obtain the average value of the remaining charge and discharge parameters, and obtain the average value of the system supply voltage VSYS_avg, the average value of the battery voltage VBAT_avg, and the average value of the charging current IBAT_avg.

[0159] In step 49, the processor may calculate the impedance value R of the power path tube in the charging module as R = (VSYS_avg - VBAT_avg) / IBAT_avg.

[0160] In step 410, the processor may return the impedance value of the power path tube to the system application or the specified location of the electronic device.

[0161] The above detection method is described below in combination with the charging scenario of an electronic device. Refer to Figure 5 , including:

[0162] In step 51, the processor may detect whether the external power supply voltage VBUS is greater than 4V and whether the external charger is of the DCP type. If not, the current detection fails. If so, jump to step 52.

[0163] In step 52, the processor may agree with the external charger to limit the charging current of the battery BAT to 1.5A.

[0164] In step 53, the processor may determine whether the battery temperature is within the range of (0, 50) degrees Celsius or the battery is less than or equal to 80%. If not, the current detection fails; if so, jump to step 54.

[0165] In step 54, the processor may obtain the system supply voltage VSYS, the battery voltage VBAT, and the charging current IBAT from the charging module.

[0166] In step 55, after the processor obtains a set of charge and discharge parameters each time, it determines whether there is a parameter of 0 in the charge and discharge parameters. If so, end the current detection; if not, jump to step 56.

[0167] In step 56, the processor may determine whether 50 sets of charge and discharge parameters are collected during the timing period. If not, jump to step 54; if so, jump to step 57.

[0168] In step 57, the processor may turn off the timer; obtain the average value of 50 sets of charge and discharge parameters, and obtain the average value of the system supply voltage VSYS_avg, the average value of the battery voltage VBAT_avg, and the average value of the charging current IBAT_avg.

[0169] In step 58, the processor may calculate the impedance value R of the power path tube in the charging module as R = (VSYS_avg - VBAT_avg) / IBAT_avg.

[0170] In step 59, the processor may determine whether the impedance value R of the power path tube is within (50, 150) ohms. If so, the current detection passes; if not, it is determined that the power path tube is in an abnormal state, and the process jumps to step 510.

[0171] In step 510, the processor may detect whether three consecutive detections are all in an abnormal state. If so, the process jumps to step 511; if not, the process jumps to step 54.

[0172] In step 511, the processor may generate an abnormal detection result and return it to the system application of the upper layer or store it at a specified location.

[0173] Based on Figure 4 and Figure 5 the example solutions shown, (1) by setting the detection method, there is no need to use external fixtures to detect the working state of the power path tube, which is simple and easy to implement; (2) by determining whether there is a parameter of 0 in the charge and discharge parameters, abnormal parameters can be excluded to ensure the accuracy of the detection results; (3) the impedance value and / or detection results of the power path tube can be fed back to the system application of the electronic device for convenient retrospective viewing; (4) by determining whether the external power supply voltage is greater than 4V or whether the charger is of the DCP type, it can be determined that the external power supply and charger are capable of powering the system and charging the battery; (5) by detecting the battery temperature and battery power, some suitable charging scenarios for detection can be determined to execute the solution to ensure the accuracy of the detection results.

[0174] Based on a detection method provided in an embodiment of the present disclosure, an embodiment of the present disclosure further provides a detection device applicable to an electronic device, where the electronic device includes a charging module. Refer to Figure 6 , and the device includes:

[0175] A parameter acquisition module 61, configured to determine that the charge and discharge detection conditions are met and acquire the charge and discharge parameters of the electronic device;

[0176] A state determination module 62, configured to determine whether the power path tube in the charging module is in an abnormal state according to the charge and discharge parameters.

[0177] In an example, the state determination module includes:

[0178] An impedance value determination sub-module, configured to determine the impedance value of the power path tube in the charging module according to the charge and discharge parameters;

[0179] An abnormal state determination sub-module, configured to determine whether the charging module is in an abnormal state according to the impedance value and a preset impedance value range.

[0180] In one example, the charge and discharge parameters include the system power supply voltage, battery voltage, and charging current of the electronic device;

[0181] The system power supply voltage is the voltage value at the system voltage pin of the charging module;

[0182] The battery voltage is the voltage difference between the first battery pin and the second battery pin of the charging module;

[0183] The charging current is the ratio of the voltage difference between the first resistor pin and the second resistor pin of the charging module to the resistance value of the precision resistor.

[0184] In one example, when there is a set of charge and discharge parameters, the impedance value determination sub-module includes:

[0185] A voltage value acquisition unit, configured to acquire the voltage difference between the system power supply voltage and the battery voltage to obtain the voltage value across the power path tube in the charging module;

[0186] An impedance value acquisition unit, configured to determine the ratio of the voltage value of the power path tube to the charging current as the impedance value of the power path tube in the charging module.

[0187] In one example, when there are multiple sets of charge and discharge parameters, the impedance value determination sub-module includes:

[0188] An average value acquisition unit, configured to respectively acquire the average values of the system power supply voltage, battery voltage, and charging current in the charge and discharge parameters to obtain the average system power supply voltage, average battery voltage, and average charging current;

[0189] A voltage average value acquisition unit, configured to acquire the voltage difference between the average system power supply voltage and the average battery voltage to obtain the average voltage across the power path tube in the charging module;

[0190] An impedance value determination unit, configured to determine the ratio of the average voltage of the power path tube to the average charging current as the impedance value of the power path tube in the charging module.

[0191] In one example, after acquiring the charge and discharge parameters of the electronic device, the parameter acquisition module includes:

[0192] A parameter determination sub-module, configured to determine that a set of charge and discharge parameters is acquired and determine whether a parameter with a value of 0 is included in the set of charge and discharge parameters;

[0193] A parameter elimination sub-module, which is used to determine that the set of charge and discharge parameters contains a parameter of 0, and then eliminate the set of charge and discharge parameters.

[0194] In one example, the parameter acquisition module further includes:

[0195] An invalid parameter determination sub-module, which is used to determine the number of groups of charge and discharge parameters that contain invalid parameters;

[0196] A result judgment sub-module, which is used to determine that the number of groups is less than or equal to a preset number threshold, and trigger the average value acquisition sub-unit; and determine that the number of groups is greater than the preset number threshold, and generate an abnormal detection result.

[0197] In one example, the preset impedance value range is a first preset range in the battery charging scenario, and the abnormal state determination sub-module includes:

[0198] An impedance value determination unit, which is used to determine whether the impedance value is within the first preset range;

[0199] An abnormal state determination unit, which is used to determine that the impedance value is outside the first preset range, and then determine that the power path tube in the charging module is in an abnormal state.

[0200] In one example, the preset impedance value range is a second preset range in the battery discharge scenario, and the abnormal state determination sub-module includes:

[0201] An impedance value determination unit, which is used to determine whether the impedance value is within the second preset range;

[0202] An abnormal state determination unit, which is used to determine that the impedance value is outside the second preset range, and then determine that the power path tube in the charging module is in an abnormal state; and determine whether the abnormal state is detected continuously for a preset number of times. If so, generate an abnormal detection result. If not, re-trigger the parameter acquisition module.

[0203] In one example, the state determination module further includes:

[0204] A correct state determination sub-module, which is used to determine that the impedance value is within the first preset range, and then determine that the power path tube in the charging module is in a normal working state; or, determine that the impedance value is within the second preset range, and then determine that the power path tube in the charging module is in a normal working state.

[0205] In one example, the parameter acquisition module includes:

[0206] A charge and discharge state detection sub-module, which is used to detect the charge and discharge state of the charging module, and the charge and discharge state includes a charging state or a discharging state;

[0207] The discharge state detection sub-module is used to determine that the detected charge-discharge state is the charging state and trigger the parameter acquisition module.

[0208] In one example, the parameter acquisition module includes:

[0209] The type determination sub-module is used to detect the external power supply voltage and the type of the external charger;

[0210] The current determination sub-module is used to determine that the external power supply voltage exceeds a preset power supply voltage threshold and the charger type is a preset type, and determine the maximum charging current of the battery;

[0211] The condition determination sub-module is used to determine that the battery power is less than a preset power threshold or the battery temperature is within a preset temperature range, and determine that the charging condition in the charge-discharge detection conditions is satisfied.

[0212] It should be noted that the device embodiment shown in this embodiment matches the content of the above method embodiment. The content of the above method embodiment can be referred to and will not be repeated here.

[0213] In an exemplary embodiment, an electronic device is further provided, including:

[0214] A charging module including a power path tube;

[0215] A processor;

[0216] A processor;

[0217] A memory for storing computer programs executable by the processor;

[0218] Wherein, the processor is configured to execute the computer program in the memory to implement the method as described above.

[0219] In an exemplary embodiment, a computer-readable storage medium is further provided, such as a memory including an executable computer program, and the above executable computer program can be executed by a processor to implement the method of the above embodiment. Among them, the readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0220] After considering the specification and practicing the disclosure herein, those skilled in the art will readily think of other embodiments of the present disclosure. The present disclosure is intended to cover any variations, uses, or adaptations, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0221] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A detection method, characterized in that: Applicable to an electronic device, the electronic device includes a charging module, and the method includes: Determine whether the charge and discharge detection conditions are met and obtain the charge and discharge parameters of the electronic device; Determine whether the power path tube in the charging module is in an abnormal state according to the charging and discharging parameters.

2. The method according to claim 1, characterized in that Determining whether the power path tube in the charging module is in an abnormal state according to the charging and discharging parameters includes: Determine the impedance value of the power path tube in the charging module according to the charging and discharging parameters; Whether the charging module is in an abnormal state is determined according to the impedance value and a preset impedance value range.

3. The method according to claim 1 or 2, characterized in that: The charging and discharging parameters include the system power supply voltage, battery voltage and charging current of the electronic device; The system supply voltage is the voltage value at the system voltage pin of the charging module; The battery voltage is the voltage difference between the first battery pin and the second battery pin of the charging module; The charging current is the ratio of the voltage difference between the first resistance pin and the second resistance pin of the charging module to the resistance value of the precision resistor.

4. The method according to claim 3, characterized in that When the charging and discharging parameters are a group, determining the impedance value of the power path tube in the charging module according to the charging and discharging parameters includes: Obtaining a voltage difference between the system power supply voltage and the battery voltage to obtain voltage values ​​at both ends of a power path tube in the charging module; The ratio of the voltage value of the power path tube to the charging current is determined as the impedance value of the power path tube in the charging module.

5. The method according to claim 3, characterized in that: When there are multiple groups of charging and discharging parameters, determining the impedance value of the power path tube in the charging module according to the charging and discharging parameters includes: Respectively obtaining average values ​​of the system power supply voltage, the battery voltage and the charging current in the charging and discharging parameters to obtain an average value of the system power supply voltage, an average value of the battery voltage and an average value of the charging current; Obtaining a voltage difference between an average value of the system power supply voltage and an average value of the battery voltage, and obtaining an average voltage at both ends of a power path tube in the charging module; The ratio of the average voltage of the power path tube to the average charging current is determined as the impedance value of the power path tube in the charging module.

6. The method according to claim 4 or 5, characterized in that: After acquiring the charge and discharge parameters of the electronic device, the method further includes: Determine whether a set of charge and discharge parameters is obtained and whether the set of charge and discharge parameters includes a parameter with a value of 0; If it is determined that the parameter included in the group of charge and discharge parameters is 0, the group of charge and discharge parameters is eliminated.

7. The method according to claim 5, characterized in that Before respectively obtaining the average values ​​of the system power supply voltage, the battery voltage and the charging current in the charging and discharging parameters, the method further includes: Determine the number of groups of multiple charge and discharge parameters that include invalid parameters; If it is determined that the number of groups is less than or equal to a preset group number threshold, then after eliminating invalid parameters, the steps of respectively obtaining average values ​​of the system power supply voltage, the battery voltage and the charging current in the charging and discharging parameters are performed; Determine that the number of groups is greater than the preset group number threshold, and generate an abnormality detection result.

8. The method according to claim 2, characterized in that: The preset impedance value range is a first preset range in a battery charging scenario, and determining whether the charging module is in an abnormal state according to the impedance value and the preset impedance value range includes: determining whether the impedance value is within the first preset range; If it is determined that the impedance value is outside the first preset range, it is determined that the power path tube in the charging module is in an abnormal state.

9. The method according to claim 2, characterized in that: The preset impedance value range is a second preset range in a battery discharging scenario, and determining whether the charging module is in an abnormal state according to the impedance value and the preset impedance value range includes: determining whether the impedance value is within the second preset range; Determining that the impedance value is outside the second preset range, then determining that the power path tube in the charging module is in an abnormal state; Determine whether an abnormal state is detected for a preset number of consecutive times. If so, generate an abnormal detection result. If not, re-execute the step of determining whether the charge and discharge detection conditions are met and obtaining the charge and discharge parameters of the electronic device.

10. The method according to claim 8 or 9, characterized in that: The method further comprises: Determining that the impedance value is within the first preset range, then determining that the power path tube in the charging module is in a normal working state; or, If it is determined that the impedance value is within the second preset range, it is determined that the power path tube in the charging module is in a normal working state.

11. The method according to claim 1, characterized in that: Determine whether the charge and discharge detection conditions are met, including: Detecting the charging and discharging state of the charging module, wherein the charging and discharging state includes a charging state or a discharging state; Determining that the charge-discharge state is detected to be a discharge state, and determining that a discharge condition in the charge-discharge detection condition is satisfied; It is determined that the charge and discharge state is detected to be a charging state, and the steps of determining that a charge and discharge detection condition is met and obtaining charge and discharge parameters of the electronic device are performed.

12. The method according to claim 1, characterized in that Determine whether the charge and discharge detection conditions are met, including: Detect external power supply voltage and external charger type; Determining that the external power supply voltage exceeds a preset power supply voltage threshold and the charger type is a preset type, and determining a maximum charging current of the battery; It is determined that the power level of the battery is less than a preset power level threshold or the battery temperature is within a preset temperature range, and it is determined that a charging condition in the charge and discharge detection condition is met.

13. A detection device, characterized in that: Applicable to electronic equipment, the electronic equipment includes a charging module, and the device includes: A parameter acquisition module, used to determine whether the charge and discharge detection conditions are met and obtain the charge and discharge parameters of the electronic device; A state determination module is used to determine whether the power path tube in the charging module is in an abnormal state according to the charging and discharging parameters.

14. An electronic device, characterized in that: include: A charging module including a power path tube; processor; a memory for storing a computer program executable by the processor; The processor is configured to execute the computer program in the memory to implement the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: When the executable computer program in the storage medium is executed by a processor, the method according to any one of claims 1 to 12 can be implemented.