Bus device and address allocation method for bus device

By allocating addresses in sequence in the bus device by the controller, the problems of low efficiency and repeated conflicts in the existing technology of module allocation are solved, and an automated and stable address allocation process is realized.

CN120238523APending Publication Date: 2025-07-01GUANGDONG MIDEA WHITE HOME APPLIANCE TECH INNOVATION CENT CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311863910.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In the prior art, bus devices are inefficient when allocating addresses to modules and are prone to problems of conflict and repeated allocation.

Method used

The controller sends an address encoding notification to the first module. After the module responds, the controller applies for the address. The controller allocates the address and sends an encoding notification to the next module in turn until all modules allocate the address.

Benefits of technology

It realizes automatic allocation of addresses to each module in the bus device without manual participation, improving efficiency and avoiding the problems of address conflicts and duplicate allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238523A_ABST
    Figure CN120238523A_ABST
Patent Text Reader

Abstract

The invention discloses bus equipment and an address allocation method of the bus equipment, and relates to the technical field of electronics, the bus equipment comprises a controller and a plurality of modules, the plurality of modules are connected in sequence, the controller is connected with the first module in the plurality of modules, and the method comprises the steps that the controller sends an address coding notification to the first module; for the module receiving the address coding notification, the module responds to the address coding notification and sends an address application request to the controller; the controller allocates an address to the module sending the address application request in response to the address application request, and returns the address to the corresponding module; and for each module before the last module in the plurality of modules, the module determines the received address as the currently used address and sends an address coding notification to the next module. By adopting the method and the device, the address can be automatically allocated to each module in the bus equipment, and the address allocation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technology, and particularly to a bus device and an address allocation method for a bus device. Background Art

[0002] A bus device is a control device often used in industrial production. For example, the bus device can be a motion controller. Generally, a bus device includes a controller and multiple modules. The controller and the multiple modules are connected through a backplane bus. The controller can transmit data, addresses, control signals, etc. to the modules through the backplane bus.

[0003] Before the bus device is used, it is necessary to manually assign addresses to each module to enable communication between the controller and the modules through the backplane bus. However, manual address assignment for modules is inefficient and error-prone. Summary of the Invention

[0004] Embodiments of this application provide a bus device and an address allocation method for a bus device, which can automatically assign addresses to each module in the bus device and improve the efficiency of address assignment. The technical solutions are as follows:

[0005] In a first aspect, an address allocation method for a bus device is provided. The bus device includes a controller and multiple modules. The multiple modules are connected in sequence. The controller is connected to the first module among the multiple modules. The method includes:

[0006] The controller sends an address coding notification to the first module;

[0007] For the module that receives the address coding notification, the module responds to the address coding notification and sends an address application request to the controller;

[0008] The controller responds to the address application request, assigns an address to the module that sends the address application request, and returns the address to the corresponding module;

[0009] For each module before the last module among the multiple modules, the module determines the received address as the currently used address and sends an address coding notification to the next module.

[0010] Optionally, each module includes a first interface and a second interface. Among two connected modules in the multiple modules, the second interface of the previous module is connected to the first interface of the subsequent module. The controller is connected to the first interface of the first module among the multiple modules. The initial states of the first interface and the second interface of each module are in a disconnected state.

[0011] Optionally, after the module determines the received address as the currently used address, it further includes: switching the first interface and the second interface from the disconnected state to the conducting state.

[0012] Optionally, in response to an address application request, the controller allocates an address to the module that sends the address application request, including: the controller allocates an address to the module that sends the address application request according to the order of the module that sends the address application request among multiple modules.

[0013] Optionally, in response to an address coding notification, the module sends an address application request to the controller, including: the module determines whether an address has been allocated currently in response to the address coding notification; the module sends an address application request to the controller in response to no address being allocated currently.

[0014] Optionally, in response to an address coding notification, the module sends an address application request to the controller, including:

[0015] the module determines whether an address has been allocated currently in response to the address coding notification;

