Master-slave-free dynamic address allocation method and device for parallel connection of multiple power supply modules

By using a masterless dynamic address allocation method, random codes are generated by sampling the voltage and current of the power supply modules. This enables automatic allocation and dynamic adjustment of module addresses in a multi-power supply module parallel system, overcoming the shortcomings of the master-slave address allocation method in the prior art and improving the reliability and flexibility of the system.

CN121814733APending Publication Date: 2026-04-07BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing parallel systems of multiple power supply modules, the master-slave address allocation and management method has problems such as single point of failure risk, limited system self-recovery capability, complex dynamic module access and exit, complex configuration and maintenance, and insufficient module parity in scenarios with dynamic changes in the number of modules, hot-swapping, or high system reliability requirements.

Method used

A masterless dynamic address allocation method is adopted. Random codes are generated by sampling the voltage and current of the power module. The CAN communication bus is used to realize masterless dynamic address allocation between modules, including random code generation, interaction, sorting and address determination. This avoids the dependence of the master module and realizes automatic allocation and dynamic adjustment of module addresses.

Benefits of technology

It reduces the system's dependence on a single module, solves the hot-swap problem, improves the operational stability of the parallel system under module abnormality or failure conditions, simplifies the system configuration process, enhances the parity and general application of modules, and eliminates the need for time base calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
Patent Text Reader

Abstract

The invention relates to the technical field of power supply devices, in particular to a master-slave-free dynamic address allocation method and device for multiple parallel power supply modules. The method comprises the steps of judging whether a current power supply module is in a first state; if yes, determining a random code of the current power supply module based on the sampling voltage and the sampling current of the current power supply module, and switching the first state into a second state; if not, judging whether the current power supply module is in a second state; if yes, receiving random codes of other power supply modules, obtaining a random code list, and switching the second state to a third state; if not, judging whether the current power supply module is in a third state; if yes, sorting the random code lists from large to small, and determining the sorted random code lists; and taking the position of the random code of the current power supply module in the random code list as the address of the current power supply module so as to realize master-slave-free dynamic address allocation. Therefore, automatic distribution of the communication addresses of the power supply modules can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power supply technology, and in particular to a method and apparatus for non-master-slave dynamic address allocation of multiple power supply modules connected in parallel. Background Technology

[0002] In modular power systems, multiple power modules are typically connected in parallel to expand the system's output capacity and provide redundancy, thereby improving system reliability and flexibility. To enable status interaction, control coordination, and information communication between the parallel power modules, each power module usually needs to be assigned a unique communication address or logical identifier.

[0003] In existing parallel systems of multiple power supply modules, a master-slave address allocation and management approach is commonly used. This involves designating a master module among the multiple power supply modules, responsible for address allocation, communication scheduling, and system management, while the remaining modules act as slave modules, responding to the master module's instructions. However, in applications with dynamically changing module numbers, hot-swappable modules, or high system reliability requirements, this master-slave address allocation and management approach reveals shortcomings. These include single-point-of-failure risks, limited system self-recovery capabilities, difficulties in dynamic module access and deactivation, complex system configuration and maintenance, and insufficient module parity.

[0004] Based on this, the present invention proposes a masterless dynamic address allocation method and apparatus for multiple power supply modules connected in parallel to solve the above-mentioned technical problems. Summary of the Invention

[0005] This invention describes a method and apparatus for dynamic address allocation without master and slave for multiple power supply modules connected in parallel, which can realize the automatic allocation of communication addresses of power supply modules.

[0006] According to a first aspect, the present invention provides a masterless dynamic address allocation method for multiple power supply modules connected in parallel, applied to a controller in a multi-power supply module parallel system. The parallel system further includes multiple power supply modules and a CAN communication bus. Each power supply module is equipped with the controller, and each power supply module is communicatively connected via the CAN communication bus. The method includes: Determine whether the current power module is in the first state; if so, determine the random code of the current power module based on the sampled voltage and sampled current of the current power module, and switch the first state to the second state. If not, determine whether the current power module is in the second state; if yes, receive the random code from other power modules, obtain the random code list, and switch the second state to the third state. If not, determine whether the current power module is in the third state; if yes, sort the random code list from largest to smallest to determine the sorted random code list; use the position of the random code of the current power module in the random code list as the address of the current power module to achieve masterless dynamic address allocation. The first state, the second state, and the third state are determined by sorting the power-on duration of the current power module. The power-on duration of the first state is less than that of the second state, and the power-on duration of the second state is less than that of the third state.

