Detection circuit and method, device and module thereof, electronic equipment and storage medium

By designing a detection circuit including multiple sampling resistors and input and output terminals, the problem of difficulty in detecting the charging current of each battery alone in the prior art is solved, and accurate detection of the charging current of each battery and improvement of the battery charging efficiency is achieved.

CN120065016APending Publication Date: 2025-05-30BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311617634.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In existing electronic devices, it is difficult to detect the charging current of each battery separately, resulting in the inability to accurately obtain the voltage difference between batteries, affecting the accuracy of charging control.

Method used

A detection circuit is designed, including at least two sampling resistors and multiple sets of inputs and outputs. Each set of inputs is electrically connected to a sampling resistor. The voltage difference value at the output indicates the voltage division of the charging circuit where the sampling resistor is located, thereby achieving separate detection of the charging current of each battery.

Benefits of technology

Through this detection circuit, the charging current of each battery can be detected separately, which improves the battery charging efficiency and accuracy, and solves the problem that the battery voltage difference cannot be accurately obtained in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120065016A_ABST
    Figure CN120065016A_ABST
Patent Text Reader

Abstract

The invention provides a detection circuit, a detection method, a detection device, a detection module, electronic equipment and a storage medium. The electronic equipment comprises at least two sampling resistors, at least two groups of input ends and at least one group of output ends, each group of input ends is electrically connected with one sampling resistor; and the voltage difference value of the at least one group of output ends is used for representing the partial voltage of the charging loop where the at least one sampling resistor is located. According to the embodiment of the invention, the voltage value of each sampling resistor can be independently detected or the voltage values of a plurality of sampling resistors can be simultaneously detected, so that the purpose of independently detecting the charging current of a certain battery or simultaneously detecting the charging current of a plurality of batteries is achieved, and the battery charging efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Some electronic devices are provided with two batteries, namely a first battery and a second battery. The first battery is coupled to a charging chip through an isolation and balancing circuit, and the second battery is coupled to the charging chip through an isolation and balancing circuit. A voltage measurement control module is used to obtain the voltages of the first battery and the second battery, and output a control signal according to the voltage difference between the first battery and the second battery. The isolation and balancing circuit is used to receive the control signal and be in a conducting state, a balanced state, or an off state under the control of the control signal. To obtain an accurate voltage difference, the electronic device is further provided with a current sampling circuit, and the current sampling circuit can adopt a main board side coulombmeter design. When the sampling resistor is set on the return ground side, the sampling current at this time is the total charging current of the two batteries, resulting in the effect that the first battery and the second battery cannot be detected separately. Summary of the Invention

[0003] The present disclosure provides a detection circuit and a method, device, module, electronic device, and storage medium thereof to solve the above technical problems.

[0004] According to a first aspect of the present disclosure, a detection circuit is provided, including at least two sampling resistors, at least two sets of input terminals, and at least one set of output terminals; each set of input terminals is electrically connected to a sampling resistor; the voltage difference of the at least one set of output terminals is used to represent the voltage division of at least one charging circuit where the sampling resistor is located.

[0005] Optionally, one input terminal in each set of input terminals is electrically connected to a reference voltage line at different positions, and the other input terminal of each set of input terminals is used to detect the voltage division of the connected sampling resistor.

[0006] Optionally, the at least two sampling resistors include a first sampling resistor and a second sampling resistor, the at least two sets of input terminals include a first sampling terminal, a second sampling terminal, a third sampling terminal, and a fourth sampling terminal; the at least one set of output terminals includes a first detection terminal and a second detection terminal; the first sampling terminal is electrically connected to the first end of the first sampling resistor and a first reference voltage line respectively, and the second sampling terminal is electrically connected to the first end of the second sampling resistor and a second reference voltage line respectively; the third sampling terminal is electrically connected to the second end of the first sampling resistor, and the fourth sampling terminal is electrically connected to the second end of the second sampling resistor; the voltage difference between the first detection terminal and the second detection terminal is used to represent the voltage division of the charging circuit where the first sampling resistor and / or the second sampling resistor is located.

[0007] Optionally, the detection circuit includes a sampling unit; a first end of the sampling unit is electrically connected to a first end of the first sampling resistor, a second end of the sampling unit is electrically connected to a first end of the second sampling resistor, a third end of the sampling unit is electrically connected to a second end of the first sampling resistor, and a fourth end of the sampling unit is electrically connected to a second end of the second sampling resistor; a first detection end of the sampling unit is electrically connected to a first detection end of the detection circuit, and a second detection end of the sampling unit is electrically connected to a second detection end of the detection circuit.

[0008] Optionally, the sampling unit includes a first resistor, a second resistor, a third resistor, and a fourth resistor;

[0009] A first end of the first resistor is electrically connected to a first end of the sampling unit, and a second end of the first resistor is electrically connected to a first end of the second resistor and a first detection end of the sampling unit respectively; a second end of the second resistor is electrically connected to a second end of the sampling unit;

[0010] A first end of the third resistor is electrically connected to a third end of the sampling unit, and a second end of the third resistor is electrically connected to a first end of the fourth resistor and a second detection end of the sampling unit respectively; a second end of the fourth resistor is electrically connected to a fourth end of the sampling unit.

[0011] Optionally, the resistance values of the first resistor and the second resistor are equal; and / or the resistance values of the third resistor and the fourth resistor are equal.

[0012] Optionally, one input end in each group of input ends is a common detection end, and the other input end in each group of input ends is used to detect the voltage division of the connected sampling resistor.

[0013] Optionally, the at least two sampling resistors include a first sampling resistor and a second sampling resistor, and the at least two groups of input ends include a third sampling end and a fourth sampling end; the at least one group of output ends includes a second detection end; the third sampling end is electrically connected to a second end of the first sampling resistor, and the fourth sampling end is electrically connected to a second end of the second sampling resistor; a first end of the first sampling resistor and a first end of the second sampling resistor are electrically connected to a reference voltage line;

[0014] The voltage difference between the first detection end and the second detection end is used to represent the voltage division of the charging circuit where the first sampling resistor and / or the second sampling resistor is located.

[0015] Optionally, the detection circuit includes a sampling unit, and the sampling unit includes a third resistor and a fourth resistor; a first end of the third resistor is electrically connected to a second end of the first sampling resistor, and a second end of the third resistor is electrically connected to a first end of the fourth resistor and the second detection end respectively; a second end of the fourth resistor is electrically connected to a second end of the second sampling resistor.

[0016] Optionally, the detection circuit further includes a mode switching unit: the mode switching unit is electrically connected to the sampling unit;

[0017] The mode switching unit is configured to adjust the working mode of the sampling unit; the sampling unit is configured to detect voltage values of the first sampling resistor and / or the second sampling resistor in the working mode.

[0018] Optionally, the mode switching unit includes: a first switching device; a first end of the first switching device is electrically connected to a first end of the sampling unit or a common detection end, and a second end of the first switching device is electrically connected to a third end of the sampling unit; the first switching device is configured to bypass the first sampling resistor when switched to the conducting state;

[0019] and / or,

[0020] The mode switching unit includes: a second switching device; a first end of the second switching device is electrically connected to a second end of the sampling unit or the common detection end, and a second end of the second switching device is electrically connected to a fourth end of the sampling unit; the second switching device is configured to bypass the second sampling resistor when switched to the conducting state.

[0021] Optionally, the detection circuit further includes a mode control unit; the mode control unit is electrically connected to the mode switching unit; the mode control unit is configured to generate a mode switching signal and send it to the mode switching unit so that the mode switching unit adjusts the working mode of the sampling unit.

[0022] Optionally, the mode control unit includes a third switching device, a fourth switching device, and a power signal terminal; the power signal terminal is configured to receive a level signal;

[0023] A first end of the third switching device is electrically connected to a control end of the first switching device, a second end of the third switching device is electrically connected to the power signal terminal, and a control end of the third switching device is configured to receive a first trigger control signal; a first end of the fourth switching device is electrically connected to the power signal terminal, a second end of the fourth switching device is electrically connected to a control end of the second switching device, and a control end of the fourth switching device is configured to receive a second trigger control signal;

[0024] The third switching device is configured to switch to the conducting state when receiving the first trigger control signal, so as to output the power signal at the power signal terminal to the first switching device;

[0025] The fourth switching device is configured to switch to the conducting state when receiving the second trigger control signal, so as to output the power signal at the power signal terminal to the second switching device.

[0026] Optionally, the detection circuit further includes a power signal acquisition unit; the power acquisition unit is electrically connected to the power signal terminal;

[0027] The power signal acquisition unit is configured to output the power signal of the external power supply from the power signal terminal when detecting that the external power supply is connected, or output the power signal of the battery from the power signal terminal when detecting that the external power supply is not connected.

[0028] Optionally, the power signal acquisition unit includes a first diode and a second diode; the anode of the first diode is electrically connected to the power signal line, the cathode of the first diode is electrically connected to the power signal terminal; the anode of the second diode is electrically connected to the positive electrode of the battery, and the cathode of the second diode is electrically connected to the power signal terminal.

