Battery replacement system and coding method

By using voltage divider modules with different voltage divider capabilities in the battery swap system to connect with the installation slot, voltage is collected to determine the location of the battery pack, the problem of coding sequence dependence and communication abnormalities in the prior art is solved, and accurate coding and high reliability are achieved under any installation sequence.

CN120056800APending Publication Date: 2025-05-30CONTEMPORARY AMPEREX TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when encoding the SBMU, the battery swap system needs to be carried out in the order of the installation slots. If the battery pack is not installed in sequence, it cannot be accurately encoded, and PC triggering and packet interaction is required, which is prone to encoding failure due to communication abnormalities.

Method used

A battery swap system is designed, including the main battery management system and N installation slots. The main battery management system is connected to the installation slots through N voltage division modules with different voltage division capabilities. The voltage division capabilities of different voltage division modules are different. The collected voltage is used to determine the installation slot where the battery pack is located, thereby realizing the encoding of the SBMU. The system does not require battery packs to be installed in sequence, nor does it require PC triggering and packet interaction.

Benefits of technology

It realizes accurate encoding of SBMU in any installation sequence, improves the reliability and flexibility of the battery swap system, and avoids encoding failures caused by communication abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120056800A_ABST
    Figure CN120056800A_ABST
Patent Text Reader

Abstract

The invention discloses a battery replacement system and a coding method, the battery replacement system comprises a main battery management system, the main battery management system comprises N first voltage division modules with different voltage division capabilities, the first ends of the first voltage division modules are connected with mounting slots, and the mounting slots connected with different first voltage division modules are different; the N mounting slots are used for mounting battery packs, each mounting slot is used for mounting at least one battery pack, the slave battery management system of each battery pack comprises a first control unit and a first pull-up module, the first end of the first pull-up module is connected with the first control unit, and the second end of the first pull-up module is connected with a power supply; and under the condition that the first battery pack is mounted in the first mounting slot position, the first end of the first voltage dividing module connected with the first mounting slot position is connected with the first end of the first pull-up module in the first slave battery management system and the first control unit in the first slave battery management system respectively. In this way, encoding from a battery management system may be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of coding technologies, and particularly to a battery swapping system and a coding method. Background Art

[0002] In the current battery system architecture, a slave battery management system (SBMU) serves as a communication node of a master battery management system (MBMU). In order to accurately determine which SBMU sends a message when receiving a message from the SBMU, it is necessary to code the SBMU.

[0003] Therefore, a solution for coding the SBMU is needed. Summary of the Invention

[0004] This application provides a battery swapping system and a coding method, which can implement coding for a slave battery management system.

[0005] In a first aspect, this application provides a battery swapping system, including: a master battery management system, which includes N first voltage dividing modules with different voltage dividing capabilities. The first end of the first voltage dividing module is connected to an installation slot, and different installation slots are connected to different first voltage dividing modules. N is a positive integer greater than 1; N installation slots are used for installing battery packs. Each installation slot is used for installing at least one battery pack. The slave battery management system of the battery pack includes a first control unit and a first pull-up module. The first end of the first pull-up module is connected to the first control unit, and the second end of the first pull-up module is connected to a power supply. When the first battery pack is installed in the first installation slot, the first end of the first voltage dividing module connected to the first installation slot is respectively connected to the first end of the first pull-up module in the first slave battery management system and the first control unit in the first slave battery management system. The first slave battery management system is the slave battery management system of the first battery pack, and the first installation slot is any one of the N installation slots.

[0006] Thus, since the voltage dividing capabilities of the first voltage dividing modules connected to different installation slots are different, when the battery pack is installed in different installation slots, the first voltage between the first voltage dividing module connected to the first installation slot and the first pull-up module in the first slave battery management unit is different. Therefore, the installation slot where the battery pack is located can be determined based on this first voltage, thereby coding the first slave battery management system.

[0007] In some embodiments, the main battery management system further includes a second control unit and N second pull-up modules. The first end of each second pull-up module is connected to an installation slot, and different second pull-up modules are connected to different installation slots. The first end of each second pull-up module is also connected to the second control unit, and the second end of each second pull-up module is connected to a power supply. The slave battery management system further includes a second voltage-dividing module. When the first battery pack is installed in the first installation slot, the first end of the second pull-up module connected to the first installation slot is connected to the first end of the second voltage-dividing module in the first slave battery management system, and the first end of the second voltage-dividing module in the first slave battery management system is also connected to the second control unit.

[0008] In this way, since the second pull-up resistor can be connected to the second voltage-dividing resistor when the installation slot is installed with a battery pack, and the second pull-up resistor is not connected to the second voltage-dividing resistor when the installation slot is not installed with a battery pack, the second voltage between the installation slot and the second pull-up module is different when the installation slot is installed with a battery pack and when the installation slot is not installed with a battery pack. Therefore, it can be accurately determined whether the installation slot is installed with a battery pack based on this second voltage.

[0009] In some embodiments, the first control unit is connected to the second control unit. The second control unit is configured to collect a third voltage between the second pull-up module connected to the first installation slot and the first installation slot, and send the third voltage to the first control unit. The first control unit is configured to collect a first voltage between the first voltage-dividing module connected to the first installation slot and the first pull-up module in the first slave battery management system, and determine whether a fault occurs in the battery swapping system based on the first voltage and the third voltage.

[0010] In this way, based on the third voltage between the second pull-up module connected to the first installation slot and the first installation slot, and the first voltage between the first voltage-dividing module connected to the first installation slot and the first pull-up module in the first slave battery management system, it can be accurately determined whether a fault occurs in the battery swapping system.

[0011] In a second aspect, the present application provides an encoding method, which is applied to the battery swapping system shown in any one of the embodiments of the first aspect. The method includes: collecting, by the first control unit, a first voltage between the first voltage-dividing module connected to the first installation slot and the first pull-up module in the first slave battery management system; and encoding, by the first control unit, the first slave battery management system based on the first voltage.

