A battery charging and discharging circuit and electronic device

By employing a battery charging and discharging circuit in a distributed energy storage system, and utilizing switch state switching and unidirectional current flow, the problem of system shutdown caused by overcharging of the energy storage battery is solved. This enables the battery to provide normal power supply and feedback functions, reduces the risk of system shutdown, and saves costs.

CN122137039APending Publication Date: 2026-06-02SUNWODA ENERGY TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUNWODA ENERGY TECHNOLOGY CO LTD
Filing Date
2026-02-03
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In distributed energy storage systems, the detection accuracy of energy storage batteries is low when the current is small, making it difficult to accurately control the charging power. This can lead to overcharging, triggering the protection mechanism, causing the system to shut down and preventing it from supplying power to the load or feeding back to the grid.

Method used

The battery charging and discharging circuit includes a main circuit, a first circuit, and a control unit. By controlling the state switching of the switch and the unidirectional flow of current, it ensures that the battery discharges instead of charging when it is about to be overcharged, thus avoiding system shutdown.

Benefits of technology

This technology prevents system shutdown when the battery is about to overcharge, ensuring that the battery can supply power to the load or feed back to the grid normally, reducing the risk of system shutdown and saving costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122137039A_ABST
    Figure CN122137039A_ABST
Patent Text Reader

Abstract

This application provides a battery charging and discharging circuit and electronic device, relating to the field of energy storage battery technology. The battery charging and discharging circuit includes a main circuit, a first circuit, and a control unit. The main circuit includes a first switch for controlling charging and discharging, and the first circuit is connected in parallel with the first switch. The first circuit includes a second switch and a first unit, which are connected in series in the first circuit. The control unit is used to control the second switch to close and the first switch to open when the battery voltage exceeds a first threshold. The first unit controls unidirectional current flow; when the second switch is closed and the first switch is open, the first unit is on if the battery is discharging, and off if the battery is charging. This ensures that the distributed energy storage system does not shut down when the battery is about to overcharge or even overcharged, allowing the battery to normally supply power to the load or feed back to the grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of energy storage battery technology, and in particular to a circuit and electronic device for charging and discharging a battery. Background Technology

[0002] In distributed energy storage systems, such as those combining photovoltaic (PV) converters and grid converters, the energy storage battery needs to work in conjunction with both PV and grid converters to achieve bidirectional energy flow (charging and discharging). For example, during the day when PV resources are abundant, the system needs to store excess electricity in the energy storage battery through the PV converter; while at night or when load demand is high, the energy storage battery supplies power to the load or feeds back to the grid through the grid converter.

[0003] Currently, distributed energy storage systems rely on the current detection accuracy of converters to control charging power. However, when the current is low, the current detection accuracy of distributed energy storage systems is low, and it is difficult to accurately control the charging power. This can cause the energy storage battery to trigger the protection mechanism due to overcharging, resulting in the shutdown of the entire distributed energy storage system. Consequently, the energy storage battery cannot supply power to the load or feed back to the grid. Summary of the Invention

[0004] This application provides a circuit and electronic device for charging and discharging a battery, so as to enable the energy storage battery to normally supply power to the load or feed back to the grid when it is about to be overcharged or even overcharged.

[0005] In a first aspect, this application provides a battery charging and discharging circuit, comprising: a main circuit for battery charging and discharging, a first circuit, and a control unit, wherein:

[0006] The main circuit includes a first switch for controlling charging and discharging, and a first circuit connected in parallel with the first switch;

[0007] The first circuit includes a second switch and a first unit, which are connected in series in the first circuit.

[0008] The control unit is used to control the second switch to close and the first switch to open when the battery voltage is greater than a first threshold.

[0009] The first unit is used to control the unidirectional flow of current. When the second switch is closed and the first switch is open, the first unit is turned on if the battery is discharging, and the first unit is turned off if the battery is charging.

[0010] In some embodiments, the first unit includes a diode, and the battery charging and discharging circuit further includes: a first resistor, a second resistor, and a second circuit, wherein:

[0011] The first resistor is connected in series with the first switch, the second resistor and the second switch are connected in series in the first circuit, and the second resistor and the first unit are connected in series in the first circuit.

[0012] The first end of the second resistor is connected to the second end of the first resistor, and the anode of the first unit is connected to the second end of the first switch;

[0013] The first terminal of the first resistor is connected to the battery, and the second terminal of the second switch is connected to the inverter.

[0014] The second circuit is connected to the control unit, the second circuit is connected to the first circuit, and the second circuit is connected to the main circuit.

[0015] The first resistor is used to provide the control unit with the current data of the main circuit, and the second resistor is used to provide the control unit with the current data of the first circuit.

[0016] The second circuit is used to control the closing or opening of the second switch based on the current in the first resistor and the current in the second resistor.

[0017] In some embodiments, the second circuit further includes: a second unit, a third unit, and a fourth unit, wherein:

[0018] The first end of the second unit is connected to the first end of the first resistor, and the second end of the second unit is connected to the second end of the first resistor;

[0019] The third terminal of the second unit is connected to the first terminal of the second resistor, and the fourth terminal of the second unit is connected to the second terminal of the second resistor.

[0020] The fifth terminal of the second unit is connected to the control unit, and the sixth terminal of the second unit is connected to the control unit.

[0021] The first end of the third unit is connected to the first end of the fourth unit;

[0022] The second end of the fourth unit is connected to the sixth end of the second unit, and the third end of the fourth unit is connected to the control unit;

[0023] The second unit is used to detect the current in the first resistor and the current in the second resistor;

[0024] The third unit is used to provide a reference current for the fourth unit;

[0025] The fourth unit is used to perform delay control on the second switch based on the reference current.

[0026] In some embodiments, the main circuit for battery charging and discharging further includes a third switch, wherein...

[0027] The first terminal of the third switch is connected to the first terminal of the battery, and the second terminal of the third switch is connected to the inverter.

[0028] The third switch is used to prevent the battery from charging and discharging when a circuit fault occurs.