[0029] Optionally, the detection circuit further includes at least two battery connectors, and one of the sampling resistors is connected between one of the battery connectors and one of the reference voltage lines, and the other sampling resistor is connected between the other battery connector and the other reference voltage line.

[0030] Optionally, the detection circuit further includes a first battery connector and a second battery connector; the first battery connector and the second battery connector; the first sampling resistor is connected in series between the first battery connector and the first reference voltage line, and the second sampling resistor is connected in series between the second battery connector and the second reference voltage line;

[0031] The detection circuit is configured to acquire the voltage value of the first sampling resistor and / or the second sampling resistor, and the voltage value is used to determine the charging current in the charging circuit where the battery is located.

[0032] Optionally, the first sampling resistor and the first battery connector are adjacent to each other on the circuit board and the distance therebetween is less than or equal to a preset distance threshold, or the first sampling resistor and the first battery connector are distributed on both sides of the circuit board and the first sampling resistor is located within the projection area of the first battery connector.

[0033] Optionally, the detection circuit further includes a first controller; a first control pin of the first controller is electrically connected to a control end of a third switching device in the detection circuit, and a second control pin of the first controller is electrically connected to a control end of a fourth switching device in the detection circuit;

[0034] The first controller is configured to output a second trigger control signal through the second control pin when the first battery connected to the first battery connector has a charging requirement;

[0035] The first controller is further configured to output a first trigger control signal through the first control pin when the second battery connected to the second battery connector has a charging requirement.

[0036] Optionally, the detection circuit further includes a second controller; a power supply pin of the second controller is electrically connected to an anode of a first diode in the detection circuit, and is configured to output a power supply signal from an external device to the first diode; a battery pin of the second controller is electrically connected to an anode of a second diode in the detection circuit, and is configured to output a power supply signal from the first battery connected to the first battery connector and / or the second battery connected to the second battery connector to the second diode.

[0037] Optionally, the detection circuit further includes a first charging switching circuit and a first charging module; the first charging switching circuit is electrically connected to the first battery connector and the first charging module respectively; the first charging switching circuit is configured to switch to a conducting state when receiving the first trigger control signal, so that the first charging module charges the first battery through the first battery connector.

[0038] Optionally, the first charging switching circuit includes a fifth switching device; a first end of the fifth switching device is electrically connected to the first charging module, a second end of the fifth switching device is electrically connected to the first battery connector, and a control end of the fifth switching device is electrically connected to the first control pin of the first controller.

[0039] Optionally, the first charging switching circuit further includes a fifth resistor and a sixth resistor; a first end of the fifth resistor is electrically connected to the first end of the fifth switching device, and a second end of the fifth resistor is electrically connected to the first control pin of the first controller, a second end of the sixth resistor, and a control end of the fifth switching device respectively; a first end of the sixth resistor is electrically connected to a preset power supply pin of the first charging module.

[0040] Optionally, the detection circuit further includes a second charging switching circuit; the second charging switching circuit is electrically connected to the second battery connector and the first charging module respectively; the second charging switching circuit is configured to switch to a conducting state when receiving a second trigger control signal, so that the first charging module charges the second battery through the second battery connector.

[0041] Optionally, the second charging switching circuit includes a sixth switching device; a first end of the sixth switching device is electrically connected to the first charging module, a second end of the sixth switching device is electrically connected to the second battery connector, and a control end of the sixth switching device is electrically connected to a second control pin of the first controller.

[0042] Optionally, the second charging switching circuit further includes a seventh resistor and an eighth resistor; a first end of the seventh resistor is electrically connected to the first end of the sixth switching device, and a second end of the seventh resistor is electrically connected to the second control pin of the first controller, a second end of the eighth resistor, and the control end of the sixth switching device respectively; a first end of the eighth resistor is electrically connected to a preset power supply pin of the first charging module.

[0043] Optionally, the first sampling resistor and the second sampling resistor have equal resistance values.

[0044] According to a second aspect of the present disclosure, there is provided a detection module, including the circuit according to any one of the first aspect.

[0045] Optionally, it further includes: a circuit board; the first sampling resistor and the first battery connector are arranged adjacent to each other on the circuit board and the distance therebetween is less than or equal to a preset distance threshold, or the first sampling resistor and the first battery connector are distributed on both sides of the circuit board and the first sampling resistor is located within the projection area of the first battery connector;

[0046] and / or,

[0047] the second sampling resistor and the second battery connector are arranged adjacent to each other on the circuit board and the distance therebetween is less than or equal to a preset distance threshold, or the second sampling resistor and the second battery connector are distributed on both sides of the circuit board and the second sampling resistor is located within the projection area of the second battery connector.

[0048] According to a third aspect of the present disclosure, there is provided an electronic device, including at least two batteries, and the circuit according to any one of the first aspect for detecting the at least two batteries and / or the detection module according to the second aspect.

[0049] According to a fourth aspect of the present disclosure, there is provided a charging control method, the method including:

[0050] In response to detecting that at least one of at least two batteries has a charging requirement, control the detection circuit to detect the voltage value of the charging circuit where the battery is located;

[0051] Determine the charging current of the charging circuit where the battery is located according to the voltage value.

[0052] Optionally, the at least two batteries include a first battery and a second battery. Controlling the detection circuit to detect the voltage value of the charging circuit where the battery is located includes:

[0053] Output a first trigger control signal in response to detecting that the second battery has a charging requirement, and output a second trigger control signal in response to detecting that the first battery has a charging requirement;

[0054] Obtain the voltage difference between the first detection end and the second detection end of the detection circuit as the voltage value of the charging circuit where the battery is located.

[0055] According to the fifth aspect of the present disclosure, there is provided a charging control device, the device includes:

[0056] A voltage value acquisition module, configured to control the detection circuit to detect the voltage value of the charging circuit where the battery is located in response to detecting that at least one of at least two batteries has a charging requirement;

[0057] A charging current determination module, configured to determine the charging current of the charging circuit where the battery is located according to the voltage value.

[0058] Optionally, the at least two batteries include a first battery and a second battery, and the voltage value acquisition module includes:

[0059] A first trigger signal output module, configured to output a first trigger control signal in response to detecting that the second battery has a charging requirement;

[0060] A second trigger signal output module, configured to output a second trigger control signal in response to detecting that the first battery has a charging requirement;

[0061] A voltage value acquisition module, configured to obtain the voltage difference between the first detection end and the second detection end of the detection circuit as the voltage value of the charging circuit where the battery is located.

[0062] According to the sixth aspect of the present disclosure, there is provided an electronic device, including: a processor and a memory;

[0063] The memory is used to store a computer program executable by the processor;

[0064] Wherein, the processor is configured to execute the computer program in the memory to implement the method as described in the second aspect.

[0065] According to a seventh aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium, which can implement the method described in the second aspect when the executable computer program in the storage medium is executed by a processor.

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

[0067] The detection circuit provided in this embodiment includes at least two sampling resistors, at least two groups of input terminals, and at least one group of output terminals; each group of input terminals is electrically connected to a sampling resistor; the voltage difference of the at least one group of output terminals is used to represent the voltage division of the charging circuit where at least one sampling resistor is located. In this way, this embodiment can detect the voltage value of each sampling resistor separately or detect the voltage values of multiple sampling resistors simultaneously, achieving the purpose of separately detecting the charging current of a certain battery or simultaneously detecting the charging currents of multiple batteries, which is beneficial to improving the battery charging efficiency.

[0068] 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

[0069] Figure 1 It is a block diagram of an electronic device according to an embodiment of the present disclosure.

[0070] Figure 2 It is a block diagram of a voltage detection circuit according to an embodiment of the present disclosure.

[0071] Figure 3 It is a circuit diagram of a sampling unit according to an embodiment of the present disclosure.

[0072] Figure 4 It is a block diagram of another voltage detection circuit according to an embodiment of the present disclosure.

[0073] Figure 5 It is a circuit diagram of a mode switching unit according to an embodiment of the present disclosure.

[0074] Figure 6 It is a block diagram of yet another voltage detection circuit according to an embodiment of the present disclosure.

[0075] Figure 7 It is a circuit diagram of a mode control unit according to an embodiment of the present disclosure.

[0076] Figure 8 It is a circuit diagram of a power signal acquisition unit according to an embodiment of the present disclosure.

[0077] Figure 9 It is a block diagram of another electronic device according to an embodiment of the present disclosure.

[0078] Figure 10Block diagram of another electronic device according to an embodiment of the present disclosure.

[0079] Figure 11 Block diagram of another electronic device according to an embodiment of the present disclosure.

[0080] Figure 12 Block diagram of another electronic device according to an embodiment of the present disclosure.

[0081] Figure 13 Circuit diagram of a voltage detection circuit in an electronic device according to an embodiment of the present disclosure.

