Charging and discharging circuit for multiple batteries, and electronic device

By adding a switching element between the battery and the charging chip, and by using a processor and controller to adjust the resistance value, the problem of uneven power distribution in multi-battery devices is solved, achieving power balance among multiple batteries and improving battery utilization efficiency.

WO2026001415A1PCT designated stage Publication Date: 2026-01-02HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/095401
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-28
Filing Date
2025-05-16
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

In electronic devices such as folding devices, uneven charge levels can easily occur during the charging or discharging of multiple batteries, resulting in some batteries not being able to be fully charged or depleted at the same time.

Method used

By adding a switching element between the battery and the charging chip, and using a processor and controller to adjust the resistance value of the switching element, the charging or discharging current is adjusted based on the difference in battery power to achieve power balance among multiple batteries.

Benefits of technology

It effectively reduces the power difference between multiple batteries, allowing the batteries to be fully charged or depleted almost simultaneously, thus improving battery utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025095401_02012026_PF_FP_ABST
    Figure CN2025095401_02012026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present invention are a charging and discharging circuit for multiple batteries, and an electronic device. The circuit comprises a processor, a USB interface, a charging chip, a first battery, a second battery, a first controller, and a first switching element, wherein the first battery is connected to the charging chip by means of the first switching element, and the second battery is connected to the charging chip; the charging chip is connected to the USB interface, and the processor is connected to the charging chip and the first controller; the charging chip is used for using electrical energy received from the USB interface to charge the first battery and the second battery; the processor is used for, when the electronic device is in a charged state, determining a first resistance value of the first switching element on the basis of the charge level of the first battery and the charge level of the second battery, and sending the first resistance value to the first controller; and the first controller is used for adjusting the resistance of the first switching element to the first resistance value, such that the difference between the charge level of the first battery and the charge level of the second battery is reduced after the adjustment. By means of multiple dynamic adjustments, multiple batteries can be fully charged simultaneously.
Need to check novelty before this filing date? Find Prior Art

Description

Multi-battery charging and discharging circuit and electronic device

[0001] The present application claims priority to the Chinese patent application No. 202410866261.5, filed on June 28, 2024, and entitled "Multi-battery charging and discharging circuit and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of electronic devices, and in particular to a multi-battery charging and discharging circuit and an electronic device. BACKGROUND

[0003] In order to meet the power supply needs of electronic devices such as folding machines, multiple batteries can be provided in the folding machine. The multiple batteries can be distributed at different parts of the folding machine and can be charged and discharged in parallel. However, the charging or discharging of multiple batteries can result in an unbalanced battery capacity. For example, in the case where a folding machine includes a first battery and a second battery, when charging the electronic device, if the capacity of the first battery is 90% and the capacity of the second battery is 50%, the difference in battery capacity will cause the first battery and the second battery to be unable to be fully charged at the same time. Or, when the battery is discharged, if the capacity of the first battery is 50% and the capacity of the second battery is 10%, the capacities of the first battery and the second battery will not be depleted at the same time. SUMMARY

[0004] Embodiments of the present application provide a multi-battery charging and discharging circuit and an electronic device. The multi-battery charging and discharging circuit can achieve balanced charging and discharging of multiple batteries, so that multiple batteries can be charged at approximately the same time.

[0005] In a first aspect, embodiments of the present application provide a multi-battery charging and discharging circuit, including: the multi-battery charging and discharging circuit includes a processor, a USB interface, a charging chip, a first battery, a second battery, a first controller, and a first switching element, the first battery is connected to the charging chip through the first switching element, and the second battery is connected to the charging chip; the charging chip is connected to the USB interface, and the processor is connected to the charging chip and the first controller.

[0006] The charging chip is configured to use the electrical energy received from the USB interface to charge the first battery and the second battery.

[0007] The processor is configured to determine a first resistance value of the first switching element based on the capacity of the first battery and the capacity of the second battery when the electronic device is in a charging state, and send the first resistance value to the first controller.

[0008] The first controller is configured to adjust the resistance of the first switching element to the first resistance value, so that the difference between the capacity of the first battery and the capacity of the second battery after adjustment is reduced.

[0009] The circuit adjusts the charging current of the first battery by adjusting the resistance of the first switch element during the charging process of the electronic device, so as to reduce the difference in the electric quantity between the first battery and the second battery, and the first battery and the second battery can be filled at the same time through multiple adjustments.

[0010] Optionally, the electronic device can be a foldable device, a folding screen device, or the like, and can also be a straight phone.

[0011] In combination with the first aspect, in a possible implementation manner, the circuit further includes a first comparator and a first digital-to-analog converter (DAC), and the first switch element includes a first conduction end, a second conduction end, and a control end; the first conduction end and the second conduction end of the first switch element are connected to the charging chip and the first end of the first battery, respectively;

[0012] The first comparator is connected to the first conduction end and the second conduction end of the first switch element, and is configured to compare the voltages of the first conduction end and the second conduction end of the first switch element, and send a comparison result of the first comparator to the first controller;

[0013] The first controller is specifically configured to, when the voltage of the first conduction end of the first switch element is greater than the voltage of the second conduction end of the first switch element, determine a first duty cycle based on the received first resistance value, output a pulse signal of the first duty cycle to the first DAC, and when the voltage of the first conduction end of the first switch element is less than the voltage of the second conduction end of the first switch element, output a pulse signal of a first preset duty cycle to the first DAC;

[0014] The first DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the first duty cycle is used for input to the control end of the first switch element to control the first switch element to work in a linear region, and the resistance of the first switch element is the first resistance value; and the analog signal converted from the pulse signal of the first preset duty cycle is used for input to the control end of the first switch element to control the first switch element to work in a full conduction region.

[0015] Optionally, the first controller can store a correspondence between resistance and duty cycle, and the first duty cycle is a duty cycle corresponding to the first resistance value.

[0016] The circuit adjusts the resistance of the first switch element based on the duty cycle, and the circuit logic is simple and responds quickly.

[0017] In combination with the first aspect, in a possible implementation manner, the circuit further includes a second controller and a second switch element, the first battery is connected to the charging chip through the first switch element and the second switch element, and the first switch element and the second switch element are connected in reverse series; and the processor is further connected to the second controller.

[0018] The processor is further configured to determine a second resistance value of the second switch element based on the first battery power and the second battery power when the electronic device is in the discharging state, and send the second resistance value to the second controller;

[0019] The second controller is configured to adjust the resistance of the second switch element to the second resistance value, and after the adjustment, the difference between the first battery power and the second battery power is reduced.

[0020] The above circuit, by adding a second switch element between the first battery and the charging chip, during the discharging process of the electronic device, by adjusting the resistance of the second switch element, the discharging current of the first battery is adjusted, so as to reduce the difference between the first battery power and the second battery power, and through multiple adjustments, the first battery power and the second battery power can be close to being consumed at the same time.

[0021] In combination with the first aspect, in a possible implementation manner, the circuit further includes a second comparator and a second DAC, and the second switch element includes a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the second switch element are connected to the first end of the first battery and the second conduction end of the first switch element respectively;

[0022] The second comparator is connected to the first conduction end and the second conduction end of the second switch element, configured to compare the voltages of the first conduction end and the second conduction end of the second switch element, and send the comparison result of the second comparator to the second controller;

[0023] The second controller is specifically configured to, when the voltage of the first conduction end of the second switch element is greater than the voltage of the second conduction end of the first switch element, determine a second duty cycle based on the received second resistance value, output a pulse signal of the second duty cycle to the second DAC, and when the voltage of the first conduction end of the second switch element is less than the voltage of the second conduction end of the first switch element, output a pulse signal of a second preset duty cycle to the second DAC;

[0024] The second DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the second duty cycle is used for input to the control end of the second switch element to control the second switch element to work in a linear region, and the resistance of the second switch element is controlled to be the second resistance value; and the analog signal converted from the pulse signal of the second preset duty cycle is used for input to the control end of the second switch element to control the second switch element to work in a full conduction region.

[0025] Optionally, the second controller can store a correspondence between resistance and duty cycle, and the second duty cycle is a duty cycle corresponding to the second resistance value.

[0026] The circuit controls resistance of the second switch element based on the duty cycle, and has simple logic and fast response.

[0027] With reference to the first aspect, in a possible implementation, the circuit further includes a third controller, a third switch element, a fourth controller and a fourth switch element, the second battery is connected to the charging chip through the third switch element and the fourth switch element, and the third switch element and the fourth switch element are connected in reverse series; the processor is further connected to the third controller and the fourth controller.

[0028] The processor is further configured to, when the electronic device is in a charging state, determine a third resistance value of the third switch element based on the electric quantity of the first battery and the electric quantity of the second battery, and send the third resistance value to the third controller, or, when the electronic device is in a discharging state, determine a fourth resistance value of the fourth switch element based on the electric quantity of the first battery and the electric quantity of the second battery, and send the fourth resistance value to the fourth controller.

[0029] The third controller is configured to adjust the resistance of the third switch element to the third resistance value, so that the difference between the electric quantity of the first battery and the electric quantity of the second battery decreases after the adjustment.

[0030] The fourth controller is configured to adjust the resistance of the fourth switch element to the fourth resistance value, so that the difference between the electric quantity of the first battery and the electric quantity of the second battery decreases after the adjustment.

[0031] The circuit further includes the third switch element and the fourth switch element between the second battery and the charging chip, so that the charging current of the second battery can be adjusted by adjusting the resistance of the third switch element during the charging of the electronic device, so as to reduce the difference between the electric quantity of the first battery and the electric quantity of the second battery, and the electric quantity of the first battery and the electric quantity of the second battery can be made to be exhausted at the same time through multiple adjustments. During the discharging of the electronic device, the discharging current of the second battery can be adjusted by adjusting the resistance of the fourth switch element, so as to reduce the difference between the electric quantity of the first battery and the electric quantity of the second battery, and the electric quantity of the first battery and the electric quantity of the second battery can be made to be exhausted at the same time through multiple adjustments. It should be noted that the third switch element or the fourth switch element can be included between the second battery and the charging chip, and the charging current or the discharging current of the second battery can be adjusted correspondingly.

[0032] With reference to the first aspect, in a possible implementation, the circuit further includes a third comparator and a third DAC, and the third switch element includes a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the third switch element are respectively connected to the charging chip and the first end of the second battery.

[0033] The third comparator is connected to the first conduction end and the second conduction end of the third switch element, and is configured to compare the voltages of the first conduction end and the second conduction end of the third switch element, and send a comparison result of the third comparator to the third controller.

[0034] The third controller is specifically configured to determine the third duty cycle based on the received third resistance value, output a pulse signal of the third duty cycle to the third DAC when the voltage at the first conduction end of the third switch element is greater than the voltage at the second conduction end of the third switch element, and output a pulse signal of the third preset duty cycle to the third DAC when the voltage at the first conduction end of the third switch element is less than the voltage at the second conduction end of the third switch element.