[0012] Therefore, since the voltage division capabilities of the first voltage division modules connected to different installation slots are different, when the battery pack is installed in different installation slots, the first voltage between the first voltage division module connected to the first installation slot and the first pull-up module in the first slave battery management unit is different. Therefore, the installation slot where the battery pack is located can be determined based on this first voltage, so as to encode the first slave battery management system.

[0013] In some embodiments, encoding the first slave battery management system based on the first voltage includes: determining the first preset range in which the first voltage is located; using the first preset value corresponding to the first preset range as the encoding value of the first slave battery management system.

[0014] In this way, since the voltage division capabilities of the first voltage division modules connected to different installation slots are different, when the first battery pack is installed in different installation slots, the preset ranges in which the first voltage collected by the first control unit is located are different. Therefore, according to the first preset range in which the first voltage is located, the installation slot where the first battery pack is installed can be accurately determined, so as to accurately obtain the encoding value of the first slave battery management system.

[0015] In some embodiments, the method further includes: collecting, by a second control unit, a second voltage between the installation slot and the second pull-up module; and determining, by the second control unit based on the second voltage, whether a battery pack is installed in the installation slot.

[0016] In this way, since when a battery pack is installed in the installation slot, the second pull-up resistor can be connected to the second voltage division resistor, and when no battery pack is installed in the installation slot, the second pull-up resistor is not connected to the second voltage division resistor, the second voltage between the installation slot and the second pull-up module is different when a battery pack is installed in the installation slot and when no battery pack is installed in the installation slot. Therefore, it can be accurately determined whether a battery pack is installed in the installation slot based on this second voltage.

[0017] In some embodiments, determining whether a battery pack is installed in the installation slot based on the second voltage includes: determining that a battery pack is installed in the installation slot when the second voltage is within a second preset range; and determining that no battery pack is installed in the installation slot when the second voltage is within a third preset range, where the lower limit of the third preset range is greater than the upper limit of the second preset range.

[0018] In this way, since when a battery pack is installed in the installation slot, the second pull-up resistor can be connected to the second voltage division resistor, causing the second voltage to be within a smaller second preset range; when no battery pack is installed in the installation slot, the second pull-up resistor is not connected to the second voltage division resistor, and the second voltage is within a larger third preset range. Therefore, it can be accurately determined whether a battery pack is installed in the installation slot by determining whether the second voltage is within the second preset range or the third preset range, thereby improving the reliability of the battery swapping system.

[0019] In some embodiments, the method further includes: collecting, by a second control unit, a third voltage between a second pull-up module connected to a first mounting slot and the first mounting slot, and sending the third voltage to a first control unit; determining, by the first control unit, whether a fault occurs in the battery swapping system based on the first voltage and the third voltage.

[0020] Thus, based on the third voltage between the second pull-up module connected to the first mounting slot and the first mounting slot, and the first voltage between the first voltage-dividing module connected to the first mounting slot and the first pull-up module in the first slave battery management system, it is possible to accurately determine whether a fault occurs in the battery swapping system.

[0021] In some embodiments, determining whether a fault occurs in the battery swapping system based on the first voltage and the third voltage includes: determining that a fault occurs in the battery swapping system when the first voltage is within a fourth preset range and the third voltage is within a second preset range.

[0022] Thus, by determining whether the first voltage is within the fourth preset range and whether the third voltage is within the second preset range, it is possible to accurately determine whether a fault occurs in the battery swapping system.

[0023] In some embodiments, after collecting, by the second control unit, the third voltage between the second pull-up module connected to the first mounting slot and the first mounting slot and sending the third voltage to the first control unit, the method further includes: determining, by the first control unit, that a short-circuit to ground or short-circuit to power supply fault occurs in the battery swapping system when the first voltage is not greater than a first threshold or greater than a second threshold and the third voltage is within the second preset range; determining, by the first control unit, that an open-circuit fault occurs in the battery swapping system when the first voltage is within a fifth preset range and the third voltage is within the second preset range, where the lower limit of the fifth preset range is greater than the first threshold and the upper limit of the fifth preset range is not greater than the second threshold.

[0024] Thus, by respectively determining the ranges of the first voltage and the third voltage, it is possible to accurately determine the type of fault in the battery swapping system.

[0025] In a third aspect, the present application provides an encoding device applied to the battery swapping system shown in any of the embodiments of the first aspect. The device includes: a first acquisition module, configured to acquire, by a first control unit, a first voltage between a first voltage-dividing module connected to a first mounting slot and a first pull-up module in a first slave battery management system; an encoding module, configured to encode, by the first control unit, the first slave battery management system based on the first voltage.

[0026] Therefore, since the voltage division capabilities of the first voltage division modules connected to different installation slots are different, when the battery pack is installed in different installation slots, the first voltage between the first voltage division module connected to the first installation slot and the first pull-up module in the first slave battery management unit is different. Therefore, the installation slot where the battery pack is located can be determined based on this first voltage, so as to encode the first slave battery management system.

[0027] In a fourth aspect, the present application provides an electronic device, which includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the encoding method shown in any one of the embodiments of the second aspect is implemented.

[0028] In a fifth aspect, the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the encoding method shown in any one of the embodiments of the second aspect is implemented.

[0029] In a sixth aspect, an embodiment of the present application provides a computer program product, and when the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to execute the encoding method shown in any one of the embodiments of the second aspect.

[0030] The above description is only an overview of the technical solutions of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the description. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the specific embodiments of the present application are hereinafter specifically exemplified. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. And in all the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0032] Figure 1 One of the structural schematic diagrams of a battery swapping system provided by some embodiments of the present application;

[0033] Figure 2 Another structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0034] Figure 3 Another structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0035] Figure 4 Another structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0036] Figure 5 The fifth structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0037] Figure 6 The sixth structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0038] Figure 7 The seventh structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0039] Figure 8 The eighth structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0040] Figure 9 The ninth structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0041] Figure 10 The tenth structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0042] Figure 11 The eleventh structural schematic diagram of a battery swapping system provided by some embodiments of the present application;