[0082] Figure 14 Circuit diagram of a voltage detection circuit in another electronic device according to an embodiment of the present disclosure.

[0083] Figure 15 Block diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners

[0084] 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 implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.

[0085] To solve the above technical problems, the embodiments of the present disclosure provide a detection circuit, its method, device, module, electronic device, and storage medium. The above voltage detection circuit may include at least two sampling resistors, at least two groups of input terminals, and at least one group of output terminals; each group of input terminals is electrically connected to a sampling resistor; the voltage difference of the at least one group of output terminals is used to represent the voltage division of at least one charging loop where the sampling resistor is located. It can be understood that each sampling resistor can collect the voltage division of a charging loop where a battery is located, so that at least two sampling resistors can sample the charging and discharging currents of at least two batteries.

[0086] In one example, one input terminal in each group of input terminals is electrically connected to a reference voltage line at a different position, and the other input terminal in each group is used to detect the voltage division of the connected sampling voltage. It can be understood that since the positions of the reference voltage lines (such as the ground GND in the subsequent embodiments) are different, the reference voltages provided by them also vary. In this way, by connecting to different reference voltage lines respectively, it is convenient to eliminate the difference in reference voltages subsequently, which is applicable to scenarios where the installation distance of the reference voltage lines is relatively far, such as the reference voltage lines of different screens of a folding screen (double-fold screen, triple-fold screen or multi-fold screen, etc.). In one example, one input terminal in each group of input terminals is a common detection terminal, and the other input terminal in each group of input terminals is used to detect the voltage division of the connected sampling resistor. In this way, by connecting to the same common detection terminal or sharing the same common detection terminal, only the voltage division of the sampling resistor needs to be detected, and the detection process is simple and fast, which is applicable to scenarios where the reference voltage line is short or the installation distance is relatively close.

[0087] In one example, the detection circuit further includes at least two battery connectors, one of the sampling resistors is connected between one of the battery connectors and one of the reference voltage lines, and the other sampling resistor is connected between another battery connector and another reference voltage line. In one example, it further includes a first battery connector and a second battery connector; the first battery connector and the second battery connector; the first sampling resistor is connected in series between the first battery connector and the first reference voltage line, and the second sampling resistor is connected in series between the second battery connector and the second reference voltage line; the detection circuit is used to obtain the voltage value of the first sampling resistor and / or the second sampling resistor, and the voltage value is used to determine the charging current in the charging circuit where the battery is located.

[0088] It should be noted that when the detection circuit includes multiple sampling resistors, there are multiple combinations for collecting the charging and discharging currents of the battery. In the subsequent embodiments of the present disclosure, the scenarios of providing a single battery and detecting all batteries simultaneously are provided, and at this time, the requirements for battery detection can be met. In this way, the solutions of the subsequent embodiments can be simplified to the solution of detecting the charging and discharging currents of 2 batteries with 2 sampling resistors, which is convenient for understanding the solution.

[0089] It can be understood that the electronic device may include the above detection circuit, or a detection module composed of the above detection circuit. Subsequently, taking the detection of the voltage values of the first sampling resistor and the second sampling resistor in the electronic device as an example, the detection circuit, its method, device, module, electronic device, and storage medium provided by the embodiments of the present disclosure will be described. Figure 1 The structural schematic diagram of an electronic device according to an embodiment of the present disclosure. Refer to Figure 1, an electronic device 10 includes a detection circuit 11, a first battery CELL1, and a second battery CELL2. The above detection circuit includes a first sampling resistor Rsenser1, a second sampling resistor Rsenser2, a first battery connector CNTR1, and a second battery connector CNTR2; the first battery CELL1 is electrically connected to the first battery connector CNTR1, and the second battery CELL2 is electrically connected to the second battery connector CNTR2; the first sampling resistor Rsenser1 is connected in series between the first battery connector CNTR1 and a first reference voltage line (such as ground wire GND1), and the second sampling resistor Rsenser2 is connected in series between the second battery connector CNTR2 and a second reference voltage line (such as ground wire GND2).

[0090] In an example, when the first sampling resistor Rsenser1 and the first battery connector CNTR1 are on the same side of the circuit board (such as the main board, not shown in the figure) of the electronic device, they are arranged adjacent to each other and the distance is less than or equal to a preset distance threshold. The above preset distance threshold can be set according to the specific scenario, for example, 1 - 20 mm. Or, the first sampling resistor Rsenser1 and the first battery connector CNTR1 are distributed on both sides of the circuit board (such as the main board) of the electronic device and the first sampling resistor Rsenser1 is located within the projection area of the first battery connector CNTR1. The first sampling resistor Rsenser1 can be electrically connected to the first battery connector CNTR1 through a via hole on the circuit board. In this way, the trace length between the first sampling resistor Rsenser1 and the first battery connector CNTR1 can be reduced, which is beneficial to improving the accuracy of collecting voltage or current.

[0091] In an example, the detection module or the electronic device further includes a circuit board. When the second sampling resistor Rsenser2 and the second battery connector CNTR2 are on the same side of the circuit board (not shown in the figure), they are arranged adjacent to each other and the distance is less than or equal to a preset distance threshold. The above preset distance threshold can be set according to the specific scenario, for example, 1 - 20 mm. Or, the second sampling resistor Rsenser2 and the second battery connector CNTR2 are distributed on both sides of the circuit board and the second sampling resistor Rsenser2 is located within the projection area of the second battery connector CNTR2. The second sampling resistor Rsenser2 can be electrically connected to the second battery connector CNTR2 through a via hole on the circuit board. In this way, the trace length between the second sampling resistor Rsenser2 and the second battery connector CNTR2 can be reduced, which is beneficial to improving the accuracy of collecting voltage or current.

[0092] In one example, the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 are implemented with resistors of the same type, for example, resistors with the same resistance value. In one example, the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be implemented with high-precision resistors in the milliohm level with 1% accuracy. It can be understood that the resistance values of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be determined according to the charging currents of the first battery and the second battery.

[0093] In one example, continue to refer to Figure 1 , the detection circuit 11 includes: a first sampling terminal a, a second sampling terminal b, a third sampling terminal c, a fourth sampling terminal d, a first detection terminal e, and a second detection terminal f. The first sampling terminal a is electrically connected to the first end of the first sampling resistor Rsenser1 to be detected, and the second sampling terminal b is electrically connected to the first end of the second sampling resistor Rsenser2 to be detected; the third sampling terminal c is electrically connected to the second end of the first sampling resistor Rsenser1, and the fourth sampling terminal d is electrically connected to the second end of the second sampling resistor Rsenser2; the voltage difference between the first detection terminal e and the second detection terminal f is used to represent the voltage division of the charging circuit where the first sampling resistor Rsenser1 and / or the second sampling resistor is located.

[0094] In one example, refer to Figure 2 , the detection circuit 11 includes a sampling unit 21; the first end of the sampling unit 21 is electrically connected to the first end of the first sampling resistor Rsenser1, the second end of the sampling unit 21 is electrically connected to the first end of the second sampling resistor Rsenser2, the third end of the sampling unit 21 is electrically connected to the second end of the first sampling resistor Rsenser1, and the fourth end of the sampling unit 21 is electrically connected to the second end of the second sampling resistor Rsenser2; the first detection end of the sampling unit 21 is electrically connected to the first detection end of the detection circuit 11, and the second detection end of the sampling unit 21 is electrically connected to the second detection end b of the detection circuit 11.

[0095] In one example, refer to Figure 3 , the sampling unit 21 includes a first resistor R1, a second resistor R2, a third resistor R3, and a fourth resistor R4. The first end of the first resistor R1 is electrically connected to the first end of the sampling unit 21, and the second end of the first resistor R1 is electrically connected to the first end of the second resistor R2 and the first detection end of the sampling unit 21 respectively; the second end of the second resistor R2 is electrically connected to the second end of the sampling unit 21; the first end of the third resistor R3 is electrically connected to the third end of the sampling unit 21, and the second end of the third resistor R3 is electrically connected to the first end of the fourth resistor R4 and the second detection end of the sampling unit 21 respectively; the second end of the fourth resistor R4 is electrically connected to the fourth end of the sampling unit 21.

[0096] In one example, the first resistor R1 and the second resistor R2 can be implemented by resistors with the same resistance value. When the resistance values of the first resistor R1 and the second resistor R2 are the same, the voltage difference between the first ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be divided, and the voltage difference between the first ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be detected, that is, the error between the ground levels of the first ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be detected. This is because the installation positions of the first battery and the second battery are different, resulting in a certain distance between the first battery connector CNTR1 and the second battery connector CNTR2; since the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 are close to the corresponding batteries, there is a distance between the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2; there may be a voltage difference between the ground wires of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 respectively, and the above voltage difference can be detected by setting the same resistance value. In another example, the third resistor R3 and the fourth resistor R4 can be implemented by resistors with the same resistance value. When the resistance values of the third resistor R3 and the fourth resistor R4 are the same, the voltage difference between the second ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be divided, and the voltage difference between the second ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be detected, that is, the error between the ground levels of the second ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 can be detected. Considering that there may be a voltage difference between the first ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2, this voltage difference can be synchronously conducted between the second ends of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2; in this way, by setting the resistance values of the third resistor R3 and the fourth resistor R4 to be the same, the above voltage difference can be detected.