[0016] the module sends the currently allocated address to the controller in response to an address being allocated currently;

[0017] After receiving the address sent by the module, the controller determines whether the received address meets the address allocation condition;

[0018] The controller sends a recoding notification to the module in response to the received address not meeting the address allocation condition;

[0019] In response to the recoding notification, the module deletes the currently allocated address and the address application request sent to the controller.

[0020] Optionally, the address allocation condition is that the address received by the controller matches the order of the module that sends the address among multiple modules.

[0021] Optionally, the address allocation condition is that the address received by the controller is the same as the address corresponding to the module that sends the address recorded in the address table of the controller.

[0022] Optionally, the module determines the received address as the currently used address, including: the module determines that the received address is within the set address range and then determines the received address as the currently used address.

[0023] In a second aspect, a bus device is provided. The bus device includes a controller and multiple modules. The multiple modules are connected in sequence, and the controller is connected to the first module among the multiple modules;

[0024] The controller is configured to send an address coding notification to the first module;

[0025] For the module that receives the address coding notification, the module is configured to send an address application request to the controller in response to the address coding notification;

[0026] The controller is configured to, in response to an address application request, allocate an address to the module that sends the address application request and return the address to the corresponding module;

[0027] For each module before the last module among the multiple modules, each module is configured to determine the received address as the currently used address and send an address coding notification to the next module.

[0028] Optionally, each module includes a first interface and a second interface. Among two connected modules in the multiple modules, the second interface of the previous module is connected to the first interface of the subsequent module, and the controller is connected to the first interface of the first module among the multiple modules. The initial states of the first interface and the second interface of each module are in a disconnected state.

[0029] Optionally, after the module determines the received address as the currently used address, it is further configured to switch the states of the first interface and the second interface from the disconnected state to the conducting state.

[0030] Optionally, the controller is configured to allocate an address to the module that sends the address application request according to the order of the module that sends the address application request among the multiple modules.

[0031] Optionally, the module determines whether an address has been allocated currently in response to the address coding notification. In response to the current unallocated address, it sends an address application request to the controller.

[0032] Optionally, the module determines whether an address has been allocated currently in response to the address coding notification; in response to the current allocated address, it sends the currently allocated address to the controller. After receiving the address sent by the module, the controller determines whether the received address meets the address allocation condition. In response to the received address not meeting the address allocation condition, the controller sends a recoding notification to the module. In response to the recoding notification, the module deletes the currently allocated address and sends an address application request to the controller.

[0033] Optionally, the address allocation condition is that the address received by the controller matches the order of the module that sends the address among the multiple modules.

[0034] Optionally, the address allocation condition is that the address received by the controller is the same as the address corresponding to the module that sends the address recorded in the address table of the controller.

[0035] Optionally, the module is configured to determine that the received address is within the set address range and then determine the received address as the currently used address.

[0036] The beneficial effects brought by the technical solution provided by the embodiments of the present application are:

[0037] In an embodiment of the present application, the controller and multiple modules in a bus device can be connected in sequence. The controller can first send an address coding notification to the first module connected to the controller, and after receiving the address application request sent by the module, allocate an address to the module that sent the address application request. After each module is allocated an address, it can send an address coding notification to the next module connected to the module, so that the next module sends an address application request to the controller. In this way, the controller can allocate addresses to each module in the bus device in sequence without manual participation, which can improve the efficiency of allocating addresses to modules. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a schematic diagram of a traditional bus device;

[0039] Figure 2 is a schematic diagram of a bus device provided by an embodiment of the present application;

[0040] Figure 3 is a flowchart of an address allocation method for a bus device provided by an embodiment of the present application;

[0041] Figure 4 is a schematic diagram of a bus device provided by an embodiment of the present application;

[0042] Figure 5 is a flowchart of an address allocation method for a bus device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0043] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0044] Figure 1 is a schematic diagram of a traditional bus device, as Figure 1 shown, the bus device 100 may include a controller 110 and multiple modules 120. The controller 110 and the multiple modules 120 may be connected through a backplane bus 130.