[0043] Figure 12 The flowchart of a coding method provided by some embodiments of the present application;

[0044] Figure 13 The structural schematic diagram of a coding device provided by some embodiments of the present application;

[0045] Figure 14 The structural schematic diagram of an electronic device provided by some embodiments of the present application. Detailed implementation manners

[0046] Next, embodiments of the technical solutions of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and thus are only examples and cannot be used to limit the protection scope of the present application.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above accompanying drawings are intended to cover non-exclusive inclusion.

[0048] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality of" is more than two, unless otherwise specifically defined.

[0049] Reference to "embodiment" herein means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0050] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.

[0051] In the description of the embodiments of the present application, the term "a plurality of" refers to more than two (including two). Similarly, "a plurality of groups" refers to more than two groups (including two groups), and "a plurality of sheets" refers to more than two sheets (including two sheets).

[0052] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installation", "connection", "connection", "fixation", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, and can be the communication inside two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.

[0053] As described in the background art, with the development of new energy vehicles, higher requirements are put forward for new energy vehicles, such as long cruising range and fast charging. However, since there has been no effective breakthrough in battery technology barriers, in order to meet the market demand, the battery swapping mode has emerged.

[0054] Although the battery swapping mode can effectively solve the pain point of long battery charging time, firstly, the structure of the current back-mounted battery swapping battery pack forces the vehicle to sacrifice a certain amount of loading space; secondly, the battery swapping battery pack is installed behind the front of the vehicle, and there are certain safety hazards under uphill, downhill and bad road conditions; thirdly, the battery swapping battery pack has a fixed power, and it is impossible to install a battery pack with the corresponding power according to the different mileage requirements of users. If multiple power cabinets are expanded, it will bring great challenges to the dispatching operation of the station control. To meet the above application scenario requirements, the battery swapping battery pack is made modular and standardized. At the same time, the battery system architecture also needs to be innovated, changing from the previous two-level architecture to a three-level architecture. The communication topology of the entire system also needs to be innovated. It is necessary to use the SBMU as the communication node of the MBMU, encode the SBMU to bind the corresponding message address, and realize the interaction between the SBMU and the MBMU.

[0055] In the related technology, the MBMU encoding function can receive the encoding request of a personal computer (PC) and realize the encoding of all SBMUs. That is, when the PC sends an encoding request message to the MBMU, the MBMU enables the hard wire voltage of the SBMU encoding to be pulled low, and at the same time sends an encoding request message to the SBMU. The SBMU receives that the encoding address of the MBMU is valid, updates and stores the encoding address, and returns an encoding success to the MBMU after successful storage; then enables the first SBMU to pull the hard wire voltage of the second SBMU encoding low. Similarly, the MBMU sends the encoding address to the second SBMU to complete the encoding, so that the encoding of multiple SBMUs can be completed in sequence.

[0056] However, in the related technology, only the encoding of the SBMU is supported in the order of the installation slots. If the battery pack is not installed in the order of the installation slots, the encoding of the SBMU cannot be corresponding to the installation slot number, resulting in encoding errors; moreover, in the related technology, encoding can only be triggered by a PC; in addition, in the related technology, message interaction is required. If there is a communication anomaly, the encoding cannot be successful.

[0057] To solve the above technical problems, an embodiment of the present application provides a battery swapping system and a coding method. The battery swapping system may include a main battery management system and N installation slots. Among them, the main battery management system includes N first voltage dividing modules with different voltage dividing capabilities. The first end of the first voltage dividing module is connected to the installation slot, and different installation slots are connected to different first voltage dividing modules. N is a positive integer greater than 1; the N installation slots are used to install battery packs, and each installation slot is used to install at least one battery pack. The slave battery management system of the battery pack includes a first control unit and a first pull-up module. The first end of the first pull-up module is connected to the first control unit, and the second end of the first pull-up module is connected to the power supply; when the first battery pack is installed in the first installation slot, the first end of the first voltage dividing module connected to the first installation slot is respectively connected to the first end of the first pull-up module in the first slave battery management system and the first control unit in the first slave battery management system. The first slave battery management system is the slave battery management system of the first battery pack, and the first installation slot is any one of the N installation slots.

[0058] Therefore, since the voltage dividing capabilities of the first voltage dividing modules connected to different installation slots are different, when the battery pack is installed in different installation slots, the first voltage between the first voltage dividing module connected to the first installation slot and the first pull-up module in the first slave battery management unit is different. Therefore, the installation slot where the battery pack is located can be determined based on this first voltage, so as to code the first slave battery management system.

[0059] In this way, even if the battery packs are not installed in the order of the installation slots, the SBMU can be accurately coded; moreover, in some embodiments of the present application, the first control unit can periodically collect the first voltage between the first voltage dividing module connected to the first installation slot and the first pull-up module in the first SBMU, and the first control unit can code the first SBMU based on the first voltage without being triggered by the PC; in addition, in the embodiments of the present application, there is no need to perform message interaction, so the coding failure will not be caused by communication anomalies.

[0060] The battery swapping system and the coding method provided by the embodiments of the present application will be introduced in detail below.

[0061] Figure 1 It is a schematic structural diagram of a battery swapping system provided by some embodiments of the present application.

[0062] As Figure 1 shown, the battery swapping system 100 may include: a main battery management system 110 and N installation slots 120.

[0063] It should be noted that N may be a positive integer greater than 1. In the embodiments of the present application, N = 3 is taken as an example for introduction.

[0064] Among them, the main battery management system 110 may include N first voltage dividing modules 111 with different voltage dividing capabilities. The first end of the first voltage dividing module 111 may be connected to the installation slot 120, and the installation slots 120 connected to different first voltage dividing modules 111 may be different. The second end of the first voltage dividing module 111 may be grounded.