[0097] In yet another example, the first resistor R1, the second resistor R2, the third resistor R3, and the fourth resistor R4 can be implemented by resistors with the same resistance value. For example, the first resistor R1, the second resistor R2, the third resistor R3, and the fourth resistor R4 are all implemented by high-precision resistors with a resistance value of 100 ohms and a 1% accuracy. In this way, in this example, by setting each resistor to have the same resistance value, the voltage difference between the first detection end and the second detection end can cancel out the error caused by the different ground connection voltages (or electric potentials), which is beneficial to improving the accuracy of the detection result.

[0098] For example, the voltage of the grounding point connected to the first end of the first sampling resistor Rsenser1 is VGND_1, and the voltage of the grounding point connected to the first end of the second sampling resistor Rsenser2 is VGND_2. Then the voltage difference between the two grounding points is ΔV = VGND_2 - VGND_1 = Vb - Va. The voltage division at the first detection end is ΔVe = (Vb - Va) / 2. When the resistance values of the first sampling resistor Rsenser1 and the second sampling resistor Rsenser2 are the same, the voltage difference between the second end of the first sampling resistor Rsenser1 and the second end of the second sampling resistor Rsenser2 is ΔVf = ΔVe = (Vb - Va) / 2. That is, the sampling unit 21 can differential out the error caused by different ground potentials at the above locations.

[0099] It should be noted that when one input terminal in each group of at least two groups of input terminals of the detection circuit is a common detection terminal, at this time, the first sampling terminal and the second sampling terminal of the detection circuit can be regarded as the above common detection terminal. At this time, it is default that the reference voltages of the first sampling terminal and the second sampling terminal are the same, which can reduce the number of sampling terminals. At this time, the sampling unit of the detection circuit can include a third resistor R3 and a fourth resistor R4, that is, the first resistor R1 and the second resistor R2 in the above example are deleted, and the connection methods and working principles of the third resistor R3 and the fourth resistor R4 in the two embodiments are the same.

[0100] In an example, refer to Figure 4 , the detection circuit further includes a mode switching unit 41. The mode switching unit 41 is electrically connected to the sampling unit 21 and is used to adjust the working mode of the sampling unit 21. At this time, the sampling unit is used to detect the voltage values of the first sampling resistor Rsenser1 and / or the second sampling resistor Rsenser2 in the above working mode. In this embodiment, the above working mode may include a mode of only detecting the charging current of the charging circuit where the first battery CELL1 is located when the first battery CELL1 is charged alone (subsequently referred to as the third working mode), a mode of only detecting the charging current of the charging circuit where the second battery CELL2 is located when the second battery CELL2 is charged alone (subsequently referred to as the second working mode), and a mode of simultaneously detecting the charging current of the charging circuit where the first battery CELL1 is located and the charging current of the charging circuit where the second battery CELL2 is located when the first battery CELL1 and the second battery CELL2 are charged simultaneously (subsequently referred to as the first working mode).

[0101] In an example, refer to Figure 5, the mode switching unit 41 includes a first switching device Q1. The first end of the first switching device Q1 is electrically connected to the first end of the sampling unit 21, and the second end of the first switching device Q1 is electrically connected to the third end of the sampling unit 21. Or rather, the first switching device Q1 is in a parallel relationship with the first sampling resistor Rsenser1. The first switching device Q1 is used to bypass the first sampling resistor Rsenser1 when switched to the conducting state, and when switched to the off state, the first sampling resistor Rsenser1 can normally detect the charging current in the loop where it is located (reflected by its own voltage value).

[0102] In another example, continue to refer to Figure 5 , the mode switching unit 41 includes a second switching device Q2. The first end of the second switching device Q2 is electrically connected to the second end of the sampling unit 21, and the second end of the second switching device Q2 is electrically connected to the fourth end of the sampling unit 21. Or rather, the second switching device Q2 is in a parallel relationship with the second sampling resistor Rsenser2 to be detected. The second switching device is used to bypass the second sampling resistor Rsenser2 when switched to the conducting state, and when switched to the off state, the second sampling resistor Rsenser2 can normally detect the charging current in the loop where it is located (reflected by its own voltage value).

[0103] In one example, the first switching device Q1 and the second switching device Q2 can be implemented by using the same type of switching device, such as a small-signal N-MOSFET. Those skilled in the art can select appropriate first switching device Q1 and second switching device Q2 according to the specific scenario, which is not limited here.

[0104] In this example, the working principle of the above mode switching unit 41 is as follows: when the first switching device Q1 is switched to the off state and the second switching device Q2 is switched to the conducting state, the mode switching unit 41 controls the sampling unit 21 to switch to the third working mode; when the first switching device Q1 is switched to the conducting state and the second switching device Q2 is switched to the off state, the mode switching unit 41 controls the sampling unit 21 to switch to the second working mode; when the first switching device Q1 is switched to the off state and the second switching device Q2 is switched to the off state, the mode switching unit 41 controls the sampling unit 21 to switch to the first working mode.

[0105] In one example, refer to Figure 6 , the detection circuit 11 further includes a mode control unit 61. The mode control unit 61 is electrically connected to the mode switching unit 41; the mode control unit 61 is used to generate a mode switching signal and send it to the mode switching unit 41 so that the mode switching unit 41 adjusts the working mode of the sampling unit 21.

[0106] In one example, refer to Figure 7, the mode control unit 61 includes a third switching device Q3, a fourth switching device Q4, and a power signal terminal Cntl; the power signal terminal is used to receive a level signal ( Figure 5 g point). The first end of the third switching device Q3 is electrically connected to the control end of the first switching device Q1, the second end of the third switching device Q3 is electrically connected to the power signal terminal Cntl, and the control end of the third switching device Q3 is used to receive a first trigger control signal; the first end of the fourth switching device Q4 is electrically connected to the power signal terminal Cntl, the second end of the fourth switching device Q4 is electrically connected to the control end of the second switching device Q2, and the control end of the fourth switching device Q4 is used to receive a second trigger control signal; the third switching device Q3 is used to switch to the conducting state when receiving the first trigger control signal to output the power signal at the power signal terminal Cntl to the first switching device Q1. The fourth switching device Q4 is used to switch to the conducting state when receiving the second trigger control signal to output the power signal at the power signal terminal Cntl to the second switching device Q2.

[0107] In one example, the third switching device Q3 and the fourth switching device Q4 can be implemented by using the same type of switching device, such as a small-signal P-MOSFET. Those skilled in the art can select appropriate third switching device Q3 and fourth switching device Q4 according to the specific scenario, which is not limited herein.

[0108] In one example, referring to Figure 8 , the detection circuit 11 further includes a power signal acquisition unit 81; the power acquisition unit 81 is electrically connected to the power signal terminal Cntl. The power signal acquisition unit 81 is used to output the power signal of the external power supply (represented by VBUS) from the power signal terminal Cntl when detecting the connection of an external power supply (such as an external charger), or output the power signal of the battery (represented by VBATT) from the power signal terminal Cntl when detecting that the external power supply is not connected.

[0109] Continuing to refer to Figure 8 , the power signal acquisition unit 81 includes a first diode D1 and a second diode D2; the anode of the first diode D1 is electrically connected to the power signal line (transmitting the power signal VBUS), and the cathode of the first diode D1 is electrically connected to the power signal terminal Cntl; the anode of the second diode D2 is electrically connected to the positive electrode of the battery CELL (such as CELL1 and / or CELL2), and the cathode of the second diode D2 is electrically connected to the power signal terminal Cntl.

[0110] It can be understood that the first diode D1 and the second diode D2 can be implemented by using the same type of diode. For example, both the first diode D1 and the second diode D2 are Schottky diodes. Those skilled in the art can select diodes according to the specific scenario, which is not limited herein.

[0111] In one example, referring to Figure 9 , the electronic device further includes a first controller 91. A first control pin GPIO1 of the first controller 91 is electrically connected to a control end of a third switching device Q3 in the detection circuit 11; a second control pin GPIO2 of the first controller 91 is electrically connected to a control end of a fourth switching device Q4 in the detection circuit 11. The first controller 91 is configured to output a second trigger control signal through the second control pin GPIO2 when the first battery CELL1 has a charging requirement; the first controller 91 is further configured to output a first trigger control signal through the first control pin GPIO1 when the second battery CELL2 has a charging requirement. Considering that the third switching device Q3 and the fourth switching device Q4 are implemented by P-MOSFET devices, at this time, the first trigger control signal can be a low-level signal, and the second trigger control signal can be a low-level signal.