[0035] The third DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the third duty cycle is used to be input to the control end of the third switch element to control the third switch element to work in a linear region, and control the resistance of the third switch element to be the third resistance value; and the analog signal converted from the pulse signal of the third preset duty cycle is used to be input to the control end of the third switch element to control the third switch element to work in a fully on region.

[0036] Optionally, the third controller can store a correspondence between resistance and duty cycle, and the third duty cycle is a duty cycle corresponding to the third resistance value.

[0037] The above circuit controls the resistance of the third switch element based on the duty cycle, and has simple circuit logic and rapid response.

[0038] With reference to the first aspect, in a possible implementation manner, the circuit further includes a fourth comparator and a fourth DAC, and the fourth switch element includes a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the fourth switch element are connected to the first end of the second battery and the second conduction end of the third switch element respectively.

[0039] The fourth comparator is connected to the first conduction end and the second conduction end of the fourth switch element, and is configured to compare the voltages at the first conduction end and the second conduction end of the fourth switch element, and send a comparison result of the fourth comparator to the fourth controller.

[0040] The fourth controller is specifically configured to determine a fourth duty cycle based on a received fourth resistance value, output a pulse signal of the fourth duty cycle to the fourth DAC when the voltage at the first conduction end of the fourth switch element is greater than the voltage at the second conduction end of the fourth switch element, and output a pulse signal of a fourth preset duty cycle to the fourth DAC when the voltage at the first conduction end of the fourth switch element is less than the voltage at the second conduction end of the fourth switch element.

[0041] The fourth DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted by the pulse signal with the fourth duty cycle is configured to be input to a control end of the fourth switch element to control the fourth switch element to work in a linear region, and the resistance of the fourth switch element is the fourth resistance value; and the pulse signal with the fourth preset duty cycle is configured to be input to the control end of the fourth switch element to control the fourth switch element to work in a full-on region.

[0042] Optionally, the fourth controller can store a correspondence between the resistance and the duty cycle, and the fourth duty cycle is a duty cycle corresponding to the fourth resistance value.

[0043] The circuit controls the resistance of the fourth switch element based on the duty cycle, and the circuit logic is simple and the response is fast.

[0044] In combination with the first aspect, in a possible implementation manner, the circuit further includes a third battery, a fifth controller, and a fifth switch element, the third battery is connected to the charging chip through the fifth switch element, and the processor is further connected to the fifth controller.

[0045] The processor is further configured to, when the electronic device is in a charging state, determine a first resistance value, a third resistance value, and a fifth resistance value of the fifth switch element based on the electric quantity of the first battery, the electric quantity of the second battery, and the electric quantity of the third battery, and send the fifth resistance value to the fifth controller.

[0046] The fifth controller is configured to adjust the resistance of the fifth switch element to the fifth resistance value, and after the adjustment, the difference between the electric quantity of the third battery and the electric quantity of the first battery or the second battery is reduced.

[0047] In combination with the first aspect, in a possible implementation manner, the circuit further includes a fifth comparator and a fifth DAC, and the fifth switch element includes a first conduction end, a second conduction end, and a control end; the first conduction end and the second conduction end of the fifth switch element are respectively connected to the charging chip and a first end of the third battery.

[0048] The fifth comparator is connected to the first conduction end and the second conduction end of the fifth switch element, configured to compare the voltages of the first conduction end and the second conduction end of the fifth switch element, and send a comparison result of the fifth comparator to the fifth controller.

[0049] The fifth controller is specifically configured to, when the voltage of the first conduction end of the fifth switch element is greater than the voltage of the second conduction end of the fifth switch element, determine a fifth duty cycle based on the received fifth resistance value, output a pulse signal with the fifth duty cycle to the fifth DAC, and when the voltage of the first conduction end of the fifth switch element is less than the voltage of the second conduction end of the fifth switch element, output a pulse signal with a fifth preset duty cycle to the fifth DAC.

[0050] The fifth DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted by the pulse signal with the fifth duty cycle is configured to be input to a control terminal of the fifth switch element to control the fifth switch element to work in a linear region, and the resistance of the fifth switch element is the fifth resistance value; and the pulse signal with the fifth preset duty cycle is configured to be input to the control terminal of the fifth switch element to control the fifth switch element to work in a full-on region.

[0051] Optionally, the fifth controller can store a correspondence between the resistance and the duty cycle, and the fifth duty cycle is the duty cycle corresponding to the fifth resistance value.

[0052] The above circuit controls the resistance of the fifth switch element based on the duty cycle, and the circuit logic is simple and the response is fast.

[0053] In combination with the first aspect, in a possible implementation manner, the circuit further includes a sixth controller and a sixth switch element, the third battery is connected to the charging chip through the fifth switch element and the sixth switch element, the fifth switch element and the sixth switch element are reversely connected in series, and the processor is further connected to the sixth controller.

[0054] The processor is configured to, when the electronic device is in a discharging state, determine a sixth resistance value of the sixth switch element based on the electric quantity of the first battery, the electric quantity of the second battery and the electric quantity of the third battery, and send the sixth resistance value to the sixth controller.

[0055] The sixth controller is configured to adjust the resistance of the sixth switch element to be the sixth resistance value, and after the adjustment, the difference between the electric quantity of the third battery and the electric quantity of the first battery or the second battery is reduced.

[0056] The above circuit includes three parallel-connected batteries, by adding the fifth switch element and the sixth switch element between the third battery and the charging chip, during the charging of the electronic device, the charging current of the third battery can also be adjusted by adjusting the resistance of the fifth switch element, so as to reduce the difference between the electric quantity of the third battery and the electric quantity of the first battery or the second battery, and through multiple adjustments, the electric quantities of the first battery, the second battery and the third battery can be made to be exhausted at the same time. During the discharging of the electronic device, the discharging current of the third battery can also be adjusted by adjusting the resistance of the sixth switch element, so as to reduce the difference between the electric quantity of the third battery and the electric quantity of the first battery or the second battery, and through multiple adjustments, the electric quantities of the first battery, the second battery and the third battery can be made to be exhausted at the same time.

[0057] It should be noted that the third battery and the charging chip can include the above fifth switch element or sixth switch element, and correspondingly, the charging current or discharging current of the third battery can be adjusted.

[0058] With reference to the first aspect, in a possible implementation manner, the circuit further includes a sixth comparator and a sixth DAC, the sixth switch element includes a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the sixth switch element are connected to the first end of the third battery and the second conduction end of the fifth switch element respectively;

[0059] The sixth comparator is connected to the first conduction end and the second conduction end of the sixth switch element, and is configured to compare the voltages of the first conduction end and the second conduction end of the sixth switch element, and send a comparison result of the sixth comparator to the sixth controller;

[0060] The sixth controller is specifically configured to, when the voltage of the first conduction end of the sixth switch element is greater than the voltage of the second conduction end of the sixth switch element, determine the sixth duty ratio based on the received sixth resistance value, output a pulse signal of the sixth duty ratio to the sixth DAC, and when the voltage of the first conduction end of the sixth switch element is less than the voltage of the second conduction end of the sixth switch element, output a pulse signal of the sixth preset duty ratio to the sixth DAC;

[0061] The sixth DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the sixth duty ratio is used for input to the control end of the sixth switch element to control the sixth switch element to work in a linear region, and the resistance of the sixth switch element is the sixth resistance value; and the pulse signal of the sixth preset duty ratio is used for input to the control end of the sixth switch element to control the sixth switch element to work in a full conduction region.

[0062] Optionally, the sixth controller can store a correspondence between resistance and duty ratio, and the sixth duty ratio is a duty ratio corresponding to the sixth resistance value.

[0063] The above circuit controls the resistance of the sixth switch element based on the duty ratio, and the circuit logic is simple and the response is rapid.

[0064] It should be noted that when the first to sixth switch elements are of the same type, the correspondence between resistance and duty ratio stored by the first to sixth controllers can be the same, and when the first to sixth switch elements are of different types, the correspondence between resistance and duty ratio stored by the first to sixth controllers can be different.

[0065] With reference to the first aspect, in a possible implementation manner, the processor is further configured to, when the electronic device is in a charging state, determine whether the charging current of the battery needs to be adjusted based on the electric quantity of the first battery, the electric quantity of the second battery and the electric quantity of the third battery; and when the charging current needs to be adjusted, determine the first resistance value, the third resistance value and the fifth resistance value based on the electric quantity of the first battery, the electric quantity of the second battery, the electric quantity of the third battery, the current charging current value of the first battery, the current charging current value of the second battery and the current charging current value of the third battery.

[0066] With reference to the first aspect, in a possible implementation manner, the processor is further configured to:

[0067] when the first battery has more power than the second battery and the second battery has more power than the third battery, determining that the target charging current of the first battery is less than the current charging current value of the first battery, determining that the target charging current of the third battery is greater than the current charging current value of the third battery, and determining that the target charging current of the second battery is equal to the current charging current value of the second battery;

[0068] determining the first resistance value based on the target charging current of the first battery;

[0069] determining the third resistance value based on the target charging current of the second battery;

[0070] determining the fifth resistance value based on the target charging current of the third battery.

[0071] With reference to the first aspect, in a possible implementation manner, the processor is further configured to, when the electronic device is in a discharging state, determining whether the discharging current of the battery needs to be adjusted based on the power of the first battery, the power of the second battery and the power of the third battery; and when the discharging current needs to be adjusted, determining the second resistance value, the fourth resistance value and the sixth resistance value based on the power of the first battery, the power of the second battery, the power of the third battery, the current discharging current value of the first battery, the current discharging current value of the second battery and the current discharging current value of the third battery.

[0072] With reference to the first aspect, in a possible implementation manner, the processor is further configured to:

[0073] when the first battery has more power than the second battery and the second battery has more power than the third battery, determining that the target discharging current of the first battery is greater than the current discharging current value of the first battery; determining that the target discharging current of the third battery is less than the current discharging current value of the third battery; and determining that the target discharging current of the second battery is equal to the current discharging current value of the second battery;

[0074] determining the second resistance value based on the target discharging current of the first battery;

[0075] determining the fourth resistance value based on the target discharging current of the second battery;

[0076] determining the sixth resistance value based on the target discharging current of the third battery.

[0077] The second aspect, the embodiment of the present application provides an electronic device, the electronic device includes the multi-battery charging and discharging circuit as described in the first aspect or any one of the implementations of the first aspect.

[0078] In a third aspect, the embodiments of the present application further provide a charging and discharging control method, which is applied to the multi-battery charging and discharging circuit in the first aspect or any of the implementation manners of the first aspect, and can be implemented by an electronic device or a processor in the electronic device. The method comprises the method implemented by the processor in the first aspect or any of the implementation manners of the first aspect.

[0079] In a fourth aspect, the embodiments of the present application further provide a charging and discharging control method, which is applied to the multi-battery charging and discharging circuit in the first aspect or any of the implementation manners of the first aspect, and can be implemented by an electronic device or a controller in the electronic device. The method comprises the method implemented by the controller in the first aspect or any of the implementation manners of the first aspect.