[0029] In some embodiments, the battery charging and discharging circuit further includes a third circuit and a fourth circuit, wherein,

[0030] The first end of the third circuit is connected to the control unit, and the second end of the third circuit is connected to the coil corresponding to the third switch.

[0031] The first end of the fourth circuit is connected to the control unit, and the second end of the fourth circuit is connected to the coil corresponding to the first switch.

[0032] The third circuit is used to convert the voltage of the signal sent by the control unit into a voltage that can control the third switch to close or open.

[0033] The fourth circuit is used to convert the voltage of the signal sent by the control unit into a voltage that can control the first switch to close or open.

[0034] In some embodiments, the battery charging and discharging circuit further includes a fifth unit and a fifth circuit, wherein,

[0035] The first end of the fifth unit is connected to the fourth unit, the second end of the fifth unit is connected to the control unit, and the third end of the fifth unit is connected to the first end of the fifth circuit.

[0036] The second terminal of the fifth circuit is connected to the coil corresponding to the second switch;

[0037] The fifth unit is used to control the second switch based on the signals sent by the fourth unit or the control unit;

[0038] The fifth circuit is used to convert the voltage of the signal sent by the control unit into a voltage that can control the second switch to close or open.

[0039] In some embodiments, the control unit is also configured to set the signal sent by the fourth unit to a default value.

[0040] In some embodiments, when the second switch is closed, the control unit is also used to determine the state of the battery, which is either a charging state or a discharging state, based on the current of the first resistor and the current of the second resistor.

[0041] When the state is in the discharge state, the control unit is also used to control the first switch to close when the discharge current is greater than the second threshold, and to control the second switch to open after a first duration.

[0042] When the state is in the discharge state, the control unit is also configured to control the first switch to close after a second duration when the discharge current is greater than the third threshold, and to control the second switch to open after the first duration.

[0043] The second threshold is greater than or equal to the third threshold, and the discharge current is determined by the current of the first resistor and / or the current of the second resistor.

[0044] In some embodiments, when the second switch is closed and the state is charging, the control unit is also used to control the first switch to open.

[0045] When the second switch is closed and in the charging state, the control unit is also used to control the third switch to open when both the first resistor and the second resistor have charging current and the magnitude of the current in the first resistor and the magnitude of the current in the second resistor are the same.

[0046] When the second switch is closed and in the charging state, the control unit is also used to control the third switch to open when there is charging current in the first resistor and no current in the second resistor.

[0047] Secondly, embodiments of this application provide an electronic device, including the battery charging and discharging circuits as described in the first aspect above and any of the first aspects that may be involved.

[0048] This application provides a battery charging and discharging circuit and electronic device. The battery charging and discharging circuit includes a main circuit, a first circuit, and a control unit. The main circuit includes a first switch for controlling charging and discharging, and the first circuit is connected in parallel with the first switch. The first circuit includes a second switch and a first unit, which are connected in series in the first circuit. The control unit controls the second switch to close and the first switch to open when the battery voltage exceeds a first threshold. The first unit controls unidirectional current flow; when the second switch is closed and the first switch is open, the first unit conducts if the battery is discharging, and does not conduct if the battery is charging. In this battery charging and discharging circuit, when charging is about to be completed (battery voltage exceeds the first threshold), the second switch is closed and the first switch is opened, allowing the battery to discharge but preventing charging. Therefore, when the battery is about to overcharge or even overcharged, the distributed energy storage system will not shut down, allowing the battery to normally supply power to the load or feed back to the grid. Attached Figure Description

[0049] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0050] Figure 1 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 1 ;

[0051] Figure 2 This application provides a schematic diagram of the structure of a distributed energy storage system according to an embodiment of the present application.

[0052] Figure 3 This is a schematic diagram of the structure of a battery provided in an embodiment of this application;

[0053] Figure 4 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 2 ;

[0054] Figure 5 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 3 ;

[0055] Figure 6 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 4 ;

[0056] Figure 7 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 5 ;

[0057] Figure 8 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 6 ;

[0058] Figure 9 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 7 .

[0059] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0060] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0061] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0062] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0063] In distributed energy storage systems, such as those combining photovoltaic (PV) converters and grid converters, the energy storage battery needs to work in conjunction with both PV and grid converters to achieve bidirectional energy flow (charging and discharging). For example, during the day when PV resources are abundant, the system needs to store excess electricity in the energy storage battery through the PV converter; while at night or when load demand is high, the energy storage battery supplies power to the load or feeds back to the grid through the grid converter.

[0064] The photovoltaic converter is used to convert the DC power from the photovoltaic array into a voltage that matches the energy storage battery and control the charging power. The mains converter is used for bidirectional power flow to realize energy interaction between the energy storage battery and the grid or load. For example, when charging the battery, the mains converter can convert the AC power from the grid into DC power to charge the energy storage battery. When discharging the battery, the mains converter can convert the DC power from the energy storage battery into AC power to be connected to the grid or used by the load. The energy storage battery is connected to the converter through a main circuit switching device (such as a high-power contactor) to form the main circuit.

[0065] Currently, distributed energy storage systems rely on the current detection accuracy of converters to control charging power. However, when the current is low, the current detection accuracy of distributed energy storage systems is low, and it is difficult to accurately control the charging power. This can cause the energy storage battery to trigger the protection mechanism due to overcharging, resulting in the shutdown of the entire distributed energy storage system. Consequently, the energy storage battery cannot supply power to the load or feed back to the grid.

[0066] To address the aforementioned technical problems, this application provides a battery charging and discharging circuit. The circuit includes a main charging and discharging circuit, a first circuit, and a control unit. The main circuit includes a first switch for controlling charging and discharging, and the first circuit is connected in parallel with the first switch. The first circuit includes a second switch and a first unit, which are connected in series in the first circuit. The control unit controls the second switch to close and the first switch to open when the battery voltage exceeds a first threshold. The first unit controls unidirectional current flow; when the second switch is closed and the first switch is open, the first unit conducts if the battery is discharging and does not conduct if the battery is charging. In this battery charging and discharging circuit, when charging is about to complete (battery voltage exceeds the first threshold), the second switch is closed and the first switch is opened, allowing the battery to discharge but preventing charging. Therefore, even when the battery is about to overcharge or even overcharged, the distributed energy storage system will not shut down, allowing the battery to normally supply power to the load or feed back to the grid.