[0007] According to a second aspect, the present invention provides a masterless dynamic address allocation device for multiple power supply modules connected in parallel, applied to a controller in a multi-power supply module parallel system. The parallel system further includes multiple power supply modules and a CAN communication bus. Each power supply module is equipped with the controller, and each power supply module is communicatively connected via the CAN communication bus. The first data processing unit is configured to determine whether the current power module is in the first state; if so, it determines the random code of the current power module based on the sampled voltage and sampled current of the current power module, and switches the first state to the second state. The second data processing unit is configured to, if not, determine whether the current power module is in the second state; if yes, receive random codes from other power modules, obtain a list of random codes, and switch the second state to the third state. The third data processing unit is configured to, if not, determine whether the current power module is in the third state; if yes, sort the random code list from largest to smallest to determine the sorted random code list; and use the position of the random code of the current power module in the random code list as the address of the current power module to achieve masterless dynamic address allocation. The first state, the second state, and the third state are determined by sorting the power-on duration of the current power module. The power-on duration of the first state is less than that of the second state, and the power-on duration of the second state is less than that of the third state.

[0008] Thirdly, embodiments of this specification also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any embodiment of this specification.

[0009] Fourthly, embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods described in any embodiment of this specification.

[0010] According to the masterless dynamic address allocation method and apparatus for multiple power supply modules in parallel provided by the present invention, if the current power supply module is determined to be in the first state, it indicates that it is the module with the earlier power-on sequence in the current parallel system. At this time, the module will generate a random code based on its real-time collected sampled voltage and sampled current data. The sampled voltage and current serve as the operating parameters of the power supply module, and their numerical fluctuation characteristics can provide unique basic variables for random code generation, ensuring that the generated random code has module uniqueness and reducing the probability of subsequent conflicts. At the same time, after completing the random code generation, the module immediately switches its state from the first state to the second state. If the current power supply module is not in the first state, it is further determined whether it is in the second state. If the determination result is yes, it means that the module has completed the random code generation. At this time, the communication receiving function will be activated to receive the random codes sent by other power supply modules in the parallel system, and all received random codes will be summarized and organized to form a complete random code list. After the random code list is collected, the state will be switched from the second state to the third state. If the current power supply module is not in the second state, it is further determined whether it is in the third state. If the determination result is yes, the module will first sort the summarized random code list from largest to smallest to obtain an ordered random code list; then, it will locate the specific position of the random code generated by the current power module itself in the sorted list, and directly use this position information as the unique communication address of the current power module, completing the autonomous address allocation. In this way, the present invention can realize the automatic allocation of the power module's communication address. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A flowchart illustrating a masterless dynamic address allocation method for multiple power supply modules connected in parallel according to one embodiment is shown. Figure 2 A schematic block diagram of a masterless dynamic address allocation device with multiple power supply modules connected in parallel according to one embodiment is shown. Detailed Implementation

[0013] The solution provided by the present invention will now be described with reference to the accompanying drawings.

[0014] Figure 1This diagram illustrates a masterless dynamic address allocation method for multiple power modules connected in parallel according to one embodiment. It is understood that this method can be executed by any device, equipment, platform, or cluster of devices with computing and processing capabilities. The controller is applied to a multi-power module parallel system, which further includes multiple power modules and a CAN communication bus. Each power module is equipped with the controller, and each power module is communicatively connected via the CAN communication bus. Figure 1 As shown, the method includes: Determine if the current power module is in the first state; if so, determine the random code of the current power module based on the sampled voltage and sampled current of the current power module, and switch the first state to the second state. If not, determine whether the current power module is in the second state; if yes, receive the random code from other power modules, obtain the random code list, and switch the second state to the third state. If not, determine whether the current power module is in the third state; if so, sort the random code list from largest to smallest to determine the sorted random code list; use the position of the random code of the current power module in the random code list as the address of the current power module to achieve masterless dynamic address allocation. The first, second, and third states are determined by the power-on duration of the current power module. The power-on duration of the first state is shorter than that of the second state, and the power-on duration of the second state is shorter than that of the third state.