[0080] In a fifth aspect, the embodiments of the present application provide a computer readable storage medium comprising instructions, which, when executed on a processor, cause the processor to perform the method implemented by the processor in the first aspect or any of the implementation manners of the first aspect.

[0081] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed on a processor, cause the processor to perform the method implemented by the processor in the first aspect or any of the implementation manners of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0082] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows.

[0083] FIG. 1 is a structural schematic diagram of an electronic device provided by the embodiments of the present application;

[0084] FIG. 2 is a circuit schematic diagram of a multi-battery charging and discharging circuit provided by the embodiments of the present application;

[0085] FIG. 3 is a circuit schematic diagram of another multi-battery charging and discharging circuit provided by the embodiments of the present application;

[0086] FIG. 4 is a circuit schematic diagram of an isolation module provided by the embodiments of the present application;

[0087] FIG. 5 is a flow schematic diagram of a circuit control method executed by a controller in an isolation module provided by the embodiments of the present application;

[0088] FIG. 6 is a circuit schematic diagram of another multi-battery charging and discharging circuit provided by the embodiments of the present application;

[0089] FIG. 7 is a flow schematic diagram of a charging control method provided by the embodiments of the present application;

[0090] FIG. 8 is a circuit schematic diagram of another multi-battery charging and discharging circuit provided by the embodiments of the present application;

[0091] FIG. 9 is a flow diagram of a discharge control method according to an embodiment of the present application. DETAILED DESCRIPTION

[0092] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; "and / or" in the text only represents a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0093] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more than two.

[0094] It should be noted that in the present application, the words "in some embodiments", "exemplarily", "for example" and the like are used to represent as an example, illustration or description. Any embodiment or design scheme described as "in some embodiments", "exemplarily", "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the use of "in some embodiments", "exemplarily", "for example" and the like is intended to present the relevant concept in a specific way.

[0095] In the embodiments of the present application, the "connection" between two electronic components (or electrical modules, electrical units) means electrical connection. The electrical connection here means that the two electronic components are connected to transmit electrical signals. The electrical connection between the two electronic components can be direct connection through a wire, or indirect connection through other electronic components.

[0096] In the embodiments of the present application, the "power" of the battery can be understood as the remaining power of the battery. In the embodiments of the present application, the power of the battery is represented by the proportion or ratio of the remaining power of the battery to the capacity of the battery. The power difference between two batteries means the absolute value of the difference.

[0097] In order to realize that the multiple batteries of the electronic device can be close to full at the same time when in the charging state, or the multiple batteries can be close to empty at the same time when in the discharging state, the present application provides a multiple battery charging and discharging circuit and an electronic device, which are described as follows.

[0098] First, the electronic device provided by the embodiments of the present application is introduced in combination with FIG. 1. The electronic device can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, and the like. The embodiments of the present application do not specially limit the specific type of the electronic device. Exemplary embodiments of the electronic device 100 include, but are not limited to, portable electronic devices or non-portable devices carrying a Linux or other operating system. Linux or other operating systems.

[0099] As shown in FIG. 1, the electronic device 100 provided by the embodiments of the present application can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 150, a battery 160, a sensor module 170, a camera 180, and a display screen 190, etc. The sensor module 170 can include one or more of a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

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

[0101] The controller can generate operation control signals according to the instruction operation code and the timing signal, complete the control of fetching and executing instructions. In the embodiments of the present application, the controller can generate instructions such as requesting scheduling instructions, instructions indicating that there is a service conflict, service disconnection instructions, updating the characteristic state to the device service manager, and the like.

[0102] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. For example, the processor 110 is provided with a data storage controller Data Controller, which is a cache memory for storing service association records and the like. When service association is performed next time, the trigger cooperative service can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

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

[0104] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.

[0105] The electronic device 100 implements a display function through a GPU, a display screen 190, and an application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 190 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

[0106] The display screen 190 is used to display images, videos, etc. The display screen 190 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 can include 1 or N display screens 190, N being a positive integer greater than 1.

[0107] Optionally, one or more foldable display screens can be included in the N display screens 190 included in the electronic device 100.

[0108] Exemplarily, the electronic device 100 includes one foldable display screen, and as an inner screen, the electronic device 100 can further include an outer screen arranged opposite to the inner screen.

[0109] The electronic device 100 can implement a shooting function through an image signal processor (ISP), a camera 180, a video codec, a GPU, a display screen 190, and an application processor, etc.

[0110] The camera 180 is used to capture still images or videos. An object generates an optical image through a lens and projects it to a photosensitive element. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard RGB, YUV, etc. format image signal. In some embodiments, the electronic device 100 can include 1 or N cameras 180, N being a positive integer greater than 1.

[0111] The external memory interface 120 can be configured to connect an external memory card, such as a Micro SD card, to extend the memory capacity of the electronic device 100. The external memory card can communicate with the processor 110 via the external memory interface 120 to store data. For example, the external memory card can store music, video, and the like.

[0112] The internal memory 121 can be configured to store computer-executable program codes including instructions. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program (e.g., a sound play application, a picture play application, and the like) required for at least one function, and the like. The data storage area can store data (e.g., audio data, a phonebook, and the like) created during the use of the electronic device 100, and the like. Furthermore, the internal memory 121 can include a volatile memory and can further include a non-volatile memory, such as at least one of a magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 110 can perform various functions of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and / or instructions stored in a memory disposed in the processor.

[0113] The electronic device 100 can include two or N batteries, where N is a positive integer greater than two. The two or N batteries can be disposed at different locations of the electronic device 100.

[0114] The charging management module 140 can be configured to receive a charging input from a charger. The charger can be a wireless charger or a wired charger. In some embodiments of the wired charging, the charging management module 140 can receive the charging input from the wired charger via the USB interface 130. In some embodiments of the wireless charging, the charging management module 140 can receive the wireless charging input via a wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 160 while supplying power to the electronic device 100 via the power management module 150.

[0115] The power management module 150 is configured to connect the plurality of batteries 160, the charging management module 140, and the processor 110. The power management module 150 receives input from the batteries 160 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display 190, the camera 180, and the sensor module 170, etc. The power management module 150 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, resistance), etc. In some other embodiments, the power management module 150 can also be disposed in the processor 110. In some other embodiments, the power management module 150 and the charging management module 140 can also be disposed in the same device.

[0116] It can be understood that the structures shown in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0117] For example, the electronic device 100 also includes one or more of an antenna, a mobile communication module, a wireless communication module, an audio module, a speaker, a microphone, a microphone, a headset interface, and a subscriber identification module (SIM) card interface, etc.

[0118] The multi-battery charging and discharging circuit involved in the embodiments of the present application will be described below in connection with FIG. 2 and FIG. 3. The electronic device 100 described above can include a multi-battery charging and discharging circuit, which can include the USB interface 130, the charging management module 140, the power management module 150, and the plurality of batteries 160 in FIG. 1 described above.

[0119] FIG. 2 and FIG. 3 both take an example of an electronic device including three batteries, which are a first battery 161, a second battery 162, and a third battery 163. The three batteries are connected in parallel and can simultaneously provide power to the power-consuming components in the electronic device 100 or be charged simultaneously, which is also referred to as the three batteries being capable of parallel charging and parallel discharging. It should be understood that the electronic device in the present application is not limited to including only three batteries, i.e., can include more or fewer batteries, such as two batteries, or four batteries, etc.

[0120] As shown in FIG. 2, in one implementation of the charging management module 140, the charging management module 140 can include a charging chip 141, a first isolation module 142, a second isolation module 143, a third isolation module 144, a fourth isolation module 145, a fifth isolation module 146, and a sixth isolation module 147. The positive pole of the first battery 161 is connected to the charging chip 141 through the second isolation module 143 and the first isolation module 142. The positive pole of the second battery 162 is connected to the charging chip 141 through the third isolation module 144 and the fourth isolation module 145. The positive pole of the third battery 163 is connected to the charging chip 141 through the fifth isolation module 146 and the sixth isolation module 147. The charging chip 141 is connected to the USB interface 130, where the USB interface 130 is used to connect an external charger. The charging chip is used to charge the first battery 161, the second battery 162, and the third battery 163 based on the electrical energy received through the USB interface 130.

[0121] The power management module 150 is also connected to devices such as processors, etc., for providing electrical energy received from the USB interface or the first battery, the second battery, and the third battery to the devices such as processors, etc.

[0122] Further, the multi-battery charging and discharging circuit further includes a current collection module, which is used to collect the current passing through the first battery 161, the current passing through the second battery 162, and the current passing through the third battery 163. The current collection module can be connected to the charging chip 141.

[0123] Exemplarily, as shown in FIG. 2, the current collection module can include a first resistor R1, a second resistor R2, and a third resistor R3. Wherein one end of the first resistor R1 is connected to the negative pole of the first battery 161, and the other end is grounded; one end of the second resistor R2 is connected to the negative pole of the second battery 162, and the other end is grounded; one end of the third resistor R3 is connected to the negative pole of the third battery 163, and the other end is grounded.

[0124] The charging chip 141 is also connected or connected through the current collection module to the common end of the first resistor R1 and the negative pole of the first battery 161, the common end of the second resistor R2 and the negative pole of the second battery 162, and the common end of the third resistor R3 and the negative pole of the third battery 163.

[0125] The charging chip 141 is also configured to collect the current passing through the first resistor R1, since the first resistor R1 is connected in series with the first battery 161, that is, the charging chip 141 collects the current passing through the first battery 161 (including the charging current and the discharging current of the first battery 161); collect the current passing through the second resistor R2, since the second resistor R2 is connected in series with the second battery 162, that is, the charging chip 141 collects the current passing through the second battery 162 (including the charging current and the discharging current of the second battery 162); collect the current passing through the third resistor R3, since the third resistor R3 is connected in series with the third battery 163, that is, the charging chip 141 collects the current passing through the third battery 163 (including the charging current and the discharging current of the third battery 163).

[0126] The charging chip 141 is also configured to send the collected current values to the processor 110, or send the collected current values to the processor 110 through the power management module 150.

[0127] The processor 110 is also configured to determine the target charging current of the first battery 161, the target charging current of the second battery 162, and / or the target charging current of the third battery 163 based on one or more of the charging current value of the first battery 161, the charging current value of the second battery 162, the charging current value of the third battery 163, the power of the first battery 161, the power of the second battery 162, and the power of the third battery 163 when the electronic device is charging.

[0128] The processor 110 is also configured to determine the target discharging current of the first battery 161, the target discharging current of the second battery 162, and / or the target discharging current of the third battery 163 based on one or more of the discharging current value of the first battery 161, the discharging current value of the second battery 162, the discharging current value of the third battery 163, the power of the first battery 161, the power of the second battery 162, and the power of the third battery 163 when the electronic device is discharging.