[0065] The N installation slots 120 can all be used to install battery packs, and each installation slot 120 can be used to install at least one battery pack.

[0066] As Figure 2 shown, the slave battery management system 130 of the battery pack may include a first control unit 131 and a first pull-up module 132. The first end of the first pull-up module 132 may be connected to the first control unit 131, and the second end of the first pull-up module 132 may be connected to the power supply.

[0067] As Figure 3 shown, when the first battery pack is installed in the first installation slot 121, the first end of the first voltage dividing module 111 connected to the first installation slot 121 may be respectively connected to the first end of the first pull-up module 132 in the first slave battery management system 133 and the first control unit 131 in the first slave battery management system 133. The first slave battery management system 133 may be the slave battery management system of the first battery pack, and the first installation slot 121 may be any one of the N installation slots.

[0068] Here, the N first voltage dividing modules with different voltage dividing capabilities may be N voltage dividing resistors with different resistance values. The first control unit may be a microcontroller unit (MCU). The first pull-up module may be a pull-up resistor.

[0069] Exemplarily, the power supply connected to the second end of the first pull-up module may be a pull-up power supply with a voltage of 5V.

[0070] Specifically, the first end of the first pull-up module may be a first analog interface, and the first control unit may be used to periodically collect the voltage at the first analog interface. In this way, when the first battery pack is installed in the first installation slot, the first control unit can collect the first voltage between the first voltage dividing module connected to the first installation slot and the first pull-up module in the first slave battery management system, and can encode the first slave battery management system based on the first voltage.

[0071] In some embodiments of the present application, the first control unit may specifically be used to determine the first preset range where the first voltage is located, and use the first preset value corresponding to the first preset range as the encoding value of the first slave battery management system.

[0072] Here, N different preset ranges can be set in advance, and the preset ranges can correspond one-to-one with the installation slots. Different coding values can also be set in advance for different installation slots, and the installation slots correspond one-to-one with the coding values. Therefore, the preset ranges can correspond one-to-one with the coding values. Based on the preset range in which the first voltage is located, the installation slot where the battery pack is installed can be determined, so as to determine the coding value corresponding to the installation slot, and then this coding value can be used as the coding value of the first slave battery management system of the battery pack.

[0073] The preset range can be determined according to the resistance value of the first voltage dividing module connected to the installation slot corresponding to it. Specifically, the preset range can be determined according to the resistance value of the first voltage dividing module, the resistance value of the first pull-up module, and the voltage of the power supply connected to the second end of the first pull-up module. The first preset value corresponding to the first preset range can be the preset value corresponding to the first installation slot.

[0074] Exemplarily, as Figure 4 shown, three first voltage dividing modules with different voltage dividing capabilities can be: a first voltage dividing resistor 410 with a resistance value of 0.47 kΩ, a second voltage dividing resistor 420 with a resistance value of 1 kΩ, and a third voltage dividing resistor 430 with a resistance value of 2.2 kΩ. As Figure 5 shown, the first pull-up module can be a first pull-up resistor 510 with a resistance value of 1 kΩ, and the power supply connected to the second end of the first pull-up resistor 510 can be a pull-up power supply with a voltage of 5V. The first end of the first pull-up resistor is connected to the first MCU 520 of the slave battery management system. If the first installation slot is the installation slot connected to the first voltage dividing resistor 410, then when the first battery pack is installed in the first installation slot, the preset range in which the first voltage is located should be (1V, 2V]; if the first installation slot is the installation slot connected to the second voltage dividing resistor 420, then when the first battery pack is installed in the first installation slot, the preset range in which the first voltage is located should be (2V, 3V]; if the first installation slot is the installation slot connected to the third voltage dividing resistor 430, then when the first battery pack is installed in the first installation slot, the preset range in which the first voltage is located should be (3V, 4V).

[0075] Therefore, when it is determined that the first preset range where the first voltage is located is (1V, 2V], it can be determined that the battery pack is installed in the mounting slot connected to the first voltage-dividing resistor 410. Therefore, the coding value "1" corresponding to the mounting slot connected to the first voltage-dividing resistor 410 can be used as the coding value of the first slave battery management system of the first battery pack; when it is determined that the first preset range where the first voltage is located is (2V, 3V], it can be determined that the battery pack is installed in the mounting slot connected to the second voltage-dividing resistor 420. Therefore, the coding value "2" corresponding to the mounting slot connected to the second voltage-dividing resistor 420 can be used as the coding value of the first slave battery management system of the first battery pack; when it is determined that the first preset range where the first voltage is located is (3V, 4V], it can be determined that the battery pack is installed in the mounting slot connected to the third voltage-dividing resistor 430. Therefore, the coding value "3" corresponding to the mounting slot connected to the third voltage-dividing resistor 430 can be used as the coding value of the first slave battery management system of the first battery pack.

[0076] In addition, since the first pull-up resistor 510 is not connected to any voltage-dividing resistor when the first battery pack is not installed in the mounting slot, the preset range where the first voltage is located should be (4V, 5V]. Therefore, it can also be preset that the coding value corresponding to (4V, 5V] is "4". The coding value "4" can be used to indicate that the battery pack is not installed in the mounting slot. Therefore, when it is determined that the first preset range where the first voltage is located is (4V, 5V], the coding value "4" can be used as the coding value of the first slave battery management system of the first battery pack.

[0077] In this way, since the voltage-dividing capabilities of the first voltage-dividing modules connected to different mounting slots are different, when the first battery pack is installed in different mounting slots, the preset ranges where the first voltages collected by the first control unit are located are different. Therefore, according to the first preset range where the first voltage is located, the mounting slot where the first battery pack is installed can be accurately determined, so as to accurately code the coding value of the first slave battery management system.