[0015] In this embodiment, if the current power module is determined to be in the first state, it indicates that it is the module with the earliest power-on sequence in the current parallel system. At this time, the module will generate a random code based on its real-time collected sampled voltage and sampled current data. The sampled voltage and current serve as the operating parameters of the power module, and their numerical fluctuation characteristics can provide unique basic variables for random code generation, ensuring that the generated random code has module uniqueness and reducing the probability of subsequent conflicts. At the same time, after completing the random code generation, the module immediately switches its state from the first state to the second state. If the current power module is not in the first state, it is further determined whether it is in the second state. If the determination result is yes, it means that the module has completed the random code generation. At this time, the communication receiving function will be activated to receive random codes sent by other power modules in the parallel system, and all received random codes will be summarized and organized to form a complete random code list. After the random code list is collected, the state will switch from the second state to the third state. If the current power module is not in the second state, it is further determined whether it is in the third state. If the determination result is yes, the module will first sort the summarized random code list from largest to smallest to obtain an ordered random code list; then, it will locate the specific position of the random code generated by the current power module itself in the sorted list, and directly use this position information as the unique communication address of the current power module, completing the autonomous address allocation. In this way, the present invention can realize the automatic allocation of the power module's communication address.

[0016] In one embodiment of the present invention, it is determined whether the current power module is in the third state; if so, the random code list is sorted from largest to smallest to determine the sorted random code list; the position of the random code of the current power module in the random code list is used as the address of the current power module, and the method further includes: Determine if the current power module is in the third state; If so, sort the random code list from largest to smallest to determine the sorted random code list; take the position of the random code of the current power module in the random code list as the address of the current power module, and switch the third state to the fourth state; If not, then the current power module is determined to be in the fourth state; When in the fourth state, record the current online status and working data of the power module and update the online status of other power modules; The power-on time in the third state is shorter than that in the fourth state, and the operating data includes current and voltage.

[0017] In this embodiment, if it is determined that the current power module is not in the third state, it is directly determined that it is in the fourth state. When the current power module is in the fourth state, on the one hand, it collects and records its own online status and working data (current and voltage) in real time, providing a data basis for the status monitoring of the parallel system; on the other hand, it synchronously updates the online status of other power modules through the CAN communication bus, realizing real-time sharing of operating information between modules and ensuring the coordinated and stable operation of the entire parallel system.

[0018] In one embodiment of the present invention, it is determined whether the current power module is in the first state. If so, no CAN message is sent to the CAN communication bus. If not, is the current power module in the second state? If yes, send a CAN message containing the random code of the current power module and the first function code to the CAN communication bus; wherein, the first function code is used to characterize the second state of the current power module. If not, is the current power module in the third state? If so, do not send CAN messages to the CAN communication bus. If not, is the current power module in the fourth state? If yes, send a CAN message containing the current power module's address, working data, second function code, and online status to the CAN communication bus. If not, the parallel system is determined to be in a stable operating state; The second function code is used to characterize the fourth state of the current power module.

[0019] In this embodiment, the system first determines whether the current power module is in the first state. If so, the module is in the initial preparation stage of address allocation and does not need to interact with other modules. Therefore, no CAN message is sent to the CAN communication bus to avoid invalid messages occupying bus bandwidth. If the current module is not in the first state, the system further determines whether it is in the second state. If the determination result is yes, it means that the module has completed random code generation and entered the information interaction stage. At this time, a CAN message containing the current power module's random code and the first function code will be sent to the CAN communication bus. The first function code is a special code for status identification, which is used to clearly indicate to other parallel modules in the bus that the sender is currently in the second state. If the module is not in the second state, the system continues to determine whether it is in the third state. If it is in the third state, the module is in the processing stage of random code sorting and address determination and does not need to send interaction information. Therefore, no CAN message is sent to the CAN communication bus. If the module is not in the third state, it is determined whether it is in the fourth state. If it is in the fourth state, the module has completed address allocation and entered the stable operation stage. It will send a CAN message to the CAN communication bus containing its own address, real-time working data (such as output current and voltage), second function code and online status. The second function code is used to clearly indicate that the sender is in the fourth state, so that other modules can quickly identify and synchronously update the operating status of other power modules.

[0020] In one embodiment of the present invention, it is determined whether the current power module is in the first state. If so, CAN messages from the CAN communication bus are not received. If not, then is the current power module in the second state? If yes, then receive the CAN message from the CAN communication bus and perform the first parsing of the CAN message. If not, is the current power module in the third state? If so, then do not receive CAN messages from the CAN communication bus. If the current power module is determined to be in the fourth state, then the CAN message from the CAN communication bus is received, and the CAN message is parsed for the second time. The CAN extended identifier field of the CAN message in the CAN communication bus includes an address or a random code.