[0045] In one example, the bus device 100 can be a Programmable Logic Controller (PLC) device, such as a motion controller. The controller 110 can be used to implement the control functions for multiple modules 120. The multiple modules 120 included in the bus device 100 are expandable modules for implementing different functions. In different application scenarios, the types and quantities of the modules 120 included in the bus device 100 can be different. Data, addresses, control signals, etc. can be transmitted between the controller 110 and the multiple modules 120 through the backplane bus 130. The backplane bus 130 can be a Controller Area Network (CAN) bus, RS485, etc.

[0046] Before the bus device 100 is applied, a unique address needs to be assigned to each module 120 connected to the backplane bus 130, so that each module 120 can implement the communication of the backplane bus 130 based on the assigned address. The current method for assigning addresses to each module 120 is mainly manual assignment. However, the efficiency of manually assigning addresses to the modules 120 is low, and as the number of modules 120 in the bus device 100 increases, problems such as address conflicts and duplicate assignments may occur when manually assigning addresses to the modules 120.

[0047] The embodiment of the present application provides an address assignment method for a bus device. The controller in the bus device can automatically assign addresses to each module in the bus device, which can avoid manually assigning addresses to each module, improve the efficiency of assigning addresses to the modules, and prevent address conflicts and duplicate assignment problems.

[0048] Figure 2 is a schematic diagram of a bus device provided by the embodiment of the present application. Refer to Figure 2 , the bus device includes a controller and multiple modules. In addition to being connected through the backplane bus, the multiple modules are also sequentially connected, that is, the first module among the multiple modules is connected to the second module, the second module is also connected to the third module, …, the nth module is also connected to the n + 1th module. Among them, Figure 2 module 1 is the first module and module N is the Nth module. The controller can be connected to the first module among the multiple modules. In one example, the modules can be connected to each other and to the controller through General-purpose input / output (GPIO) pins. The controller can send data, addresses, control signals, etc. to the first module among the multiple modules, and each module can send data, addresses, control signals, etc. to its corresponding next module or previous module.

[0049] For the address allocation method of the bus device provided in this application, it can be as follows Figure 3 shown:

[0050] Step 301: The controller sends an address coding notification to the first module.

[0051] In implementation, before the bus device is used or when there is an update in the modules in the bus device, the controller can be operated to enter the debugging mode. In the debugging mode, the controller can automatically allocate addresses for each module in the bus device. During the process of the controller allocating addresses for each module, the controller can first send an address coding notification to the module connected to the controller, that is, send an address coding notification to the first module among multiple modules in the bus device.

[0052] In an example, the address coding notification can be a control signal preset by a technician. The controller can send the control signal to the first module to send an address coding notification to the first module. For the specific form of the control signal, it is not limited in the embodiments of this application. For example, it can be a specified number of pulse signals.

[0053] Step 302: For the module that receives the address coding notification, the module responds to the address coding notification and sends an address application request to the controller.

[0054] After the first module receives the address coding notification sent by the controller, it can send an address application request to the controller to notify the controller to allocate an address for the first module. Among them, module information such as module type and module identifier can be carried in the address application request.

[0055] Step 303: The controller responds to the address application request, allocates an address for the module that sends the address application request, and returns the address to the corresponding module.

[0056] After the controller receives the address application request sent by the module, it can allocate an address for the module that sends the address application notification. For example, it can allocate an address for the module according to the module information carried in the address application request. In an example, the controller can allocate corresponding addresses for each module according to the order of each module among multiple modules, that is, the order of sending the address application request. For example, the first module is allocated the address "1", the second module is allocated the address "2", and the nth module is allocated the address "n". After determining the address allocated for the module, the controller can return the determined address to the corresponding module.

[0057] Step 304: For each module before the last module among multiple modules, each module determines the received address as the currently used address and sends an address coding notification to the next module.

