Battery management system and external voltage detection method
By using mirror constant current source sampling circuit and control unit in the battery management system, accurately identifying the type of external equipment, the problems of detection failure and high cost in the prior art are solved, and the safety and use efficiency of the battery module are improved.
Patent Information
- Application Number
- CN202411979552.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
AI Technical Summary
In the existing battery management system, the detection failure of external devices such as charging equipment and the inability to detect adverse consequences caused by load equipment, resulting in the false triggering of charging and discharging short circuits or the damage to the main circuit discharge MOS tube, and the use of two independent voltage detection circuits increases the cost.
The mirror constant current source sampling circuit, charge and discharge circuit, positive external port, negative external port and control unit are used to obtain the sampling voltage through the mirror constant current source sampling circuit, calculate the external voltage and the current voltage of the battery module, and determine whether the external device is a charging device or a load device.
Accurate type identification of external devices is achieved, and the battery module damage is avoided due to incorrect connections is improved, the battery module's use efficiency and safety is improved, the number of electronic devices is reduced, and the cost is reduced.
Smart Images

Figure CN119813460A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery technology, and in particular to a battery management system and an external voltage detection method. Background Art
[0002] In the BMS (Battery Management System), charger detection and capacitive load detection play a vital role in accurately determining whether the battery pack is in a charging or discharging state.
[0003] In the prior art, two sets of independent level detection circuits are often used, which are used to detect the charger and capacitive load respectively. Among them, if the output of the battery pack is connected to a large capacitive load, direct charging may cause a large instantaneous current, resulting in false triggering of the charge and discharge short circuit or damage to the main circuit discharge MOS tube. Therefore, it is necessary to charge through the pre-discharge circuit first, but it is difficult to accurately control the pre-discharge time by the level detection circuit alone. If it is too short, the charging is insufficient, and if it is too long, the system response speed is affected, and the pre-discharge MOS resistor may be damaged by overheating.
[0004] If the output of the battery pack is connected to a charger, the peak ripple fluctuation of the charger voltage makes the selection of the transistor base resistor of the charger detection circuit complicated, which may cause the level detection circuit to fail due to voltage fluctuation. In addition, the use of two independent voltage detection circuits requires two IO ports, increasing the cost of the BMS system. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a battery management system and an external voltage detection method, which are used to solve the problem of adverse consequences caused by failure of detection of external devices such as charging devices and inability to detect load devices in the battery management system.
[0006] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a battery management system, the battery management system comprising: a mirror constant current source sampling circuit, a charge and discharge loop, a positive external port, a negative external port and a control unit;
[0008] The positive external port is connected to the positive battery port of the battery module, the negative external port is connected to one end of the charge and discharge loop, the other end of the charge and discharge loop is connected to the negative battery port of the battery module, and the control end of the charge and discharge loop is also connected to the control port of the control unit;
[0009] The first input terminal and the second input terminal of the mirror image constant current source sampling circuit are both connected to the positive battery port of the battery module, the first output terminal of the mirror image constant current source sampling circuit is connected to the first analog-to-digital sampling port of the control unit, and the second output terminal of the mirror image constant current source sampling circuit is also connected to the negative external port to output a sampling voltage to the control unit;
[0010] The control unit is used to: calculate the external voltage between the positive external port and the negative external port based on the sampled voltage, and calculate the current voltage of the battery module according to the external voltage, and then determine whether the external device connected to the positive external port and the negative external port is a charging device or a load device according to the external voltage and the current voltage.
[0011] Optionally, the mirror image constant current source sampling circuit comprises: a current mirror unit, a first voltage detection unit and a second voltage detection unit; two input ends of the current mirror unit are the first input end and the second input end of the mirror image constant current source sampling circuit, and the first input end and the second input end are both connected to the positive battery port of the battery module;
[0012] The first output end of the current mirror unit is grounded through the first voltage detection unit, and the second output end of the current mirror unit is connected to the negative external port through the second voltage detection unit;
[0013] The output end of the first voltage detection unit is the first output end of the mirror image constant current source sampling circuit, which is used to connect to the first analog-to-digital sampling port of the control unit.
[0014] Optionally, the current mirror unit includes: a first resistor, a second resistor, a first transistor, and a second transistor; wherein one end of the first resistor and one end of the second resistor are respectively two input ends of the current mirror unit, both connected to the positive battery port of the battery module, and the other end of the first resistor and the other end of the second resistor are respectively connected to the emitter of the first transistor and the emitter of the second transistor;
[0015] The base of the first transistor is connected to the base of the second transistor; the base of the second transistor is also connected to the collector of the second transistor;
[0016] The collector of the first transistor and the collector of the second transistor are respectively the first output end and the second output end of the current mirror unit.
[0017] Optionally, the first voltage detection unit includes: a third resistor and a fourth resistor connected in series, and a series connection point of the third resistor and the fourth resistor is an output end of the first voltage detection unit.
[0018] Optionally, the second voltage detection unit includes: a fifth resistor.
[0019] Optionally, the mirror image constant current source sampling circuit further includes: a filtering unit, and the output end of the first voltage detection unit is connected to the first analog-to-digital sampling port of the control unit through the filtering unit.
[0020] Optionally, the battery management system further includes: a current sampling unit, wherein the current sampling unit is connected between the negative battery port of the battery module and the ground, and the current sampling unit is also connected to the second analog-to-digital sampling port of the control unit.
[0021] In a second aspect, an embodiment of the present application provides an external voltage detection method, which is applied to a control unit in a battery management system, and the method includes:
[0022] Obtaining a sampled voltage outputted from a first output terminal of a mirror image constant current source sampling circuit;
[0023] According to the sampled voltage, the external voltage between the positive external port and the negative external port is calculated by using the preset resistance ratio between the first output terminal and the second output terminal in the mirror image constant current source sampling circuit:
[0024] Calculating the current voltage of the battery module according to the external voltage;
[0025] According to the external voltage and the current voltage, it is determined whether the external device connected to the positive external port and the negative external port is a charging device or a load device.
[0026] Optionally, determining whether the external device connected to the positive external port and the negative external port is a charging device or a load device according to the external voltage and the current voltage includes:
[0027] If the external voltage is greater than the current voltage, determining that the external device is a charging device;
[0028] The method further comprises:
[0029] The main circuit in the charging and discharging circuit is controlled to charge.
[0030] Optionally, determining whether the external device connected to the positive external port and the negative external port is a charging device or a load device according to the external voltage and the current voltage includes:
[0031] If the external voltage is less than the current voltage, determining that the external device is a load device;
[0032] The method further comprises:
[0033] The external voltage is within a preset deviation range of a preset minimum voltage, controlling a pre-discharge circuit of the charge-discharge circuit to perform pre-discharge;
[0034] After a preset pre-discharge time, if the external voltage rises to a set voltage, the main circuit of the charge-discharge circuit is controlled to discharge.
[0035] Compared with the prior art, the battery management system and external voltage detection method provided by the present application have the following technical effects:
[0036] The embodiments of the present application provide a battery management system and an external voltage detection method. The battery management system may be composed of a mirror constant current source sampling circuit, a charge and discharge loop, a positive external port, a negative external port, and a control unit; the positive external port is connected to the positive battery port of the battery module, the negative external port is connected to one end of the charge and discharge loop, and the other end of the charge and discharge loop is connected to the negative battery port of the battery module, which provides a reliable physical path for energy transmission between the battery module and the external device, thereby improving the reliability and stability of the battery management system; the control end of the charge and discharge loop is also connected to the control port of the control unit; the first input end and the second input end of the mirror constant current source sampling circuit are both connected to the positive battery port of the battery module, the first output end of the mirror constant current source sampling circuit is connected to the first analog-to-digital sampling port of the control unit, and the mirror constant current source sampling circuit is connected to the positive battery port of the battery module. The second output end is also connected to the negative external port to output the sampled voltage to the control unit; the control unit is used to: calculate the external voltage between the positive external port and the negative external port based on the sampled voltage, and calculate the current voltage of the battery module according to the external voltage, and then determine whether the external device connected to the positive external port and the negative external port is a charging device or a load device according to the external voltage and the current voltage. Therefore, the present application can accurately determine the type of external device based on the voltage situation. After determining the type of external device, the battery module is adjusted to maintain the best state during the charging or discharging process according to the charge and discharge circuit, thereby preventing damage to the battery module due to incorrect connection, improving the use efficiency and safety of the battery module, and improving the user experience in using the battery module. At the same time, compared with the use of two independent level detection schemes in the prior art, the present application only uses a mirror constant current source sampling circuit to achieve accurate detection of external devices, so that the present application reduces the number of required electronic components, realizes multi-functional integration, optimizes the PCB layout, and saves the IO resources of the control module, that is, only uses the first analog-to-digital sampling port of the control module, reduces the BOM (bill of materials) cost, and is beneficial to the later maintenance of the battery management system. The mirror constant current source sampling circuit components in the present application are highly versatile and have a high utilization rate, which is conducive to mass production and can be applied to energy storage BMS, automotive BMS, outdoor portable BMS and other occasions. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 1 ;
[0039] Figure 2 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 2 ;
[0040] Figure 3 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 3 ;
[0041] Figure 4 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 4 ;
[0042] Figure 5 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 5 ;
[0043] Figure 6 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 6 ;
[0044] Figure 7 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 7 ;
[0045] Figure 8 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 8 ;
[0046] Fig. 9 A schematic diagram of a process for detecting an external voltage provided in an embodiment of the present application Figure 1 ;
[0047] Fig.10 A schematic diagram of a process for detecting an external voltage provided in an embodiment of the present application Figure 2 ;
[0048] Fig.11 A schematic diagram of a process for detecting an external voltage provided in an embodiment of the present application Figure 3 . DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0051] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0052] In the description of the present application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, it is based on the orientation or position relationship shown in the drawings, or is the orientation or position relationship in which the product of the invention is usually placed when used. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.
[0053] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0054] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0055] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0056] Figure 1 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 1 .like Figure 1 As shown, the battery management system 100 may include: a mirror constant current source sampling circuit 110 , a charge and discharge loop 120 , a positive external port P+, a negative external port P−, and a control unit 130 .
[0057] Among them, the positive external port P+ is connected to the positive battery port B+ of the battery module BT, ensuring that the positive battery port B+ of the battery module BT provides positive power to the positive external port P+; the negative external port P- is connected to one end of the charge and discharge loop 120, and the other end of the charge and discharge loop 120 is connected to the negative battery port B- of the battery module BT, ensuring that the negative battery port B- of the battery module BT provides negative power to the negative external port P-, so as to form a complete loop powered by the battery module BT and ensure stable transmission of current.
[0058] The control end of the charge and discharge loop 120 is also connected to the control port of the control unit 130, so as to control the control end of the charge and discharge loop 120 through the control port of the control unit 130; the first input end and the second input end of the mirror image constant current source sampling circuit 110 are both connected to the positive battery port B+ of the battery module BT, so as to provide an input signal to the mirror image constant current source sampling circuit 110 through the positive battery port B+ of the battery module BT; the first output end of the mirror image constant current source sampling circuit 110 is connected to the first analog-to-digital sampling port ADC of the control unit 130, so that the control unit 130 samples the electrical signal of the mirror image constant current source sampling circuit 110; the second output end of the mirror image constant current source sampling circuit 110 is also connected to the negative external port P-, so as to output the sampling voltage V to the control unit 130 ad .
[0059] The control unit 130 is used to: based on the sampling voltage V ad Calculate the external voltage V between the positive external port P+ and the negative external port P- a , and according to the external voltage V a , calculate the current voltage V of the battery module BT b , and then according to the external voltage V a and the current voltage V b , determine whether the external device connected to the positive external port P+ and the negative external port P- is a charging device or a load device. The charging device and the load device can be selected according to actual conditions, for example, the charging device can be selected as an identifiable charger; the load device can be selected as an external capacitive load. The control unit 130 can be selected according to actual conditions, for example, the control unit 130 can be selected as an MCU (Microcontroller Unit).
[0060] The positive external port P+ and the negative external port P− are external connection ports PACK (Battery Package) of the battery module BT.
[0061] It should be noted that the battery module can be composed of a plurality of battery cells connected in series.
[0062] The present application provides a battery management system, which can be composed of a mirror image constant current source sampling circuit, a charge and discharge loop, a positive external port, a negative external port and a control unit, etc.; the positive external port is connected to the positive battery port of the battery module, the negative external port is connected to one end of the charge and discharge loop, and the other end of the charge and discharge loop is connected to the negative battery port of the battery module, which provides a reliable physical path for energy transmission between the battery module and the external device, and improves the reliability and stability of the battery management system; the control end of the charge and discharge loop is also connected to the control port of the control unit; the first input end and the second input end of the mirror image constant current source sampling circuit are both connected to the positive battery port of the battery module, and the first output end of the mirror image constant current source sampling circuit is connected to the first output end of the control unit The positive sampling port and the second output end of the mirror constant current source sampling circuit are also connected to the negative external port to output the sampling voltage to the control unit; the control unit is used to: calculate the external voltage between the positive external port and the negative external port based on the sampling voltage, and determine whether the external device connected to the positive external port and the negative external port is a charging device or a load device by comparing the external voltage with the current battery voltage. Therefore, the present application can accurately determine the type of the external device based on the voltage condition. After determining the type of the external device, the control unit controls the battery management system to make corresponding strategies, so that the charging and discharging circuit performs corresponding tasks such as charging or discharging, as well as pre-discharging, thereby improving the use efficiency and safety of the battery module and improving the user experience in using the battery module. At the same time, compared with the use of two independent level detection schemes in the prior art, the present application only uses a mirror constant current source sampling circuit to achieve accurate detection of external devices, so that the present application reduces the number of required electronic components, realizes multi-functional integration, optimizes the PCB layout, and saves the IO resources of the control module, that is, only uses the first analog-to-digital sampling port of the control module, reduces the BOM (bill of materials) cost, and is beneficial to the later maintenance of the battery management system. The mirror constant current source sampling circuit components in the present application are highly versatile and have a high utilization rate, which is conducive to mass production and can be applied to energy storage BMS, automotive BMS, outdoor portable BMS and other occasions.
[0063] Furthermore, in order to clearly describe the battery management system 100 provided in the above embodiment, the present application also provides a structural schematic diagram of a mirror image constant current source sampling circuit 110. Figure 2 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 2 .like Figure 2 As shown, the mirror image constant current source sampling circuit 110 may include: a current mirror unit 111 , a first voltage detection unit 112 and a second voltage detection unit 113 .
[0064] Among them, the two input ends of the current mirror unit 111 are the first input end and the second input end of the mirror constant current source sampling circuit 110, and the first input end and the second input end are both connected to the positive battery port B+ of the battery module BT to provide an input signal to the current mirror unit 111 through the positive battery port B+ of the battery module BT; the first output end of the current mirror unit 111 is grounded through the first voltage detection unit 112, so that the current output by the first output end of the current mirror unit 111 can be accurately mirrored and distributed based on a stable reference potential to ensure the accuracy and stability of the output current; the second output end of the current mirror unit 111 is connected to the negative external port P- through the second voltage detection unit 113, so that the current output by the second output end of the current mirror unit 111 meets the needs of the external device; the output end of the first voltage detection unit 112 is the first output end of the mirror constant current source sampling circuit 110, which is used to connect the first analog-to-digital sampling port ADC of the control unit 130, so that the control unit 130 samples the electrical signal of the mirror constant current source sampling circuit 110.
[0065] The battery management system provided by the present application, the mirror image constant current source sampling circuit can be composed of a current mirror unit, a first voltage detection unit, and a second voltage detection unit, etc.; wherein, the two input ends of the current mirror unit are the first input end and the second input end of the mirror image constant current source sampling circuit, both of which are connected to the positive battery port of the battery module, so as to accurately mirror and proportionally copy the current of the battery module, ensure the accuracy and consistency of sampling, provide a stable and reliable current source signal for subsequent voltage detection and analysis, and effectively reduce the system performance deviation and measurement inaccuracy caused by sampling errors; the first output end of the current mirror unit is grounded through the first voltage detection unit to avoid the release of energy based on the ground when an abnormal situation occurs in the mirror image constant current source sampling circuit, and ensure the safety of the mirror image constant current source sampling circuit; the second output end of the current mirror unit is connected to the negative external port through the second voltage detection unit, so as to realize the accurate measurement of the voltages of the two output ends of the current mirror unit; the output end of the first voltage detection unit is the first output end of the mirror image constant current source sampling circuit, which is used to connect the first analog-to-digital sampling port of the control unit, so that the control unit can quickly and accurately obtain the information of the sampling voltage, which is convenient for subsequent complex calculation processing. Thus, the intelligence and reliability of the battery management system are improved.
[0066] The battery management system provided in the above embodiment of the present application is explained and illustrated in detail as follows in conjunction with the accompanying drawings. Figure 3 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 3 .like Figure 3 As shown, the current mirror unit 111 may include: a first resistor R1, a second resistor R2, a first transistor Q1 and a second transistor Q2.
[0067] Among them, one end of the first resistor R1 and one end of the second resistor R2 are respectively two input ends of the current mirror unit 111, and both are connected to the positive battery port B+ of the battery module BT to provide an input signal for the current mirror unit 111 to ensure the normal operation of the current mirror unit 111 and the realization of the precise sampling function; the other end of the first resistor R1 and the other end of the second resistor R2 are respectively connected to the emitter of the first transistor Q1 and the emitter of the second transistor Q2; the base of the first transistor Q1 is connected to the base of the second transistor Q2; the base of the second transistor Q2 is also connected to the collector of the second transistor Q2 to form a stable current mirror circuit, laying a foundation for subsequent current distribution and signal processing; the collector of the first transistor Q1 and the collector of the second transistor Q2 are respectively the first output end and the second output end of the current mirror unit 111, that is, the collector of the first transistor Q1 can be grounded through the first voltage detection unit, and the collector of the second transistor Q2 is connected to the negative external port P- through the second voltage detection unit.
[0068] The first transistor Q1 and the second transistor Q2 are both PNP transistors with the same characteristics, so that the two branch currents of the current mirror unit are closer, thereby improving the calculation accuracy of the external voltage.
[0069] It should be noted that the current mirror unit can utilize the resistance values of the first resistor R1 and the second resistor R2 to flexibly control the ratio of the output current to meet different application requirements. However, in the present application, in order to ensure the stable operation of the current mirror unit 111, the resistance values of the first resistor R1 and the second resistor R2 should be guaranteed to be the same. In addition, it should be noted that the voltage resistance selection of the first transistor Q1 and the second transistor Q2 can be selected according to the voltage condition of the battery management system, and in order to ensure that the first transistor Q1 and the second transistor Q2 are not broken down, when the external port is connected to a charging device (such as an identifiable charger), the N-type MOS tube of the main circuit in the charge and discharge circuit is disconnected, and the collector voltage Vbc of the third transistor Q3 in the pre-discharge circuit can withstand the voltage that is the sum of the battery system voltage and the charger voltage, then the base and collector voltage V bc The withstand voltage is greater than the sum of the maximum voltage of the battery management system and the voltage of the charging equipment.
[0070] The battery management system provided by the present application, the current mirror unit can be composed of a first resistor, a second resistor, a first triode and a second triode; wherein one end of the first resistor and one end of the second resistor are respectively two input ends of the current mirror unit, both connected to the positive battery port of the battery module, the other end of the first resistor and the other end of the second resistor are respectively connected to the emitter of the first triode and the emitter of the second triode; the base of the first triode is connected to the base of the second triode; the base of the second triode is also connected to the collector of the second triode; the collector of the first triode and the collector of the second triode are respectively the first output end and the second output end of the current mirror unit. Thus, the present application can realize the replication of the input current, and output through the collector of the first triode and the collector of the second triode, so as to realize the stable distribution of the current.
[0071] The battery management system provided in the above embodiment of the present application is explained and illustrated in detail as follows in conjunction with the accompanying drawings. Figure 4 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 4 .like Figure 4 As shown, the first voltage detection unit 112 may include: a third resistor R3 and a fourth resistor R4 connected in series.
[0072] Among them, the series connection point of the third resistor R3 and the fourth resistor R4 is the output end of the first voltage detection unit 112, and the output end of the first voltage detection unit 112 is connected to the first analog-to-digital sampling port ADC of the control unit 130, so that the control unit 130 samples the electrical signal of the mirror constant current source sampling circuit 110.
[0073] In the battery management system provided by the present application, the first voltage detection unit can be composed of a third resistor and a fourth resistor connected in series, and the series connection point of the third resistor and the fourth resistor is the output end of the first voltage detection unit, so as to transmit the electrical signal of the resistor voltage division to the first analog-to-digital sampling port of the control unit, so that the control unit can obtain the sampling signal in the mirror constant current source sampling circuit in real time, realize the monitoring and regulation of the mirror constant current source sampling circuit, and improve the response speed and utilization efficiency of the battery management system.
[0074] The battery management system provided in the above embodiment of the present application is explained and illustrated in detail as follows in conjunction with the accompanying drawings. Figure 5 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 5 .like Figure 5 As shown, the second voltage detection unit 113 may include: a fifth resistor R5.
[0075] The second output end of the current mirror unit 111, ie, the collector of the second transistor, is connected to the negative external port P- through the fifth resistor R5 to achieve voltage adaptation with external equipment and provide a certain over-current protection function.
[0076] In the battery management system provided by the present application, the second voltage detection unit can be composed of a fifth resistor. The second output end of the current mirror unit, that is, the collector of the second transistor, is connected to the negative external port through the fifth resistor to achieve voltage adaptation with the external circuit and provide a certain overcurrent protection function to improve the stability and safety of the battery management system.
[0077] The battery management system provided in the above embodiment of the present application is explained and illustrated in detail as follows in conjunction with the accompanying drawings. Figure 6 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 6 .like Figure 6 As shown, the mirror image constant current source sampling circuit 110 may further include: a filtering unit 114 .
[0078] The output end of the first voltage detection unit 112 is connected to the first analog-to-digital sampling port ADC of the control unit 130 through the filtering unit 114, so that the output electrical signal of the first voltage detection unit 112 is transmitted to the first analog-to-digital sampling port ADC of the control unit 130 after filtering by the filtering unit 114, thereby providing the control unit 130 with stable and accurate voltage sampling data (such as the sampling voltage V ad ), so as to facilitate subsequent analysis and processing, thereby ensuring that the entire battery management system can be based on the sampled voltage V ad , realize intelligent and precise control and operation, and improve the stability and reliability of the battery management system.
[0079] The filtering unit 114 may include: a sixth resistor R6 and a first capacitor C1.
[0080] The serial connection point of the third resistor R3 and the fourth resistor R4 is connected to the first analog-to-digital sampling port ADC of the control unit 130 through the sixth resistor R6 to output the sampling voltage V to the control unit 130. ad The first analog-to-digital sampling port ADC of the control unit 130 is also grounded through the first capacitor C1 to achieve filtering of the input signal of the first analog-to-digital sampling port ADC.
[0081] The battery management system provided in the present application, the mirror constant current source sampling circuit can also be composed of a filtering unit, and the output end of the first voltage detection unit is connected to the analog-to-digital sampling port of the control unit through the filtering unit to provide the control unit with stable and accurate voltage sampling data for subsequent analysis and processing, thereby ensuring that the entire battery management system can achieve intelligent and precise control and operation based on the sampling voltage, thereby improving the stability and reliability of the battery management system.
[0082] The battery management system provided in the above embodiment of the present application is explained and illustrated in detail as follows in conjunction with the accompanying drawings. Figure 7 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 7 .like Figure 7 As shown, the battery management system 100 may further include: a current sampling unit 140 .
[0083] Among them, the current sampling unit 140 is connected between the negative battery port B- of the battery module BT and the ground to form a stable current detection path; the current sampling unit 140 is also connected to the second analog-to-digital sampling port ADC of the control unit 130, so that the control unit 130 can collect the current information of the battery module BT in the working state, and then analyze and process the current signal, so as to grasp the current operation status of the battery module BT in real time, and provide data support for realizing efficient operation, precise control and optimization of battery management strategy of the entire battery management system, which greatly enhances the reliability, stability and intelligence of the battery management system.
[0084] The current sampling unit 140 may include: a seventh resistor R2.
[0085] Among them, the seventh resistor R2 is connected between the negative battery port B- of the battery module BT and the ground; the seventh resistor R2 is also connected to the second analog-to-digital sampling port ADC of the control unit 130, so that the control unit 130 can collect the current information of the battery module BT in the working state.
[0086] The battery management system provided in the present application may also be composed of a current sampling unit. The current sampling unit is connected between the negative battery port of the battery module and the ground. The current sampling unit is also connected to the second analog-to-digital sampling port of the control unit to realize the grasp of the current operation status of the battery module BT, and provide data support for realizing efficient operation, precise control and optimization of battery management strategies of the entire battery management system, which greatly enhances the reliability, stability and intelligence of the battery management system.
[0087] exist Figure 7 Based on this, the embodiment of the present application also provides a structural schematic diagram of a battery management system, Figure 8 A schematic diagram of a battery management system provided in an embodiment of the present application Figure 8 .like Figure 8 As shown, the charge and discharge circuit 120 may include: a main circuit 121 and a pre-discharge circuit 122 .
[0088] The main circuit 121 may include: a first N-type MOS transistor Q3 and a second N-type MOS transistor Q4. The gate of the first N-type MOS transistor Q3 and the gate of the second N-type MOS transistor Q4 are both used to connect to the control port of the control unit 130; the source of the first N-type MOS transistor Q3 is grounded through the current sampling unit 140; the source of the second N-type MOS transistor Q4 is used to connect to the second output end of the mirror constant current source sampling circuit 110; the drain of the first N-type MOS transistor Q3 is connected to the drain of the first N-type MOS transistor Q3. The first N-type MOS transistor Q3 is a discharge MOS transistor, and the second N-type MOS transistor Q4 is a charge MOS transistor.
[0089] The pre-discharge loop 122 may include: a third transistor Q3 , a pre-discharge resistor RL, an eighth resistor R8 , and a ninth resistor R9 .
[0090] Among them, the emitter of the third triode Q3 is connected to the source of the first N-type MOS tube Q3; the collector of the third triode Q3 is connected to the second output end of the mirror constant current source sampling circuit 110 through the pre-discharge resistor RL; the base of the third triode Q3 is connected to the enable port of the control unit 130 through the ninth resistor R9; the emitter of the third triode Q3 is connected to the base of the third triode Q3 through the eighth resistor R8.
[0091] The battery management system provided by the present application can have a charge and discharge circuit composed of a main discharge circuit and a pre-discharge circuit. When the battery management system is connected to an external load device (such as an external capacitive load), the load device (such as an external capacitive load) is first charged by controlling the pre-discharge circuit. When the charging voltage of the load device (such as an external capacitive load) reaches a certain level, the main discharge circuit is opened for normal discharge; when the battery management system is connected to an external charging device (such as an identifiable charger), the charging voltage of the charging device (such as an identifiable charger) is detected to ensure that the charging voltage meets the requirements of the battery management system, thereby improving the safety of the battery management system.
[0092] Based on the same inventive concept, an external voltage detection method is also provided in an embodiment of the present application, which can be executed by the control device 130 in the above-mentioned battery management system. Fig. 9 A schematic diagram of a process for detecting an external voltage provided in an embodiment of the present application Figure 1 .like Fig. 9 As shown, the method may include:
[0093] S201, obtaining a sampling voltage outputted from a first output terminal of a mirror image constant current source sampling circuit.
[0094] In one possible implementation, referring to the above Figure 8 The control device 130 obtains the sampling voltage V outputted from the first output terminal of the mirror constant current source sampling circuit through the first analog-to-digital sampling port ADC.ad .
[0095] S202 , according to the sampled voltage, using a preset resistance ratio between the first output terminal and the second output terminal in the mirror image constant current source sampling circuit, to calculate the external voltage between the positive external port and the negative external port.
[0096] S203: Calculate the current voltage of the battery module according to the external voltage.
[0097] Among them, the preset resistance ratio can be selected according to actual conditions.
[0098] In one possible implementation, referring to the above Figure 8 Since the output end of the first voltage detection unit is the first output end of the mirror image constant current source sampling circuit, the third resistor R3 and the fourth resistor R4 connected in series are the first output end of the mirror image constant current source sampling circuit. Since the second output end of the current mirror unit is connected to the negative external port through the second voltage detection unit, the second output end of the mirror image constant current source sampling circuit is the second voltage detection unit, that is, the fifth resistor R5. Then according to the sampling voltage V ad , first calculate the first current I1 at the first output terminal of the mirror image constant current source sampling circuit according to Ohm's law. Since the first current I1 at the first output terminal of the mirror image constant current source sampling circuit is approximately equal to the second current I2 at the second output terminal of the mirror image constant current source sampling circuit, the following formula (1) is used to calculate the external voltage V between the positive external port and the negative external port: a .
[0099] V a ≈((Vad / R4)*(R2+R5))+Vbe Formula (1)
[0100] Wherein, Vbe is the junction voltage between the emitter and the base of the first transistor Q1.
[0101] Since the first current I1 is approximately equal to the second current I2, the voltage formed by the branch where the first current I1 and the second current I2 are located is in a preset resistance ratio relationship with the circuit resistance of the branch where the first current I1 and the second current I2 are located, that is, the third resistor R3 and the fourth resistor R4 connected in series corresponding to the first output terminal and the fifth resistor R5 corresponding to the second output terminal in the mirror constant current source sampling circuit are in a preset resistance ratio relationship with the voltage formed by the branch where the first current I1 and the second current I2 are located, which can be expressed according to the following formula (2):
[0102] V b / V a ≈(R3+R4) / R5 Formula (2)
[0103] Among them, V b is the voltage of the branch where the first current I1 is located, and is also the current voltage V of the battery module BTb .
[0104] It can be seen from the above formula (2) that when the first resistor R1 = the second resistor R2, the resistance ratio of the third resistor R3, the fourth resistor R4 and the fifth resistor R5 connected in series determines the external voltage V between the positive external port and the negative external port. a The maximum value of .
[0105] It should be noted that the sampling voltage V ad The voltage is the voltage value obtained by dividing the third resistor R3 and the fourth resistor R4 in series, wherein the values of the third resistor R3 and the fourth resistor R4 should be determined according to the battery management system voltage VB+ and ensure that the sampling voltage V ad The maximum sampling voltage cannot exceed the preset maximum sampling voltage of the control device 130. The preset maximum sampling voltage can be selected according to actual conditions.
[0106] S204: Determine, based on the external voltage and the current voltage, whether the external device connected to the positive external port and the negative external port is a charging device or a load device.
[0107] In one possible implementation, referring to the above Figure 8 , according to the external voltage V a and the current voltage V b The size relationship between them determines whether the external device connected to the positive external port and the negative external port is a charging device or a load device.
[0108] It should be noted that when the positive external port and the negative external port are connected to an external device, that is, the current battery management system is in working state, the first N-type MOS tube Q3 and the second N-type MOS tube Q4 on the main discharge circuit can choose to turn off one of them according to the situation of the external device. For example, if the external device is a charging device (such as an identifiable charger), turn off the second N-type MOS tube Q4; if the external device is a load device (such as an external capacitive load), turn off the first N-type MOS tube Q3. The pre-discharge circuit only works when the external device is a load device (such as an external capacitive load), and in the remaining state, enters the standby state to protect the safety of the battery management system.
[0109] The external voltage detection method provided by the present application is applied to the control unit in the battery management system, by obtaining the sampled voltage output by the first output terminal of the mirror constant current source sampling circuit; according to the sampled voltage, the preset resistance ratio relationship between the first output terminal and the second output terminal in the mirror constant current source sampling circuit is used to calculate the external voltage between the positive external port and the negative external port: according to the external voltage, the current voltage of the battery module is calculated, thereby improving the accuracy and reliability of the voltage measurement; according to the external voltage and the current voltage, it is determined whether the external device connected to the positive external port and the negative external port is a charging device or a load device, thereby making the entire battery management system highly adaptable and flexible. Therefore, the present application can utilize the characteristics of the mirror constant current source circuit, and adopt the method of obtaining the external voltage and the current voltage to realize the detection and judgment function of the charging device and the load device, thereby improving the reliability of the battery management system.
[0110] Optionally, in the above method, determining whether the external device connected to the positive external port and the negative external port is a charging device or a load device according to the external voltage and the current voltage may include:
[0111] If the external voltage is greater than the current voltage, it is determined that the external device is a charging device.
[0112] In one possible implementation, if the external voltage V a Greater than the current voltage V b , and the external voltage V a If the preset charging voltage requirement range is also within the preset charging voltage requirement range, the battery management system determines that the external device is a charging device (such as an identifiable charger), that is, a charging device (such as an identifiable charger) is connected, and the charging voltage of the charging device (such as an identifiable charger) is normal, and the charging device (such as an identifiable charger) is identified. Among them, the preset charging voltage requirement range can be selected according to actual conditions and is not limited here.
[0113] In a possible implementation, the external voltage detection method may further include:
[0114] Control the main circuit in the charge and discharge circuit to charge.
[0115] In one possible implementation, when it is determined that the external device is a charging device (such as an identifiable charger), the main circuit in the charge and discharge circuit is controlled to charge the charging device (such as an identifiable charger), ensuring the safe charging process of the battery module for the charging device (such as an identifiable charger), improving the charging efficiency and battery life, and ensuring that the battery management system operates stably in the optimal state.
[0116] The external voltage detection method provided by the present application determines that the external device is a charging device if the external voltage is greater than the current voltage, so that the battery management system can realize automatic control of the charging process; then the main circuit in the charge and discharge circuit is controlled to charge to ensure the completeness of the charging process. Therefore, the present application can allow the battery module to charge the external device according to its actual needs, reduce unsafe factors in the charging process, avoid other hidden dangers caused by excessively high charging voltage, and improve the safety and stability of the battery management system.
[0117] Optionally, in the above method, determining whether the external device connected to the positive external port and the negative external port is a charging device or a load device according to the external voltage and the current voltage may include:
[0118] If the external voltage is less than the current voltage, the external device is determined to be a load device.
[0119] In one possible implementation, if the external voltage V a Less than the current voltage V b , it is determined that the external device is a load device (such as an external capacitive load), that is, a load device (such as an external capacitive load) is connected.
[0120] In one possible implementation, Fig.10 A schematic diagram of a process for detecting an external voltage provided in an embodiment of the present application Figure 2 .like Fig.10 As shown, the external voltage detection method may further include:
[0121] S301 : When the external voltage is within a preset deviation range of a preset minimum voltage, the pre-discharge circuit of the charge-discharge circuit is controlled to perform pre-discharge.
[0122] The preset minimum voltage and the preset deviation range may be selected according to actual conditions. For example, the preset minimum voltage may be 0V.
[0123] In a possible implementation, when it is determined that the external device is a load device (such as an external capacitive load), and the external voltage V a Within a preset deviation range of a preset minimum voltage (such as 0V), the third transistor Q3 in the pre-discharge loop of the charge-discharge loop is controlled to perform pre-discharge.
[0124] S302: After a preset pre-discharge time, if the external voltage rises to a set voltage, the main circuit of the charge-discharge circuit is controlled to discharge.
[0125] The set voltage may be selected according to actual conditions. For example, the set voltage is 1 / 3 of the battery management system voltage VB+.
[0126] The preset pre-discharge time can be set according to the time it takes for the external voltage to rise to the set voltage, and the set voltage meets the discharge voltage requirement of the battery management system, and can be selected according to actual conditions.
[0127] In one possible implementation, after a preset pre-discharge time, if the external voltage V a When it rises to the set voltage (such as 1 / 3*VB+), the main circuit of the charge and discharge circuit is opened for discharge.
[0128] It should be noted that after the main circuit of the charge and discharge circuit is opened, the sampling voltage V ad The calculated external voltage V a If the voltage is always the preset minimum voltage (such as 0V), it can be considered that the external device is short-circuited, and other protection strategies or warning measures can be implemented.
[0129] The external voltage detection method provided by the present application determines that the external device is a load device if the external voltage is less than the current voltage; and the external voltage is within the preset deviation range of the preset minimum voltage, the pre-discharge circuit of the charge-discharge circuit is controlled to pre-discharge; after the preset pre-discharge time, if the external voltage rises to the set voltage, the main circuit of the charge-discharge circuit is controlled to discharge. Therefore, the present application can effectively identify the state of the load device, decide to open the main circuit in the charge-discharge circuit according to the actual situation, realize the protection of the first N-type MOS tube and the second N-type MOS tube in the main circuit, and realize the protection of the pre-discharge resistor, thereby improving the safety and reliability of the battery management system.
[0130] To facilitate understanding of the external voltage detection method, the present application embodiment further provides an example of a process of an external voltage detection method, which is described below in conjunction with the accompanying drawings. Fig.11 A schematic diagram of a process for detecting an external voltage provided in an embodiment of the present application Figure 3 .like Fig.11 As shown, the external voltage detection method may include:
[0131] S401, obtaining a sampling voltage outputted from a first output terminal of a mirror image constant current source sampling circuit.
[0132] Specifically, refer to the above Figure 8 The control device 130 obtains the sampling voltage V outputted from the first output terminal of the mirror constant current source sampling circuit through the first analog-to-digital sampling port ADC. ad .
[0133] S402, according to the sampled voltage, using the preset resistance ratio between the first output terminal and the second output terminal in the mirror image constant current source sampling circuit, calculate the external voltage between the positive external port and the negative external port and the current voltage of the battery module.
[0134] Specifically, since the output end of the first voltage detection unit is the first output end of the mirror image constant current source sampling circuit, the third resistor R3 and the fourth resistor R4 connected in series are the first output end of the mirror image constant current source sampling circuit. Since the second output end of the current mirror unit is connected to the negative external port through the second voltage detection unit, the second output end of the mirror image constant current source sampling circuit is the second voltage detection unit, that is, the fifth resistor R5. Then according to the sampling voltage V ad , first calculate the first current I1 at the first output terminal of the mirror image constant current source sampling circuit according to Ohm's law. Since the first current I1 at the first output terminal of the mirror image constant current source sampling circuit is approximately equal to the second current I2 at the second output terminal of the mirror image constant current source sampling circuit, the external voltage V between the positive external port and the negative external port is calculated using the above formula (1): a .
[0135] Since the first current I1 is approximately equal to the second current I2, the voltage formed by the branch where the first current I1 and the second current I2 are located is in a preset resistance ratio relationship with the circuit resistance of the branch where the first current I1 and the second current I2 are located, that is, the third resistor R3 and the fourth resistor R4 connected in series corresponding to the first output terminal in the mirror constant current source sampling circuit and the fifth resistor R5 corresponding to the second output terminal are in a preset resistance ratio relationship with the voltage formed by the branch where the first current I1 and the second current I2 are located. The current voltage V of the battery module can be obtained according to the above formula (2): b .
[0136] S403: Determine whether the external device connected to the positive external port and the negative external port is a charging device or a load device, and execute a corresponding control strategy.
[0137] Specifically, refer to the above Figure 8 , according to the external voltage V a and the current voltage V b The size relationship between them, that is, if the external voltage V a Greater than the current voltage V b , and the external voltage V a If the charging voltage is also within the preset range, the battery management system determines that the external device is a charging device (such as an identifiable charger), that is, a charging device (such as an identifiable charger) is connected and the charging voltage of the charging device (such as an identifiable charger) is normal. Then the main circuit in the charge and discharge circuit is controlled to charge the charging device (such as an identifiable charger), ensuring the safe charging process of the battery module for the charging device (such as an identifiable charger), improving the charging efficiency and battery life, and ensuring that the battery management system operates stably in the optimal state.
[0138] If the external voltage V a Less than the current voltage V b, then it is determined that the external device is a load device (such as an external capacitive load), that is, a load device (such as an external capacitive load) is connected, and the external voltage V a Within a preset deviation range of a preset minimum voltage (such as 0V), the third transistor Q3 in the pre-discharge circuit of the charge-discharge circuit is controlled to perform pre-discharge, and after a preset pre-discharge time, if the external voltage V a When it rises to the set voltage (such as 1 / 3*VB+), the main circuit of the charge and discharge circuit is opened for discharge.
[0139] It should be noted that after the main circuit of the charge and discharge circuit is opened, the sampling voltage V ad The calculated external voltage V a If the voltage is always the preset minimum voltage (such as 0V), it can be considered that the external device is short-circuited, and other protection strategies or warning measures can be implemented.
[0140] The external voltage detection method provided in the present application obtains a sampled voltage outputted from the first output terminal of a mirror image constant current source sampling circuit, and based on the sampled voltage, uses a preset resistance ratio relationship between the first output terminal and the second output terminal in the mirror image constant current source sampling circuit to calculate the external voltage between the positive external port and the negative external port and the current voltage of the battery module, determines whether the external device connected to the positive external port and the negative external port is a charging device or a load device, and executes a corresponding control strategy. Therefore, the present application can be applied to external device detection of the battery management system, such as the circuit design of charging device detection and load device detection. In the battery management system, the charging device detection is to ensure whether the battery module is connected to the charging device in the current state, and whether the charging voltage meets the charging requirements of the charging device, etc., and to execute corresponding strategies to improve the safety of the battery management system; the load device detection in the battery management system is to charge the capacitor in the load device to the set voltage level, and then open the main circuit in the charging and discharging circuit to protect the discharge MOS in the main circuit from the problem of pipe explosion caused by large current surge impact, so as to make the pre-discharge circuit in the charging and discharging circuit more matched with the main circuit switching, avoiding false triggering caused by switching the pre-discharge circuit to the main circuit too early or too late, damage to the main circuit components, and delayed response problems of the battery management system. At the same time, compared with the use of two independent level detection schemes in the prior art, the present application only uses a mirror constant current source sampling circuit to achieve accurate detection of external devices, so that the present application reduces the number of required electronic components, realizes multi-functional integration, optimizes the PCB layout, and saves the IO resources of the control module, that is, only uses the first analog-to-digital sampling port of the control module, reduces the BOM (bill of materials) cost, and is beneficial to the later maintenance of the battery management system. The mirror constant current source sampling circuit components in the present application are highly versatile and have a high utilization rate, which is conducive to mass production and can be applied to energy storage BMS, automotive BMS, outdoor portable BMS and other occasions.
[0141] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A battery management system, characterized in that: The battery management system comprises: a mirror image constant current source sampling circuit, a charge and discharge circuit, a positive external port, a negative external port and a control unit; The positive external port is connected to the positive battery port of the battery module, the negative external port is connected to one end of the charge and discharge loop, the other end of the charge and discharge loop is connected to the negative battery port of the battery module, and the control end of the charge and discharge loop is also connected to the control port of the control unit; The first input terminal and the second input terminal of the mirror image constant current source sampling circuit are both connected to the positive battery port of the battery module, the first output terminal of the mirror image constant current source sampling circuit is connected to the first analog-to-digital sampling port of the control unit, and the second output terminal of the mirror image constant current source sampling circuit is also connected to the negative external port to output a sampling voltage to the control unit; The control unit is used to: calculate the external voltage between the positive external port and the negative external port based on the sampled voltage, and calculate the current voltage of the battery module according to the external voltage, and then determine whether the external device connected to the positive external port and the negative external port is a charging device or a load device according to the external voltage and the current voltage.
2. The battery management system according to claim 1, characterized in that: The mirror image constant current source sampling circuit comprises: a current mirror unit, a first voltage detection unit and a second voltage detection unit; two input ends of the current mirror unit are the first input end and the second input end of the mirror image constant current source sampling circuit, and the first input end and the second input end are both connected to the positive battery port of the battery module; The first output end of the current mirror unit is grounded through the first voltage detection unit, and the second output end of the current mirror unit is connected to the negative external port through the second voltage detection unit; The output end of the first voltage detection unit is the first output end of the mirror image constant current source sampling circuit, which is used to connect to the first analog-to-digital sampling port of the control unit.
3. The battery management system according to claim 2, characterized in that: The current mirror unit comprises: a first resistor, a second resistor, a first transistor, and a second transistor; wherein one end of the first resistor and one end of the second resistor are respectively two input ends of the current mirror unit, both of which are connected to the positive battery port of the battery module, and the other end of the first resistor and the other end of the second resistor are respectively connected to the emitter of the first transistor and the emitter of the second transistor; The base of the first transistor is connected to the base of the second transistor; the base of the second transistor is also connected to the collector of the second transistor; The collector of the first transistor and the collector of the second transistor are respectively the first output end and the second output end of the current mirror unit.
4. The battery management system according to claim 2, characterized in that: The first voltage detection unit includes: a third resistor and a fourth resistor connected in series, and a serial connection point of the third resistor and the fourth resistor is an output end of the first voltage detection unit.
5. The battery management system according to claim 2, characterized in that: The second voltage detection unit includes: a fifth resistor.
6. The battery management system according to claim 2, characterized in that: The mirror image constant current source sampling circuit further includes: a filtering unit, and the output end of the first voltage detection unit is connected to the first analog-to-digital sampling port of the control unit through the filtering unit.
7. The battery management system according to claim 1, characterized in that: The battery management system further includes: a current sampling unit, which is connected between the negative battery port of the battery module and the ground, and is also connected to the second analog-to-digital sampling port of the control unit.
8. An external voltage detection method, characterized in that: The control unit used in the battery management system according to claim 1, the method comprising: Obtaining a sampled voltage outputted from a first output terminal of a mirror image constant current source sampling circuit; According to the sampled voltage, the external voltage between the positive external port and the negative external port is calculated by using the preset resistance ratio between the first output terminal and the second output terminal in the mirror image constant current source sampling circuit: Calculating the current voltage of the battery module according to the external voltage; According to the external voltage and the current voltage, it is determined whether the external device connected to the positive external port and the negative external port is a charging device or a load device.
9. The external voltage detection method according to claim 8, characterized in that: The step of determining, based on the external voltage and the current voltage, whether the external device connected to the positive external port and the negative external port is a charging device or a load device comprises: If the external voltage is greater than the current voltage, determining that the external device is a charging device; The method further comprises: The main circuit in the charging and discharging circuit is controlled to charge.
10. The external voltage detection method according to claim 8, characterized in that: The step of determining, based on the external voltage and the current voltage, whether the external device connected to the positive external port and the negative external port is a charging device or a load device comprises: If the external voltage is less than the current voltage, determining that the external device is a load device; The method further comprises: The external voltage is within a preset deviation range of a preset minimum voltage, controlling a pre-discharge circuit of the charge-discharge circuit to perform pre-discharge; After a preset pre-discharge time, if the external voltage rises to a set voltage, the main circuit of the charge-discharge circuit is controlled to discharge.