[0112] In one example, referring to Figure 10 , the electronic device further includes a second controller 101; a power supply pin VBUS of the second controller 101 is electrically connected to an anode of a first diode D1 in the detection circuit 11, and is configured to output a power signal from an external device to the first diode D1; a battery pin VBATT of the second controller 101 is electrically connected to an anode of a second diode D2 in the detection circuit 11, and is configured to output a power signal from the first battery CELL1 connected by the first connector and / or the second battery CELL2 connected by the second battery connector to the second diode D2.

[0113] In one example, referring to Figure 11 , the electronic device further includes a first charging switching circuit 111 and a first charging module 112; the first charging switching circuit 111 is electrically connected to the first battery connector CNTR1 and the first charging module 112 respectively; the first charging switching circuit 111 is configured to switch to a conducting state when receiving the first trigger control signal, so that the first charging module 112 charges the first battery CELL1 through the first battery connector CNTR1.

[0114] In one example, continuing to refer to Figure 11, the first charging switching circuit 111 includes a fifth switching device Q5; the first end of the fifth switching device Q5 is electrically connected to the first charging module 112, the second end of the fifth switching device Q5 is electrically connected to the first battery connector CNTR1, and the control end of the fifth switching device Q5 is electrically connected to GPIO1 of the first controller 91. In one example, the fifth switching device Q5 can be implemented by a power N-MOSFET device, which is not limited herein. For example, when the fifth switching device Q5 receives the first trigger control signal output by the first control pin GPIO1, it can switch to the conducting state, and at this time, the power signal of the first charging module 112 can be output to the first battery connector CNTR1 to charge the first battery CELL1.

[0115] In another example, continue to refer to Figure 11 , the first charging switching circuit 111 further includes a fifth resistor R5 and a sixth resistor R6; the first end of the fifth resistor R5 is electrically connected to the first end of the fifth switching device Q5, and the second end of the fifth resistor R5 is respectively electrically connected to the first control pin GPIO1 of the first controller 91, the second end of the sixth resistor R6, and the control end of the fifth switching device Q5; the first end of the sixth resistor R6 is electrically connected to the preset power supply pin of the first charging module 112 (represented by 3V3, indicating that a voltage of 3.3V can be provided, and the voltage magnitude can be adjusted).

[0116] It can be understood that the fifth resistor R5 is arranged between the first end and the control end of the fifth switching device Q5 to form a charge discharge circuit, thereby ensuring the lifespan of the fifth switching device Q5. In one example, the resistance value of the fifth resistor R5 can be selected according to the requirements of the fifth switching device Q5. In this example, the resistance value of the fifth resistor R5 is 100k ohms.

[0117] It can be understood that the sixth resistor R6 is arranged between the preset power supply pin of the first charging module 112 and the control end of the fifth switching device Q5 to play a current limiting role and avoid phenomena such as current backflow affecting the first controller and the first charging module. In one example, the resistance value of the sixth resistor R6 can be set between 2.2k and 10k ohms.

[0118] When the driving ability of the first control pin GPIO1 of the first controller 91 cannot control the fifth switching device Q5 to switch to the conducting state or when the first control pin GPIO1 of the first controller 91 is powered off when the electronic device is shut down, the preset power supply pin of the first charging module 112 can provide a control signal for the fifth switching device Q5 to make the fifth switching device Q5 switch to the conducting state, that is, the preset power supply pin is a pin that maintains an output high-level signal.

[0119] It can also be understood that when the first control pin GPIO1 of the first controller 91 and the sixth resistor R6 exist simultaneously, when the preset power supply pin provides a high-level signal and the first control pin GPIO1 provides a low-level signal, the control end of the fifth switching device Q5 can be pulled down to the low-level state, thereby switching to the off state; when the preset power supply pin provides a high-level signal and the first control pin GPIO1 provides a high-level signal, the control end of the fifth switching device Q5 can be pulled up to the high-level state, thereby switching to the on state.

[0120] In one example, continue to refer to Figure 11 , the electronic device further includes a second charging switching circuit 113. The second charging switching circuit 113 is electrically connected to the second battery connector CNTR2 and the first charging module 112 respectively; the second charging switching circuit 113 is configured to switch to the on state when receiving a second trigger control signal, so that the first charging module 112 charges the second battery CELL2 through the second battery connector CNTR2.

[0121] In one example, continue to refer to Figure 11 , the second charging switching circuit 113 includes a sixth switching device Q6. The first end of the sixth switching device Q6 is electrically connected to the first charging module 112, the second end of the sixth switching device Q6 is electrically connected to the second battery connector CNTR2, and the control end of the sixth switching device Q6 is electrically connected to the second control pin GPIO2 of the first controller 91. When the sixth switching device Q6 switches to the on state, the first charging module 112 can charge the second battery CELL2; when the sixth switching device Q6 switches to the off state, the second battery CELL2 cannot be charged.

[0122] In another example, continue to refer to Figure 11 , the second charging switching circuit 113 further includes a seventh resistor R7 and an eighth resistor R8. The first end of the seventh resistor R7 is electrically connected to the first end of the sixth switching device Q6, and the second end of the seventh resistor R7 is electrically connected to the second control pin GPIO2 of the first controller 91, the second end of the eighth resistor R8, and the control end of the sixth switching device Q6 respectively; the first end of the eighth resistor R8 is electrically connected to the preset power supply pin of the first charging module 112.

[0123] It can be understood that the seventh resistor R7 is arranged between the first end and the control end of the sixth switching device Q6 to form a charge discharge circuit, thereby ensuring the service life of the sixth switching device Q6. In one example, the resistance value of the seventh resistor R7 can be selected according to the requirements of the sixth switching device Q6. In this example, the resistance value of the seventh resistor R7 is 100 k ohms.

[0124] It is understandable that the eighth resistor R8 is arranged between the preset power supply pin of the first charging module 112 and the control end of the fifth switching device Q5, which plays a role in current limiting to avoid phenomena such as current backflow affecting the first controller and the first charging module. In one example, the resistance value of the eighth resistor R8 can be set between 2.2k and 10k ohms. In one example, the sixth resistor R6 and the eighth resistor R8 are implemented by resistors with equal resistance values.

[0125] When the driving ability of the first control pin GPIO1 of the first controller 91 cannot control the sixth switching device Q6 to switch to the conducting state or when the first control pin GPIO1 of the first controller 91 is powered off when the electronic device is shut down, the preset power supply pin of the first charging module 112 can provide a control signal for the sixth switching device Q6 to enable the sixth switching device Q6 to switch to the conducting state, that is, the preset power supply pin is a pin that maintains an output high-level signal.

[0126] It is also understandable that when the first control pin GPIO1 of the first controller 91 and the eighth resistor R8 exist simultaneously, when the preset power supply pin provides a high-level signal and the first control pin GPIO1 provides a low-level signal, the control end of the sixth switching device Q6 can be pulled down to the low-level state, thereby switching to the off state; when the preset power supply pin provides a high-level signal and the first control pin GPIO1 provides a high-level signal, the control end of the sixth switching device Q6 can be pulled up to the high-level state, thereby switching to the conducting state.

[0127] It should also be noted that the first controller 91, the second controller 101, the charge and discharge chip, the first fast charging chip, the second fast charging chip, the power management chip, etc. can be implemented by at least one device with control ability among the power management chip, the processor, and the charge and discharge chip in the electronic device. The description content of the embodiments of the present disclosure is only used to conveniently describe the solution and does not constitute a limitation to the solution of the present disclosure.

[0128] Combining the solutions of the above embodiments, the embodiments of the present disclosure provide a solution for sampling the charging current in three working modes. The control chip is used as the first controller, the charge and discharge chip is used as the second controller, the power management chip is used to collect the voltage and calculate the charging current, and the first fast charging chip is used to charge the first battery and the second fast charging chip is used to charge the second battery. The structure of the electronic device is as Figure 12 shown. The truth table of the GPIO pin outputting the trigger control signal of the control chip in the three working modes is shown in Table 1.

[0129] Table 1 GPIO Truth Table

[0130] Working mode GPIO-1 GPIO-2 drive1 drive2 Charging two batteries simultaneously 1 1 0 0 Charging the second battery alone 0 1 1 0 Charging the first battery alone 1 0 0 1

[0131] In the first working mode, the charging current is detected when the first battery CELL1 and the second battery CELL2 are charged simultaneously.

[0132] The control chip can detect whether the first battery CELL1 and the second battery CELL2 have charging requirements simultaneously. For example, when the power level of the first battery CELL1 is lower than the first preset power threshold (such as 20%, which can be set), the first battery CELL1 has a charging requirement. Also, when the power level of the second battery CELL2 is lower than the second preset power threshold (such as 10%, which can be set), the second battery CELL2 has a charging requirement.

[0133] When it is detected that the first battery CELL1 and the second battery CELL2 have charging requirements, the control chip outputs a first trigger control signal (such as a low-level signal) through the first control pin GPIO1. At this time, the third switching device Q3 switches to the conducting state; the control chip outputs a second trigger control signal (such as a low-level signal) through the second control pin GPIO2. At this time, the fourth switching device Q4 switches to the conducting state.