[0078] Thus, since the voltage-dividing capabilities of the first voltage-dividing modules connected to different mounting slots are different, when the battery pack is installed in different mounting slots, the first voltage between the first voltage-dividing module connected to the first mounting slot and the first pull-up module in the first slave battery management unit is different. Therefore, the mounting slot where the battery pack is located can be determined based on this first voltage, so as to code the first slave battery management system.

[0079] Accurately coding the slave battery management system can facilitate quickly locating the faulty battery pack and handling the fault.

[0080] In some embodiments of the present application, such as Figure 6As shown, the main battery management system 110 may further include a second control unit 112 and N second pull-up modules 113. The first end of the second pull-up module 113 may be connected to the installation slot 120, and the installation slots 120 connected to different second pull-up modules 113 may be different. The first end of the second pull-up module 113 may also be connected to the second control unit 112, and the second end of the second pull-up module 113 may be connected to a power supply.

[0081] As Figure 7 shown, the slave battery management system 130 may further include a second voltage dividing module 134. The second end of the second voltage dividing module 134 may be grounded.

[0082] As Figure 8 shown, when the first battery pack is installed in the first installation slot 121, the first end of the second pull-up module 113 connected to the first installation slot 121 may be connected to the first end of the second voltage dividing module 134 in the first slave battery management system 133, and the first end of the second voltage dividing module 134 in the first slave battery management system 133 may also be connected to the second control unit 112.

[0083] Here, the N second pull-up modules may be pull-up resistors. The second control unit may be an MCU. The second voltage dividing module may be a voltage dividing resistor.

[0084] Exemplarily, the power supply connected to the second end of the second pull-up module may be a pull-up power supply with a voltage of 5V.

[0085] Specifically, the first end of the second pull-up module may be a second analog interface, that is, the second analog interface may be located on the connection line between the installation slot and the second pull-up module. The second control unit may be used to periodically collect the second voltage at the second analog interface, and may determine whether a battery pack is installed in the installation slot based on the second voltage. The number of installed battery packs may also be further determined.

[0086] Thus, since when a battery pack is installed in the installation slot, the second pull-up resistor may be connected to the second voltage dividing resistor, and when no battery pack is installed in the installation slot, the second pull-up resistor is not connected to the second voltage dividing resistor, the second voltage between the installation slot and the second pull-up module is different when a battery pack is installed in the installation slot and when no battery pack is installed in the installation slot. Therefore, it is possible to accurately determine whether a battery pack is installed in the installation slot based on the second voltage.

[0087] In some embodiments of the present application, the second control unit may specifically be used to determine that a battery pack is installed in the installation slot when the second voltage is within a second preset range; and determine that no battery pack is installed in the installation slot when the second voltage is within a third preset range.

[0088] Among them, the lower limit of the third preset range can be greater than the upper limit of the second preset range.

[0089] Here, for any installation slot, when no battery pack is installed in the installation slot, the second pull-up module is not connected to the second voltage dividing module, so the second voltage collected by the second control unit is relatively high; when a battery pack is installed in the installation slot, the second pull-up module is connected to the second voltage dividing module, so the second voltage collected by the second control unit is relatively low. Therefore, it can be determined that a battery pack is installed in the installation slot when the second voltage is low; it can be determined that no battery pack is installed in the installation slot when the second voltage is high.

[0090] Specifically, the second preset range and the third preset range can be preset. The second preset range can be determined according to the resistance value of the second voltage dividing module, the resistance value of the second pull-up module, and the voltage of the power supply connected to the second end of the second pull-up module. The third preset range can be determined according to the resistance value of the second pull-up module and the voltage of the power supply connected to the second end of the second pull-up module.

[0091] Exemplarily, as Figure 9 shown, the 3 second pull-up modules can be the second pull-up resistor 910, the third pull-up resistor 920, and the fourth pull-up resistor 930, and the resistance values can all be 1 kΩ. The first ends of the second pull-up resistor 910, the third pull-up resistor 920, and the fourth pull-up resistor 930 are all connected to the second MCU 940 of the main battery management system. The power supplies connected to the second ends of the second pull-up resistor 910, the third pull-up resistor 920, and the fourth pull-up resistor 930 can all be the pull-up power supply with a voltage of 5V. As Figure 10 shown, the second voltage dividing module can be the fourth voltage dividing resistor 950 with a resistance value of 1 kΩ. Based on this, the second preset range is [2V, 3V], and the third preset range is [4V, 5V].

[0092] For any installation slot, if the second voltage is within [2V, 3V], it can be determined that a battery pack is installed in this installation slot; if the second voltage is within [4V, 5V], it can be determined that no battery pack is installed in this installation slot.

[0093] In this way, since when a battery pack is installed in the installation slot, the second pull-up resistor can be connected to the second voltage dividing resistor, making the second voltage within the smaller second preset range; when no battery pack is installed in the installation slot, the second pull-up resistor is not connected to the second voltage dividing resistor, and the second voltage is within the larger third preset range. Therefore, by judging whether the second voltage is within the second preset range or the third preset range, it can be accurately determined whether a battery pack is installed in the installation slot, thereby improving the reliability of the battery swapping system.

[0094] In some embodiments of the present application, as Figure 11As shown, the first control unit 131 can be connected to the second control unit 112.

[0095] The second control unit 112 can be used to collect the third voltage between the second pull-up module 113 connected to the first mounting slot 121 and the first mounting slot 121, and send the third voltage to the first control unit 131;

[0096] The first control unit 131 can be used to collect the first voltage between the first voltage-dividing module 111 connected to the first mounting slot 121 and the first pull-up module 132 in the first slave battery management system 133, and determine whether the battery swapping system fails based on the first voltage and the third voltage.

[0097] Here, the first control unit can be used to periodically collect the voltage at the first analog interface. In this way, when the first battery pack is installed in the first mounting slot, the first control unit can collect the first voltage between the first voltage-dividing module connected to the first mounting slot and the first pull-up module in the first slave battery management system. The second control unit can be used to periodically collect the third voltage at the second analog interface corresponding to the first mounting slot.