[0067] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0068] Figure 1 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 1 ,like Figure 1 As shown, the battery charging and discharging circuit 1 includes: a main charging and discharging circuit 11, a first circuit 12, and a control unit 13, wherein:

[0069] The main circuit 11 includes a first switch 1101 for controlling charging and discharging, and the first circuit 12 is connected in parallel with the first switch 1101;

[0070] The first circuit 12 includes a second switch 1201 and a first unit 1202, which are connected in series in the first circuit 12.

[0071] The control unit 13 is used to control the second switch 1201 to close and the first switch 1101 to open when the battery voltage is greater than the first threshold.

[0072] The first unit 1202 is used to control the unidirectional flow of current. When the second switch 1201 is closed and the first switch 1101 is open, the first unit 1202 is turned on if the battery is discharging, and the first unit 1202 is not turned on if the battery is charging.

[0073] The main circuit 11 also includes a battery 1102 and a converter 1103. The first end of the first switch 1101 is connected to the second end of the battery 1102, the second end of the first switch 1101 is connected to the second end of the converter 1103, and the first end of the battery 1102 is connected to the first end of the converter 1103.

[0074] The first threshold can be preset; for example, the first threshold is 3.6 volts (V).

[0075] The first unit has unidirectional current flow, meaning that when current passes through the first unit, it can only flow from the first end of the first unit to the second end of the first unit, and cannot flow from the second end of the first unit to the first end of the first unit.

[0076] Battery 1102 can be an energy storage battery or an energy storage battery pack. Inverter 1103 can include photovoltaic inverters and mains inverters. The energy storage battery pack refers to an energy storage unit composed of multiple energy storage battery cells (such as lithium batteries and lithium iron phosphate batteries) connected in series or parallel. It is equipped with a battery management system, heat dissipation structure and protective shell, and can be connected to photovoltaic inverters and mains inverters to form a distributed energy storage system.

[0077] When the first switch 1101 is closed and the second switch 1201 is open, the current flow direction when charging the battery 1102 can be in the following order: inverter 1103, battery 1102, first switch 1101 and inverter 1103; when the battery 1102 is discharging as a load, the current flow direction can be in the following order: battery 1102, inverter 1103, first switch 1103 and battery 1102.

[0078] When the voltage of battery 1102 is greater than the first threshold, control unit 13 can control the second switch 1201 to close and the first switch 1101 to open through the IO port of control unit 13. In this case, since the first unit 1202 can control the current to flow in one direction, battery 1102 can only discharge for the load and cannot be charged. Furthermore, the current flow can only be sequentially: battery 1102, inverter 1103, first unit 1202, second switch 1201 and battery 1102.

[0079] In this embodiment, the battery charging and discharging circuit 1 includes: a main circuit 11 for battery charging and discharging, a first circuit 12, and a control unit 13, wherein: the main circuit 11 includes a first switch 1101 for controlling charging and discharging, and the first circuit 12 is connected in parallel with the first switch 1101; the first circuit 12 includes a second switch 1201 and a first unit 1202, which are connected in series in the first circuit 12; the control unit 13 is used to control the second switch 1201 to close and the first switch 1101 to open when the battery voltage is greater than a first threshold; the first unit 1202 is used to control the unidirectional flow of current, wherein when the second switch 1201 is closed and the first switch 1101 is open, if the battery is discharging, the first unit 1202 is turned on, and if the battery is charging, the first unit 1202 is not turned on. The main circuit 11 also includes a battery 1102 and a converter 1103. The first terminal of the first switch 1101 is connected to the second terminal of the battery 1102, and the second terminal of the first switch 1101 is connected to the second terminal of the converter 1103. The first terminal of the battery 1102 is connected to the first terminal of the converter 1103. In the battery charging and discharging circuit 1 described above, when charging is about to be completed (the voltage of the battery 1102 is greater than the first threshold), the second switch 1201 is closed and the first switch 1101 is opened, so that the battery 1102 can discharge but cannot be charged. Therefore, when the battery 1102 is about to be overcharged or even overcharged, the distributed energy storage system will not shut down, and the battery 1102 can normally supply power to the load or feed back to the grid.

[0080] Furthermore, in the aforementioned battery charging and discharging circuit 1, the distributed energy storage system can be kept running even when the battery is about to be overcharged or even overcharged by using a low-cost first unit and second switch, thus saving costs.

[0081] Based on the above embodiments, the following will be combined with... Figure 2 The principle of battery charging and discharging is explained. For example, Figure 2 This is a schematic diagram of a distributed energy storage system provided in an embodiment of this application. It should be noted that... Figure 2 The following explanation uses an inverter consisting of two photovoltaic inverters and two mains inverters as an example. Figure 2 As shown, the distributed energy storage system includes a battery, a photovoltaic converter 1, a photovoltaic converter 2, a mains converter 1, a mains converter 2, a power grid, a photovoltaic (PV) panel 1, and a PV panel 2.

[0082] Photovoltaic converter 1 is connected to PV panel 1, photovoltaic converter 2 is connected to PV panel 2, mains converter 1 is connected to the power grid, mains converter 2 is connected to the power grid, and the battery is connected to photovoltaic converter 1, photovoltaic converter 2, mains converter 1 and mains converter 2.

[0083] Among them, the battery is the core of the system's energy storage, and the battery can be used to interact with external energy through different converters;

[0084] PV panels are photovoltaic modules. PV panels can be used to convert solar energy into direct current and send the direct current to a photovoltaic converter.

[0085] The power grid is the interface for mains power supply. The power grid can be used to receive the alternating current sent by the photovoltaic converter and supply the alternating current to other electronic devices (such as drum washing machines, ovens, and air conditioners).