[0129] The first isolation module 142 is configured to adjust the charging current of the first battery 161 to be the target charging current of the first battery 161, so that the difference between the power of the first battery 161 and the power of the second battery 162 or the third battery 163 after adjustment is reduced. The second isolation module 143 is configured to adjust the discharging current of the first battery 161 to be the target discharging current of the first battery 161, so that the difference between the power of the first battery 161 and the power of the second battery 162 or the third battery 163 after adjustment is reduced.

[0130] The third isolation module 144 is configured to adjust the charging current of the second battery 162 to a target charging current of the second battery 162, so as to reduce the difference between the electric quantity of the second battery 162 and the electric quantity of the first battery 161 or the third battery 163. The fourth isolation module 145 is configured to adjust the discharging current of the second battery 162 to a target discharging current of the second battery 162, so as to reduce the difference between the electric quantity of the second battery 162 and the electric quantity of the first battery 161 or the third battery 163.

[0131] The fifth isolation module 146 is configured to adjust the charging current of the third battery 163 to a target charging current of the third battery 163, so as to reduce the difference between the electric quantity of the third battery 163 and the electric quantity of the first battery 161 or the second battery 162. The sixth isolation module 147 is configured to adjust the discharging current of the third battery 163 to a target discharging current of the third battery 163, so as to reduce the difference between the electric quantity of the third battery 163 and the electric quantity of the first battery 161 or the second battery 162.

[0132] As shown in FIG. 3, in another implementation of the charging management module 14, the charging current or the discharging current of only part of the batteries can be adjusted. For example, the capacity of the second battery 162 is greater than the capacity of the first battery 161 and greater than the capacity of the third battery 163, and the line resistance of the third battery 163 is greater than the line resistance of the first battery 161 and greater than the line resistance of the second battery 162. At this time, since the capacity of the second battery 162 is the largest, the charging current and the discharging current of the second battery 162 can not be adjusted, that is, the second battery 162 does not need to be connected to the charging chip 141 through the third isolation module 144 and the fourth isolation module 145. Since the line resistance of the third battery 163 is the largest, the discharging current of the third battery 163 can not be adjusted, that is, the second battery 162 does not need to be connected to the charging chip 141 through the sixth isolation module 147.

[0133] Optionally, the charging management module 140 can include a plurality of charging chips 141, a first isolation module 142, a second isolation module 143, and a fifth isolation module 146. The positive pole of the first battery 161 is connected to each charging chip 141 through the second isolation module 143 and the first isolation module 142; the positive pole of the second battery 162 is directly connected to each charging chip 141. The positive pole of the third battery 163 is connected to each charging chip 141 through the fifth isolation module 146. As shown in FIG. 3, the charging management module 140 can include one or more slow charging chips 141a, one or more fast charging chips (such as a first fast charging chip 141b and a second fast charging chip 141c). Among them, the fast charging chip is used to charge the first battery 161, the second battery 162 and the third battery 163 quickly when the sum of the electric quantity of the first battery 161, the second battery 162 and the third battery 163 is large, such as greater than a preset threshold, and the slow charging chip 141a is used to charge the first battery 161, the second battery 162 and the third battery 163 slowly when the sum of the electric quantity of the first battery 161, the second battery 162 and the third battery 163 is small, such as less than a preset threshold.

[0134] Optionally, the charging chip 141 is also connected to the power management module 150. The power management module 150 is used to receive the input of the battery 160 and / or the charging management module 140, convert the power supply, and supply power to the components or devices in the electronic device.

[0135] The circuit diagram of the above-mentioned isolation module 40 will be described below in combination with FIG. 4. The isolation module described in FIG. 4 can be any one of the above-mentioned first to sixth isolation modules.

[0136] The isolation module 40 can include a controller 41, a comparator 42, a DAC 43, and a switching element 44.

[0137] The switch element 44 includes a first conduction terminal, a second conduction terminal, and a control terminal. The switch element 44 can include one switch tube or multiple cascaded switch tubes. The switch tube can be a metal oxide semiconductor field effect transistor (MOSFET) or other switch device, and is exemplarily an NMOS tube. The switch element 44 is exemplarily described by taking an NMOS tube as an example. The first conduction terminal of the switch element 44 can be the drain D of the NMOS tube, the second conduction terminal can be the source S, and the control terminal can be the gate G. For the NMOS tube, the voltage of the control terminal (i.e., the gate G) of the NMOS tube can be controlled to work in three conduction states, i.e., the cutoff region, the linear region, and the full conduction region. When the NMOS tube works in the linear region, the voltage of the control terminal (i.e., the gate G) of the NMOS tube can be controlled to have different resistances.

[0138] When the isolation module 40 (e.g., the first isolation module 142, the third isolation module 144, or the fifth isolation module 146) is used to regulate the charging current of the battery, the switch element 44 in the isolation module 40 works in the linear region, the first conduction terminal (i.e., the drain D) of the switch element 44 is connected to the charging chip 141, and the second conduction terminal (i.e., the source S) of the switch element 44 is connected to the positive electrode of the battery (e.g., the first battery 161, the second battery 162, or the third battery 163).

[0139] When the isolation module 40 (e.g., the second isolation module 143, the fourth isolation module 145, or the sixth isolation module 147) is used to regulate the discharging current of the battery, the switch element 44 in the isolation module 40 works in the linear region, the first conduction terminal (i.e., the drain D) of the switch element 44 is connected to the positive electrode of the battery (e.g., the first battery 161, the second battery 162, or the third battery 163), and the second conduction terminal (i.e., the source S) of the switch element 44 is connected to the charging chip 141.

[0140] The controller 41 includes a first end, a second end, and a third end. The first end of the controller 41 is connected to the processor 110 for communication with the processor 110, for example, receiving the resistance of the switch element 44 sent by the processor 110. The second end of the controller 41 is connected to the comparator 42, and the third end of the controller 41 is connected to the DAC 43.

[0141] The two input terminals of the comparator 42 are respectively connected to the first conduction terminal and the second conduction terminal of the switch element 44, for comparing the voltage of the first conduction terminal and the second conduction terminal of the switch element 44, and sending the comparison result to the controller 41.

[0142] The controller 41 is configured to receive the resistance value sent by the processor 110, and when the comparison result indicates that the voltage of the first conduction end is greater than the voltage of the second conduction end, determine the duty cycle of the pulse width modulation (PWM) signal as the target duty cycle based on the received resistance value, and output the PWM signal with the determined duty cycle to the DAC 43. The DAC 43 is configured to convert the received PWM signal into an analog signal and input the analog signal to the control end of the switching element 44. At this time, the analog signal converted from the PWM signal with the target duty cycle determined by the controller 41 makes the switching element 44 work in the linear region. In the embodiment of the present application, the PWM signal is also referred to as a pulse signal.

[0143] In the embodiment of the present application, the analog signals obtained by processing the PWM signals with different duty cycles by the DAC 43 have different equivalent voltages, and the greater the duty cycle, the greater the equivalent voltage of the analog signal. When the analog signal is input to the control end of the switching element 44, the greater the equivalent voltage of the analog signal, the smaller the resistance of the switching element 44 before the switching element 44 is fully turned on. When the switching element 44 is fully turned on, the resistance of the switching element 44 basically no longer changes.

[0144] The controller 41 is further configured to output a PWM signal with a preset duty cycle to the DAC 43 when the comparison result indicates that the voltage of the first conduction end is less than the voltage of the second conduction end. At this time, the analog signal converted from the PWM signal with the preset duty cycle makes the switching element 44 work in the fully turned-on region.

[0145] The controller 41 performs a control method as follows, which is performed by the controller 41 and can include but is not limited to the following part or all of the method:

[0146] S1, the controller 41 receives the resistance value of the switching element 44 from the processor.

[0147] S2, the controller 41 receives the comparison result from the comparator, which indicates whether the voltage of the first conduction end of the switching element is greater than the voltage of the second conduction end. For example, the comparison result “1” indicates that the voltage of the first conduction end is greater than the voltage of the second conduction end, and the comparison result “0” indicates that the voltage of the first conduction end is less than the voltage of the second conduction end.

[0148] S3, the controller 41 determines whether the comparison result indicates that the voltage of the first conduction end is greater than the voltage of the second conduction end.

[0149] For example, when the comparison result is “1”, it is determined that the voltage of the first conduction end is greater than the voltage of the second conduction end, and S4 is performed at this time; when the comparison result is “0”, it is determined that the voltage of the first conduction end is less than the voltage of the second conduction end; and when the comparison result is “0”, S5 is performed at this time.

[0150] S4, the controller 41 determines the duty cycle of the output PWM as a target duty cycle based on the received resistance value.

[0151] Specifically, the controller 41 stores a correspondence between resistance and duty cycle. The correspondence between resistance and duty cycle includes a plurality of resistance values and a plurality of duty cycles corresponding to the plurality of resistance values, respectively. Further, the controller 41 can determine the duty cycle corresponding to the received resistance value as the duty cycle of the PWM signal to be output (i.e., the target duty cycle). At this time, the analog signal converted by the PWM with the target duty cycle determined by the controller 41 causes the switching element 44 to operate in the linear region. The analog signals corresponding to different duty cycles cause the resistance of the switching element 44 to be different.

[0152] S5, the controller 41 determines the duty cycle of the output PWM as a preset duty cycle. The analog signal converted by the PWM with the preset duty cycle causes the switching element 44 to operate in the fully on region. The preset duty cycle can be 1, or other values that can cause the switching element 44 to operate in the fully on region.

[0153] S6, the controller 41 sends the PWM with the determined duty cycle to the DAC.

[0154] After step S4 or S5, the controller 41 can perform S6 to output the PWM signal to the DAC. Further, the DAC 43 converts the received PWM into an analog signal and inputs it to the control terminal of the switching element 44 to control the on-off state of the switching element and the resistance of the switching element 44 when the switching element 44 is in the linear region.

[0155] As shown in FIG. 6 in combination with FIG. 4 and FIG. 2, the circuit schematic of the multi-battery charging and discharging circuit shown in FIG. 2 is exemplarily shown. In order to distinguish the controllers, comparators, DACs and switching elements in different isolation modules, the controller, comparator, DAC and switching element in the first isolation module 142 are respectively referred to as the first controller, the first comparator, the first DAC and the first switching element Q1. The controller, comparator, DAC and switching element in the second isolation module 143 are respectively referred to as the second controller, the second comparator, the second DAC and the second switching element Q2. The controller, comparator, DAC and switching element in the third isolation module 144 are respectively referred to as the third controller, the third comparator, the third DAC and the third switching element Q3. The controller, comparator, DAC and switching element in the fourth isolation module 145 are respectively referred to as the fourth controller, the fourth comparator, the fourth DAC and the fourth switching element Q4. The controller, comparator, DAC and switching element in the fifth isolation module 146 are respectively referred to as the fifth controller, the fifth comparator, the fifth DAC and the fifth switching element Q5. The controller, comparator, DAC and switching element in the sixth isolation module 147 are respectively referred to as the sixth controller, the sixth comparator, the sixth DAC and the sixth switching element Q6.