[0098] Exemplarily, the first control unit and the second control unit can be connected through a CAN line.

[0099] In this way, based on the third voltage between the second pull-up module connected to the first mounting slot and the first mounting slot, and the first voltage between the first voltage-dividing module connected to the first mounting slot and the first pull-up module in the first slave battery management system, it can be accurately determined whether the battery swapping system fails.

[0100] In some embodiments of the present application, the first control unit can specifically be used to determine that the battery swapping system fails when the first voltage is within the fourth preset range and the third voltage is within the second preset range.

[0101] Here, the failure can be a short-to-ground or short-to-power supply failure or an open-circuit failure.

[0102] The first control unit can also be used to determine that the battery swapping system does not have a short-to-ground or short-to-power supply failure and an open-circuit failure when the first voltage and the third voltage do not meet the preset conditions. The preset conditions can be that the first voltage is within the fourth preset range and the third voltage is within the second preset range.

[0103] Exemplarily, the fourth preset range can be (-∞, 1V], (4V, 5V], or (5V, +∞). The second preset range can be [2V, 3V].

[0104] In this way, by determining whether the first voltage is within the fourth preset range and whether the third voltage is within the second preset range, it is possible to accurately determine whether a fault occurs in the battery swapping system.

[0105] In some embodiments of the present application, the first control unit may further be configured to:

[0106] When the first voltage is not greater than the first threshold or greater than the second threshold, and the third voltage is within the second preset range, it is determined that a short-circuit to ground or short-circuit to power supply fault occurs in the battery swapping system;

[0107] When the first voltage is within the fifth preset range and the third voltage is within the second preset range, it is determined that an open-circuit fault occurs in the battery swapping system.

[0108] Here, the lower limit of the fifth preset range may be greater than the first threshold, and the upper limit of the fifth preset range may not be greater than the second threshold.

[0109] Exemplarily, the first threshold may be 1V, and the second threshold may be 5V. The fifth preset range may be (4V, 5V]. The second preset range may be [2V, 3V]. When the first voltage is not greater than 1V or greater than 5V, and the third voltage is within [2V, 3V], the first control unit may report that a short-circuit to ground or short-circuit to power supply fault occurs in the battery swapping system; when the first voltage is within (4V, 5V] and the third voltage is within [2V, 3V], the first control unit may report that an open-circuit fault occurs in the battery swapping system.

[0110] In this way, by respectively determining the ranges where the first voltage and the third voltage are located, the fault type of the battery swapping system can be accurately determined.

[0111] Figure 12 It is a schematic flowchart of the encoding method provided for some embodiments of the present application.

[0112] As Figure 12 shown, this encoding method can be applied to the battery swapping system provided in any of the above embodiments. This encoding method may include S1210 - S1220:

[0113] S1210, collecting, by the first control unit, a first voltage between a first voltage dividing module connected to the first installation slot and a first pull-up module in the first slave battery management system;

[0114] S1220, encoding, by the first control unit, the first slave battery management system based on the first voltage.

[0115] Therefore, since the voltage division capabilities of the first voltage division modules connected to different installation slots are different, when the battery pack is installed in different installation slots, the first voltage between the first voltage division module connected to the first installation slot and the first pull-up module in the first slave battery management unit is different. Therefore, the installation slot where the battery pack is located can be determined based on this first voltage, so as to encode the first slave battery management system.

[0116] In some embodiments of the present application, the above encoding the first slave battery management system based on the first voltage may include:

[0117] Determine the first preset range in which the first voltage is located;

[0118] Use the first preset value corresponding to the first preset range as the encoding value of the first slave battery management system.

[0119] In this way, since the voltage division capabilities of the first voltage division modules connected to different installation slots are different, when the first battery pack is installed in different installation slots, the preset ranges in which the first voltages collected by the first control unit are located are different. Therefore, according to the first preset range in which the first voltage is located, the installation slot where the first battery pack is installed can be accurately determined, so as to accurately obtain the encoding value of the first slave battery management system.

[0120] In some embodiments of the present application, the method may further include:

[0121] Collect the second voltage between the installation slot and the second pull-up module through the second control unit;

[0122] Determine whether the installation slot is installed with a battery pack based on the second voltage through the second control unit.

[0123] In this way, since when the installation slot is installed with a battery pack, the second pull-up resistor can be connected to the second voltage division resistor, and when the installation slot is not installed with a battery pack, the second pull-up resistor is not connected to the second voltage division resistor, the second voltage between the installation slot and the second pull-up module is different when the installation slot is installed with a battery pack and when the installation slot is not installed with a battery pack. Therefore, it can be accurately determined whether the installation slot is installed with a battery pack based on this second voltage.

[0124] In some embodiments of the present application, the above determining whether the installation slot is installed with a battery pack based on the second voltage may include:

[0125] When the second voltage is within the second preset range, determine that the installation slot is installed with a battery pack;

[0126] When the second voltage is within the third preset range, determine that the installation slot is not installed with a battery pack, and the lower limit of the third preset range is greater than the upper limit of the second preset range.

[0127] Thus, since when a battery pack is installed in the installation slot, the second pull-up resistor can be connected to the second voltage-dividing resistor, making the second voltage fall within a smaller second preset range; when no battery pack is installed in the installation slot, the second pull-up resistor is not connected to the second voltage-dividing resistor, and the second voltage falls within a larger third preset range. Therefore, by determining whether the second voltage is within the second preset range or the third preset range, it can be accurately determined whether a battery pack is installed in the installation slot, thereby improving the reliability of the battery swapping system.

[0128] In some embodiments of the present application, the method may further include:

[0129] The second control unit collects a third voltage between the second pull-up module connected to the first installation slot and the first installation slot, and sends the third voltage to the first control unit;

[0130] The first control unit determines whether a fault occurs in the battery swapping system based on the first voltage and the third voltage.