[0058] After receiving the address assigned by the controller, the first module can store the received address and determine this address as the address it uses in the backplane bus.

[0059] After determining the currently used address, the first module can send an address coding notification to the second module. Among them, the address coding notification sent by the module can be the same control signal as the address coding notification sent by the controller in step 301. Subsequently, the second module and the controller can sequentially execute the processing of steps 302 - step 304, thereby realizing the controller to assign an address to the second module. After determining the currently used address, the first module can send an address coding notification to the third module. In this way, each module and the controller can sequentially execute the processing of steps 302 - step 304, thereby realizing the controller to assign an address to each module.

[0060] When the last module among multiple modules receives the address, it can determine the received address as the currently used address and send an address coding completion notification to the controller. Alternatively, this last module can still execute the process of sending an address coding notification to the next module. Since there is no corresponding next module for this last module, this module will not receive information returned by the next module. In one example, if the module does not receive information returned by the next module within a preset time period, it can send an address coding completion notification to the controller.

[0061] In one example, after each module receives the address coding notification, it can execute the processing of step 302 and determine the address received in step 304 as the address it uses. After each module is assigned an address and receives the address again, it can send the corresponding address to the next module until the address is sent to the module that has not been assigned an address yet. In this way, it can be realized that the controller sends an address to the unconnected module. When each module sends an address application request to the controller, it can send the address application request to the previous module. After each module receives the address application request sent by the next module, it can send this address application request to the previous module until this address application request is sent to the controller. In this way, it can be realized that the module not connected to the controller sends an address application request to the controller.

[0062] It can be seen that in the embodiment of the present application, the controller and multiple modules in the bus device can be sequentially connected, and the controller can sequentially assign addresses to each module in the bus device without manual participation, which can improve the efficiency of address assignment for modules and avoid problems of address conflict and duplicate assignment.

[0063] Figure 4 This is a bus device provided by an embodiment of the present application. Refer to Figure 4, the bus device includes a controller and multiple modules. Each module includes a first interface and a second interface. Among the two connected modules in the multiple modules, the second interface of the previous module is connected to the first interface of the subsequent module, and the controller is connected to the first interface of the first module in the multiple modules. The initial states of the first interface and the second interface of each module are in a disconnected state. Among them, the first interface and the second interface of each module can be GPIO pins included in the module. Before the controller assigns an address to the module or before confirming the address of the module, the first interface and the second interface of each module can be in a disconnected state.

[0064] Correspondingly, in the processing of step 304 above, after the module determines the received address as the currently used address, it can switch the first interface and the second interface from the disconnected state to the conducting state. In this way, when the module without an assigned address sends an address application request to the controller, it can directly send the address application request to the second interface of the previous module of this module. Since the first interface and the second interface of each module with an assigned address are conducting, that is, the first interface and the second interface of each module before this module without an assigned address have been conducting, the address application request sent by this module without an assigned address can be directly sent to the controller. Moreover, the controller can also directly send an address to the first interface of the first module, realizing directly sending the address to the module without an assigned address. In this way, it is possible to avoid the forwarding of the address application request by each module before this module without an assigned address, simplify the steps of information transmission between the controller and the module, and thus improve the efficiency of the controller in assigning addresses to the module.

[0065] In an implementable manner, in the processing of step 303 where the controller responds to the address application request and assigns an address to the module that sends the address application request, the controller can also assign an address to the module that sends the address application request according to the order of the module that sends the address application request among the multiple modules.

[0066] In implementation, the controller can assign corresponding addresses to each module according to the order of each module among the multiple modules. In one implementation manner, the controller can assign addresses to each module in sequence according to the order of the received address application requests. For example, the first module is assigned the address "1", the second module is assigned the address "2", and the nth module is assigned the address "n". In this way, according to the order of the multiple modules, assigning addresses to the modules can avoid the problem of repeatedly assigning addresses to the modules, and thus improve the stability of the controller in automatically assigning addresses.