[0156] The first switching element Q1 and the second switching element Q2 are reversely connected in series between the charging chip 141 and the positive electrode of the first battery 161, that is, the first conduction end of the first switching element Q1 is connected to the charging chip 141, the second conduction end of the first switching element Q1 is connected to the second conduction end of the second switching element Q2, and the first conduction end of the second switching element Q2 is connected to the positive electrode of the first battery 161.

[0157] Similarly, the third switching element Q3 and the fourth switching element Q4 are reversely connected in series between the charging chip 141 and the positive electrode of the second battery 162, that is, the first conduction end of the third switching element Q3 is connected to the charging chip 141, the second conduction end of the third switching element Q3 is connected to the second conduction end of the fourth switching element Q4, and the first conduction end of the fourth switching element Q4 is connected to the positive electrode of the second battery 162.

[0158] Similarly, the fifth switching element Q5 and the sixth switching element Q6 are reversely connected in series between the charging chip 141 and the positive electrode of the third battery 163, that is, the first conduction end of the fifth switching element Q5 is connected to the charging chip 141, the second conduction end of the fifth switching element Q5 is connected to the second conduction end of the sixth switching element Q6, and the first conduction end of the sixth switching element Q6 is connected to the positive electrode of the third battery 163.

[0159] The processor 110 is connected to each controller (not shown in FIG. 6), that is, connected to the first controller, the second controller, the third controller, the fourth controller, the fifth controller and the sixth controller.

[0160] In a possible implementation, the charging chip 141 is further configured to collect voltages at the A1 point, the A2 point, the A3 point, and the B point, and send the collected voltage values to the processor 110.

[0161] The processor 110 is specifically configured to determine target charging currents of the first battery 161, the second battery 162, and the third battery 163 based on the electric quantity of the first battery, the electric quantity of the second battery, and current charging current values of the first battery 161, the second battery 162, and the third battery 163 when the electronic device is in a charging state. Further, the processor 110 is further configured to calculate required resistance values of the first switch element Q1, the third switch element Q3, and the fifth switch element Q5, also referred to as a first resistance value, a third resistance value, and a fifth resistance value, respectively, based on the voltage values at the A1 point, the A2 point, the A3 point, and the B point, known resistance values of the second switch element Q2, the fourth switch element Q4, and the sixth switch element Q6 when turned on, and the target charging currents of the first battery 161, the second battery 162, and the third battery 163. Further, the processor 110 is further configured to send the first resistance value to the first controller, the third resistance value to the third controller, and the fifth resistance value to the fifth controller.

[0162] The processor 110 is specifically further configured to determine target discharging currents of the first battery 161, the second battery 162, and the third battery 163 based on the electric quantity of the first battery, the electric quantity of the second battery, and current discharging current values of the first battery 161, the second battery 162, and the third battery 163 when the electronic device is in a discharging state. Further, the processor 110 is further configured to calculate required resistance values of the second switch element Q2, the fourth switch element Q4, and the sixth switch element Q6, also referred to as a second resistance value, a fourth resistance value, and a sixth resistance value, respectively, based on the voltage values at the A1 point, the A2 point, the A3 point, and the B point, known resistance values of the first switch element Q1, the third switch element Q3, and the fifth switch element Q5 when turned on, and the target discharging currents of the first battery 161, the second battery 162, and the third battery 163. Further, the processor 110 is further configured to send the second resistance value to the second controller, the fourth resistance value to the fourth controller, and the sixth resistance value to the sixth controller.

[0163] It should be noted that, in another implementation, any two or more of the first controller, the second controller, the third controller, the fourth controller, the fifth controller and the sixth controller can be integrated together. For example, the first controller and the second controller are integrated together as one controller, which can implement the functions of the first controller and the second controller. The third controller and the fourth controller are integrated together as one controller, which can implement the functions of the third controller and the fourth controller. The fifth controller and the sixth controller are integrated together as one controller, which can implement the functions of the fifth controller and the sixth controller.

[0164] It should also be noted that, in the multi-battery charging and discharging circuit shown in FIG. 3, the third isolation module 144, the fourth isolation module 145 and the sixth isolation module 147 can be omitted.

[0165] It should also be noted that the above is described by taking the multi-battery charging and discharging circuit including three batteries as an example, and it should be understood that the charging and discharging control circuit can include more or fewer batteries, and the isolation modules corresponding to the batteries.

[0166] For example, the multi-battery charging and discharging circuit can include 2 batteries, i.e., the first battery and the second battery, or the first battery and the third battery, or the second battery and the third battery, and the isolation modules between the batteries and the charging chip. At this time, the power management module can adjust the charging current or the discharging current of the 2 batteries, or adjust the charging current or the discharging current of one of the batteries, and the implementation principle is the same as that of the above-mentioned 3 batteries, which will not be described here.

[0167] For another example, the multi-battery charging and discharging circuit can include N batteries and an isolation module between each battery and the charging chip. As with the first battery, one or two isolation modules can be included between each battery and the charging chip. The power management module can adjust the charging current or the discharging current of the N batteries, and the implementation principle is the same as that of the above-mentioned 3 batteries, which will not be described here.

[0168] The following describes the charging and discharging control method related to the embodiments of the present application, which is implemented by the above-mentioned electronic device or the above-mentioned multi-battery charging and discharging circuit. The method can include a charging control method and a discharging control method. The following takes the multi-battery charging and discharging circuit including three batteries as an example to describe the charging control method and the discharging control method respectively.

[0169] (I) Charging control method:

[0170] The charging control method can include, but is not limited to, the following part or all steps as follows in combination with the circuit schematic diagram shown in FIG. 6 and the flow chart of the charging control method shown in FIG. 7:

[0171] S101, when the electronic device is in a charging state, the processor acquires the charging current of the first battery, the charging current of the second battery and the charging current of the third battery, and acquires the power of the first battery, the power of the second battery and the power of the third battery.

[0172] Specifically, after the electronic device listens to the plugging and unplugging event of the USB interface 130, it can report to the processor to determine whether the electronic device is in a charging state or a discharging state.

[0173] The processor can periodically, for example, every 5s, 10s or 30s, etc., acquire the charging current of the first battery, the charging current of the second battery and the charging current of the third battery through the charging chip, and acquire the power of the first battery, the power of the second battery and the power of the third battery.

[0174] S102, the processor determines whether the charging current of the battery needs to be adjusted based on the acquired power of the first battery, the second battery and the third battery. If yes, execute S103, otherwise, return to execute S101.

[0175] For example, when there are two battery power difference values greater than or equal to the first threshold value among the first battery, the second battery and the third battery, it is determined that the charging current of the battery needs to be adjusted, otherwise, it is determined that the charging current of the battery does not need to be adjusted. Here, the difference value refers to the absolute value of the difference value, and the first threshold value can be 1%, 2%, 5%, 10% or other values.

[0176] For example, if the first threshold value is 5%, the power of the first battery is 50%, the power of the second battery is 48%, and the power of the third battery is 44%, since the first battery and the second battery power difference value is 2%, the first battery and the third battery power difference value is 6%, and the second battery and the third battery power difference value is 4%, there is a first battery and a third battery power difference value of 6% greater than 5%, so it is determined that the charging current of the battery needs to be adjusted.

[0177] For example, if the first threshold value is 2%, the power of the first battery is 50%, the power of the second battery is 48%, and the power of the third battery is 44%, since the first battery and the second battery power difference value is 2%, the first battery and the third battery power difference value is 6%, and the second battery and the third battery power difference value is 4%, these power difference values are not greater than 2%, so it is determined that the charging current of the battery needs to be adjusted.

[0178] For example, the processor can compare the electric quantity of the other batteries with the electric quantity of the battery with the largest capacity, and if there is a battery with an electric quantity difference from the battery with the largest capacity greater than or equal to a second threshold value, it is determined that the charging current of the battery needs to be adjusted, that is, S103 is continued to be executed; otherwise, S101 is returned to be executed. Here, the difference refers to the absolute value of the difference, and the second threshold value can be 1%, 2%, 5%, 10% or other values. Alternatively, the charging current of the battery other than the battery with the largest capacity can be adjusted, or the charging current of all the batteries can be adjusted.

[0179] For example, if the second battery is the battery with the largest capacity, the second threshold value is 5%, the electric quantity of the first battery is 50%, the electric quantity of the second battery is 48%, and the electric quantity of the third battery is 44%, since the electric quantity difference between the first battery and the second battery is 2%, which is less than 5%, and the electric quantity difference between the third battery and the second battery is 4%, which is also less than 5%, it is determined that the charging current of the battery does not need to be adjusted.

[0180] S103, the processor determines the target charging current of the first battery, the second battery and the third battery based on the electric quantity of the first battery, the second battery and the third battery and the current charging current value of the first battery, the second battery and the third battery.

[0181] In the first implementation of S103, when three batteries are included in the electronic device, the processor can reduce the charging current corresponding to the battery with a large electric quantity, increase the charging current corresponding to the battery with a small electric quantity, and keep the charging current corresponding to the battery with a medium electric quantity unchanged.

[0182] For example, taking the electric quantity of the first battery > the electric quantity of the second battery > the electric quantity of the third battery as an example, the processor can determine the target charging current of the first battery as the product of the current charging current value of the first battery and a first value, and the first value is a positive number less than 1, such as 0.9. The processor can determine the target charging current of the third battery as the product of the current charging current value of the third battery and a second value, and the second value is a positive number greater than 1, such as 1.1.

[0183] The first value can be determined based on the difference between the electric quantity of the first battery and the electric quantity of the second battery, and the larger the difference, the smaller the first value. Similarly, the second value can be determined based on the difference between the electric quantity of the third battery and the electric quantity of the second battery, and the larger the difference, the smaller the second value. The processor can store the correspondence between the difference and the first value, and the correspondence between the difference and the second value, and then calculate the target charging current of the first battery using the first value corresponding to the difference between the electric quantity of the first battery and the electric quantity of the second battery, and calculate the target charging current of the third battery using the second value corresponding to the difference between the electric quantity of the third battery and the electric quantity of the second battery.

[0184] In the second implementation of S103, the processor can also not adjust the charging current of the battery with the largest capacity, but adjust the charging current of the other batteries except the battery with the largest capacity. Taking the second battery as an example, the processor can compare the electric quantity of the first battery, the electric quantity of the third battery with the electric quantity of the second battery respectively. When the electric quantity of the first battery is less than the electric quantity of the second battery, the processor can determine the target charging current of the first battery as the product of the current charging current value of the first battery and a third value, and the third value is a positive number less than 1, for example, 0.9. When the electric quantity of the first battery is greater than the electric quantity of the second battery, the processor can determine the target charging current of the first battery as the product of the current charging current value of the first battery and a fourth value, and the fourth value is a positive number greater than 1, for example, 1.1. Here, taking the first battery as an example, the determination method of the target charging current of the third battery is the same as that of the first battery, which will not be described herein.