[0134] The charge and discharge chip, as the second controller, can output a power signal from an external power source or a battery to the power signal terminals, that is, the second terminal of the third switching device Q3 and the first terminal of the fourth switching device Q4, as Figure 12 shown at point g. At this time, the control terminal of the first switching device Q1 receives the mode switching signal drive1 output from the first terminal of the third switching device Q3, and the first switching device Q1 switches to the off state; the control terminal of the second switching device Q2 receives the mode switching signal drive2 output from the first terminal of the fourth switching device Q4, and the second switching device Q2 switches to the off state.

[0135] At this time, taking the grounding point GND1 corresponding to point a as the reference point, the voltages of the first detection terminal (point e) and the second detection terminal (point f) are respectively:

[0136]

[0137]

[0138]

[0139] Combining equations (1) to (3), it can be derived that:

[0140] Vsense = Vf - Ve = 1 / 2×(I1×Rsense1 + I2×Rsense2); (4)

[0141] Vsense = Vf - Ve = R / 2×(I1 + I2); (5)

[0142]

[0143] In formulas (1) to (6), R1 to R4 respectively represent the resistance values of the first resistor, the second resistor, the third resistor, and the fourth resistor, I1 and I2 respectively represent the charging currents of the first battery and the second battery, Va to Vf respectively represent the voltages at points a to f, Vac represents the voltage difference between points a and c, and Vbd represents the voltage difference between points b and d. Formula (6) indicates that when the resistance values of Rsense1 and Rsense2 are R, the resistance value of the equivalent resistor Rsense of the first sampling resistor Rsense1 and the second sampling resistor Rsense2 becomes R / 2.

[0144] In the second working mode, the charging current is detected when the second battery CELL2 is charging alone.

[0145] The control chip is used as the first controller and can detect whether the first battery CELL1 and the second battery CELL2 have charging requirements. For example, when the power of the first battery CELL1 is greater than or equal to the first preset power threshold (such as 20%, which can be set), it is determined that the first battery CELL1 does not have a charging requirement. Another example is that when the power of the second battery CELL2 is lower than the second preset power threshold (such as 10%, which can be set), it is determined that the second battery CELL2 has a charging requirement.

[0146] When it is detected that the second battery CELL2 has a charging requirement, the control chip outputs a first trigger control signal (such as a low-level signal) through the first control pin GPIO1, and the third switching device Q3 switches to the conducting state. At this time, the fourth switching device Q4 switches to the off state.

[0147] The control end of the first switching device Q1 receives the mode switching signal drive1 output from the first end of the third switching device Q3, and the first switching device Q1 switches to the conducting state; the control end of the second switching device Q2 receives the mode switching signal drive2 output from the first end of the fourth switching device Q4, and the second switching device Q2 switches to the off state.

[0148] At this time, the voltages at the first detection end (point e) and the second detection end (point f) are respectively:

[0149]

[0150]

[0151] Combining formula (1) and formula (7), it can be deduced that:

[0152]

[0153]

[0154]

[0155] Equation (10) indicates that when the resistance value of Rsense2 is R, the detection circuit detects that the resistance value of the equivalent resistance Rsense is half of the resistance value R of the second sampling resistor.

[0156] In the third working mode, the charging current is detected when the first battery CELL1 is charged alone.

[0157] The control chip can detect whether the first battery CELL1 and the second battery CELL2 have charging requirements. For example, when the power of the first battery CELL1 is less than the first preset power threshold (such as 20%, which can be set), it is determined that the first battery CELL1 does not have a charging requirement. Another example is that when the power of the second battery CELL2 is greater than or equal to the second preset power threshold (such as 10%, which can be set), it is determined that the second battery CELL2 has no charging requirement.

[0158] When it is detected that the first battery CELL1 has a charging requirement, the control chip outputs a second trigger control signal (such as a low-level signal) through the second control pin GPIO1, and the fourth switching device Q4 switches to the on state. At this time, the third switching device Q3 switches to the off state.

[0159] The control end of the second switching device Q2 receives the mode switching signal drive2 output from the first end of the fourth switching device Q4, and the second switching device Q2 switches to the on state; the control end of the first switching device Q1 receives the mode switching signal drive2 output from the first end of the third switching device Q3, and the first switching device Q1 switches to the off state.

[0160] At this time, the voltages of the first detection end (point e) and the second detection end (point f) are respectively:

[0161]

[0162]

[0163] Combining Equation (10) and Equation (11), it can be deduced that:

[0164]

[0165]

[0166]

[0167] Equation (14) indicates that when the resistance value of Rsense1 is R, the detection circuit detects that the resistance value of the equivalent resistance Rsense is half of the resistance value R of the first sampling resistor.

[0168] Combining equations (6), (10), and (14), it can be seen that the equivalent resistance Rsense of the detection circuit during sampling of the first sampling resistor and the second sampling resistor is reduced to half of the original. In other words, in the solution of the present disclosure, the resistance values of the first sampling resistor and the second sampling resistor can be changed to 2 times the sampling resistor in the above embodiment, that is, 2R. By increasing the resistance value of the sampling resistor, the requirements for the sampling resistor in terms of volume, failure rate, etc. can be reduced, achieving benefits in terms of sampling resistor device packaging, failure rate, and cost.

[0169] Based on equations (6), (10), and (14), it can be known that when the detection circuit is provided with multiple (such as n, n = 2, 3, 4...) sampling resistors, the equivalent resistance of the detection circuit can be reduced to 1 / n of the original resistance value. In other words, in the solution of the present disclosure, the resistance values of the n sampling resistors can be changed to n times the sampling resistor in the above embodiment, that is, nR. By increasing the resistance value of the sampling resistor, the requirements for the sampling resistor in terms of volume, failure rate, etc. can be reduced, achieving benefits in terms of sampling resistor device packaging, failure rate, and cost.

[0170] Combining the solutions of the above embodiments, the embodiments of the present disclosure provide a solution for sampling the charging current using three working modes. Refer to Figure 13 , the difference between this solution and Figure 12 the solution shown is that it includes 1 charging chip while Figure 12 the solution shown in Figure 13 includes Figure 12 the control chip, charge and discharge chip, third switching device Q3, fourth switching device Q4, first diode D1, and second diode D2 shown in Figure 13 . Therefore,

[0171] In the first working mode, the first battery CELL1 and the second battery CELL2 are charged simultaneously. The fifth switching device Q5 and / or the sixth switching device Q6 are switched to the conducting state, and the first switching device Q1 and the second switching device are switched to the off state, and the charging currents of the first battery CELL1 and the second battery CELL2 can be detected respectively.

[0172] In the second operating mode, the first battery CELL1 is not charged and the second battery CELL2 is charged. At this time, the fifth switching device Q5 is switched to the off state, and the sixth switching device Q6 is switched to the on state; the first switching device Q1 is switched to the on state, and the second switching device Q2 is switched to the off state, so as to detect the charging circuit of the charging loop where the second battery CELL2 is located.

[0173] In the third operating mode, the first battery CELL1 is charged and the second battery CELL2 is not charged. At this time, the fifth switching device Q5 is switched to the on state, and the sixth switching device Q6 is switched to the off state; the first switching device Q1 is switched to the off state, and the second switching device Q2 is switched to the on state, so as to detect the charging circuit of the charging loop where the first battery CELL1 is located.

[0174] In this way, in this embodiment, the layouts of the two sampling resistors are respectively close to the first battery connector and the second battery connector, and then through voltage division and sampling by the sampling unit, it is no longer limited by the layout architecture of the first battery and the second battery in the electronic device, which is beneficial to expanding the application scenarios. Or rather, the solution of this embodiment can reduce the requirements for the charging and discharging traces of the battery, and reduce the influence of risks such as ground plane integrity, loop interference, and noise interference on the detection result. Finally, the solution of this embodiment is suitable for the usage scenarios of one or two charge and discharge chips.

[0175] Based on an electronic device provided in an embodiment of the present disclosure, an embodiment of the present disclosure further provides a charging control method. Refer to Figure 14 and the method includes step 141 and step 142.

[0176] In step 141, in response to detecting that at least one of the first battery and the second battery has a charging requirement, control the detection circuit to detect the voltage value of the charging loop where the battery is located;

[0177] In step 142, determine the charging current of the charging loop where the battery is located according to the voltage value.

[0178] In an example, the at least two batteries include a first battery and a second battery. Controlling the detection circuit to detect the voltage value of the charging loop where the battery is located includes:

[0179] Output a first trigger control signal in response to detecting that the second battery has a charging requirement, and output a second trigger control signal in response to detecting that the first battery has a charging requirement;

[0180] Obtain the voltage difference between the first detection end and the second detection end of the detection circuit as the voltage value of the charging loop where the battery is located.