[0021] In this embodiment, if the current module is not in the first state, it is further determined whether it is in the second state. If the determination result is yes, it means that the module has entered the random code interaction and aggregation stage. At this time, the CAN message receiving function will be started to receive CAN messages from the CAN communication bus and perform the first parsing on the received messages. If the module is not in the second state, it is further determined whether it is in the third state. If it is in the third state, the module is focused on the random code sorting and address determination operation at this stage and does not need to receive external interaction messages. Therefore, it does not receive CAN messages from the CAN communication bus to ensure that the operation process is not interfered with. If the module is not in the third state, it is directly determined that it is in the fourth state. At this time, the module has completed the address allocation and entered the stable operation stage. The CAN message receiving function will be started to receive CAN messages in the bus and perform the second parsing.

[0022] It should also be noted that since the random code or address is directly written into the CAN extended identifier field of the CAN message, the concurrency conflict problem can be resolved by utilizing the arbitration mechanism of the CAN bus. Furthermore, because the address and random code are related in their positions within the sorted random code list, address duplication during normal operation is also avoided.

[0023] In one embodiment of the present invention, the first parsing of the CAN message includes: When the function code in the CAN message is the first function code, receive the random code in the CAN message; When the function code in the CAN message is the second function code, receive the address of other power modules in the CAN message and set the random code corresponding to the address of the other power module to the maximum. Based on the current power module's random code and the random codes corresponding to the addresses of other power modules, determine the updated list of random codes; The address of the current power module is determined based on the updated list of random codes.

[0024] In this embodiment, when the function code in the CAN message is parsed to be the first function code, it indicates that the message comes from another parallel power module in the second state. At this time, the random codes of other modules carried in the message are extracted first and added to the current power module's random code collection list. If the function code in the CAN message is parsed to be the second function code, it means that the module sending the message has completed address allocation and entered the fourth state. At this time, the module's address information contained in the message needs to be extracted. Simultaneously, to ensure the uniqueness and orderliness of address allocation, the random code of the power module corresponding to that address is set to a preset maximum value. Based on the current power module's random code and the random codes corresponding to the addresses of other power modules, an updated random code list is determined; based on the updated random code list, the address of the current power module is determined.

[0025] In one embodiment of the present invention, determining the address of the current power module based on the updated random code list includes: If there are empty address slots in the updated random code list, one of the empty address slots will be used as the address of the current power module. If there are no empty address slots in the updated random code list, the position of the current power module's random code in the updated random code list will be used as the address of the current power module.

[0026] In this embodiment, the system first checks whether there are any empty address slots in the updated random code list. Empty address slots refer to unused address numbers due to module offline status, hot-swapping, or other reasons. If an empty address slot is detected, to improve address resource utilization and ensure the continuity of the address sequence, one slot is directly selected as the address of the current power module. If no empty address slots are detected in the updated random code list, it means that all addresses are effectively occupied. In this case, the system follows a preset rule, directly determining the final communication address based on the current power module's random code's position in the updated list, ensuring orderly and conflict-free address allocation.

[0027] In one embodiment of the present invention, the second parsing of the CAN message includes: when the function code in the CAN message is the first function code, not receiving the address and online status of the other power modules in the CAN message; when the function code in the CAN message is the second function code, receiving the address and online status of the other power modules in the CAN message.

[0028] In this embodiment, if the function code in the CAN message is parsed to be the first function code, it indicates that the message comes from a module in the address allocation phase. Since the current module has completed address allocation and entered a stable operating phase, it does not need to respond to such initial interaction messages, and therefore does not receive the CAN message or any data it carries. If the function code is parsed to be the second function code, it is determined that the message comes from another power module that is also in the stable operating phase. In this case, the addresses and online status information of other modules carried in the message are received, providing data support for the system to update the module operating status in real time.