[0185] In the first implementation of S103, the third value can be determined based on the difference between the electric quantity of the first battery and the electric quantity of the second battery, and the greater the difference, the smaller the third value. Similarly, the fourth value can be determined based on the difference between the electric quantity of the first battery and the electric quantity of the second battery, and the greater the difference, the smaller the fourth value. The processor can store the corresponding relationship between the difference and the ratio, and then calculate the target charging current of the first battery using the ratio corresponding to the difference between the electric quantity of the first battery and the electric quantity of the second battery, and calculate the target charging current of the third battery using the ratio corresponding to the difference between the electric quantity of the third battery and the electric quantity of the second battery.

[0186] In S104, the processor determines the first resistance value of the first switch element, the third resistance value of the third switch element, and the fifth resistance value of the fifth switch element based on the target charging currents of the first battery, the second battery and the third battery respectively.

[0187] The processor can receive the voltage values at A1 point, A2 point, A3 point and B point sent by the charging chip, and further, based on the voltage values at A1 point, A2 point, A3 point and B point, the known resistance values of the second switch element, the fourth switch element and the sixth switch element when conducting, and the target charging currents of the first battery, the second battery and the third battery, the required resistance values of the first switch element, the third switch element and the fifth switch element are calculated respectively, which are also referred to as the first resistance value, the third resistance value and the fifth resistance value.

[0188] Further, the processor can send the first resistance value to the first controller, the third resistance value to the third controller, and the fifth resistance value to the fifth controller, that is, execute S105-S107 as follows. Alternatively, when the charging current of the second battery does not need to be adjusted, S106 can also not be executed, and the third resistance value is not sent to the third controller.

[0189] S105, the processor sends the first resistance value to the first controller. The first resistance value is the resistance size that the first switch element needs to adjust to.

[0190] Further, after the first controller determines that the voltage of the first conduction end of the first switch element Q1 is greater than the voltage of the second conduction end based on the comparison result of the first comparator, the first controller determines the duty cycle P1 corresponding to the first resistance value based on the stored correspondence between the resistance and the duty cycle, and then outputs a PWM signal (also referred to as PWM1) with the duty cycle P1 to the first DAC. The first DAC processes the PWM1 to obtain a first signal, and the first signal controls the first switch element to work in the linear region and makes the resistance of the first switch element be the first resistance value, so as to adjust the charging current of the first battery, so that the charging current of the first battery is the target charging current of the first battery or is closer to the target charging current of the first battery.

[0191] Optionally, the processor can also send the first resistance value to the second controller or not send the first resistance value. After the second controller determines that the voltage of the first conduction end of the second switch element Q2 is less than the voltage of the second conduction end based on the comparison result of the second comparator, the second controller outputs a PWM signal (also referred to as PWM2) with a preset duty cycle to the second DAC. The second DAC processes the PWM2 to obtain a second signal, and the second signal controls the second switch element to work in the full conduction region.

[0192] S106, the processor sends the third resistance value to the third controller. The third resistance value is the resistance size that the third switch element needs to adjust to.

[0193] Further, after the third controller determines that the voltage of the first conduction end of the third switch element Q3 is greater than the voltage of the second conduction end based on the comparison result of the third comparator, the third controller determines the duty cycle P2 corresponding to the third resistance value based on the stored correspondence between the resistance and the duty cycle, and then outputs a PWM signal (also referred to as PWM3) with the duty cycle P2 to the third DAC. The third DAC processes the PWM3 to obtain a third signal, and the third signal controls the third switch element Q3 to work in the linear region and makes the resistance of the third switch element Q3 be the third resistance value, so as to adjust the charging current of the second battery, so that the charging current of the second battery is the target charging current of the second battery or is closer to the target charging current of the second battery.

[0194] Optionally, the processor can further send the third resistance value or not send the third resistance value to the fourth controller, and the fourth controller outputs a PWM signal (also referred to as PWM4) with a preset duty cycle to the fourth DAC after determining that the voltage of the first conduction end of the fourth switch element Q4 is less than the voltage of the second conduction end based on the comparison result of the fourth comparator. The fourth DAC processes the PWM4 to obtain a fourth signal, and the fourth signal controls the fourth switch element Q4 to work in the full conduction zone.

[0195] In S107, the processor sends a fifth resistance value to the fifth controller. The fifth resistance value is the resistance size that the fifth switch element needs to adjust to.

[0196] Further, the fifth controller determines the duty cycle P3 corresponding to the fifth resistance value based on the stored correspondence between the resistance and the duty cycle after determining that the voltage of the first conduction end of the fifth switch element Q5 is greater than the voltage of the second conduction end based on the comparison result of the fifth comparator, and then outputs a PWM signal (also referred to as PWM5) with a duty cycle of P3 to the fifth DAC. The fifth DAC processes the PWM5 to obtain a fifth signal, and the fifth signal controls the fifth switch element Q5 to work in the linear zone and makes the resistance of the fifth switch element Q5 be the fifth resistance value, so as to adjust the charging current of the third battery, so that the charging current of the third battery is the target charging current of the third battery or closer to the target charging current of the third battery.

[0197] Optionally, the processor can further send the fifth resistance value or not send the fifth resistance value to the sixth controller, and the sixth controller outputs a PWM signal (also referred to as PWM6) with a preset duty cycle to the sixth DAC after determining that the voltage of the first conduction end of the sixth switch element Q6 is less than the voltage of the second conduction end based on the comparison result of the sixth comparator. The sixth DAC processes the PWM6 to obtain a sixth signal, and the sixth signal controls the sixth switch element Q6 to work in the full conduction zone.

[0198] It should be noted that the above S101 can be triggered at a certain time, and the above S101-S106 can be executed cyclically, so that the first battery, the second battery and the third battery can be fully charged at the same time.

[0199] For the multi-battery charging and discharging circuit shown in FIG. 3, the processor can send the target charging current of the first battery to the first controller and send the target charging current of the third battery to the fifth controller. For specific implementation, refer to the above S104 and S106, which will not be described here.

[0200] (II) Discharge control method

[0201] As shown in the circuit schematic diagram during discharging in FIG. 8 and the flowchart of the discharge control method in FIG. 9, the discharge control method can include but not limited to the following part or all steps:

[0202] S201, when the electronic device is in a discharging state, the processor acquires the discharging current of the first battery, the discharging current of the second battery and the discharging current of the third battery, and acquires the power of the first battery, the power of the second battery and the power of the third battery.

[0203] The processor can periodically, for example, every 5s, 10s or 30s, etc., acquire the discharging current of the first battery, the discharging current of the second battery and the discharging current of the third battery through the charging chip, and acquire the power of the first battery, the power of the second battery and the power of the third battery.

[0204] S202, the processor determines whether the discharging current of the battery needs to be adjusted based on the acquired power of the first battery, the second battery and the third battery. If yes, S203 is executed, otherwise, S201 is executed.

[0205] For example, when the difference between the powers of two of the first battery, the second battery and the third battery is greater than or equal to a third threshold value, it is determined that the discharging current of the battery needs to be adjusted, otherwise, it is determined that the discharging current of the battery does not need to be adjusted. Here, the difference refers to the absolute value of the difference, and the third threshold value can be 1%, 2%, 5%, 10% or other values.

[0206] For another example, when the power difference between any two of the first battery, the second battery and the third battery is greater than or equal to the third threshold value, it is determined that the discharging current of the battery needs to be adjusted, otherwise, it is determined that the discharging current of the battery does not need to be adjusted. Here, the difference refers to the absolute value of the difference.

[0207] For another example, the power of the battery with the largest capacity can be taken as a reference to compare the power of other batteries with the power of the battery with the largest capacity. If there is a battery in the other batteries whose power difference from the battery with the largest capacity is greater than or equal to a fourth threshold value, it is determined that the discharging current of the battery needs to be adjusted, and S203 is continued to be executed, otherwise, S201 is returned to be executed. Here, the difference refers to the absolute value of the difference, and the fourth threshold value can be 1%, 2%, 5%, 10% or other values. Alternatively, the discharging current of the battery other than the battery with the largest capacity can be adjusted, or the discharging current of all the batteries can be adjusted.

[0208] For another example, for the circuit shown in FIG. 3, the processor can adjust the discharging current of the first battery, and does not adjust the discharging current of the second battery and the third battery. At this time, when the power difference between the first battery and the second battery is greater than a fifth threshold value, such as 2%, 5%, 10% or other values, it can be determined that the discharging current of the battery needs to be adjusted, otherwise, it is determined that the discharging current of the battery does not need to be adjusted.

[0209] S203, the processor determines the target discharge current of the first battery, the second battery and the third battery based on the electric quantity of the first battery, the second battery and the third battery, and the current discharge current value of the first battery, the second battery and the third battery.

[0210] In the first implementation of S203, when three batteries are included in the electronic device, the processor can increase the discharge current corresponding to the battery with large electric quantity, decrease the discharge current corresponding to the battery with small electric quantity, and keep the discharge current corresponding to the battery with medium electric quantity unchanged.

[0211] For example, taking the electric quantity of the first battery > the electric quantity of the second battery > the electric quantity of the third battery as an example, the processor can determine the target discharge current of the first battery as the product of the current discharge current value of the first battery and a fifth value, and the fifth value is a positive number greater than 1, such as 1.2. The processor can determine the target discharge current of the third battery as the product of the current discharge current value of the third battery and a sixth value, and the sixth value is a positive number less than 1, such as 0.8.

[0212] The fifth value can be determined based on the difference between the electric quantity of the first battery and the electric quantity of the second battery, and the larger the difference, the larger the fifth value. Similarly, the sixth value can be determined based on the difference between the electric quantity of the third battery and the electric quantity of the second battery, and the larger the difference, the smaller the sixth value. The processor can store the corresponding relationship between the difference and the fifth value, and the corresponding relationship between the difference and the sixth value, and then use the fifth value corresponding to the difference between the electric quantity of the first battery and the electric quantity of the second battery to calculate the target discharge current of the first battery, and use the sixth value corresponding to the difference between the electric quantity of the third battery and the electric quantity of the second battery to calculate the target discharge current of the third battery.

[0213] In the second implementation of S203, the processor can also not adjust the discharge current of the battery with the largest capacity, but adjust the discharge current of the other batteries except the battery with the largest capacity. Taking the second battery as the battery with the largest capacity as an example, the electric quantity of the first battery and the electric quantity of the third battery can be compared with the electric quantity of the second battery at this time. At this time, when the electric quantity of the first battery is less than the electric quantity of the second battery, the processor can determine the target discharge current of the first battery as the product of the current discharge current value of the first battery and a seventh value, and the seventh value is a positive number greater than 1, such as 1.1. When the electric quantity of the first battery is greater than the electric quantity of the second battery, the processor can determine the target discharge current of the first battery as the product of the current discharge current value of the first battery and an eighth value, and the eighth value is a positive number less than 1, such as 0.9. Here, taking the first battery as an example, the determination method of the target discharge current of the third battery is the same as that of the first battery, which will not be described here.