[0067] In addition, an address table is stored in the controller. After the controller completes the address allocation for each module in the bus device, the address information corresponding to each module can be stored in the address table. Since the address of each module matches the order of each module among multiple modules, the position of each module among multiple modules can be determined according to the address corresponding to each module in the address table. In practical applications, when the data sent by a certain module in the bus device is abnormal, the position of the module can be determined according to the address corresponding to the module with the abnormality, which can improve the efficiency of troubleshooting abnormalities.

[0068] In the embodiment of the present application, an address may be pre-allocated to a module in the bus device. For example, the address may be allocated by a technician, or after the number of modules in the bus device is updated, the address that needs to be updated stored in the module. Considering the above situation, the processing of the module in response to the address coding notification in step 302 may further include:

[0069] Processing one:

[0070] The module responds to the address coding notification, determines whether an address has been allocated currently, and in response to the current unallocated address, sends an address application request to the controller.

[0071] In implementation, when the module receives the address coding notification sent by the controller or the previous module, it can determine whether an address has been allocated currently. For example, it can determine whether address information is stored in the position in the module's memory used to store the address. If no address information is stored, it is determined that the address has not been allocated currently. When the module determines that its own address has not been allocated, it can send an address application request to the controller so that the controller allocates an address for the module.

[0072] Processing two:

[0073] Step 3021: The module responds to the address coding notification and determines whether an address has been allocated currently.

[0074] Step 3022: The module responds to the currently allocated address and sends the currently allocated address to the controller.

[0075] If the module determines that an address has been allocated currently, the module can send the current address to the controller. In an example, since the module has an address allocated currently, the module can report the address to the controller through the backplane bus.

[0076] Step 3023: After the controller receives the address sent by the module, it determines whether the received address meets the address allocation condition.

[0077] In a feasible manner, the address allocation condition is that the address received by the controller matches the order of the module sending the address among multiple modules.

[0078] In implementation, the addresses assigned to the modules in the module are pre-set by technicians. After the controller receives the addresses reported by the modules, it can verify whether the addresses reported by the modules match the order of the modules among multiple modules. For example, if the module is the third module among multiple modules, the controller can determine whether the address reported by the module is the address "3". If the controller determines that the address reported by the verified module matches the order of the module among multiple modules, it can determine that the address pre-assigned to the module by the technician meets the address assignment conditions.

[0079] In another implementable way, the address assignment condition is that the address received by the controller is the same as the address corresponding to the module whose sending address is recorded in the address table of the controller.

[0080] In implementation, there may be updates to the modules in the bus device, such as adding modules in the bus device or reducing modules in the bus device. In this case, the controller may store the address table corresponding to the modules in the bus device before the update.

[0081] After the controller receives the address sent by the module, if the address is consistent with the address corresponding to the module recorded in the address table, it indicates that after the module in the bus device is updated, the order of the module among multiple modules has not changed, and the module can still apply the original address, that is, the address sent by the module meets the address assignment conditions. If the address is inconsistent with the address corresponding to the module recorded in the address table, or the address table does not record the address of the module, it indicates that after the module in the bus device is updated, the order of the module among multiple modules has changed, or it indicates that the module is a newly added module in the bus device.

[0082] It should be noted that after the controller receives the address sent by the module and determines that the received address meets the address assignment conditions, the controller can send an address confirmation notice to the address sending the module, so that the module can continue to apply the address already assigned to the module. After determining that the received address does not meet the address assignment conditions, step 3024 can be executed.

[0083] In addition, each time it is determined that the received address is inconsistent with the address corresponding to the module recorded in the address table, or the address table does not record the address of the module, and after re-assigning an address to the module subsequently, the address table can be updated. On the one hand, update the address corresponding to the module in the address table. On the other hand, it is necessary to adaptively update the addresses corresponding to other modules after the module in the address table. After determining that there is no address corresponding to the module in the address table, it indicates that the module is a newly added module, and the address corresponding to the module can be inserted into the corresponding position in the address table, and the addresses after the module in the address table are incremented by "1".