[0029] In this embodiment, a batch of power modules are powered on simultaneously and enter the dynamic address allocation process. This involves the following steps: First, during the module power-on initialization and random identifier generation stage, each power module samples its local voltage or current value, converts the sampled analog quantity into a digital quantity, and stores it locally as a random identifier. Since each module has a different characteristic impedance, the resulting random identifiers are also different. During this stage, modules do not communicate with each other; all functions are executed locally within the module. Next, during the module identifier broadcasting and collection stage, each power module writes its local random identifier into the CAN extended identifier portion of the CAN communication extended frame and broadcasts it via the CAN bus. At this point, because each module's random identifier is written into the CAN extended identifier portion, the different random identifiers result in different priorities for each module's frame message during CAN bus arbitration, conforming to CAN communication requirements. At the receiving end of each power module's CAN frame message, a receive mask mode is set. This way, although the extended identifiers of the CAN frame messages on the bus are different, each power module does not perform extended identifier matching when receiving messages; it receives messages from all modules and stores them locally. Thus, there is no master / slave distinction among all devices on the bus; all messages can be received and processed locally. Entering the random identifier sorting and address mapping stage, each power module has a local random code list (Serial Code Array), which includes all random codes sent to the CAN bus. However, due to different receiving orders, the storage order of the random code lists in each power module's local random code list is different. At this point, the random code lists are sorted from largest to smallest, resulting in consistent random code lists for all modules. The sorted random code list is copied to a new list, called the sorted random code list (Serial Code Sort). Data matching the local random code is read from the sorted random code list, and the sequence number of this data is recorded as the module address. At this point, each power module obtains its own module address, recorded as its ID. All power modules have different IDs; power modules with larger random codes have smaller IDs and higher communication priority on the bus. It is particularly important to emphasize that although the above process is performed locally in each module, and the sorted random code list (Serial Code Sort) is not transmitted to the CAN bus, due to the high timing compatibility and master-slave characteristic of this method, the sorted random code lists (Serial Code Sort) stored locally in all modules are consistent. During the address confirmation and operation status broadcast phase, all power modules on the bus have local IDs. The IDs are written into the CAN extension identifier part of the CAN communication extension frame, and the voltage and current information are written into the CAN data segment part of the CAN communication extension frame. Masterless communication is then performed according to different priorities.All devices on the bus can receive voltage and current information from all other devices and record it in their local working data list according to their different IDs. The power supply enters a normal and orderly operation phase. Then, it enters the online status monitoring and dynamic maintenance phase. Simultaneously, the local power module receives the corresponding ID from the bus and records the device as online at the corresponding position in the Module On Work Check online monitoring table. Periodically, the records in the online monitoring table are checked at the corresponding positions. If all records show the device as offline, it is disconnected. During this process, the number of all online devices is updated in real time.

[0030] In this embodiment, when a batch of power modules are operating stably, a hot-insertion of a power module occurs, triggering a dynamic address allocation process. This involves the following steps: First, during the module power-on initialization and random identifier generation stage, the module's local voltage or current value is sampled. The sampled analog value is converted to a digital value and stored locally as a random identifier. It's important to note that at this time, other power modules in the parallel system have completed their module identifier broadcasting and collection phases and are not transmitting their random identifiers on the CAN bus. Next, during the module identifier broadcasting and collection phase, the hot-inserted module receives the IDs and operating information of other modules from the CAN bus. Based on the ID value, the maximum value 0xFFFFFFFF is written to the corresponding position in the sorted random identifier list (Serial Code Sort), signifying that the device's random identifier for that ID is the maximum value 0xFFFFFFFF. Finally, during the random identifier sorting and address mapping stage, the hot-inserted device sorts the random identifier list (Serial Code Array) locally from largest to smallest. At this time, only the hot-inserted device has a real random identifier; the random identifiers of other devices are all 0. Therefore, after sorting, the random code of this device will definitely be at the first position in the Serial Code Array. Then, the Serial Code Sort is scanned sequentially from smallest to largest, and the random code of the hot-insertion device is written to the first non-0xFFFFFFFF address read. The index of this position is recorded as the address ID of this module. It is important to note that the above method solves the dynamic address allocation problem for hot-insertion devices, and the hot-insertion process is independent of other working devices and does not affect the normal operation of the system.

[0031] In this embodiment, when a batch of power modules are operating stably, a power module is hot-swapped (failure), triggering a dynamic address allocation process. This involves the following steps: The hot-swapped device stops working, and the CAN frame message corresponding to that ID disappears from the bus. For other devices operating in the online status monitoring and dynamic maintenance phase, since they cannot receive the frame message for that ID, the number of online devices decreases by one, and the voltage and current information corresponding to that ID in the local working data list is reset to zero, without affecting the normal operation of the entire parallel system.