[0181] It should be noted that in the process of describing the cooperation of various components of the electronic device, a solution for obtaining the charging current during charging is described. For specific details, reference can be made to the content of the above embodiments, which will not be elaborated here.

[0182] Based on the above-mentioned charging control method, an embodiment of the present disclosure further provides a charging control device, which includes:

[0183] A voltage value acquisition module, configured to control a detection circuit to detect the voltage value of the charging circuit where the battery is located in response to detecting that at least one of at least two batteries has a charging requirement;

[0184] A charging current determination module, configured to determine the charging current of the charging circuit where the battery is located according to the voltage value.

[0185] In one example, the at least two batteries include a first battery and a second battery, and the voltage value acquisition module includes:

[0186] A first trigger signal output module, configured to output a first trigger control signal in response to detecting that the second battery has a charging requirement;

[0187] A second trigger signal output module, configured to output a second trigger control signal in response to detecting that the first battery has a charging requirement;

[0188] A voltage value acquisition module, configured to obtain the voltage difference between the first detection end and the second detection end of the detection circuit as the voltage value of the charging circuit where the battery is located.

[0189] It should be noted that the device embodiment provided in this embodiment corresponds to the above method embodiment. For specific details, reference can be made to the content of the above method embodiments, which will not be elaborated here.

[0190] Figure 15 It is a block diagram of an electronic device shown according to an exemplary embodiment. For example, the electronic device 1500 may be a smart phone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0191] Refer to Figure 15 , the electronic device 1500 may include one or more of the following components: a processing component 1502, a memory 1504, a power supply component 1506, a multimedia component 1508, an audio component 1510, an input / output (I / O) interface 1512, a sensor component 1514, a communication component 1516, and an image acquisition component 1518.

[0192] The processing component 1502 generally controls the overall operation of the electronic device 1500, such as operations associated with display, telephone calls, data communication, camera operation, and recording operation. The processing component 1502 may include one or more processors 1520 to execute computer programs. In addition, the processing component 1502 may include one or more modules to facilitate the interaction between the processing component 1502 and other components. For example, the processing component 1502 may include a multimedia module to facilitate the interaction between the multimedia component 1508 and the processing component 1502.

[0193] The memory 1504 is configured to store various types of data to support the operation of the electronic device 1500. Examples of such data include computer programs for any application or method operating on the electronic device 1500, contact data, phone book data, messages, pictures, videos, etc. The memory 1504 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0194] The power component 1506 provides power to various components of the electronic device 1500. The power component 1506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1500. The power component 1506 may include a power chip, and the controller can communicate with the power chip to control the power chip to turn on or off the first switching device, so that the battery supplies power to the circuit board or not. The power component 1506 may include the above detection circuit, and / or, detection module.

[0195] The multimedia component 1508 includes a screen that provides an output interface between the electronic device 1500 and the target object.

[0196] In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input information from the target object. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation.

[0197] The audio component 1510 is configured to output and / or input audio file information. For example, the audio component 1510 includes a microphone (MIC) that is configured to receive external audio file information when the electronic device 1500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio file information can be further stored in the memory 1504 or transmitted via the communication component 1516. In some embodiments, the audio component 1510 further includes a speaker for outputting audio file information.

[0198] The I / O interface 1512 provides an interface between the processing component 1502 and a peripheral interface module, which may be a keyboard, a click wheel, buttons, etc.

[0199] The sensor component 1514 includes one or more sensors for providing an assessment of various aspects of the status of the electronic device 1500. For example, the sensor component 1514 can detect the on / off state of the electronic device 1500, the relative positioning of components, such as the display screen and keypad of the electronic device 1500. The sensor component 1514 can also detect a change in the position of the electronic device 1500 or a component, the presence or absence of contact of a target object with the electronic device 1500, the orientation or acceleration / deceleration of the electronic device 1500, and a change in the temperature of the electronic device 1500. In this example, the sensor component 1514 can include a magnetic sensor, a gyroscope, and a magnetic field sensor, and can also include an inertial sensor, an image sensor, etc. The magnetic field sensor includes at least one of the following: a Hall sensor, a thin film magnetoresistive sensor, and a magnetic fluid acceleration sensor.

[0200] The communication component 1516 is configured to facilitate communication between the electronic device 1500 and other devices in a wired or wireless manner. The electronic device 1500 can access a wireless network based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 1516 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1516 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0201] In an exemplary embodiment, the electronic device 1500 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0202] In a possible example, a non-transitory computer-readable storage medium is further provided, and when the executable computer program in the storage medium is executed by a processor, the charging control method as described above can be implemented.

[0203] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the disclosure herein. The present disclosure is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0204] 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 circuit, characterized in that, it includes at least two sampling resistors, at least two groups of input terminals and at least one group of output terminals; each group of input terminals is electrically connected to a sampling resistor; the voltage difference of the at least one group of output terminals is used to represent the voltage division of the charging circuit where at least one sampling resistor is located.

2. The detection circuit according to claim 1, characterized in that, one input terminal in each group of input terminals is respectively electrically connected to the reference voltage lines at different positions, and the other input terminal of each group of input terminals is used to detect the voltage division of the connected sampling resistor.

3. The detection circuit according to claim 2, characterized in that, the at least two sampling resistors include a first sampling resistor and a second sampling resistor, the at least two groups of input terminals include a first sampling terminal, a second sampling terminal, a third sampling terminal and a fourth sampling terminal; the at least one group of output terminals includes a first detection terminal and a second detection terminal; the first sampling terminal is respectively electrically connected to the first end of the first sampling resistor and the first reference voltage line, and the second sampling terminal is respectively electrically connected to the first end of the second sampling resistor and the second reference voltage line; the third sampling terminal is electrically connected to the second end of the first sampling resistor, and the fourth sampling terminal is electrically connected to the second end of the second sampling resistor; the voltage difference between the first detection terminal and the second detection terminal is used to represent the voltage division of the charging circuit where the first sampling resistor and / or the second sampling resistor is located.

4. The circuit according to claim 1, characterized in that, the detection circuit includes a sampling unit; the first end of the sampling unit is electrically connected to the first end of the first sampling resistor, the second end of the sampling unit is electrically connected to the first end of the second sampling resistor, the third end of the sampling unit is electrically connected to the second end of the first sampling resistor, and the fourth end of the sampling unit is electrically connected to the second end of the second sampling resistor; the first detection end of the sampling unit is electrically connected to the first detection end of the detection circuit, and the second detection end of the sampling unit is electrically connected to the second detection end of the detection circuit.

5. The circuit according to claim 4, characterized in that, the sampling unit includes a first resistor, a second resistor, a third resistor and a fourth resistor; the first end of the first resistor is electrically connected to the first end of the sampling unit, and the second end of the first resistor is respectively electrically connected to the first end of the second resistor and the first detection end of the sampling unit; the second end of the second resistor is electrically connected to the second end of the sampling unit; the first end of the third resistor is electrically connected to the third end of the sampling unit, and the second end of the third resistor is respectively electrically connected to the first end of the fourth resistor and the second detection end of the sampling unit; the second end of the fourth resistor is electrically connected to the fourth end of the sampling unit.

6. The circuit according to claim 5, characterized in that, the resistance values of the first resistor and the second resistor are equal; and / or, the resistance values of the third resistor and the fourth resistor are equal.

7. The circuit according to claim 1, characterized in that, One input terminal in each group of input terminals is a common detection terminal, and the other input terminal in each group of input terminals is used to detect the voltage division of the connected sampling resistor.

8. The circuit according to claim 7, wherein, the at least two sampling resistors include a first sampling resistor and a second sampling resistor, and the at least two groups of input terminals include a third sampling terminal and a fourth sampling terminal; the at least one group of output terminals includes a second detection terminal; the third sampling terminal is electrically connected to the second end of the first sampling resistor, and the fourth sampling terminal is electrically connected to the second end of the second sampling resistor; the first end of the first sampling resistor and the first end of the second sampling resistor are electrically connected to a reference voltage line; the voltage difference between the first detection terminal and the second detection terminal is used to represent the voltage division of the charging loop where the first sampling resistor and / or the second sampling resistor is located.

9. The circuit according to claim 8, wherein, the detection circuit includes a sampling unit, and the sampling unit includes a third resistor and a fourth resistor; the first end of the third resistor is electrically connected to the second end of the first sampling resistor, the second end of the third resistor is electrically connected to the first end of the fourth resistor and the second detection terminal respectively; the second end of the fourth resistor is electrically connected to the second end of the second sampling resistor.

10. The circuit according to claim 4 or 9, wherein, the detection circuit further includes a mode switching unit: the mode switching unit is electrically connected to the sampling unit; the mode switching unit is used to adjust the working mode of the sampling unit; the sampling unit is used to detect the voltage value of the first sampling resistor and / or the second sampling resistor in the working mode.