[0086] Based on the above embodiments, the following will be combined with... Figure 3 The structure of the battery will be described. For example, Figure 3 This is a schematic diagram of a battery structure provided in an embodiment of this application. It should be noted that... Figure 3 Let's take a battery consisting of three battery packs as an example. Figure 3 As shown, the battery includes a high-voltage box, battery pack 1, battery pack 2 and battery pack 3. The high-voltage box includes a B+ interface, a B- interface, a P+ interface, a P- interface, a C+ interface and a C- interface.

[0087] The voltage box is connected to the battery pack via B+ and B- interfaces, and to the converters (photovoltaic converter and mains converter) via P+, P-, C+, and C- interfaces.

[0088] The high-voltage box is the core control and protection unit of the battery. It is used to control the on / off state of the charging and discharging circuit, and also to detect the current and voltage at various points in the battery charging and discharging circuit.

[0089] The B+ interface is the positive terminal of battery pack 1, battery pack 2 and battery pack 3. The B+ interface provides positive power input to the main circuit inside the high voltage box and is the positive hub for battery interaction with the outside world. The B+ interface can be used to collect the positive current of multiple battery packs.

[0090] The B- interface is the negative terminal of battery pack 1, battery pack 2 and battery pack 3. The B- interface is the main interface for the negative energy output / input of the battery pack, and it gathers the negative current of multiple battery packs to form a complete current loop. The B- interface serves as the system grounding reference terminal to ensure the voltage stability of the circuits used for current detection and control switches in the high-voltage box.

[0091] The P+ interface is the positive terminal of the photovoltaic converter. It is used to receive stable DC power output from the photovoltaic converter (after energy conversion by the photovoltaic panel) and serve as the positive channel for photovoltaic energy charging the battery. The P+ interface is connected to the positive terminal of the main circuit in the high-voltage box, transmitting photovoltaic power to the B+ interface, which ultimately charges the battery pack.

[0092] The P- interface is the negative terminal of the photovoltaic converter. The P- interface is the negative circuit interface for the DC output of the photovoltaic converter, forming a complete negative channel for photovoltaic charging with the P- interface. The P- interface is connected to the current detection resistor in the high-voltage box (such as the first resistor and the second resistor in the following embodiment) to sample the photovoltaic charging current in real time, providing data for the microcontroller unit (MCU) in the high-voltage box to determine the charging status (such as whether overcharge protection is triggered).

[0093] The C+ interface is the positive terminal of the AC converter and the positive terminal of the bidirectional energy channel. It is linked with auxiliary circuits (such as the first circuit) within the high-voltage box to achieve current shunt control during discharge. During charging, the C+ interface receives the DC positive current (grid supplemental energy) converted by the AC converter and transmits it to the B+ interface to charge the battery pack. During discharging, the C+ interface receives the DC positive current output from the battery pack via the B+ interface and transmits it to the AC converter to convert it into AC power for grid connection.

[0094] The C- interface is the negative terminal of the mains converter. The C- interface is the negative terminal of the bidirectional energy channel. The C- interface and the C+ interface form a complete negative terminal loop for interaction between the mains converter. This complete negative terminal loop is used to ensure the current return during charging / discharging. The C- interface is connected to the fault diagnosis circuit in the high-voltage box (such as in parallel with the first unit) and can be used to detect whether there is an abnormal current in the auxiliary circuit (such as the first circuit) (such as leakage caused by the first switch not being disconnected).

[0095] Based on the above embodiments, the first unit includes a diode. Next, in conjunction with... Figure 4 The circuitry for charging and discharging the battery will be further explained. Figure 4 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 2 It should be noted that, Figure 4 Let's take a diode as an example to illustrate this. Figure 4 As shown, the first unit 1202 in the battery charging and discharging circuit 1 is a diode D1. The battery charging and discharging circuit 1 also includes a first resistor R1, a second resistor R2, and a second circuit 14.

[0096] The first resistor R1 is connected in series with the first switch 1101, the second resistor R2 and the second switch 1201 are connected in series in the first circuit 12, and the second resistor R2 and the first unit 1202 (diode D1) are connected in series in the first circuit.

[0097] The first end of the second resistor R2 is connected to the second end of the first resistor R1, and the anode of the first unit 1202 (diode D1) is connected to the second end of the first switch 1101.

[0098] The first terminal of the first resistor R1 is connected to the battery 1102, and the second terminal of the second switch 1201 is connected to the inverter 1103.

[0099] The second circuit 14 is connected to the control unit 13, the second circuit 14 is connected to the first circuit 12, and the second circuit 14 is connected to the main circuit 11.

[0100] The first resistor R1 is used to provide the main circuit current data to the control unit 13, and the second resistor R2 is used to provide the first circuit current data to the control unit 13.

[0101] The second circuit 14 is used to control the closing or opening of the second switch 1201 based on the current of the first resistor R1 and the current of the second resistor R2.

[0102] The principle by which the second circuit 14 controls the closing or opening of the second switch 1201 based on the current in the first resistor R1 and the current in the second resistor R2 can be as follows:

[0103] When the second switch 1201 is open, the second circuit 14 can detect the current of the first resistor R1 and the current of the second resistor R2. Based on the detected current of the first resistor R1 and the second resistor R2, it determines whether the current battery 1102 is in a discharging state or a charging state. When the battery 1102 is in a discharging state, the second switch 1201 can be kept open. When the battery 1102 is in a charging state, it is determined whether the charging current is greater than a fourth threshold. If the charging current is greater than the fourth threshold, the second switch 1201 is kept open. The fourth threshold can be preset. For example, the fourth threshold is 10 amperes (A).

[0104] In this embodiment, cross-verification of current data between the main circuit and the first circuit avoids misjudgment of the state caused by interference from the current in a single circuit (such as signal noise and instantaneous fluctuations), which can eliminate the risk of the second switch being accidentally closed during high-power charging and ensure high battery charging efficiency.

[0105] Based on the above embodiments, the following will be combined with... Figure 5 The circuit 1 for charging and discharging the battery will be further explained. Figure 5 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 3 ,like Figure 5 As shown, the second circuit 14 further includes: a second unit 1401, a third unit 1402, and a fourth unit 1403, wherein:

[0106] The first end of the second unit 1401 is connected to the first end of the first resistor R1, and the second end of the second unit 1401 is connected to the second end of the first resistor R1.

[0107] The third terminal of the second unit 1401 is connected to the first terminal of the second resistor R2, and the fourth terminal of the second unit 1401 is connected to the second terminal of the second resistor R2.

[0108] The fifth terminal of the second unit 1401 is connected to the control unit 13, and the sixth terminal of the second unit 1401 is connected to the control unit 13.

[0109] The first end of the third unit 1402 is connected to the first end of the fourth unit 1403;

[0110] The second end of the fourth unit 1403 is connected to the sixth end of the second unit 1401, and the third end of the fourth unit 1403 is connected to the control unit 13.

[0111] The second unit 1401 is used to detect the current of the first resistor R1 and the current of the second resistor R2;

[0112] The third unit 1402 is used to provide a reference current for the fourth unit 1403;

[0113] The fourth unit 1403 is used to perform delay control on the second switch 1201 based on the reference current.

[0114] The reference current is set by the third unit 1402, for example, the reference current is 3A.

[0115] The implementation principle of the delay control of the second switch 1201 based on the reference current in the fourth unit 1403 is as follows:

[0116] If the second switch 1201 is closed and the first switch 1101 is open, then if the discharge current (the current of the first resistor R1 or the current of the second resistor R2) is greater than or equal to the reference current, the fourth unit can delay the opening of the second switch 1201.

[0117] If the second switch 1201 is closed and the first switch 1101 is open, then when the battery is discharging, the magnitude of the current in the first resistor R1 is the same as the magnitude of the current in the second resistor R2, and the direction of the current in the first resistor R1 is also the same as the direction of the current in the second resistor R2.

[0118] In this embodiment, since the second switch is prone to arcing when directly disconnected under high current, leading to contact adhesion or burnout, the fourth unit, based on the reference current of the third unit, delays disconnecting the second switch when the discharge current is greater than or equal to the reference current in a discharge scenario where the second switch is closed and the first switch is open. This buffers current surges, reduces the probability of arcing, extends the contactor's lifespan, and solves the device wear problem caused by instantaneous high-current shutdown in related technologies. Furthermore, the first resistor and its current are completely synchronized during discharge, providing a precise basis for delay control.

[0119] Based on the above embodiments, the following will be combined with... Figure 6 The circuit 1 for charging and discharging the battery will be further explained. Figure 6 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 4 ,like Figure 6 As shown, the main circuit 11 for battery charging and discharging also includes: a third switch 1104, wherein,

[0120] The first end of the third switch 1104 is connected to the first end of the battery 1102, and the second end of the third switch 1104 is connected to the inverter 1103.

[0121] The third switch 1104 is used to control the battery 1102 to stop charging and discharging when a circuit fault occurs.

[0122] It should be noted that when the second switch 1201 is closed, the control unit 13 can control the first switch 1101 to open.

[0123] In the event of a circuit malfunction, the third switch 1104 can be disconnected, thereby preventing the battery 1102 from charging and discharging.

[0124] In this embodiment, the third switch can directly cut off the battery's charging and discharging path when a circuit fault occurs, completely blocking energy interaction and preventing device burnout or system collapse caused by the expansion of the fault. In addition, when the second switch is closed, the control unit can control the first switch to open, ensuring that the main circuit and the auxiliary circuit will not conduct in parallel. This avoids current disturbances and device overload caused by the superposition of the two circuits, and provides a clear circuit state premise for the fault isolation of the third switch. The overall design continues the general low-cost device selection approach, strengthens safety redundancy without increasing system complexity, and avoids system shutdown due to battery overcharging or fault.

[0125] Based on the above embodiments, the following will be combined with... Figure 7 The circuit 1 for charging and discharging the battery will be further explained. Figure 7 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 5 ,like Figure 7 As shown, the battery charging and discharging circuit 1 also includes a third circuit 15 and a fourth circuit 16, wherein,

[0126] The first end of the third circuit 15 is connected to the control unit 13, and the second end of the third circuit 15 is connected to the coil corresponding to the third switch 1104.

[0127] The first end of the fourth circuit 16 is connected to the control unit 13, and the second end of the fourth circuit 16 is connected to the coil corresponding to the first switch 1101.

[0128] The third circuit 15 is used to convert the voltage of the signal sent by the control unit 13 into a voltage that can control the third switch 1104 to close or open.

[0129] The fourth circuit 16 is used to convert the voltage of the signal sent by the control unit 13 into a voltage that can control the first switch 1101 to close or open.

[0130] For example, the voltage of the signal sent by the control unit is 3.3V, the voltage that can control the third switch 1104 to close or open is 12V or 24V, and the voltage that can control the first switch 1101 to close or open is 12V or 24V.

[0131] The battery charging and discharging circuit 1 also includes a first electromagnetic induction coil L1 and a second electromagnetic induction coil L2. The principle for controlling the third switch 1104 to close or open is as follows:

[0132] The control unit 13 outputs a high-level signal (3.3V), which is converted into a 12V or 24V driving voltage by the third circuit 15 and applied to the two ends of the first electromagnetic induction coil L1 corresponding to the third switch 1104. The coil is energized to generate electromagnetic attraction, which attracts the main contacts of the third switch 1104, so that the third switch 1104 is closed.

[0133] The control unit 13 outputs a low-level signal, which is converted into a 12V or 24V driving voltage by the third circuit 15 and applied to the two ends of the first electromagnetic induction coil L1 corresponding to the third switch 1104. The first electromagnetic induction coil L1 corresponding to the third switch 1104 is de-energized, the electromagnetic attraction disappears, and the main contacts are opened under the action of the spring, so that the third switch 1104 is opened.

[0134] The principle of controlling the first switch 1101 to close or open is as follows:

[0135] The control unit 13 outputs a high-level signal (3.3V), which is converted into a 12V or 24V driving voltage by the fourth circuit 16 and applied to the two ends of the second electromagnetic induction coil L2 corresponding to the first switch 1101. The coil is energized to generate electromagnetic attraction, which attracts the main contacts of the first switch 1101, so that the first switch 1101 is closed.

[0136] The control unit 13 outputs a low-level signal, which is converted into a 12V or 24V driving voltage by the fourth circuit 16 and applied to the two ends of the second electromagnetic induction coil L2 corresponding to the first switch 1101. The second electromagnetic induction coil L2 corresponding to the first switch 1101 is de-energized, the electromagnetic attraction disappears, and the main contacts are opened under the action of the spring, so that the first switch 1101 is opened.

[0137] In this embodiment, the voltage of the signal output by the control unit is independently converted into a switch drive voltage through the third and fourth circuits. This solves the problem of mismatch between the control signal and the switch coil voltage, ensuring the reliable engagement and disengagement of the first and third switches. Furthermore, the independent drive design avoids signal interference between switches, reducing the risk of malfunction. The first and second electromagnetic induction coils are the coils of the corresponding switches. The electromagnetic attraction generated by their energization can stably achieve the engagement of the main contacts of the switches. After the power is cut off, the electromagnetic attraction disappears, and the switches are disconnected by spring reset. Combined with the precise drive of the voltage conversion circuit, the response speed and stability of the switch action are further improved. At the same time, the core advantages of low cost and high reliability of the overall circuit are maintained, effectively ensuring that the energy storage system avoids overcharging shutdown during charging and discharging.

[0138] Based on the above embodiments, the following will be combined with... Figure 8 The circuit 1 for charging and discharging the battery will be further explained. Figure 8 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 6 ,like Figure 8 As shown, the battery charging and discharging circuit 1 also includes a fifth unit 17 and a fifth circuit 18, wherein,

[0139] The first end of the fifth unit 17 is connected to the fourth unit 1403, the second end of the fifth unit 17 is connected to the control unit 13, and the third end of the fifth unit 17 is connected to the first end of the fifth circuit 18.

[0140] The second terminal of the fifth circuit 18 is connected to the coil corresponding to the second switch 1201;

[0141] The fifth unit 17 is used to control the second switch 1201 based on the signal sent by the fourth unit 1403 or the signal sent by the control unit 13;

[0142] The fifth circuit 18 is used to convert the voltage of the signal sent by the control unit 13 into a voltage that can control the second switch 1201 to close or open.

[0143] For example, the voltage of the signal sent by the control unit is 3.3V, and the voltage that can control the second switch 1201 to close or open is 12V or 24V.

[0144] The fifth unit may include combinational logic circuits. For example, the fifth unit is an OR gate, that is, when the signal output by the fourth unit and / or the signal sent by the control unit is a high-level signal, the second switch 1201 can be controlled to close or open.

[0145] When the current of the second resistor R2 detected by the second unit 1401 is greater than or equal to the reference current provided by the third unit 1402, the fourth unit 1403 delays sending a low-level signal to the fifth unit 17. Since the signal sent by the fourth unit 1403 is low-level and the signal sent by the control unit 13 is low-level, the signal output by the fifth unit 17 is low-level. The fifth circuit 18 receives the low-level signal and converts it into a voltage (12V or 24V) that can control the second switch 1201 to close or open.

[0146] The battery charging and discharging circuit 1 also includes a third electromagnetic induction coil L3, and the principle for controlling the second switch 1201 to close or open is as follows:

[0147] The fifth circuit 18 applies a high-level signal (12V or 24V) to both ends of the third electromagnetic induction coil L3 corresponding to the second switch 1201. The coil is energized to generate electromagnetic attraction, which attracts the main contacts of the second switch 1201, causing the second switch 1201 to close.

[0148] The fifth circuit 18 applies a low-level signal (12V or 24V) to both ends of the third electromagnetic induction coil L3 corresponding to the second switch 1201. The third electromagnetic induction coil L3 corresponding to the second switch 1201 is de-energized, the electromagnetic attraction disappears, and the main contacts are opened under the action of the spring, so that the second switch 1201 is disconnected.

[0149] In this embodiment, the fifth unit uses OR gate logic to implement dual-source control of the control unit's direct signal and the fourth unit's delayed signal. A valid signal from either unit triggers the second switch, preventing switch malfunction due to a single control path failure. Furthermore, the fifth circuit precisely converts the control signal voltage into a standard drive voltage to match the drive requirements of the third electromagnetic induction coil, ensuring reliable engagement and disengagement of the second switch's main contacts and resolving the issue of malfunction caused by voltage mismatch. Combined with the fourth unit's delayed logic, a low-level signal is output delayed when the second resistor current reaches the target, preventing arc damage caused by hard shutdown of the second switch under high current and extending device lifespan. Simultaneously, the overall design adheres to the selection principle of general-purpose, low-cost components, without increasing system cost. This effectively enhances the reliability and flexibility of the auxiliary circuit control, ensuring that the energy storage system avoids overcharging shutdown and prevents damage from malfunctioning critical components in a wide power range charging and discharging scenario.

[0150] In some implementations, the control unit 13 is also used to set the signal sent by the fourth unit 1403 to a default value, thereby restoring the fourth unit 1403 to its initial state. The default value can be preset; for example, the default value is a high-level signal.

[0151] In some implementations, when the second switch 1201 is closed, the control unit 13 is also used to determine the state of the battery 1102, which is either a charging state or a discharging state, based on the current of the first resistor R1 and the current of the second resistor R2.

[0152] When the state is in the discharge state, the control unit 13 is also used to control the first switch 1101 to close when the discharge current is greater than the second threshold, and to control the second switch 1201 to open after the first duration.

[0153] When the state is in the discharge state, the control unit 13 is also configured to control the first switch 1101 to close after a second duration when the discharge current is greater than the third threshold, and to control the second switch 1201 to open after the first duration.

[0154] The second threshold is greater than or equal to the third threshold, and the discharge current is determined by the current of the first resistor R1 and / or the current of the second resistor R2.