[0214] In the first implementation of S203, the seventh value can be determined based on the difference between the first battery's capacity and the second battery's capacity. The greater the difference, the smaller the seventh value. Similarly, the fourth value can be determined based on the difference between the first battery's capacity and the second battery's capacity. The greater the difference, the greater the eighth value. The processor can store the correspondence between the difference and the ratio, and then calculate the target discharge current of the first battery using the ratio corresponding to the difference between the first battery's capacity and the second battery's capacity, and calculate the target discharge current of the third battery using the ratio corresponding to the difference between the third battery's capacity and the second battery's capacity.

[0215] In the third implementation of S203, the processor can also not adjust the discharge current of the battery with the largest capacity, and not adjust the discharge current of the battery with the largest line resistance, but adjust the batteries other than the two batteries.

[0216] As shown in FIG. 3, the multi-battery charging and discharging circuit. Taking the second battery as the battery with the largest capacity and the third battery as the battery with the largest line resistance as an example. At this time, the first battery's capacity can be compared with the second battery's capacity. At this time, when the first battery's capacity is less than the second battery's capacity, the processor can reduce the first battery's discharge current, and when the first battery's capacity is greater than the second battery's capacity, the processor can increase the first battery's discharge current.

[0217] S204, determining the second resistance value of the second switch element, the fourth resistance value of the fourth switch element, and the sixth resistance value of the sixth switch element based on the target charging currents of the first battery, the second battery, and the third battery, respectively.

[0218] The processor can receive the voltage values at A1 point, A2 point, A3 point, and B point sent by the charging chip, further based on the voltage values at A1 point, A2 point, A3 point, and B point, the known resistance values of the first switch element Q1, the third switch element Q3, and the fifth switch element Q5 when conducting, and the target discharge currents of the first battery 161, the second battery 162, and the third battery 163, respectively calculate the required resistance of the second switch element Q2, the fourth switch element Q4, and the sixth switch element Q6, also respectively referred to as the second resistance value, the fourth resistance value, and the sixth resistance value.

[0219] Further, the processor can also send the second resistance value to the second controller, send the fourth resistance value to the fourth controller, and send the sixth resistance value to the sixth controller, that is, execute S205-S207 as follows. Alternatively, when the second battery's discharge current does not need to be adjusted, S206 can also not be executed, and the fourth resistance value is not sent to the fourth controller.

[0220] S205, the processor sends the second resistance value to the second controller. The second resistance value is the resistance size that the second switch element needs to adjust to.

[0221] Further, the second controller determines, after determining that the voltage of the first conduction end of the second switch element Q2 is greater than the voltage of the second conduction end based on the comparison result of the second comparator, a duty cycle P4 corresponding to the second resistance value based on the stored correspondence between the resistance and the duty cycle, and then outputs a PWM signal (also referred to as PWM7) with the duty cycle P4 to the second DAC. The second DAC processes the PWM7 to obtain a seventh signal, and the seventh signal controls the second switch element Q2 to work in the linear region and makes the resistance of the second switch element be the second resistance value, so as to adjust the discharge current of the first battery and make the discharge current of the first battery be the target discharge current of the first battery or closer to the target discharge current of the first battery.

[0222] Optionally, the processor can also send the second resistance value or not send the second resistance value to the first controller, and the first controller outputs a PWM signal (also referred to as PWM8) with a preset duty cycle to the first DAC after determining that the voltage of the first conduction end of the first switch element Q1 is less than the voltage of the second conduction end based on the comparison result of the first comparator. The first DAC processes the PWM8 signal to obtain an eighth signal, and at this time, the eighth signal controls the first switch element Q1 to work in the fully on region.

[0223] S206, the processor sends the fourth resistance value to the fourth controller. The fourth resistance value is the resistance size that the fourth switch element needs to adjust to.

[0224] Further, the fourth controller determines, after determining that the voltage of the first conduction end of the fourth switch element Q4 is greater than the voltage of the second conduction end based on the comparison result of the fourth comparator, a duty cycle P3 corresponding to the fourth resistance value based on the stored correspondence between the resistance and the duty cycle, and then outputs a PWM signal (also referred to as PWM9) with the duty cycle P5 to the fourth DAC. The fourth DAC processes the PWM9 to obtain a ninth signal, and the ninth signal controls the fourth switch element Q4 to work in the linear region and makes the resistance of the fourth switch element be the fourth resistance value, so as to adjust the discharge current of the second battery and make the discharge current of the second battery be the target discharge current of the second battery or closer to the target discharge current of the second battery.

[0225] Optionally, the processor can also send the fourth resistance value or not send the fourth resistance value to the third controller, and the third controller outputs a PWM signal (also referred to as PWM10) with a preset duty cycle to the third DAC after determining that the voltage of the first conduction end of the third switch element Q3 is less than the voltage of the second conduction end based on the comparison result of the third comparator. The third DAC processes the PWM4 to obtain a tenth signal, and the tenth signal controls the fourth switch element Q3 to work in the fully on region.

[0226] S207, the processor sends a sixth resistance value to the sixth controller. The sixth resistance value is a resistance size that the sixth switch element needs to adjust to.

[0227] Further, after the sixth controller determines that the voltage of the first conduction end of the sixth switch element Q6 is greater than the voltage of the second conduction end based on the comparison result of the sixth comparator, the sixth controller determines the duty cycle P6 corresponding to the sixth resistance value based on the stored correspondence between the resistance and the duty cycle, and then outputs a PWM signal (also referred to as PWM11) with the duty cycle P6 to the sixth DAC. The sixth DAC processes the PWM11 to obtain an eleventh signal, and the eleventh signal controls the sixth switch element Q6 to work in the linear region and makes the resistance of the sixth switch element be the sixth resistance value, so as to adjust the discharge current of the third battery, and make the discharge current of the third battery be the target discharge current of the third battery or be closer to the target discharge current of the third battery.

[0228] Optionally, the processor can also send the sixth resistance value to the fifth controller or not send the sixth resistance value, and after the fifth controller determines that the voltage of the first conduction end of the fifth switch element Q5 is less than the voltage of the second conduction end based on the comparison result of the fifth comparator, the fifth controller outputs a PWM signal (also referred to as PWM12) with a preset duty cycle to the fifth DAC. The fifth DAC processes the PWM12 to obtain a twelfth signal, and the twelfth signal controls the fifth switch element Q5 to work in the fully on region.

[0229] It should be noted that the above S201 can be triggered at a certain time, and the above S201-S206 are cyclically executed, so that the first battery, the second battery and the third battery can be fully charged at the same time.

[0230] For the multi-battery charging and discharging circuit shown in FIG. 3, the processor can send the target discharge current of the first battery to the first controller. For specific implementation, refer to the above S204 and S206, which will not be described here.

[0231] It should be understood that each step in the above method embodiments provided by the present application can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor.

[0232] The present application also provides a computer program product, which comprises a computer program (also referred to as code or instructions), which, when executed, causes a computer to execute the method performed by the controller or the processor in any one of the above embodiments.

[0233] The application also provides a computer readable storage medium, which stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer performs the method executed by the controller or the processor in any one of the above embodiments.

[0234] The embodiments of the application can be combined in any manner to achieve different technical effects.

[0235] In the above embodiments, all or part of the embodiments can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiments can be realized in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk) and the like.

[0236] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments can be implemented by a computer program to instruct the relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The storage medium includes ROM or random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.

[0237] In summary, the above is only an embodiment of the technical scheme of the application, and is not used to limit the protection scope of the application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the application shall be included in the protection scope of the application.

Claims

1. A multi-battery charge-discharge circuit applied to an electronic device having a plurality of batteries, characterized by comprising: The multi-battery charging and discharging circuit comprises a processor, a USB interface, a charging chip, a first battery, a second battery, a first controller and a first switching element, the first battery is connected to the charging chip through the first switching element, and the second battery is connected to the charging chip; the charging chip is connected to the USB interface, and the processor is connected to the charging chip and the first controller; The charging chip is configured to charge the first battery and the second battery by using the electric energy received from the USB interface; The processor is configured to determine a first resistance value of the first switching element based on the electric quantity of the first battery and the electric quantity of the second battery when the electronic device is in a charging state, and send the first resistance value to the first controller; The first controller is configured to adjust the resistance of the first switching element to the first resistance value, so that the difference between the electric quantity of the first battery and the electric quantity of the second battery after adjustment is reduced.

2. The multi-cell charge and discharge circuit of claim 1, wherein, The circuit further comprises a first comparator and a first digital-to-analog converter (DAC), and the first switching element comprises a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the first switching element are connected to the charging chip and the first end of the first battery respectively; The first comparator is connected to the first conduction end and the second conduction end of the first switching element, configured to compare the voltages of the first conduction end and the second conduction end of the first switching element, and send the comparison result of the first comparator to the first controller; The first controller is specifically configured to determine a first duty cycle based on the received first resistance value when the voltage of the first conduction end of the first switching element is greater than the voltage of the second conduction end of the first switching element, output a pulse signal of the first duty cycle to the first DAC, and output a pulse signal of a first preset duty cycle to the first DAC when the voltage of the first conduction end of the first switching element is less than the voltage of the second conduction end of the first switching element; The first DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the first duty cycle is used as an input to the control end of the first switching element to control the first switching element to work in a linear region, and the resistance of the first switching element is controlled to be the first resistance value; The analog signal converted from the pulse signal of the first preset duty cycle is used as an input to the control end of the first switching element to control the first switching element to work in a fully conductive region.

3. The multi-cell charge and discharge circuit according to claim 1 or 2, wherein The circuit further comprises a second controller and a second switching element, the first battery is connected to the charging chip through the first switching element and the second switching element, and the first switching element and the second switching element are connected in reverse series; The processor is further connected to the second controller; The processor is further configured to determine a second resistance value of the second switching element based on the electric quantity of the first battery and the electric quantity of the second battery when the electronic device is in a discharging state, and send the second resistance value to the second controller; The second controller is configured to adjust the resistance of the second switch element to the second resistance value, so that the difference between the electric quantity of the first battery and the electric quantity of the second battery is reduced.