11. The circuit according to claim 10, wherein, the mode switching unit includes: a first switching device; the first end of the first switching device is electrically connected to the first end of the sampling unit or the common detection terminal, and the second end of the first switching device is electrically connected to the third end of the sampling unit; the first switching device is used to bypass the first sampling resistor when switched to the conducting state; and / or, the mode switching unit includes: a second switching device; the first end of the second switching device is electrically connected to the second end of the sampling unit or the common detection terminal, and the second end of the second switching device is electrically connected to the fourth end of the sampling unit; the second switching device is used to bypass the second sampling resistor when switched to the conducting state.

12. The circuit according to claim 10, wherein, the detection circuit further includes a mode control unit; the mode control unit is electrically connected to the mode switching unit; the mode control unit is used to generate a mode switching signal and send it to the mode switching unit so that the mode switching unit adjusts the working mode of the sampling unit.

13. The circuit according to claim 12, wherein, the mode control unit includes a third switching device, a fourth switching device and a power signal terminal; the power signal terminal is used to receive a level signal; The first end of the third switching device is electrically connected to the control end of the first switching device, the second end of the third switching device is electrically connected to the power signal terminal, and the control end of the third switching device is used to receive a first trigger control signal; the first end of the fourth switching device is electrically connected to the power signal terminal, the second end of the fourth switching device is electrically connected to the control end of the second switching device, and the control end of the fourth switching device is used to receive a second trigger control signal; The third switching device is configured to switch to a conducting state when receiving the first trigger control signal, so as to output the power signal at the power signal terminal to the first switching device; The fourth switching device is configured to switch to a conducting state when receiving the second trigger control signal, so as to output the power signal at the power signal terminal to the second switching device.

14. The circuit according to claim 13, wherein, The detection circuit further includes a power signal acquisition unit; the power acquisition unit is electrically connected to the power signal terminal; The power signal acquisition unit is configured to output the power signal of the external power supply from the power signal terminal when detecting that the external power supply is connected, or output the power signal of the battery from the power signal terminal when detecting that the external power supply is not connected.

15. The circuit according to claim 14, wherein, The power signal acquisition unit includes a first diode and a second diode; the anode of the first diode is electrically connected to the power signal line, the cathode of the first diode is electrically connected to the power signal terminal; the anode of the second diode is electrically connected to the positive electrode of the battery, and the cathode of the second diode is electrically connected to the power signal terminal.

16. The circuit according to claim 2, wherein, The detection circuit further includes at least two battery connectors, and one of the sampling resistors is connected between one of the battery connectors and one of the reference voltage lines, and the other sampling resistor is connected between the other battery connector and the other reference voltage line.

17. The circuit according to claim 16, wherein, The detection circuit further includes a first battery connector and a second battery connector; the first battery connector and the second battery connector; the first sampling resistor is connected in series between the first battery connector and the first reference voltage line, and the second sampling resistor is connected in series between the second battery connector and the second reference voltage line; The detection circuit is configured to obtain the voltage value of the first sampling resistor and / or the second sampling resistor, and the voltage value is used to determine the charging current in the charging circuit where the battery is located.

18. The circuit according to claim 17, wherein, The first sampling resistor and the first battery connector are adjacent to each other on the circuit board and the distance is less than or equal to a preset distance threshold, or the first sampling resistor and the first battery connector are distributed on both sides of the circuit board and the first sampling resistor is within the projection area of the first battery connector.

19. The circuit according to claim 17, wherein, The detection circuit further includes a first controller; a first control pin of the first controller is electrically connected to a control end of a third switching device in the detection circuit, and a second control pin of the first controller is electrically connected to a control end of a fourth switching device in the detection circuit; The first controller is configured to output a second trigger control signal through the second control pin when the first battery connected to the first battery connector has a charging requirement; The first controller is further configured to output a first trigger control signal through the first control pin when the second battery connected to the second battery connector has a charging requirement.

20. The circuit according to claim 17, wherein, The detection circuit further includes a second controller; a power supply pin of the second controller is electrically connected to an anode of a first diode in the detection circuit for outputting a power supply signal from an external device to the first diode; a battery pin of the second controller is electrically connected to an anode of a second diode in the detection circuit for outputting a power supply signal from the first battery connected to the first battery connector and / or the second battery connected to the second battery connector to the second diode.

21. The circuit according to claim 19, wherein, The detection circuit further includes a first charging switching circuit and a first charging module; the first charging switching circuit is electrically connected to the first battery connector and the first charging module respectively; the first charging switching circuit is configured to switch to a conducting state when receiving the first trigger control signal, so that the first charging module charges the first battery through the first battery connector.

22. The circuit according to claim 21, wherein, The first charging switching circuit includes a fifth switching device; a first end of the fifth switching device is electrically connected to the first charging module, a second end of the fifth switching device is electrically connected to the first battery connector, and a control end of the fifth switching device is electrically connected to the first control pin of the first controller.

23. The circuit according to claim 22, wherein, The first charging switching circuit further includes a fifth resistor and a sixth resistor; a first end of the fifth resistor is electrically connected to the first end of the fifth switching device, and a second end of the fifth resistor is electrically connected to the first control pin of the first controller, a second end of the sixth resistor and a control end of the fifth switching device respectively; a first end of the sixth resistor is electrically connected to a preset power supply pin of the first charging module.

24. The circuit according to claim 21, wherein, The detection circuit further includes a second charging switching circuit; the second charging switching circuit is electrically connected to the second battery connector and the first charging module respectively; the second charging switching circuit is configured to switch to a conducting state when receiving the second trigger control signal, so that the first charging module charges the second battery through the second battery connector.

25. The circuit according to claim 24, wherein, The second charging switching circuit includes a sixth switching device; a first end of the sixth switching device is electrically connected to the first charging module, a second end of the sixth switching device is electrically connected to the second battery connector, and a control end of the sixth switching device is electrically connected to a second control pin of the first controller.

26. The circuit according to claim 25, wherein, the second charging switching circuit further includes a seventh resistor and an eighth resistor; a first end of the seventh resistor is electrically connected to the first end of the sixth switching device, and a second end of the seventh resistor is electrically connected to the second control pin of the first controller, a second end of the eighth resistor, and the control end of the sixth switching device respectively; a first end of the eighth resistor is electrically connected to a preset power supply pin of the first charging module.

27. The circuit according to claim 26, wherein, the first sampling resistor and the second sampling resistor have equal resistance values.

28. A detection module, wherein, it includes the circuit according to any one of claims 1 to 27.

29. The detection module according to claim 28, wherein, it further includes: a circuit board; the first sampling resistor and the first battery connector are arranged adjacent to each other on the circuit board and the distance therebetween is less than or equal to a preset distance threshold, or the first sampling resistor and the first battery connector are distributed on two sides of the circuit board and the first sampling resistor is located within the projection area of the first battery connector; and / or, the second sampling resistor and the second battery connector are arranged adjacent to each other on the circuit board and the distance therebetween is less than or equal to a preset distance threshold, or the second sampling resistor and the second battery connector are distributed on two sides of the circuit board and the second sampling resistor is located within the projection area of the second battery connector.

30. An electronic device, wherein, it includes at least two batteries, and the circuit according to any one of claims 1 to 27 for detecting the at least two batteries and / or the detection module according to claim 28 or 29.

31. A charging control method, wherein, the method includes: in response to detecting that at least one of the at least two batteries has a charging requirement, controlling a detection circuit to detect a voltage value of a charging loop where the battery is located; determining a charging current of the charging loop where the battery is located according to the voltage value.

32. The method according to claim 31, wherein, the at least two batteries include a first battery and a second battery, and controlling the detection circuit to detect the voltage value of the charging loop where the battery is located includes: outputting a first trigger control signal in response to detecting that the second battery has a charging requirement, and outputting a second trigger control signal in response to detecting that the first battery has a charging requirement; acquiring a voltage difference between a first detection end and a second detection end of the detection circuit as the voltage value of the charging loop where the battery is located.

33. A charging control device, wherein, the device includes: a voltage value acquisition module, configured to control a detection circuit to detect a voltage value of a charging loop where a battery is located in response to detecting that at least one of at least two batteries has a charging requirement; A charging current determination module, configured to determine the charging current of the charging circuit where the battery is located according to the voltage value.

34. The apparatus according to claim 33, wherein, the at least two batteries include a first battery and a second battery, and the voltage value acquisition module includes: a first trigger signal output module, configured to output a first trigger control signal in response to detecting that the second battery has a charging requirement; a second trigger signal output module, configured to output a second trigger control signal in response to detecting that the first battery has a charging requirement; a voltage value acquisition module, configured to acquire the voltage difference between the first detection end and the second detection end of the detection circuit as the voltage value of the charging circuit where the battery is located.

35. An electronic device, wherein, comprising: a processor and a memory; the memory is configured to store a computer program executable by the processor; wherein, the processor is configured to execute the computer program in the memory to implement the method according to claim 31 or 32.

36. A non-transitory computer-readable storage medium, wherein, when the executable computer program in the storage medium is executed by a processor, the method according to claim 31 or 32 can be implemented.