[0084] Step 3024: The controller responds to receiving that the address does not meet the address allocation condition and sends a recoding notice to the module.

[0085] If the controller determines that the address does not meet the address allocation condition, it can send a recoding notice to the module that sent the address. The recoding notice can be a control signal different from the address coding signal preset by the technician. For the specific form of the control signal, there is no limitation in the embodiments of the present application. For example, it can be a specified number of pulse signals.

[0086] Step 3025: The module responds to the recoding notice, deletes the currently allocated address, and sends an address application request to the controller.

[0087] Upon receiving the recoding notice sent by the controller, the module can delete the currently allocated address and send an address application request to the controller to request a reallocation of the address.

[0088] In an implementable manner, after the module determines that the received address is within the set address range, it determines the received address as the currently used address.

[0089] In implementation, after each module receives the address allocated by the controller, it can verify the received address to ensure that the received address is a legal addressing. For example, in each module, there can be stored the address range corresponding to the addresses applied in the bus device preset in advance. After each module receives the address allocated by the controller, it can determine whether the received address is within the set address range. If it is, it determines that the address allocated by the controller belongs to legal addressing and can determine the address allocated by the controller as the currently used address of the module. If not, it can send an address application request to the controller again so that the controller allocates an address to the module again.

[0090] It can be seen that in the embodiments of the present application, the controller can automatically allocate addresses to the modules and can adapt to the dynamic change in the number of modules in the bus device and re-allocate addresses to the modules. It can improve the efficiency and stability of the controller in allocating addresses.

[0091] Figure 5 It is a flowchart of an address allocation method for a bus device provided by the embodiments of the present application. As Figure 5 shown, the method includes:

[0092] Step S1: After the controller enters the debug mode, it runs the program for encoding and allocating the backplane bus address.

[0093] Step S2: The controller sends a GPIO instruction through the GPIO pin. The GPIO instruction is the address coding notice, for example, it can be 2 1ms pulses of low level turning to high level.

[0094] Step S3. After receiving the GPIO instruction, Module 1 can determine whether it has been addressed currently.

[0095] Step S4. If Module 1 determines that it has been addressed currently, it can report the current address to the controller in broadcast form through the backplane bus. If Module 1 has not been addressed currently, it can apply to the controller for address coding.

[0096] The address reported by Module 1 to the controller or the address application request sent for applying for address coding can be collectively referred to as the first address message.

[0097] Step S5. After receiving the address reported by Module 1, the controller can confirm the addressed address of Module 1. Or after receiving the address application request sent by Module 1, the controller can confirm the new address coding for Module 1.

[0098] In Step S5, the controller can return the No. 1 address coding to Module 1, and the No. 1 address coding can be the confirmation information of the addressed address of Module 1 or the address assigned to Module 1.

[0099] Step S6. After receiving the address assigned by the controller, Module 1 can determine whether the received address is a legal address.

[0100] Step S7. Module 1 sends a GPIO instruction to Module 2 through the GPIO pin, and the GPIO instruction is the same as the GPIO instruction in Step S2.

[0101] The steps S8 - S12 executed by Module 2 and the controller are similar to the steps S3 - S7 executed by the above-mentioned Module 1 and the controller, and will not be elaborated in this embodiment of the present application. After that, the address assignment for Module 3, Module 4, and Module N can all refer to the addressing process of Module 1 or Module 2 until the addressing of each module in the bus device is completed.

[0102] It can be seen that in this embodiment of the present application, the controller can assign addresses to each module in the bus device in sequence without manual participation, which can improve the efficiency of address assignment for modules and avoid problems such as address conflicts and duplicate assignments.

[0103] Based on the same inventive concept, this embodiment of the present application also provides a bus device, and the bus device can be as Figure 2 shown. In the bus device, it includes a controller and multiple modules. The multiple modules are connected in sequence, and the controller is connected to the first module among the multiple modules;