4. The multi-cell charge and discharge circuit of claim 3, wherein, The circuit further comprises a second comparator and a second DAC, and the second switch element comprises a first conduction terminal, a second conduction terminal and a control terminal; the first conduction terminal and the second conduction terminal of the second switch element are connected to the first terminal of the first battery and the second conduction terminal of the first switch element respectively; The second comparator is connected to the first conduction terminal and the second conduction terminal of the second switch element, and is configured to compare the voltages of the first conduction terminal and the second conduction terminal of the second switch element, and send the comparison result of the second comparator to the second controller; The second controller is specifically configured to, when the voltage of the first conduction terminal of the second switch element is greater than the voltage of the second conduction terminal of the first switch element, determine a second duty cycle based on the received second resistance value, output a pulse signal of the second duty cycle to the second DAC, and when the voltage of the first conduction terminal of the second switch element is less than the voltage of the second conduction terminal of the first switch element, output a pulse signal of a second preset duty cycle to the second DAC; The second DAC is configured to convert the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the second duty cycle is used as an input to the control terminal of the second switch element to control the second switch element to work in a linear region, and control the resistance of the second switch element to be the second resistance value; The analog signal converted from the pulse signal of the second preset duty cycle is used as an input to the control terminal of the second switch element to control the second switch element to work in a full conduction region.

5. The multi-cell charge and discharge circuit according to claim 3 or 4, wherein The circuit further comprises a third controller, a third switch element, a fourth controller and a fourth switch element, and the second battery is connected to the charging chip through the third switch element and the fourth switch element, and the third switch element and the fourth switch element are connected in reverse series; The processor is further connected to the third controller and the fourth controller; The processor is further configured to, when the electronic device is in a charging state, determine a third resistance value of the third switch element based on the electric quantity of the first battery and the electric quantity of the second battery, and send the third resistance value to the third controller; or, when the electronic device is in a discharging state, determine a fourth resistance value of the fourth switch element based on the electric quantity of the first battery and the electric quantity of the second battery, and send the fourth resistance value to the fourth controller; The third controller is configured to adjust the resistance of the third switch element to the third resistance value, so that the difference between the electric quantity of the first battery and the electric quantity of the second battery is reduced; The fourth controller is configured to adjust the resistance of the fourth switch element to the fourth resistance value, so that the difference between the electric quantity of the first battery and the electric quantity of the second battery is reduced.

6. The multi-cell charge and discharge circuit of claim 5, wherein, The circuit further comprises a third comparator and a third DAC, the third switch element comprises a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the third switch element are connected to the charging chip and the first end of the second battery respectively; The third comparator is connected to the first conduction end and the second conduction end of the third switch element, and is used for comparing the voltage of the first conduction end and the second conduction end of the third switch element, and sending the comparison result of the third comparator to the third controller; The third controller is specifically used for determining a third duty ratio based on the received third resistance value when the voltage of the first conduction end of the third switch element is greater than the voltage of the second conduction end of the third switch element, outputting a pulse signal of the third duty ratio to the third DAC, and outputting a pulse signal of a third preset duty ratio to the third DAC when the voltage of the first conduction end of the third switch element is less than the voltage of the second conduction end of the third switch element; The third DAC is used for converting the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the third duty ratio is used for inputting into the control end of the third switch element to control the third switch element to work in a linear region, and the resistance of the third switch element is controlled to be the third resistance value; the analog signal converted from the pulse signal of the third preset duty ratio is used for inputting into the control end of the third switch element to control the third switch element to work in a full conduction region.

7. The multi-cell charge and discharge circuit according to claim 5 or 6, wherein The circuit further comprises a fourth comparator and a fourth DAC, the fourth switch element comprises a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the fourth switch element are connected to the first end of the second battery and the second conduction end of the third switch element respectively; The fourth comparator is connected to the first conduction end and the second conduction end of the fourth switch element, and is used for comparing the voltage of the first conduction end and the second conduction end of the fourth switch element, and sending the comparison result of the fourth comparator to the fourth controller; The fourth controller is specifically used for determining a fourth duty ratio based on the received fourth resistance value when the voltage of the first conduction end of the fourth switch element is greater than the voltage of the second conduction end of the fourth switch element, outputting a pulse signal of the fourth duty ratio to the fourth DAC, and outputting a pulse signal of a fourth preset duty ratio to the fourth DAC when the voltage of the first conduction end of the fourth switch element is less than the voltage of the second conduction end of the fourth switch element; The fourth DAC is used for converting the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the fourth duty ratio is used for inputting into the control end of the fourth switch element to control the fourth switch element to work in a linear region, and the resistance of the fourth switch element is controlled to be the fourth resistance value; the pulse signal of the fourth preset duty ratio is used for inputting into the control end of the fourth switch element to control the fourth switch element to work in a full conduction region.

8. The multi-cell charge and discharge circuit according to any one of claims 5 to 7, wherein The circuit further comprises a third battery, a fifth controller and a fifth switching element, the third battery is connected to the charging chip through the fifth switching element, and the processor is further connected to the fifth controller; The processor is further configured to, when the electronic device is in a charging state, determine, based on the electric quantity of the first battery, the electric quantity of the second battery and the electric quantity of the third battery, the first resistance value, the third resistance value and a fifth resistance value of the fifth switching element, and send the fifth resistance value to the fifth controller; The fifth controller is configured to adjust the resistance of the fifth switching element to the fifth resistance value, and after the adjustment, the difference between the electric quantity of the third battery and the electric quantity of the first battery or the second battery is reduced.

9. The multi-cell charge and discharge circuit of claim 8, wherein, The circuit further comprises a fifth comparator and a fifth DAC, and the fifth switching element comprises a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the fifth switching element are connected to the charging chip and the first end of the third battery respectively; The fifth comparator is connected to the first conduction end and the second conduction end of the fifth switching element, configured to compare the voltages of the first conduction end and the second conduction end of the fifth switching element, and send the comparison result of the fifth comparator to the fifth controller; The fifth controller is specifically configured to, when the voltage of the first conduction end of the fifth switching element is greater than the voltage of the second conduction end of the fifth switching element, determine a fifth duty cycle based on the received fifth resistance value, output a pulse signal of the fifth duty cycle to the fifth DAC, and when the voltage of the first conduction end of the fifth switching element is less than the voltage of the second conduction end of the fifth switching element, output a pulse signal of a fifth preset duty cycle to the fifth DAC; The fifth DAC is configured to convert the input pulse signal into an analog signal; and the analog signal converted from the pulse signal of the fifth duty cycle is used as an input to the control end of the fifth switching element to control the fifth switching element to work in a linear region and control the resistance of the fifth switching element to be the fifth resistance value; The pulse signal of the fifth preset duty cycle is used as an input to the control end of the fifth switching element to control the fifth switching element to work in a fully on region.

10. The multi-cell charge and discharge circuit according to claim 8 or 9, wherein The circuit further comprises a sixth controller and a sixth switching element, the third battery is connected to the charging chip through the fifth switching element and the sixth switching element, and the fifth switching element and the sixth switching element are connected in reverse series, and the processor is further connected to the sixth controller; The processor is configured to, when the electronic device is in a discharging state, determine, based on the electric quantity of the first battery, the electric quantity of the second battery and the electric quantity of the third battery, a sixth resistance value of the sixth switching element, and send the sixth resistance value to the sixth controller; The sixth controller is configured to adjust the resistance of the sixth switching element to the sixth resistance value, and after the adjustment, the difference between the electric quantity of the third battery and the electric quantity of the first battery or the second battery is reduced.

11. The multi-cell charge and discharge circuit of claim 10, wherein, The circuit further comprises a sixth comparator and a sixth DAC, the sixth switch element comprises a first conduction end, a second conduction end and a control end; the first conduction end and the second conduction end of the sixth switch element are connected with the first end of the third battery and the second conduction end of the fifth switch element respectively; The sixth comparator is connected with the first conduction end and the second conduction end of the sixth switch element, and is used for comparing the voltage of the first conduction end and the second conduction end of the sixth switch element, and sending the comparison result of the sixth comparator to the sixth controller; The sixth controller is specifically used for, when the voltage of the first conduction end of the sixth switch element is greater than the voltage of the second conduction end of the sixth switch element, determining a sixth duty ratio based on the received sixth resistance value, outputting a pulse signal of the sixth duty ratio to the sixth DAC, and outputting a pulse signal of a sixth preset duty ratio to the sixth DAC when the voltage of the first conduction end of the sixth switch element is less than the voltage of the second conduction end of the sixth switch element; The sixth DAC is used for converting the input pulse signal into an analog signal; the analog signal converted from the pulse signal of the sixth duty ratio is used for inputting into the control end of the sixth switch element to control the sixth switch element to work in a linear region, and the resistance of the sixth switch element is the sixth resistance value; The pulse signal of the sixth preset duty ratio is used for inputting into the control end of the sixth switch element to control the sixth switch element to work in a full conduction region.

12. The multi-battery charging and discharging circuit of any one of claims 8-11, wherein The processor is further used for, when the electronic device is in a charging state, judging whether the charging current of the battery needs to be adjusted based on the electric quantity of the first battery, the electric quantity of the second battery and the electric quantity of the third battery; When the adjustment is needed, the first resistance value, the third resistance value and the fifth resistance value are determined based on the electric quantity of the first battery, the electric quantity of the second battery, the electric quantity of the third battery, the current charging current value of the first battery, the current charging current value of the second battery and the current charging current value of the third battery.

13. The multi-cell charge and discharge circuit of claim 12, wherein, The processor is further used for: When the electric quantity of the first battery is greater than the electric quantity of the second battery, and the electric quantity of the second battery is greater than the electric quantity of the third battery, determining that the target charging current of the first battery is less than the current charging current value of the first battery, determining that the target charging current of the third battery is greater than the current charging current value of the third battery, and determining that the target charging current of the second battery is equal to the current charging current value of the second battery; determining the first resistance value based on the target charging current of the first battery; determining the third resistance value based on the target charging current of the second battery; determining the fifth resistance value based on the target charging current of the third battery.

14. The multi-battery charging and discharging circuit of any one of claims 10-11, wherein The processor is further configured to determine whether to adjust the discharging current of the batteries based on the first battery level, the second battery level and the third battery level when the electronic device is in the discharging state; When adjustment is needed, the second resistance value, the fourth resistance value and the sixth resistance value are determined based on the first battery level, the second battery level, the third battery level, the current discharging current value of the first battery, the current discharging current value of the second battery and the current discharging current value of the third battery.

15. The multi-cell charge and discharge circuit of claim 14, wherein, The processor is further configured to: determine that the target discharging current of the first battery is greater than the current discharging current value of the first battery when the first battery level is greater than the second battery level and the second battery level is greater than the third battery level; determine that the target discharging current of the third battery is less than the current discharging current value of the third battery; determine that the target discharging current of the second battery is equal to the current discharging current value of the second battery; determine the second resistance value based on the target discharging current of the first battery; determine the fourth resistance value based on the target discharging current of the second battery; determine the sixth resistance value based on the target discharging current of the third battery.

16. An electronic device, comprising: A multi-battery charging and discharging circuit comprising any one of claims 1-15.

Citation Information

Patent Citations

  • Multi-battery charging control device and electronic equipment

    CN116316930A

  • Charging method, charging circuit and electronic equipment

    CN117375139A

  • Method of controlling plurality of batteries and electronic device to which the same is applied

    US20200266499A1