[0155] For example, the second threshold is 100A and the third threshold is 30A.

[0156] The control unit 13 can determine the state of the battery based on the direction of the current in the first resistor R1 and the second resistor R2.

[0157] The first duration and the second duration can be preset. For example, the first duration is 2 seconds and the second duration is 3 seconds.

[0158] Under normal system operation, the discharge current can be either the current of the first resistor R1 or the current of the second resistor R2.

[0159] In this embodiment, when the discharge current exceeds the second threshold, the control unit controls the first switch to close immediately and then opens the second switch after a first duration. When the discharge current exceeds the third threshold, the first switch is closed after a second delay and then the second switch is opened after a further first delay. This hierarchical delay control based on current magnitude achieves smooth switching between the auxiliary and main circuits, avoiding device arc damage and system voltage fluctuations caused by sudden large current changes. It also ensures accurate state identification through current direction determination, preventing malfunctions. Furthermore, the discharge current can be flexibly determined based on the current of a single resistor or a dual resistor, adapting to the detection requirements under different operating conditions. The overall control logic does not rely on high-precision converter sampling. With the help of general-purpose components and simple timing design, it can reliably avoid battery overcharge shutdown, balancing low cost and high stability.

[0160] In some implementations, when the second switch 1201 is closed and in the charging state, the control unit 13 is also used to control the first switch 1101 to open.

[0161] When the second switch 1201 is closed and in the charging state, the control unit 13 is also used to control the third switch 1104 to open when both the first resistor R1 and the second resistor R2 have charging current and the magnitude of the current in the first resistor R1 is the same as the magnitude of the current in the second resistor R2.

[0162] When the second switch 1201 is closed and in the charging state, the control unit 13 is also used to control the third switch 1104 to open when there is a charging current in the first resistor R1 and no current in the second resistor R2.

[0163] When the second switch 1201 is closed and the first switch 1101 is open, the second unit 1401 determines the current of the first resistor R1 and the current of the second resistor R2. If both the first resistor R1 and the second resistor R2 have charging current and the magnitude of the current of the first resistor R1 and the magnitude of the current of the second resistor R2 are the same, then the first unit 1202 is indicated to be short-circuited and fails. At this time, the control unit 13 controls the third switch 1104 to open, the system stops, and the battery 1102 will neither discharge to the load nor charge.

[0164] When the second switch 1201 is closed and the first switch 1101 is open, the second unit 1401 determines the current of the first resistor R1 and the current of the second resistor R2. If there is a charging current in the first resistor R1 and no charging current in the second resistor R2, it indicates that the first switch 1101 has not been successfully opened. At this time, the control unit 13 controls the third switch 1104 to open, and the system stops. The battery 1102 will not discharge to the load or charge.

[0165] In this embodiment, the short-circuit failure of the first unit is determined by the current based on the first resistor and the current based on the second resistor. When the first unit fails to short-circuit, the third switch is disconnected, completely isolating the battery from the inverter. The charging current cannot enter the battery, and the discharging current cannot be output. This fundamentally prevents the battery from being overcharged or the short-circuit current from burning out other components, improving system safety and solving the problem in related technologies where only the first switch is disconnected without ensuring complete isolation between the battery and the inverter, which may lead to residual current causing the fault to expand. In addition, the successful disconnection of the first switch is determined by the current based on the first resistor and the current based on the second resistor. Even if the first switch fails to disconnect (the first switch is stuck), the current can still be blocked by cutting off the total power supply to the battery, avoiding the overload risk caused by the parallel operation of the dual circuits and strengthening the redundancy of the protection.

[0166] Based on the above embodiments, the following will be combined with... Figure 9 The circuit 1 for charging and discharging the battery will be further explained. Figure 9 A schematic diagram of a battery charging and discharging circuit provided in this application embodiment. Figure 7 ,like Figure 9 As shown, the battery charging and discharging circuit 1 also includes a capacitor 1203, wherein,

[0167] Capacitor 1203 and second switch 1201 are connected in parallel.

[0168] Capacitor 1203 can be used to absorb voltage spikes when the second switch 1201 is turned off, stabilize the voltage of the first circuit 12, and reduce the withstand impedance of the second switch 1201.

[0169] For example, the capacitor is a 1 nanofarad (nF) / 2000V capacitor.

[0170] In one possible implementation, capacitor 1203 can be a capacitor component, eliminating the need for dedicated custom components.

[0171] In one possible implementation, at the instant the second switch 1201 is closed or opened, the current of the first circuit 12 is prone to instantaneous spikes. The capacitor 1203 can quickly absorb the energy of these spikes through charging and discharging, suppressing the generation and continuation of electric arcs between contacts, and avoiding contact adhesion or burning caused by electric arcs.

[0172] In this embodiment, by absorbing the instantaneous spikes generated when the second switch is closed or opened by the capacitor, contact adhesion or burning caused by electric arc can be avoided. In addition, during low-power charging and discharging switching (such as in the case of hundreds of watts at the end of charging), the capacitor can buffer the instantaneous voltage fluctuations of the first circuit, so that the voltage across the first unit and the second resistor and other devices is stable, avoiding device damage caused by voltage change. Furthermore, the capacitor can absorb instantaneous overvoltage, which can reduce the withstand voltage impedance of the second switch and further control the cost of device selection.

[0173] Based on the above embodiments, for a 300A, 1000V distributed energy storage system, the first and third switches should preferably be 450A specifications, and the second switch can be a model with lower withstand voltage and lower current, such as 100V and 100A. The above is only one example, and the embodiments of this application do not limit it.

[0174] In the embodiments of this application, the number of components used in the battery charging and discharging circuit is small, the component selection is reasonable and appropriate, and the control logic is simple and reliable, which can reduce the overall system cost.

[0175] This application also provides an electronic device, which includes the battery charging and discharging circuit of any of the above embodiments.

[0176] The various embodiments or implementation methods described in this specification are presented in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other.