[0032] In this embodiment, when a batch of power modules are operating stably, a situation arises where a power module is first hot-swapped (faulted) and then hot-swapped, triggering a dynamic address allocation process. This process involves the following steps: The hot-swapped device stops working, and the CAN frame message corresponding to that ID disappears from the bus. For other devices operating in the online status monitoring and dynamic maintenance phase, since they cannot receive the frame message for that ID, the number of online devices decreases by one, and the voltage and current information corresponding to the local working data list position is reset to zero, without affecting the normal operation of the entire parallel system. The corresponding ID is temporarily invalidated in the address system. At this time, a new device is hot-swapped, provided the number of hot-swapped devices is less than or equal to the number of hot-swapped (faulted) devices. The module enters the power-on initialization and random identifier generation phase, sampling the local voltage or current value of the module, converting the sampled analog quantity into a digital quantity, and storing it locally as a random code. It should be noted that at this time, other power modules in the parallel system have finished the module identifier broadcasting and collection phase and are no longer transmitting their random codes on the CAN bus. The module then enters the module identifier broadcasting and collection phase, where the hot-swapped module receives the IDs and working information of other modules from the CAN bus. At this point, based on the ID value, the maximum value 0xFFFFFFFF is written to the corresponding position in the sorted random code list (SerialCodeSort), and the device random code for this ID is considered to be the maximum value 0xFFFFFFFF. Because of the previous module hot-plugging, the IDs received on the bus are not continuous, so some positions in the sorted random code list (SerialCodeSort) before the maximum ID number are 0. Entering the random identifier sorting and address mapping stage, the hot-plugged device sorts the random code list (SerialCodeArray) locally from largest to smallest. At this time, only the hot-plugged device has a real random code; the random codes of other devices are all 0. Therefore, after sorting, the random code of this device must be in the lower bits of the random code list (SerialCodeArray). Then, the sorted random code list (SerialCodeSort) is scanned sequentially from smallest to largest, and the random code of the hot-plugged device is written to the first non-0xFFFFFFFF position read. The position number is recorded as the module address ID. It is important to note that during this process, the hot-inserted device reverts to the ID of the previously hot-plugged (faulty) power module, achieving dynamic address allocation. Furthermore, the hot-insertion process is independent of other working devices and does not affect the normal operation of the system.

[0033] Compared with the prior art, the masterless dynamic address allocation method proposed in this invention has at least the following beneficial effects: (1) The masterless dynamic address allocation method can realize the automatic address allocation of multiple power modules without setting a fixed master module, reducing the system's dependence on a single module; (2) The masterless dynamic address allocation method can solve the hot-plug problem. Because there is no master module, each power module can be dynamically connected or disconnected, and the corresponding address is temporarily invalid. The parallel system can still complete the address allocation process, which is beneficial to the expansion and maintenance of the parallel system; (3) The masterless dynamic address allocation method can solve the hot-plug problem and improve the operational stability of the parallel system under abnormal or faulty module conditions; (4) Since there is no master module, the system function is executed in each local link, simplifying the system configuration process, which is beneficial to the equalization design and general application of power modules, and the system has good symmetry; (5) The masterless dynamic address allocation method does not require calibration of the time base of parallel devices, and the local working timing of each device is independent and does not interfere with each other.

[0034] The foregoing has described specific embodiments of the invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0035] According to another embodiment, the present invention provides a masterless dynamic address allocation device for multiple power supply modules connected in parallel. It is applied to a controller in a multi-power supply module parallel system, wherein the parallel system further includes multiple power supply modules and a CAN communication bus, each power supply module is equipped with the controller, and each power supply module is communicatively connected via the CAN communication bus. Figure 2 A schematic block diagram of a masterless dynamic address allocation device with multiple power supply modules connected in parallel according to one embodiment is shown. It will be understood that this device can be implemented by any device, apparatus, platform, or cluster of devices with computing and processing capabilities. Figure 2 As shown, the device includes: a first data processing unit 200, a second data processing unit 202, and a third data processing unit 204. The main functions of each component are as follows: The first data processing unit 200 is configured to determine whether the current power module is in a first state; if so, it determines the random code of the current power module based on the sampled voltage and sampled current of the current power module, and switches the first state to a second state. The second data processing unit 202 is configured to, if not, determine whether the current power module is in the second state; if yes, receive random codes from other power modules, obtain a list of random codes, and switch the second state to the third state. The third data processing unit 204 is configured to, if not, determine whether the current power module is in the third state; if yes, sort the random code list from largest to smallest to determine the sorted random code list; and use the position of the random code of the current power module in the random code list as the address of the current power module to achieve masterless dynamic address allocation. The first state, the second state, and the third state are determined by sorting the power-on duration of the current power module. The power-on duration of the first state is less than that of the second state, and the power-on duration of the second state is less than that of the third state.