[0131] Thus, based on the third voltage between the second pull-up module connected to the first installation slot and the first installation slot, and the first voltage between the first voltage-dividing module connected to the first installation slot and the first pull-up module in the first slave battery management system, it can be accurately determined whether a fault occurs in the battery swapping system.

[0132] In some embodiments of the present application, determining whether a fault occurs in the battery swapping system based on the first voltage and the third voltage may include:

[0133] When the first voltage is within the fourth preset range and the third voltage is within the second preset range, it is determined that a fault occurs in the battery swapping system.

[0134] Thus, by determining whether the first voltage is within the fourth preset range and whether the third voltage is within the second preset range, it can be accurately determined whether a fault occurs in the battery swapping system.

[0135] In some embodiments of the present application, after the second control unit collects the third voltage between the second pull-up module connected to the first installation slot and the first installation slot and sends the third voltage to the first control unit, the method may further include:

[0136] When the first voltage is not greater than the first threshold or greater than the second threshold, and the third voltage is within the second preset range, the first control unit determines that a short circuit to ground or a short power supply fault occurs in the battery swapping system;

[0137] When the first voltage is within the fifth preset range and the third voltage is within the second preset range, the first control unit determines that an open - circuit fault occurs in the battery swapping system. The lower limit of the fifth preset range is greater than the first threshold, and the upper limit of the fifth preset range is not greater than the second threshold.

[0138] In this way, by separately judging the ranges where the first voltage and the third voltage are located, the fault type of the battery swapping system can be accurately judged.

[0139] For the specific introduction of the encoding method, reference can be made to the various embodiments of the above - mentioned battery swapping system, which will not be elaborated here.

[0140] Based on the same inventive concept, an embodiment of the present application also provides an encoding device. The following will Figure 13 describe in detail the encoding device provided by the embodiment of the present application.

[0141] Figure 13 shows a schematic structural diagram of an encoding device provided by an embodiment of the present application.

[0142] As Figure 13 shown, this encoding device can be applied to the battery swapping system provided in any of the above - mentioned embodiments. The encoding device may include:

[0143] A first acquisition module 1301, configured to acquire, through the first control unit, a first voltage between a first voltage - dividing module connected to the first installation slot and a first pull - up module in the first slave battery management system.

[0144] An encoding module 1302, configured to encode the first slave battery management system based on the first voltage through the first control unit.

[0145] Therefore, since the voltage - dividing capabilities of the first voltage - dividing modules connected to different installation slots are different, when the battery pack is installed in different installation slots, the first voltage between the first voltage - dividing module connected to the first installation slot and the first pull - up module in the first slave battery management unit is different. Therefore, the installation slot where the battery pack is located can be determined based on this first voltage, so as to encode the first slave battery management system.

[0146] In some embodiments of the present application, the encoding module 1302 may include:

[0147] A first determination sub - module, configured to determine the first preset range where the first voltage is located;

[0148] A processing sub - module, configured to use the first preset value corresponding to the first preset range as the encoding value of the first slave battery management system.

[0149] In some embodiments of the present application, this encoding device may further include:

[0150] The second acquisition module is configured to acquire a second voltage between the installation slot and the second pull-up module through the second control unit;

[0151] The first determination module is configured to determine whether a battery pack is installed in the installation slot based on the second voltage through the second control unit.

[0152] In some embodiments of the present application, the first determination module may include:

[0153] The second determination sub-module is configured to determine that a battery pack is installed in the installation slot when the second voltage is within a second preset range;

[0154] The third determination sub-module is configured to determine that no battery pack is installed in the installation slot when the second voltage is within a third preset range, and the lower limit of the third preset range is greater than the upper limit of the second preset range.

[0155] In some embodiments of the present application, the encoding device may further include:

[0156] The processing module is configured to acquire a third voltage between the second pull-up module connected to the first installation slot and the first installation slot through the second control unit, and send the third voltage to the first control unit;

[0157] The second determination module is configured to determine whether a failure occurs in the battery swapping system based on the first voltage and the third voltage through the first control unit.

[0158] In some embodiments of the present application, the second determination module may include:

[0159] The fourth determination sub-module is configured to determine that a failure occurs in the battery swapping system when the first voltage is within a fourth preset range and the third voltage is within a second preset range.

[0160] In some embodiments of the present application, the encoding device may further include:

[0161] The third determination module is configured to, after acquiring the third voltage between the second pull-up module connected to the first installation slot and the first installation slot through the second control unit and sending the third voltage to the first control unit, determine that a short circuit to ground or short power supply failure occurs in the battery swapping system when the first voltage is not greater than a first threshold or greater than a second threshold, and the third voltage is within a second preset range;

[0162] The fourth determination module is configured to determine that an open circuit failure occurs in the battery swapping system when the first voltage is within a fifth preset range and the third voltage is within a second preset range, the lower limit of the fifth preset range is greater than the first threshold, and the upper limit of the fifth preset range is not greater than the second threshold.

[0163] Figure 14 The figure shows a schematic structural diagram of an electronic device provided by an embodiment of the present application.

[0164] As Figure 14 shown, the electronic device 14 can implement a structural diagram of an exemplary hardware architecture of an electronic device according to the encoding method and encoding device in the embodiments of the present application. The electronic device may refer to the electronic device in the embodiments of the present application.

[0165] The electronic device 14 may include a processor 1401 and a memory 1402 storing computer program instructions.

[0166] Specifically, the above-mentioned processor 1401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0167] The memory 1402 may include a mass memory for data or instructions. By way of example and not limitation, the memory 1402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In a suitable case, the memory 1402 may include removable or non-removable (or fixed) media. In a suitable case, the memory 1402 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1402 is a non-volatile solid-state memory. In a specific embodiment, the memory 1402 may include a read-only memory (ROM), a random access memory (RAM), a disk storage media device, an optical storage media device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory 1402 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present application.

[0168] The processor 1401 reads and executes the computer program instructions stored in the memory 1402 to implement any one of the encoding methods in the above embodiments.