[0177] It should be noted that the embodiments referred to in the specification, such as "one embodiment," "embodiment," "exemplary embodiment," and "some embodiments," may include specific features, structures, or characteristics, but not every embodiment necessarily includes that specific feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same embodiment. Moreover, when a specific feature, structure, or characteristic is described in connection with an embodiment, implementing such a feature, structure, or characteristic in conjunction with other embodiments, whether explicitly described or not, is within the knowledge scope of those skilled in the art.

[0178] Generally speaking, terms should be understood at least in part by their use in context. For example, at least in part by context, the term "one or more" as used in the text can be used to describe any feature, structure, or characteristic of the singular meaning, or a combination of features, structures, or characteristics of the plural meaning. Similarly, at least in part by context, terms such as "a" or "the" can also be understood to convey either singular or plural usage.

[0179] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A circuit for charging and discharging a battery, characterized in that, It includes the main circuit for charging and discharging the battery, the first circuit, and the control unit, wherein: The main circuit includes a first switch for controlling charging and discharging, and the first circuit is connected in parallel with the first switch. The first circuit includes a second switch and a first unit, wherein the second switch and the first unit are connected in series in the first circuit; The control unit is used to control the second switch to close and the first switch to open when the battery voltage is greater than a first threshold. The first unit is used to control the unidirectional flow of current. When the second switch is closed and the first switch is open, the first unit is turned on if the battery is discharging, and the first unit is turned off if the battery is charging.

2. The battery charging and discharging circuit according to claim 1, characterized in that, The first unit includes a diode, and the battery charging and discharging circuit further includes: a first resistor, a second resistor, and a second circuit, wherein: The first resistor is connected in series with the first switch, the second resistor and the second switch are connected in series in the first circuit, and the second resistor and the first unit are connected in series in the first circuit; The first end of the second resistor is connected to the second end of the first resistor, and the anode of the first unit is connected to the second end of the first switch; The first end of the first resistor is connected to the battery, and the second end of the second switch is connected to the inverter; The second circuit is connected to the control unit, the second circuit is connected to the first circuit, and the second circuit is connected to the main circuit; The first resistor is used to provide the control unit with the current data of the main circuit, and the second resistor is used to provide the control unit with the current data of the first circuit; The second circuit is used to control the closing or opening of the second switch based on the current in the first resistor and the current in the second resistor.

3. The battery charging and discharging circuit according to claim 2, characterized in that, The second circuit further includes: a second unit, a third unit, and a fourth unit, wherein: The first end of the second unit is connected to the first end of the first resistor, and the second end of the second unit is connected to the second end of the first resistor; The third terminal of the second unit is connected to the first terminal of the second resistor, and the fourth terminal of the second unit is connected to the second terminal of the second resistor; The fifth terminal of the second unit is connected to the control unit, and the sixth terminal of the second unit is connected to the control unit. The third unit is connected to the first end of the fourth unit; The second end of the fourth unit is connected to the sixth end of the second unit, and the third end of the fourth unit is connected to the control unit; The second unit is used to detect the current in the first resistor and the current in the second resistor; The third unit is used to provide a reference current for the fourth unit; The fourth unit is used to perform delay control on the second switch based on the reference current.

4. The battery charging and discharging circuit according to claim 3, characterized in that, The main circuit for battery charging and discharging also includes: a third switch, wherein... The first terminal of the third switch is connected to the first terminal of the battery, and the second terminal of the third switch is connected to the inverter; The third switch is used to control the battery from charging and discharging when the circuit malfunctions.

5. The battery charging and discharging circuit according to claim 4, characterized in that, The battery charging and discharging circuit also includes a third circuit and a fourth circuit, wherein, The first end of the third circuit is connected to the control unit, and the second end of the third circuit is connected to the coil corresponding to the third switch; The first end of the fourth circuit is connected to the control unit, and the second end of the fourth circuit is connected to the coil corresponding to the first switch. The third circuit is used to convert the voltage of the signal sent by the control unit into a voltage that can control the third switch to close or open. The fourth circuit is used to convert the voltage of the signal sent by the control unit into a voltage that can control the first switch to close or open.

6. The battery charging and discharging circuit according to claim 5, characterized in that, The battery charging and discharging circuit also includes a fifth unit and a fifth circuit, wherein, The first end of the fifth unit is connected to the fourth unit, the second end of the fifth unit is connected to the control unit, and the third end of the fifth unit is connected to the first end of the fifth circuit. The second terminal of the fifth circuit is connected to the coil corresponding to the second switch; The fifth unit is used to control the second switch based on the signal sent by the fourth unit or the signal sent by the control unit; The fifth circuit is used to convert the voltage of the signal sent by the control unit into a voltage that can control the second switch to close or open.

7. The battery charging and discharging circuit according to claim 6, characterized in that, The control unit is also configured to set the signal sent by the fourth unit to a default value.

8. The battery charging and discharging circuit according to claim 7, characterized in that, When the second switch is closed, the control unit is also used to determine the state of the battery, which is either a charging state or a discharging state, based on the current of the first resistor and the current of the second resistor. When the state is a discharge state, the control unit is further configured to control the first switch to close when the discharge current is greater than the second threshold, and control the second switch to open after a first duration. When the state is a discharge state, the control unit is further configured to control the first switch to close after a second duration when the discharge current is greater than a third threshold, and to control the second switch to open after the first duration. The second threshold is greater than or equal to the third threshold, and the discharge current is determined by the current of the first resistor and / or the current of the second resistor.

9. The battery charging and discharging circuit according to claim 8, characterized in that, When the second switch is closed and the state is charging, the control unit is also used to control the first switch to open. When the second switch is closed and the state is charging, the control unit is further configured to control the third switch to open when both the first resistor and the second resistor have charging current and the magnitude of the current in the first resistor and the magnitude of the current in the second resistor are the same. When the second switch is closed and the state is charging, the control unit is further configured to control the third switch to open when there is charging current in the first resistor and no current in the second resistor.

10. An electronic device comprising a circuit for charging and discharging a battery as claimed in any one of claims 1 to 9.