[0036] In one embodiment of the present invention, the third data processing unit 204 is configured to perform the following operations: Determine if the current power module is in the third state; If so, sort the random code list from largest to smallest to determine the sorted random code list; take the position of the random code of the current power module in the random code list as the address of the current power module, and switch the third state to the fourth state; If not, then the current power module is determined to be in the fourth state; When in the fourth state, record the current online status and working data of the power module and update the online status of the other power modules; The power-on duration of the third state is shorter than that of the fourth state, and the operating data includes current and voltage.

[0037] In one embodiment of the present invention, the apparatus further includes a fourth data processing unit, the fourth data processing unit being configured to perform the following operations: Determine whether the current power module is in the first state. If so, do not send CAN messages to the CAN communication bus. If not, is the current power module in the second state? If yes, send a CAN message containing the random code of the current power module and the first function code to the CAN communication bus; wherein, the first function code is used to characterize the second state in which the current power module is in. If not, then is the current power module in the third state? If yes, then no CAN message is sent to the CAN communication bus. If not, is the current power module in the fourth state? If yes, send a CAN message containing the address, working data, second function code, and online status of the current power module to the CAN communication bus. If not, the parallel system is determined to be in a stable operating state; The second function code is used to characterize the fourth state in which the current power module is located.

[0038] In one embodiment of the present invention, the apparatus further includes a fifth data processing unit, the fifth data processing unit being configured to perform the following operations: Determine whether the current power module is in the first state. If so, do not receive CAN messages from the CAN communication bus. If not, then is the current power module in the second state? If yes, then receive the CAN message from the CAN communication bus and perform the first parsing of the CAN message; If not, is the current power module in the third state? If yes, then do not receive CAN messages from the CAN communication bus. If the current power module is determined to be in the fourth state, then a CAN message from the CAN communication bus is received, and the CAN message is parsed a second time. The CAN extended identifier field of the CAN message of the CAN communication bus includes an address or a random code.

[0039] In one embodiment of the present invention, the fifth data processing unit performs the "first parsing of the CAN message" operation, which involves the following steps: When the function code in the CAN message is the first function code, the random code in the CAN message is received. When the function code in the CAN message is the second function code, the address of the other power module in the CAN message is received, and the random code corresponding to the address of the other power module is set to the maximum. Based on the current power module's random code and the random codes corresponding to the addresses of other power modules, determine the updated list of random codes; Based on the updated list of random codes, the address of the current power module is determined.

[0040] In one embodiment of the present invention, the fifth data processing unit, when performing the operation of "determining the address of the current power module based on the updated random code list", performs the following operation: When there are empty address slots in the updated random code list, one of the empty address slots is used as the address of the current power module. When there are no empty address slots in the updated random code list, the position of the random code of the current power module in the updated random code list is used as the address of the current power module.

[0041] In one embodiment of the present invention, the fifth data processing unit, when performing "the second parsing of the CAN message", performs the following operations: When the function code in the CAN message is the first function code, the CAN message is not received; When the function code in the CAN message is the second function code, the address and online status of the other power modules in the CAN message are received.

[0042] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 1 The method described.

[0043] According to another embodiment, an electronic device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 1 The method described.

[0044] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0045] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0046] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A masterless dynamic address allocation method for multiple power supply modules connected in parallel, characterized in that, A controller for use in a parallel system of multiple power modules, wherein the parallel system further includes multiple power modules and a CAN communication bus, each power module is equipped with the controller, and each power module is communicatively connected via the CAN communication bus, including: Determine whether the current power module is in the first state; if so, determine the random code of the current power module based on the sampled voltage and sampled current of the current power module, and switch the first state to the second state. If not, determine whether the current power module is in the second state; if yes, receive the random code from other power modules, obtain the random code list, and switch the second state to the third state. If not, determine whether the current power module is in the third state; if yes, sort the random code list from largest to smallest to determine the sorted random code list; use the position of the random code of the current power module in the random code list as the address of the current power module to achieve masterless dynamic address allocation. The first state, the second state, and the third state are determined by sorting the power-on duration of the current power module. The power-on duration of the first state is less than that of the second state, and the power-on duration of the second state is less than that of the third state.