[0169] In one example, the electronic device may further include a communication interface 1403 and a bus 1404. Among them, as Figure 14As shown, the processor 1401, the memory 1402, and the communication interface 1403 are connected via a bus 1404 and communicate with each other.

[0170] The communication interface 1403 is mainly used to implement communication between various modules, devices, units, and / or apparatuses in the embodiments of the present application.

[0171] The bus 1404 includes hardware, software, or both, and couples the components of the electronic device to each other. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 1404 may include one or more buses. Although the embodiments of the present application describe and illustrate a specific bus, the present application contemplates any suitable bus or interconnect.

[0172] The electronic device can execute the encoding method in the embodiments of the present application, thereby implementing the encoding method and apparatus described in conjunction with Figures 12 to 13 the description.

[0173] In addition, in combination with the encoding method in the above embodiments, the embodiments of the present application can be implemented by providing a computer storage medium. Computer program instructions are stored on the computer storage medium; when the computer program instructions are executed by a processor, any one of the encoding methods in the above embodiments is implemented.

[0174] It should be clear that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.

[0175] The functional blocks shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via a data signal carried in a carrier wave. A "machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical discs, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.

[0176] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps. That is to say, the steps can be executed in the order mentioned in the embodiments, can be different from the order in the embodiments, or several steps can be executed simultaneously.

[0177] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each block in the flowchart and / or block diagram, and the combination of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more blocks of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can also be implemented by dedicated hardware that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0178] Although the present application has been described with reference to the preferred embodiments, various improvements can be made to it and components therein can be replaced with equivalents without departing from the scope of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in each embodiment can be combined in any way. The present application is not limited to the specific embodiments disclosed in the text but includes all technical solutions falling within the scope of the claims.

Claims

1. A battery swapping system, characterized in that, it includes: A main battery management system, the main battery management system includes N first voltage dividing modules with different voltage dividing capabilities, the first end of the first voltage dividing module is connected to the installation slot, and the installation slots connected by different first voltage dividing modules are different, where N is a positive integer greater than 1; The N installation slots are used to install battery packs, each installation slot is used to install at least one battery pack, and the slave battery management system of the battery pack includes a first control unit and a first pull-up module. The first end of the first pull-up module is connected to the first control unit, and the second end of the first pull-up module is connected to the power supply; When the first battery pack is installed in the first installation slot, the first end of the first voltage dividing module connected to the first installation slot is respectively connected to the first end of the first pull-up module in the first slave battery management system and the first control unit in the first slave battery management system. The first slave battery management system is the slave battery management system of the first battery pack, and the first installation slot is any one of the N installation slots.

2. The battery swapping system according to claim 1, characterized in that, The main battery management system further includes a second control unit and N second pull-up modules. The first end of the second pull-up module is connected to the installation slot, and the installation slots connected by different second pull-up modules are different. The first end of the second pull-up module is also connected to the second control unit, and the second end of the second pull-up module is connected to the power supply; The slave battery management system further includes a second voltage dividing module; When the first battery pack is installed in the first installation slot, the first end of the second pull-up module connected to the first installation slot is connected to the first end of the second voltage dividing module in the first slave battery management system, and the first end of the second voltage dividing module in the first slave battery management system is also connected to the second control unit.

3. The battery swapping system according to claim 2, characterized in that, The first control unit is connected to the second control unit; The second control unit is used to collect the third voltage between the second pull-up module connected to the first installation slot and the first installation slot, and send the third voltage to the first control unit; The first control unit is used to collect the first voltage between the first voltage dividing module connected to the first installation slot and the first pull-up module in the first slave battery management system, and determine whether the battery swapping system fails based on the first voltage and the third voltage.

4. A coding method, characterized in that, applied to the battery swapping system according to any one of claims 1-3, the method includes: Collecting, by the first control unit, the first voltage between the first voltage dividing module connected to the first installation slot and the first pull-up module in the first slave battery management system; Encoding, by the first control unit, the first slave battery management system based on the first voltage.

5. The method according to claim 4, characterized in that, The encoding the first slave battery management system based on the first voltage includes: Determine a first preset range in which the first voltage is located; Use a first preset value corresponding to the first preset range as the coding value of the first slave battery management system.

6. The method according to claim 4, wherein, the method further includes: Collect a second voltage between the mounting slot and the second pull-up module through a second control unit; Based on the second voltage, determine by the second control unit whether a battery pack is installed in the mounting slot.

7. The method according to claim 6, wherein, determining whether a battery pack is installed in the mounting slot based on the second voltage includes: When the second voltage is within a second preset range, determine that a battery pack is installed in the mounting slot; When the second voltage is within a third preset range, determine that no battery pack is installed in the mounting slot, and the lower limit of the third preset range is greater than the upper limit of the second preset range.

8. The method according to claim 6, wherein, the method further includes: Collect a third voltage between the second pull-up module connected to the first mounting slot and the first mounting slot through the second control unit, and send the third voltage to the first control unit; Based on the first voltage and the third voltage, determine by the first control unit whether a fault occurs in the battery swapping system.

9. The method according to claim 8, wherein, determining whether a fault occurs in the battery swapping system based on the first voltage and the third voltage includes: When the first voltage is within a fourth preset range and the third voltage is within the second preset range, determine that a fault occurs in the battery swapping system.

10. The method according to claim 8, wherein, after collecting the third voltage between the second pull-up module connected to the first mounting slot and the first mounting slot through the second control unit and sending the third voltage to the first control unit, the method further includes: When the first voltage is not greater than a first threshold or greater than a second threshold, and the third voltage is within the second preset range, determine by the first control unit that a short-circuit to ground or short-circuit to power supply fault occurs in the battery swapping system; When the first voltage is within a fifth preset range and the third voltage is within the second preset range, determine by the first control unit that an open-circuit fault occurs in the battery swapping system, the lower limit of the fifth preset range is greater than the first threshold, and the upper limit of the fifth preset range is not greater than the second threshold.