Address registration method, apparatus, device and storage medium for multi-battery modules
By receiving host commands in a multi-battery module RS485 communication network and starting a delayed response timer based on a random time, a registration response signal containing its own address information is generated. This solves the problem that the host cannot automatically identify the slave address, achieving low-cost and efficient address registration, and ensuring the stability of the communication system and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-03
- Publication Date
- 2026-06-30
AI Technical Summary
In multi-battery module RS485 communication networking, the host cannot automatically identify and obtain the unique address information of each slave module. Existing technologies require hardware switches or host computer configuration, which increases material costs and requires high user expertise, resulting in a poor user experience.
By receiving the address registration command from the host battery module, the system responds and starts a delayed response timer based on a random time. It then generates a registration response signal containing its own address information, ensuring that registration is performed when no other response signal is detected during the delayed response timer. This avoids bus conflicts and achieves ordered address registration.
It achieves low-cost, efficient, and conflict-free automatic address registration. The host can accurately identify each slave battery module, ensuring stable operation of the communication system, reducing networking costs, and improving user experience.
Smart Images

Figure CN122317049A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication networking technology, and in particular to a method, apparatus, device and storage medium for address registration of multi-battery modules. Background Technology
[0002] In lithium battery applications such as communication backup power and photovoltaic energy storage, multiple battery modules are often connected in series and parallel to meet the needs of applications with large battery capacity requirements. The RS485 serial communication bus, with its high cost-effectiveness, has been widely used in communication networking between battery modules.
[0003] In the battery system, each battery module has a unique address code within the network. One group of battery modules acts as the communication master, while the remaining battery modules act as communication slaves. The master battery sends a slave access command containing slave address information to the RS485 bus. Upon receiving the command, the slave battery determines whether to respond to the master's access command based on whether the address code matches its own address code, thus completing the master-slave information exchange. Slave addresses are generally configured using either hardware methods such as address switches (where the address switch is set to different codes to serve as the slave battery's address, and the user configures the battery address during installation) or software methods such as host computer configuration (where the user programs the address information into the battery using host computer software during installation). Method one requires a dedicated address switch circuit for the battery, increasing material costs. During field installation, both methods require address configuration of the battery pack, demanding a high level of user expertise and resulting in a relatively poor user experience. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, device and storage medium for address registration of multiple battery modules, aiming to solve the technical problem that the host cannot automatically identify and obtain the unique address information of each slave module in RS485 communication networking of multiple battery modules without increasing hardware costs.
[0005] To achieve the above objectives, this application proposes an address registration method for multiple battery modules. The method is applied to a communication system including a master battery module and at least two slave battery modules; the master battery module and each of the slave battery modules are connected via a communication bus, and the slave battery modules are connected in parallel via the communication bus; the method includes: Receive the address registration instruction sent by the host battery module during the address discovery process; Responding to the address registration instruction and starting a delayed response timer based on a random time; If no response signal outside itself is detected during the delayed response timing, the registration opportunity for this round of address discovery process is obtained, and a registration response signal containing its own address information is generated; Send the registration response signal containing its own address information to the host battery module to complete the address registration.
[0006] In one embodiment, the step of responding to the address registration instruction and initiating a delayed response timer based on a random time includes: Upon receiving the address registration instruction, a random number is generated; A delay response timing duration is set based on the random number; It starts its own internal timer and counts the time based on the delay response duration.
[0007] In one embodiment, the step of obtaining a registration opportunity in the current address discovery process when no response signal outside itself is detected during the delayed response timing, and generating a registration response signal containing its own address information, includes: During the timer's countdown, the system continuously monitors for data transmission start signals outside itself on the communication bus; If no data transmission start signal from outside itself is detected before the timer expires, it is determined that it has obtained the registration opportunity in this round of address discovery process and generates a registration response signal containing its own address information.
[0008] In one embodiment, the step of sending the registration response signal containing its own address information to the host battery module to complete the address registration includes: Send the registration response signal containing its own address information to the host battery module; Receive a registration confirmation instruction sent by the host battery module for the address information in the registration response signal; According to the registration confirmation instruction, the user marks its registration status as completed and stops participating in subsequent rounds of the address discovery process.
[0009] In one embodiment, the step of sending the registration response signal containing its own address information to the host battery module includes: If the registration response signal containing its own address information is not sent to the host battery module within a preset time period, the address discovery process is deemed to have failed.
[0010] In one embodiment, the step of receiving the address registration instruction sent by the host battery module during the address discovery process further includes: Receive the registration reset command sent by the host battery module; The historical registration status is cleared according to the registration reset command.
[0011] In one embodiment, after the step of sending the registration response signal containing its own address information to the host battery module to complete the address registration, the method further includes: Based on the registered address information, participate in the next round of address discovery process and return to the step of receiving the address registration instruction sent by the host battery module during the address discovery process.
[0012] Furthermore, to achieve the above objectives, this application also proposes an address registration device for a multi-battery module, the device comprising: The instruction receiving module is used to receive the address registration instruction sent by the host battery module during the address discovery process; The response timing module is used to respond to the address registration instruction and start a delayed response timing based on a random time. The registration determination module is used to obtain the registration opportunity of this round of address discovery process when no response signal outside itself is detected during the delayed response timing, and to generate a registration response signal containing its own address information; The registration completion module is used to send the registration response signal containing its own address information to the host battery module to complete the address registration.
[0013] In addition, to achieve the above objectives, this application also proposes an address registration device for multiple battery modules, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the address registration method for multiple battery modules as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the address registration method for the multi-battery module as described above.
[0015] This application provides a method, apparatus, device, and storage medium for address registration of multiple battery modules. By having the slave battery module receive the address registration command sent by the master battery module during the address discovery process, the slave module can accurately respond to the master's address registration initiation action, laying the foundation for subsequent address registration processes. This solves the problem in existing technologies where the slave module cannot respond to the master's address discovery request in a timely manner, achieving orderly initiation of address registration between the master and slave modules. By having the slave module respond to the address registration command and start a delayed response timer based on a random time, the response timing of each slave module differs, avoiding communication bus conflicts caused by multiple slave modules simultaneously sending response signals to the master. This solves the problems of response signal conflicts and the master's inability to accurately identify individual slave modules in existing multi-slave network configurations, achieving orderly responses from each slave module. By having the slave module detect response signals outside itself during the delayed response timer, it only obtains a registration opportunity and generates a register containing its own address when no other response signal is detected. The registration response signal for address information ensures that only one slave device registers its address during the same round of address discovery, avoiding the problem of duplicate address registration. This solves the problems of address conflicts and the inability of the host to obtain the unique address of each slave device in existing technologies, achieving accurate registration of the unique address of each slave device. By having the slave device send a registration response signal containing its own address information to the host battery module to complete the address registration, the host can directly obtain the unique address information of each slave device without the need for additional hardware devices to assist in address identification. This solves the technical problem that the host cannot automatically identify and obtain the unique address information of each slave module without increasing hardware costs. Compared with existing technologies, this achieves low-cost, efficient, and conflict-free automatic address registration in multi-battery module RS485 communication networking, ensuring that the host can accurately identify each slave battery module and guaranteeing the stable operation of the communication system. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating an embodiment of the address registration method for multiple battery modules in this application. Figure 2 This is a communication system block diagram provided in Embodiment 1 of the address registration method for multiple battery modules in this application; Figure 3This is a flowchart illustrating Embodiment 2 of the address registration method for multiple battery modules in this application. Figure 4 This is a flowchart illustrating Embodiment 3 of the address registration method for multiple battery modules in this application; Figure 5 This is a schematic diagram of the module structure of the address registration device for a multi-battery module according to an embodiment of this application; Figure 6 This is a schematic diagram of the address registration device structure of the multi-battery module in the hardware operating environment involved in the address registration method of the multi-battery module in this application embodiment.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0022] The main solution of this application embodiment is: receiving the address registration instruction sent by the host battery module during the address discovery process; responding to the address registration instruction and starting a delayed response timer based on a random time; obtaining the registration opportunity for this round of address discovery process when no response signal outside itself is detected during the delayed response timer, and generating a registration response signal containing its own address information; sending the registration response signal containing its own address information to the host battery module to complete the address registration.
[0023] Currently, slave battery addresses are typically configured either through hardware methods (such as address switches, where different codes are assigned to the address switches to serve as the battery's address, requiring user configuration during installation) or through a host computer-based configuration method (where the address information is programmed into the battery via software during installation). Both methods require dedicated address switch circuits for the battery, increasing material costs. During field installation, both methods necessitate address configuration of the battery pack, demanding a high level of user expertise and resulting in a relatively poor user experience.
[0024] This application provides a solution that allows the slave battery module to receive the address registration command sent by the master battery module during the address discovery process. This enables the slave to accurately respond to the master's address registration initiation action, laying the foundation for the subsequent address registration process. This solves the problem in existing technologies where the slave cannot respond to the master's address discovery request in a timely manner, and achieves orderly initiation of address registration between the master and slave. By having the slave respond to the address registration command and start a delayed response timer based on a random time, the response timing of each slave differs, avoiding communication bus conflicts caused by multiple slaves sending response signals to the master simultaneously. This solves the problems of response signal conflicts and the master's inability to accurately identify individual slaves in existing multi-slave networks, and achieves orderly responses from each slave. By having the slave detect response signals outside itself during the delayed response timer, it only obtains a registration opportunity and generates a registration signal when no other response signal is detected. The registration response signal containing its own address information ensures that only one slave device registers its address during the same round of address discovery, avoiding the problem of duplicate address registration. This solves the problems of address conflicts and the inability of the host to obtain the unique address of each slave device in existing technologies, achieving accurate registration of each slave device's unique address. By having the slave device send a registration response signal containing its own address information to the host battery module to complete the address registration, the host can directly obtain the unique address information of each slave device without the need for additional hardware to assist in address identification. This solves the technical problem that the host cannot automatically identify and obtain the unique address information of each slave module without increasing hardware costs. Compared with existing technologies, this achieves low-cost, efficient, and conflict-free automatic address registration in multi-battery module RS485 communication networking, ensuring that the host can accurately identify each slave battery module and guaranteeing the stable operation of the communication system.
[0025] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an address registration device for a multi-battery module capable of performing the above functions. The following description uses an address registration device for a multi-battery module as an example to illustrate this embodiment and the subsequent embodiments.
[0026] In this context, the master battery module refers to the main control unit in the battery system responsible for coordination, management, and initiating control commands. It typically includes a master controller, such as a BMS master controller, which initiates the address discovery process and ultimately confirms and maintains the address registry for all slave battery modules. Slave battery modules are sub-units in the battery system managed by the master. Each slave battery module contains a battery management unit and a corresponding battery cell. In this application, all slave battery modules are in an unregistered state before address registration, possessing the same network identity and needing to compete for a unique address using this method. Communication always refers to a shared communication medium, such as a Controller Area Network (CAN) bus, connecting the master battery module and all slave battery modules for transmitting data and commands. All devices are connected in parallel on the bus, and signals sent by any device can be heard by all other devices.
[0027] Based on this, embodiments of this application provide an address registration method for multiple battery modules, referring to... Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating an embodiment of the address registration method for multiple battery modules in this application. Figure 2 This is a block diagram of a communication system provided in Embodiment 1 of the address registration method for multi-battery modules in this application.
[0028] In this embodiment, the method is applied to a communication system including a master battery module and at least two slave battery modules; the master battery module and each of the slave battery modules are connected via a communication bus, and the slave battery modules are connected in parallel via the communication bus; the address registration method for the multiple battery modules includes steps S10~S40: Step S10: Receive the address registration instruction sent by the host battery module during the address discovery process.
[0029] It should be noted that during the address transmission phase of the multi-battery module RS485 communication network, the master battery module sends an address registration command to the communication bus (all parallel slave battery modules can receive the bus signal). This command triggers all slave battery modules that have not completed address registration to initiate the address registration process. All slave battery modules in an unregistered state receive this address registration command through their own RS485 communication port, confirming entry into the address registration preparation phase and awaiting subsequent response operations. The address registration command can be a specific command message broadcast by the master battery module to initiate a round of address discovery. This command does not specify a target; all unregistered slave battery modules can receive and respond to it.
[0030] In practical implementation, commands issued by the host battery module can be detected in real time to ensure that no commands are missed. Then, the commands issued by the host battery module are identified, and if an address registration command is identified, it is received. Alternatively, the commands output by the host battery module can be detected periodically at shorter intervals, and if an address registration command is detected, it is received to avoid excessive power consumption. Upon receiving an address registration command, the detection of commands issued by the host battery module can be stopped, and address registration can proceed.
[0031] Step S20: Respond to the address registration instruction and start a delayed response timer based on a random time.
[0032] It should be understood that after each slave battery module successfully receives the address registration command, it immediately responds to the command and simultaneously generates a random number. Based on this random number, it determines the delay response duration and starts the delay response timer. The random numbers generated by different slave battery modules are all different (or have an extremely low probability of being the same), therefore the corresponding delay response durations also differ. This effectively avoids the problem of multiple slave battery modules simultaneously sending signals to the communication bus, leading to bus conflicts and registration failures, and provides an orderly mechanism for subsequent registration opportunities. The delay response time corresponding to the random time is actually the time each slave battery module receives the address registration command. Before preparing to respond, it does not immediately respond, but first generates a random number and sets a unique, random waiting time (delay response time duration) based on this random number. The slave battery module starts an internal timer and listens without sending during this random duration.
[0033] Step S30: If no response signal outside itself is detected during the delayed response timing, the registration opportunity for this round of address discovery process is obtained, and a registration response signal containing its own address information is generated.
[0034] It should be understood that after each slave battery module starts its delayed response timer, it will scan the communication bus in real time, continuously detecting whether there are response signals sent by other slave battery modules (i.e., signals sent by other slaves after they have seized the registration opportunity). If no response signal from any other slave is detected before its own delayed response timer ends, the slave battery module is deemed to have successfully seized the registration opportunity in this round of address discovery. At this time, the slave battery module immediately generates a registration response signal, which contains its own address information (such as production line preset address information or built-in BMS address information), providing core basis for subsequent master confirmation of registration. If a response signal from another slave is detected during the delayed response timer, the seizure in this round is deemed to have failed, the timer stops, no registration response signal is generated, and the module waits for the master to initiate the next round of address registration instructions. The registration response signal can be sent to the master battery module to register the slave battery module that has obtained the registration opportunity on the master battery module. The registration response signal includes the address information of the slave battery module. A registration opportunity refers to the right of a slave battery module to send a registration response to the master battery module when it determines itself to be the first device to end its wait in the current waiting queue since it has not detected any other slave battery module starting to send a response signal during its own delayed response time.
[0035] Step S40: Send the registration response signal containing its own address information to the host battery module to complete the address registration.
[0036] It should be noted that the slave battery module that successfully obtains a registration opportunity in this round sends a registration response signal containing its own address information to the master battery module via the communication bus. After receiving the registration response signal, the master battery module confirms the address information and sends a registration confirmation command to the slave battery module. After the slave battery module receives and confirms the registration confirmation command, it completes its own address registration and will no longer participate in the registration opportunity preemption in the address discovery process. The master battery module then continues to initiate the next round of address registration commands until all slave battery modules have completed address registration.
[0037] The multi-battery module address registration method constructed in this embodiment effectively solves the problems of address registration conflicts and low efficiency in multi-slave parallel communication scenarios. By receiving the host address registration command and starting a random delay response timer, it effectively avoids communication bus conflicts caused by multiple slaves responding simultaneously, ensuring the orderly progress of the address registration process, reducing the registration failure rate, and improving network stability. The random delay mechanism requires no additional hardware support, and conflict avoidance is achieved solely through software logic, significantly reducing network costs. By detecting bus response signals in real time to seize registration opportunities, it ensures the fairness of registration opportunity allocation, giving each unregistered slave an equal opportunity to participate in registration, avoiding situations where some slaves cannot complete registration for a long time, and ensuring that all slaves can normally access the communication network. The entire process is completed through the interaction of the host initiating commands and the slaves responding. The steps are simple and efficient, requiring no manual intervention, realizing the automation of address registration, greatly improving registration efficiency, and adapting to the needs of batch networking of multiple modules. At the same time, sending a response signal containing its own address information ensures that the host can accurately identify each slave, laying the foundation for subsequent communication scheduling and data interaction between modules, and ensuring the stable and efficient operation of the entire battery module system.
[0038] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating a second embodiment of the address registration method for multiple battery modules in this application. In step S20, the address registration method for multiple battery modules further includes: Step S201: Generate a random number after receiving the address registration instruction.
[0039] It should be noted that when the slave battery module receives the address registration command sent by the master battery module through the communication bus, its internal control unit will immediately trigger a random number generation mechanism to autonomously generate a unique and random number. The generation of this random number does not depend on external devices and is completed independently by the slave system itself. Its core function is to provide a basis for setting differentiated delay durations in the future, thereby avoiding communication conflicts caused by multiple slave devices responding synchronously.
[0040] Step S202: Set a delay response timing duration based on the random number.
[0041] It should be understood that after the slave battery module generates a random number, it will convert the random number into a corresponding delayed response timing duration through a preset algorithm. The random numbers generated by different slaves are different, so the converted timing durations are also different. Moreover, the duration range is within a reasonable range preset by the system, so that it will not cause conflicts due to the duration being too short, nor will it affect the registration efficiency due to the duration being too long, thus achieving an orderly staggering of the response timing of each slave.
[0042] Step S203: Start its internal timer and start timing with the delay response duration.
[0043] It should be understood that after determining the delay response duration, the slave battery module will start its built-in timer, using the set duration as the timer's trigger threshold, and begin the countdown. After the timer starts, the slave enters a waiting-for-response phase. During this period, the slave will continuously monitor the communication bus and prepare to generate a registration response signal to ensure that it can promptly execute the next operation after the timer expires.
[0044] In step S30, the address registration method for the multi-battery module further includes: Step S301: During the timer's countdown, continuously monitor the data transmission start signal outside itself on the communication bus.
[0045] It should be noted that during the entire delay period of the timer, the slave battery module continuously monitors the communication bus connected in parallel through its own communication interface. The core objective of this monitoring is to capture the data transmission start signal sent by other slave battery modules on the bus besides itself. This signal is a sign that other slaves are vying for the registration opportunity. By monitoring in real time, the slave can accurately determine whether other slave battery modules have initiated a registration response in advance.
[0046] Step S302: If no data transmission start signal outside itself is detected before the timer expires, it is determined that it has obtained the registration opportunity in this round of address discovery process, and a registration response signal containing its own address information is generated.
[0047] It should be understood that if the slave battery module does not detect a data transmission start signal from another slave on the communication bus before its own timer expires, it is determined that the slave has successfully preempted the registration opportunity in this round of address discovery. At this time, the slave will immediately trigger the registration response signal generation mechanism, integrate its own address information (such as the built-in address identifier), and generate a registration response signal containing this address information, preparing for sending a response to the master and completing address registration. If it detects a signal from another slave before the timer expires, it will abandon the registration opportunity in this round and wait for the next round of instructions.
[0048] Before step S10, the address registration method for the multi-battery module further includes: Step S101: Receive the registration reset command sent by the host battery module.
[0049] It should be noted that before the master battery module initiates the address registration process (i.e., sends the address registration command), it first sends a registration reset command to all slave battery modules connected in parallel on the communication bus. Each slave battery module receives this registration reset command in real time through its own communication port, confirming that the master is about to start a new round of address registration, and synchronously enters the reset preparation state, laying the groundwork for subsequently clearing historical registration information and participating in the new registration process. The registration reset command is used to control the reset of the addresses currently registered by the slave battery modules. The registration reset command is issued by the master battery module to clear the registration status of all slave battery modules. It is usually sent during system initialization, reorganization, or when an address table error occurs, causing all slaves to return to an unregistered state, preparing to start a new round of complete address discovery.
[0050] Step S102: Clear the historical registration status according to the registration reset instruction.
[0051] It should be understood that after successfully receiving the registration reset command, the slave battery module will respond by initiating its internal state clearing mechanism. This mechanism will clear all previously existing historical registration states (such as registered address information, registration tags, response records, etc.) and restore the module to its initial, unregistered state. This prevents historical registration information from interfering with the current address registration process, ensuring that each slave device participates in address discovery and registration with the same initial state, thus guaranteeing the fairness and accuracy of the registration process.
[0052] In this embodiment, the related operation process for address registration of multiple battery modules effectively solves various problems in address registration in scenarios with multiple slave devices communicating in parallel, ensuring that the registration process is efficient, stable, and accurate, and has significant technical advantages and practical value. The pre-registration reset operation can clear the historical registration traces of the slave devices, restoring all slave devices to a unified unregistered initial state, avoiding interference from historical information in the new round of registration, ensuring that each slave device can participate in registration fairly, and guaranteeing the accuracy of the registration results. A series of operations, including random number generation, delay duration setting, and timer startup, through a differentiated delay mechanism, fundamentally avoid communication bus conflicts caused by multiple slave devices synchronously responding to host commands. No additional hardware support is required; conflict avoidance is achieved solely through software logic, reducing networking costs while ensuring the orderly progress of the registration process. The continuous monitoring of the communication bus and the determination of registration opportunities can accurately identify the registration response status of other slave devices, ensuring fair allocation of registration opportunities and avoiding situations where some slave devices cannot register for a long time. At the same time, it can quickly lock the registration qualification and generate a response signal containing its own address information, laying the foundation for subsequent host identification and module communication scheduling, realizing automated address registration, improving the registration efficiency of batch networking of multiple modules, and ensuring the stable operation of the entire battery module system.
[0053] Based on the first and / or second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to that in embodiments one and two above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 4 , Figure 4 This is a flowchart illustrating a third embodiment of the address registration method for multiple battery modules in this application. In step S40, the address registration method for multiple battery modules further includes: Step S402: Send the registration response signal containing its own address information to the host battery module.
[0054] In this embodiment, after the slave battery module successfully generates a registration response signal containing its own address information within a preset time period, it immediately sends the registration response signal to the master battery module via a parallel communication bus. During the transmission process, the signal carries the slave's own address identifier, ensuring that the master battery module can accurately identify the source of the response signal, providing a basis for subsequent address confirmation and registration verification.
[0055] Step S403: Receive the registration confirmation instruction sent by the host battery module for the address information in the registration response signal.
[0056] It should be understood that after receiving a registration response signal containing its own address information from the slave device, the master battery module will verify and confirm the address information in the signal. Once it confirms that the address information is valid and not already in use, it will generate and send a registration confirmation command to the slave battery module. The slave battery module continuously listens for master commands through its own communication port. Once it receives this registration confirmation command, it confirms that its address registration application has been approved by the master. The registration confirmation command is a confirmation message sent by the master battery module to the slave battery module after successfully receiving a registration response signal from a slave device. This command typically contains the confirmed address information, informing the slave that its address has been officially accepted and recorded by the system.
[0057] Step S404: According to the registration confirmation instruction, mark its own registration status as completed address registration and stop participating in subsequent rounds of address discovery process.
[0058] It should be noted that after receiving the registration confirmation command sent by the host, the slave battery module will immediately respond to the command, update its internal registration status flag to "address registration completed", and lock the registration status. It will no longer participate in any subsequent rounds of address discovery process initiated by the host, thus avoiding address conflicts caused by duplicate registration, reducing invalid bus listening and response operations, saving slave power consumption, and ensuring the communication efficiency of the entire battery module system.
[0059] Before step S402, the address registration method for the multi-battery module further includes: Step S401: If the registration response signal containing its own address information is not sent to the host battery module within a preset time period, the address discovery process is determined to have failed.
[0060] It should be noted that after the slave battery module successfully obtains the registration opportunity in this round of address discovery and generates a registration response signal containing its own address information, the system will preset a fixed duration as the response sending time limit. If the slave module fails to send the generated registration response signal to the master battery module within this preset time limit due to communication abnormalities, equipment failures, or other reasons, the system will automatically determine that this round of address discovery has failed, and the slave module will abandon this registration opportunity and wait for the master battery module to initiate the next round of address discovery process, thus avoiding registration chaos caused by signal transmission delays or failures.
[0061] After step S40, the address registration method for the multi-battery module further includes: Step S405: Based on the registered address information, participate in the next round of address discovery process and return to the step of receiving the address registration instruction sent by the host battery module during the address discovery process.
[0062] It should be noted that after the slave battery module completes its own address registration, it will participate in the next round of address discovery initiated by the master based on its successfully registered address information. At this time, the slave device changes to a registered device and no longer participates in the competition for registration opportunities. Instead, it cooperates with the master to complete subsequent network debugging, data interaction, and other operations. At the same time, it re-enters the listening state to receive address registration commands sent by the master in the new round of address discovery, assisting the master in completing the address registration of other unregistered slave devices and ensuring the integrity of the entire multi-battery module system network.
[0063] In this embodiment, by setting a response sending time limit and determining registration success or failure, abnormal signal sending situations can be identified in a timely manner, avoiding registration chaos caused by communication failures. Devices that failed to send responses can wait orderly for the next round of registration, ensuring the orderly progress of the registration process. The interaction between the sending of the registration response signal and the host confirmation command enables accurate verification and confirmation of address information, ensuring that the slave addresses are legal and non-duplicate, avoiding address conflicts from the source, and ensuring the host's accurate identification and control of each slave. After registration is completed, updating the status and ceasing participation in subsequent registrations can avoid duplicate registrations, save slave power consumption, reduce invalid bus interactions, and improve communication efficiency. Registered devices cooperate in the next round of address discovery, helping other unregistered devices complete registration, ensuring the integrity of the entire module system network, and serving as the foundation for subsequent stable system operation and data interaction.
[0064] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the address registration method of the multi-battery module in this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0065] This application also provides an address registration device for multiple battery modules; please refer to [reference needed]. Figure 5 The address registration device for the multi-battery module includes: The instruction receiving module 10 is used to receive the address registration instruction sent by the host battery module during the address discovery process; Response timing module 20 is used to respond to the address registration instruction and start a delayed response timing based on a random time; The registration determination module 30 is used to obtain the registration opportunity of this round of address discovery process when no response signal outside itself is detected during the delayed response timing, and to generate a registration response signal containing its own address information; The registration completion module 40 is used to send the registration response signal containing its own address information to the host battery module to complete the address registration.
[0066] Optionally, the response timing module 20 is further configured to generate a random number after receiving the address registration instruction; set a delayed response timing duration based on the random number; and start its internal timer to keep track of the delayed response timing duration.
[0067] Optionally, the response timing module 20 is further configured to continuously monitor data transmission start signals outside itself on the communication bus during the timer's timing period; if no data transmission start signal outside itself is detected before the timer's timing ends, it determines that it has obtained a registration opportunity in this round of address discovery process and generates a registration response signal containing its own address information.
[0068] Optionally, the registration completion module 40 is further configured to send the registration response signal containing its own address information to the host battery module; receive a registration confirmation instruction sent by the host battery module for the address information in the registration response signal; and mark its own registration status as completed address registration and stop participating in subsequent rounds of address discovery process according to the registration confirmation instruction.
[0069] Optionally, the registration completion module 40 is further configured to determine that the current address discovery process has failed if the registration response signal containing its own address information is not sent to the host battery module within a preset time period.
[0070] Optionally, the instruction receiving module 10 is further configured to receive a registration reset instruction sent by the host battery module; and clear the historical registration status according to the registration reset instruction.
[0071] Optionally, the registration completion module 40 is further configured to participate in the next round of address discovery process based on the registered address information and return to the step of receiving the address registration instruction sent by the host battery module during the address discovery process.
[0072] The address registration device for multi-battery modules provided in this application, employing the address registration method for multi-battery modules described in the above embodiments, can solve the technical problem that the host cannot automatically identify and obtain the unique address information of each slave module in an RS485 communication network of multi-battery modules without increasing hardware costs. Compared with the prior art, the beneficial effects of the address registration device for multi-battery modules provided in this application are the same as those of the address registration method for multi-battery modules provided in the above embodiments, and other technical features in the address registration device for multi-battery modules are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0073] This application provides an address registration device for a multi-battery module. The address registration device for a multi-battery module includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the address registration method for the multi-battery module in the first embodiment described above.
[0074] The following is for reference. Figure 6 This document illustrates a structural schematic diagram of an address registration device suitable for implementing the embodiments of this application for a multi-battery module. The address registration device for the multi-battery module in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The address registration device for the multi-battery module shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0075] like Figure 6As shown, the address registration device for the multi-battery module may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in the read-only memory 1002 or a program loaded from the storage device 1003 into the random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the address registration device for the multi-battery module. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the address registration device of the multi-battery module to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows address registration devices for multi-battery modules with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0076] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0077] The address registration device for multi-battery modules provided in this application, employing the address registration method for multi-battery modules described in the above embodiments, can solve the technical problem that the host cannot automatically identify and obtain the unique address information of each slave module in a multi-battery module RS485 communication network without increasing hardware costs. Compared with the prior art, the beneficial effects of the address registration device for multi-battery modules provided in this application are the same as those of the address registration method for multi-battery modules provided in the above embodiments, and other technical features of this address registration device for multi-battery modules are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0078] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0079] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0080] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the address registration method for the multi-battery module in the above embodiments.
[0081] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0082] The aforementioned computer-readable storage medium may be included in the address registration device of the multi-battery module; or it may exist independently and not assembled into the address registration device of the multi-battery module.
[0083] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0084] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0085] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0086] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the address registration method for the multi-battery modules described above. This solves the technical problem that, in RS485 communication networking of multi-battery modules, the host cannot automatically identify and obtain the unique address information of each slave module without increasing hardware costs. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the address registration method for multi-battery modules provided in the above embodiments, and will not be repeated here.
[0087] The above are only some embodiments of this application and do not limit the scope of implementation of this application. Any equivalent structural or procedural transformations made based on the content of this application specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the protection scope of this application.
Claims
1. A method for address registration of a multi-battery module, characterized in that, The method is applied to a communication system including a master battery module and at least two slave battery modules; the master battery module and each of the slave battery modules are connected via a communication bus, and the slave battery modules are connected in parallel via a communication bus. The method includes: Receive the address registration instruction sent by the host battery module during the address discovery process; Responding to the address registration instruction and starting a delayed response timer based on a random time; If no response signal outside itself is detected during the delayed response timing, the registration opportunity for this round of address discovery process is obtained, and a registration response signal containing its own address information is generated; Send the registration response signal containing its own address information to the host battery module to complete the address registration.
2. The address registration method for multiple battery modules as described in claim 1, characterized in that, The step of responding to the address registration instruction and starting a delayed response timer based on a random time includes: Upon receiving the address registration instruction, a random number is generated; A delay response timing duration is set based on the random number; It starts its own internal timer and counts the time based on the delay response duration.
3. The address registration method for multiple battery modules as described in claim 2, characterized in that, The step of obtaining a registration opportunity in this round of address discovery process when no response signal outside itself is detected during the delayed response timing, and generating a registration response signal containing its own address information, includes: During the timer's countdown, the system continuously monitors for data transmission start signals outside itself on the communication bus; If no data transmission start signal from outside itself is detected before the timer expires, it is determined that it has obtained the registration opportunity in this round of address discovery process and generates a registration response signal containing its own address information.
4. The address registration method for multiple battery modules as described in claim 1, characterized in that, The step of sending the registration response signal containing its own address information to the host battery module to complete the address registration includes: Send the registration response signal containing its own address information to the host battery module; Receive a registration confirmation instruction sent by the host battery module for the address information in the registration response signal; According to the registration confirmation instruction, the user marks its registration status as completed and stops participating in subsequent rounds of the address discovery process.
5. The address registration method for multiple battery modules as described in claim 4, characterized in that, Before the step of sending the registration response signal containing its own address information to the host battery module, the following steps are included: If the registration response signal containing its own address information is not sent to the host battery module within a preset time period, the address discovery process is deemed to have failed.
6. The address registration method for multiple battery modules as described in claim 1, characterized in that, The step of receiving the address registration instruction sent by the host battery module during the address discovery process also includes: Receive the registration reset command sent by the host battery module; The historical registration status is cleared according to the registration reset command.
7. The address registration method for multiple battery modules as described in claim 1, characterized in that, After the step of sending the registration response signal containing its own address information to the host battery module to complete the address registration, the method further includes: Based on the registered address information, participate in the next round of address discovery process and return to the step of receiving the address registration instruction sent by the host battery module during the address discovery process.
8. An address registration device for a multi-battery module, characterized in that, The device includes: The instruction receiving module is used to receive the address registration instruction sent by the host battery module during the address discovery process; The response timing module is used to respond to the address registration instruction and start a delayed response timing based on a random time. The registration determination module is used to obtain the registration opportunity of this round of address discovery process when no response signal outside itself is detected during the delayed response timing, and to generate a registration response signal containing its own address information; The registration completion module is used to send the registration response signal containing its own address information to the host battery module to complete the address registration.
9. An address registration device for a multi-battery module, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the address registration method for a multi-battery module as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the address registration method for the multi-battery module as described in any one of claims 1 to 7.