2. The method according to claim 1, characterized in that, The process involves determining whether the current power module is in the third state; if so, sorting the random code list from largest to smallest to determine the sorted random code list. Using the position of the random code of the current power module in the random code list as the address of the current power module, the method further includes: Determine if the current power module is in the third state; If so, sort the random code list from largest to smallest to determine the sorted random code list; take the position of the random code of the current power module in the random code list as the address of the current power module, and switch the third state to the fourth state; If not, then the current power module is determined to be in the fourth state; When in the fourth state, record the current online status and working data of the power module and update the online status of the other power modules; The power-on duration of the third state is shorter than that of the fourth state, and the operating data includes current and voltage.

3. The method according to claim 2, characterized in that, Also includes: Determine whether the current power module is in the first state. If so, do not send CAN messages to the CAN communication bus. If not, is the current power module in the second state? If yes, send a CAN message containing the random code of the current power module and the first function code to the CAN communication bus; wherein, the first function code is used to characterize the second state in which the current power module is in. If not, then is the current power module in the third state? If yes, then no CAN message is sent to the CAN communication bus. If not, is the current power module in the fourth state? If yes, send a CAN message containing the address, working data, second function code, and online status of the current power module to the CAN communication bus. If not, the parallel system is determined to be in a stable operating state; The second function code is used to characterize the fourth state in which the current power module is located.

4. The method according to claim 3, characterized in that, Also includes: Determine whether the current power module is in the first state. If so, do not receive CAN messages from the CAN communication bus. If not, then is the current power module in the second state? If yes, then receive the CAN message from the CAN communication bus and perform the first parsing of the CAN message; If not, is the current power module in the third state? If yes, then do not receive CAN messages from the CAN communication bus. If the current power module is determined to be in the fourth state, then a CAN message from the CAN communication bus is received, and the CAN message is parsed a second time. The CAN extended identifier field of the CAN message of the CAN communication bus includes an address or a random code.

5. The method according to claim 4, characterized in that, The first parsing of the CAN message includes: When the function code in the CAN message is the first function code, the random code in the CAN message is received. When the function code in the CAN message is the second function code, the address of the other power module in the CAN message is received, and the random code corresponding to the address of the other power module is set to the maximum. Based on the current power module's random code and the random codes corresponding to the addresses of other power modules, determine the updated list of random codes; Based on the updated list of random codes, the address of the current power module is determined.

6. The method according to claim 5, characterized in that, Determining the address of the current power module based on the updated random code list includes: When there are empty address slots in the updated random code list, one of the empty address slots is used as the address of the current power module. When there are no empty address slots in the updated random code list, the position of the random code of the current power module in the updated random code list is used as the address of the current power module.

7. The method according to claim 4, characterized in that, The second parsing of the CAN message includes: When the function code in the CAN message is the first function code, the CAN message is not received; When the function code in the CAN message is the second function code, the address and online status of the other power modules in the CAN message are received.

8. A masterless dynamic address allocation device for multiple power supply modules connected in parallel, characterized in that, A controller for use in a parallel system of multiple power modules, wherein the parallel system further includes multiple power modules and a CAN communication bus, each power module is equipped with the controller, and each power module is communicatively connected via the CAN communication bus, including: The first data processing unit is configured to determine whether the current power module is in the first state; if so, it determines the random code of the current power module based on the sampled voltage and sampled current of the current power module, and switches the first state to the second state. The second data processing unit is configured to, if not, determine whether the current power module is in the second state; if yes, receive random codes from other power modules, obtain a list of random codes, and switch the second state to the third state. The third data processing unit is configured to, if not, determine whether the current power module is in the third state; if yes, sort the random code list from largest to smallest to determine the sorted random code list; and use the position of the random code of the current power module in the random code list as the address of the current power module to achieve masterless dynamic address allocation. The first state, the second state, and the third state are determined by sorting the power-on duration of the current power module. The power-on duration of the first state is less than that of the second state, and the power-on duration of the second state is less than that of the third state.

9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed in a computer, causes the computer to perform the method described in any one of claims 1-7.