[0104] The controller is used to send an address coding notification to the first module.

[0105] For a module that receives an address coding notification, the module is configured to send an address application request to the controller in response to the address coding notification.

[0106] The controller is configured to allocate an address to the module that sends the address application request in response to the address application request, and return the address to the corresponding module.

[0107] For each module before the last module among multiple modules, each module is configured to determine the received address as the currently used address, and send an address coding notification to the next module.

[0108] The bus device provided by the embodiments of the present application and the address allocation method of the above bus device belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here. By using the bus device provided by the present application, the controller in the bus device can allocate addresses to each module in the bus device in sequence without manual participation, which can improve the efficiency of address allocation for modules and avoid problems such as address conflicts and duplicate allocations.

[0109] In the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. The term "at least one" means one or more, and the term "multiple" means two or more, unless otherwise clearly defined.

[0110] The above are only exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An address allocation method for a bus device, characterized in that, The bus device includes a controller and multiple modules. The multiple modules are connected in sequence. The controller is connected to the first module among the multiple modules. The method includes: The controller sends an address coding notification to the first module; For the module that receives the address coding notification, the module sends an address application request to the controller in response to the address coding notification; The controller, in response to the address application request, assigns an address to the module that sends the address application request and returns the address to the corresponding module; For each module before the last module among the multiple modules, the module determines the received address as the currently used address and sends the address coding notification to the next module.

2. The method according to claim 1, characterized in that, Each module includes a first interface and a second interface. Among the two connected modules in the multiple modules, the second interface of the previous module is connected to the first interface of the subsequent module. The controller is connected to the first interface of the first module among the multiple modules. The initial states of the first interface and the second interface of each module are in a disconnected state.

3. The method according to claim 2, wherein After the module determines the received address as the currently used address, it further includes: Switching the first interface and the second interface from the disconnected state to the conducting state.

4. The method according to any one of claims 1 to 3, characterized in that, The controller, in response to the address application request, assigns an address to the module that sends the address application request, including: The controller assigns an address to the module that sends the address application request according to the order of the module that sends the address application request among the multiple modules.

5. The method according to any one of claims 1 to 3, characterized in that, The module sends an address application request to the controller in response to the address coding notification, including: The module determines whether an address has been assigned currently in response to the address coding notification; The module sends an address application request to the controller in response to no address being assigned currently.

6. The method according to any one of claims 1 to 3, characterized in that, The module sends an address application request to the controller in response to the address coding notification, including: The module determines whether an address has been assigned currently in response to the address coding notification; The module sends the currently assigned address to the controller in response to an address having been assigned currently. After the controller receives the address sent by the module, it determines whether the received address meets the address assignment condition; The controller sends a recoding notification to the module in response to the received address not meeting the address assignment condition; The module, in response to the recoding notification, deletes the currently assigned address and the address application request sent to the controller.

7. The method according to claim 6, wherein The address assignment condition is that the address received by the controller matches the order of the module that sends the address among the multiple modules.

8. The method according to claim 6, wherein The address assignment condition is that the address received by the controller is the same as the address corresponding to the module that sends the address recorded in the address table of the controller.

9. The method according to any one of claims 1 to 3, characterized in that, The module determines the received address as the currently used address, including: After the module determines that the received address is within the set address range, it determines the received address as the currently used address.

10. A bus device, characterized in that, The bus device includes a controller and a plurality of modules. The plurality of modules are connected in sequence, and the controller is connected to the first module among the plurality of modules; The controller is configured to send an address coding notification to the first module; For the module that receives the address coding notification, the module is configured to send an address application request to the controller in response to the address coding notification; The controller is configured to, in response to the address application request, allocate an address to the module that sends the address application request and return the address to the corresponding module; For each module before the last module among the plurality of modules, the module is configured to determine the received address as the currently used address and send the address coding notification to the next module.