A bus module networking control method, device, equipment and storage medium

By realizing automatic expansion and ID redistribution of dynamic ID pools in the bus module, the problem of node ID conflict is solved, and the flexibility and accuracy of bus module networking is improved.

CN118694748BActive Publication Date: 2024-11-05SHENZHEN SANMING ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411156453.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-05
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

In the prior art, the bus module is prone to node ID conflicts during dynamic network configuration, and the existing methods are not flexible and efficient enough when the network is expanded or dynamically changed.

Method used

The main station of the bus module sends messages to reset the device communication, listens to the messages returned by the slave and assigns the node ID. If there is a conflict, store the ID in the dynamic ID pool. The dynamic ID pool will automatically expand to adapt to more node IDs, and Reassign unique ID.

Benefits of technology

It effectively avoids node conflicts, improves network efficiency and accuracy, and ensures that each bus module slave has a unique node ID.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694748B_ABST
    Figure CN118694748B_ABST
Patent Text Reader

Abstract

The present invention discloses a bus module networking control method, device, equipment and storage medium. The present invention controls the bus module master station to send a first message to reset the communication of devices within a preset range; controls the bus module slave stations within the preset range to return a second message and enter a pre-operation state; allocates a node ID to each bus module slave station; determines whether there is an address conflict; stores the conflicting node ID into a dynamic ID pool; reallocates the target replacement node ID to the corresponding bus module slave station; sends a pre-operation instruction to ensure that each bus module slave station is in a pre-operation state; after configuring parameters of each bus module slave station through a first data format, the corresponding bus module slave station is started; after confirming that each bus module slave station enters an operable state, the bus module master station is controlled to transmit a message. The present invention can realize the networking control of the bus module, can effectively avoid node conflicts, and has high networking efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bus networking technology, and in particular to a bus module networking control method, device, equipment and storage medium. Background Art

[0002] The bus module plays a vital role in modern industrial automatic control systems. The bus module is equipped with at least one communication network port, which is connected to the host control system through this network port to achieve efficient and stable data transmission. At the same time, the bus module is also equipped with IO terminal groups, which are closely connected to various industrial equipment such as reed relays, temperature sensors, flow sensors, pressure sensors, liquid level transmitters, etc. through professional connection cables. In this way, the bus module can not only realize data collection of industrial equipment, but also realize remote control of industrial equipment, greatly improving the intelligence and flexibility of the automatic control system.

[0003] In the prior art, the Controller Area Network (CAN) is a widely used communication protocol for data exchange and control between bus module devices. CANopen is an industrial communication standard based on the CAN protocol, which defines a series of protocols and device profiles for communication and control between devices in automation systems. Each device in a CANopen network requires a unique node ID to identify its location in the network. During dynamic network configuration, multiple devices may be assigned the same node ID, resulting in address conflicts. The prior art usually reduces the occurrence of conflicts by pre-defining ID ranges or manually assigning IDs, but these methods may not be flexible and efficient when the network expands or changes dynamically.

[0004] Therefore, inventing a bus module networking control method that can automatically detect and handle ID conflicts and can automatically expand to accommodate more node IDs has become an urgent problem to be solved by technicians in this field. Summary of the invention

[0005] In view of the above defects, the embodiments of the present invention provide a bus module networking control method, device, equipment and storage medium to solve the problems existing in the prior art.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides a bus module networking control method, the method comprising:

[0007] Control the bus module master station to send a first message to reset the communication of devices within a preset range;

[0008] Control the bus modules within the preset range to return a second message from the station and enter a pre-operation state;

[0009] Control the bus module master station to listen to the second message, and assign a node ID to each of the bus module slave stations according to a predefined rule;

[0010] Control the bus module master station to issue a duplicate address detection command, and determine whether there is an address conflict according to the node ID returned by each bus module slave station;

[0011] If there is an address conflict, control the bus module master station to store the conflicting node ID into a dynamic ID pool; wherein the dynamic ID pool is set to a dynamic array structure, and the dynamic array structure can automatically expand to accommodate more node IDs;

[0012] Control the bus module master station to generate a target replacement node ID in the dynamic ID pool, and reallocate the target replacement node ID to a corresponding bus module slave station;

[0013] Controlling the bus module master station to send a pre-operation instruction to ensure that each of the bus module slave stations is in a pre-operation state;

[0014] After controlling the bus module master station to configure parameters of each bus module slave station in a first data format, the corresponding bus module slave station is started;

[0015] After confirming that each of the bus module slave stations has entered an operable state, the bus module master station is controlled to transmit messages using a second data format.

[0016] Preferably, controlling the bus module master station to monitor the second message and assigning a node ID to each of the bus module slave stations according to a predefined rule comprises:

[0017] Control the bus module master station to obtain the geographical location coordinate information corresponding to each of the bus module slave stations in the second message;

[0018] Encode the geographic location coordinate information into a corresponding node ID;

[0019] The encoded node ID is correspondingly assigned to each of the bus module slave stations.

[0020] Preferably, controlling the dynamic array structure to achieve automatic expansion includes:

[0021] defining the allocation capacity of the dynamic array structure;

[0022] Real-time monitoring of the current capacity of the dynamic array structure;

[0023] If the current capacity of the dynamic array structure is greater than or equal to the allocated capacity of the dynamic array structure, the dynamic array structure is controlled to automatically expand.

[0024] Preferably, before the control bus module master station sends the first message to reset the communication of devices within a preset range, the method includes:

[0025] After the PLC is powered on, the bus module master station is controlled to enter the self-test process;

[0026] The bus module master station is controlled to read basic configuration data and read PLC status in the self-check process.

[0027] Preferably, before the control bus module master station sends the first message to reset the communication of devices within a preset range, the method further includes:

[0028] Establishing a data mapping table in the bus module master station;

[0029] The correspondence between the address of the open data area in the PLC and the data in each PDO object and SDO object of the bus module master station is stored.

[0030] Preferably, the controlling the bus module master station to generate a target replacement node ID in the dynamic ID pool and reallocating the target replacement node ID to a corresponding bus module slave station comprises:

[0031] Control the bus module master station to generate the target replacement node ID through a hash function to ensure the uniqueness of the target replacement node ID;

[0032] The bus module master station is controlled to reallocate the target replacement node ID to the corresponding bus module slave station.

[0033] Preferably, the controlling the bus module master station to issue a duplicate address detection command, and judging whether there is an address conflict according to the node ID returned by each of the bus module slave stations comprises:

[0034] Control the bus module master station to issue the duplicate address detection command through an SDO message or an NMT command;

[0035] Control each of the bus module slave stations to return the respective assigned node IDs according to the duplicate address detection command;

[0036] The bus module master station is controlled to compare the node IDs returned by each of the bus module slave stations to check whether there are duplicate node IDs.

[0037] In order to solve the above technical problems, an embodiment of the present invention provides a bus module networking control device, the device comprising:

[0038] An initial reset module, used for controlling the bus module master station to send a first message to reset the communication of devices within a preset range;

[0039] A pre-operation control module, used for controlling the bus modules within the preset range to return a second message from the station and enter a pre-operation state;

[0040] A node ID allocation module, used for controlling the bus module master station to listen to the second message and allocate a node ID to each of the bus module slave stations according to a predefined rule;

[0041] A conflict checking module, used to control the bus module master station to issue a duplicate address detection command, and to determine whether there is an address conflict according to the node ID returned by each of the bus module slave stations;

[0042] A storage module, used for controlling the bus module master station to store the conflicting node ID into a dynamic ID pool if there is an address conflict; wherein the dynamic ID pool is set as a dynamic array structure, and the dynamic array structure can be automatically expanded to accommodate more node IDs;

[0043] A dynamic generation module, used for controlling the bus module master station to generate a target replacement node ID in the dynamic ID pool, and reallocating the target replacement node ID to a corresponding bus module slave station;

[0044] A pre-operation confirmation module, used for controlling the bus module master station to send a pre-operation instruction to ensure that each of the bus module slave stations is in a pre-operation state;

[0045] A parameter configuration module, used for controlling the bus module master station to configure parameters of each bus module slave station through a first data format and then starting the corresponding bus module slave station;

[0046] The message transmission module is used to control the bus module master station to transmit messages in a second data format after confirming that each of the bus module slave stations has entered an operational state.

[0047] To solve the above technical problems, an embodiment of the present invention provides a bus module networking control device, including: at least one processor, at least one memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the method of the first aspect in the above embodiment is implemented.

[0048] To solve the above technical problem, an embodiment of the present invention provides a storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method of the first aspect in the above embodiment is implemented.

[0049] In summary, an embodiment of the present invention provides a bus module networking control method, device, equipment and storage medium. The present invention controls the bus module master station to send a first message to reset the communication of the device within a preset range, so as to prepare for subsequent configuration and operation. The bus module slave station within the preset range is controlled to return a second message and enter a pre-operation state, indicating that the bus module slave station is ready to receive and process subsequent configuration information. A node ID is assigned to each bus module slave station according to a predefined rule. A duplicate address detection command is issued to determine whether there is an address conflict. The conflicting node ID is stored in a dynamic ID pool, and the dynamic ID pool can be automatically expanded to accommodate more node IDs. A target replacement node ID is generated in the dynamic ID pool, and the target replacement node ID is reallocated to the corresponding bus module slave station, thereby ensuring that each bus module slave station has a unique node ID. A pre-operation instruction is sent to ensure that each bus module slave station is in a pre-operation state. After each bus module slave station is parameterized in a first data format, the corresponding bus module slave station is started. After confirming that each bus module slave station has entered an operable state, the bus module master station is controlled to transmit messages in the second data format, thereby realizing data exchange control between the bus module master station and the bus module slave station. Therefore, the present invention can realize the networking control of the bus module, can effectively avoid node conflicts, and has high networking efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following briefly introduces the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 The present invention is a flowchart of a bus module networking control method according to an embodiment of the present invention.

[0052] Figure 2 It is a flow chart of an embodiment of the present invention for controlling the bus module master station to listen to the second message and assigning a node ID to each of the bus module slave stations according to a predefined rule.

[0053] Figure 3 The present invention is a flowchart of controlling a dynamic array structure to achieve automatic expansion.

[0054] Figure 4 It is a flowchart of an embodiment of the present invention for controlling the bus module master station to generate a target replacement node ID in the dynamic ID pool and reallocating the target replacement node ID to the corresponding bus module slave station.

[0055] Figure 5It is a flow chart of controlling the bus module master station to reallocate the target replacement node ID to the corresponding bus module slave station according to an embodiment of the present invention.

[0056] Figure 6 It is a flowchart of an embodiment of the present invention for controlling the bus module master station to send a duplicate address detection command, and judging whether there is an address conflict according to the node ID returned by each bus module slave station.

[0057] Figure 7 It is a structural diagram of a bus module networking control device according to an embodiment of the present invention.

[0058] Figure 8 It is a structural diagram of a bus module networking control device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.

[0060] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0061] See also Figure 1 , Figure 1 A bus module networking control method provided in this application comprises the following steps:

[0062] S1. Control the bus module master station to send a first message to reset the communication of devices within a preset range.

[0063] Specifically, in this embodiment, the bus module includes a bus module master station and a bus module slave station. The bus module master station is a control node in the network, which is used to manage the communication and operation of the network and exchange data with each bus module slave station. The bus module slave station is a controlled node in the network, which is used to respond to the command of the master station and perform specific tasks.

[0064] Specifically, in this embodiment, the bus module master station and the bus module slave station are in a one-to-many relationship. In the initial state, the bus module master station and the bus module slave station are not connected and are independent of each other. Therefore, a bus module networking control method of the present application is used to realize the networking connection control between the bus module master station and multiple bus module slave stations.

[0065] Specifically, in this embodiment, the bus module master station and the bus module slave station are networked via the CANopen protocol. The bus module master station sends a first message so that all devices within a preset range receive a reset command, thereby achieving communication synchronization and network state unification.

[0066] S2. Control the bus modules within the preset range to return the second message from the slave station and enter the pre-operation state.

[0067] Specifically, in this embodiment, after receiving the first message, the bus module slave returns the second message and enters the pre-operation state, indicating that the bus module slave is ready to receive and process subsequent configuration information. Therefore, the bus module master can confirm the state of the bus module slave and start the next step of the configuration process.

[0068] Specifically, the second message returned by the bus module slave is a Boot-up message. It is understandable that the Boot-up message usually contains some basic information of the bus module slave, such as device type, device status, etc. In the CANopen network, the Boot-up message is used to notify other devices on the network when the network is started or the device is restarted, and inform other devices in the network that they are ready to communicate.

[0069] S3. Control the bus module master station to monitor the second message, and assign a node ID to each bus module slave station according to a predefined rule.

[0070] Specifically, in this embodiment, the bus module master station can know which bus module slave stations exist through the Boot-up message, and configure the existing devices in sequence.

[0071] Specifically, in this embodiment, the bus module master station monitors the Boot-up message of the bus module slave station, and allocates a unique node ID to each bus module slave station according to a predefined rule.

[0072] S4. Control the bus module master station to issue a duplicate address detection command, and determine whether there is an address conflict based on the node ID returned by each bus module slave station.

[0073] Specifically, in this embodiment, the CANopen protocol specifies the available node ID range in the CANopen network. In one embodiment, if multiple devices are assigned the same node ID, a node ID conflict will occur. Alternatively, in another embodiment, the network topology changes in real time, which may also lead to a node ID conflict.

[0074] Specifically, in this embodiment, the bus module master station sends a duplicate address detection command through an SDO message or an NMT command, requiring all bus module slave stations to return their assigned node IDs, and determines whether there is an address conflict based on the node ID returned by each bus module slave station.

[0075] S5. If there is an address conflict, the control bus module master station stores the conflicting node ID into a dynamic ID pool. The dynamic ID pool is set as a dynamic array structure, and the dynamic array structure can automatically expand to accommodate more node IDs.

[0076] Specifically, if an address conflict is detected, the bus module master stores the conflicting node ID into a pre-established dynamic ID pool to prevent the conflicting node ID from being allocated again.

[0077] Specifically, the dynamic ID pool is set as a dynamic array structure. In this embodiment, the dynamic array structure can be automatically expanded to accommodate more node IDs.

[0078] It is worth noting that the implementation method of automatic expansion of the dynamic ID pool enables the dynamic ID pool to automatically adjust its size as needed, avoiding the need for manual memory management, while also improving the flexibility and scalability of the system.

[0079] S6. Control the bus module master station to generate a target replacement node ID in the dynamic ID pool, and reallocate the target replacement node ID to the corresponding bus module slave station.

[0080] Specifically, when a node ID needs to be reallocated, the dynamic array structure can quickly retrieve an unused node ID in the dynamic ID pool as a target replacement node ID.

[0081] S7. Control the bus module master station to send a pre-operation instruction to ensure that each bus module slave station is in a pre-operation state.

[0082] S8. After controlling the bus module master station to configure parameters of each bus module slave station using the first data format, the corresponding bus module slave station is started.

[0083] Specifically, in this embodiment, the bus module master first sends a pre-operation instruction to each bus module slave station to ensure that each bus module slave station is in the pre-operation state, thereby ensuring the consistency of the bus module state and ensuring the stable operation of the network.

[0084] Specifically, the bus module master configures the parameters of each bus module slave through SDO (Service Data Objects); after the configuration is completed, the bus module master starts the corresponding bus module slave, so that the bus module slave can effectively participate in network communication.

[0085] S9. After confirming that each bus module slave station has entered an operable state, control the bus module master station to transmit messages using the second data format.

[0086] Specifically, in this embodiment, if each bus module slave returns an operational instruction, it means that the bus module slave enters the operational state and can perform PDO (PHP Data Object) message transmission. At this point, the network begins to communicate normally, and data is exchanged normally between the bus modules.

[0087] In summary, the present application provides a bus module networking control method. In this solution, the bus module master station is controlled to send a first message to reset the communication of the devices within a preset range, so as to prepare for subsequent configuration and operation. The bus module slave stations within the preset range are controlled to return a second message and enter a pre-operation state, indicating that the bus module slave stations are ready to receive and process subsequent configuration information. A node ID is assigned to each bus module slave station according to predefined rules. A duplicate address detection command is issued to determine whether there is an address conflict. The conflicting node ID is stored in a dynamic ID pool, and the dynamic ID pool can be automatically expanded to accommodate more node IDs. A target replacement node ID is generated in the dynamic ID pool, and the target replacement node ID is reallocated to the corresponding bus module slave station, thereby ensuring that each bus module slave station has a unique node ID. A pre-operation instruction is sent to ensure that each bus module slave station is in a pre-operation state. After each bus module slave station is parameterized in a first data format, the corresponding bus module slave station is started. After confirming that each bus module slave station has entered an operable state, the bus module master station is controlled to transmit messages in the second data format, thereby realizing data exchange control between the bus module master station and the bus module slave station. Therefore, the present invention can realize the networking control of the bus module, can effectively avoid node conflicts, and has high networking efficiency and accuracy.

[0088] Based on the above embodiments:

[0089] See also Figure 2 , Figure 2The present application provides a flow chart of controlling a bus module master station to monitor a second message and assigning a node ID to each bus module slave station according to a predefined rule.

[0090] As a preferred embodiment, controlling the bus module master station to monitor the second message and assigning a node ID to each bus module slave station according to a predefined rule includes:

[0091] S31. Control the bus module master station to obtain the geographical location coordinate information corresponding to each bus module slave station in the second message.

[0092] Specifically, the second message returned by the bus module slave station is a Boot-up message. In this embodiment, the Boot-up message also includes the geographical location coordinate information of the bus module slave station.

[0093] S32. Encode the geographical location coordinate information into a corresponding node ID.

[0094] Specifically, in this embodiment, the bus module master station monitors the network, identifies the Boot-up message of the bus module slave station, extracts the geographic location coordinate information, and then encodes the geographic location coordinate information into a unique node ID.

[0095] S33, assigning the encoded node ID to each bus module slave station accordingly.

[0096] Specifically, the bus module master station allocates the encoded node ID to the bus module slave station as a unique identifier of the bus module slave station in the network.

[0097] See also Figure 3 , Figure 3 A schematic diagram of a flow chart for controlling a dynamic array structure to achieve automatic expansion provided in this application.

[0098] As a preferred embodiment, controlling the dynamic array structure to achieve automatic expansion includes:

[0099] S51, defining the allocation capacity of the dynamic array structure;

[0100] S52, real-time monitoring of the current capacity of the dynamic array structure;

[0101] S53: If the current capacity of the dynamic array structure is greater than or equal to the allocated capacity of the dynamic array structure, control the dynamic array structure to automatically expand.

[0102] In this embodiment, the dynamic ID pool is initialized through the initDynamicIDPool function and a memory block of an initial size is allocated; the conflicting ID is stored through the storeConflictID function; an unused ID is retrieved through the getReplacementID function; and the state of the dynamic ID pool is reset through the clearDynamicIDPool function.

[0103] Specifically, after the network configuration is completed, the system will also regularly clear the dynamic ID pool to prepare for the next configuration. For example, the memory occupied by the dynamic ID pool is released through the freeDynamicIDPool function, which is not specifically limited here.

[0104] Therefore, through the above implementation, the bus module master station of the present application can effectively manage node ID conflicts in the network. When an address conflict occurs, the bus module master station of the present application can promptly discover and resolve the conflict, ensuring that each bus module slave station can obtain a unique node ID, thereby improving the accuracy of bus module communication.

[0105] In another preferred embodiment, the dynamic ID pool may also be configured as a data structure such as an array, a linked list, a hash table, etc., which is not specifically limited here.

[0106] The automatic expansion of the dynamic ID pool is achieved by using dynamic memory allocation technology, such as malloc or realloc function, which is not specifically limited here.

[0107] As a preferred embodiment, before the bus module master station is controlled to send a first message to reset the communication of devices within a preset range, the method includes:

[0108] After the PLC is powered on, the control bus module master station enters the self-test process.

[0109] The control bus module master station reads the basic configuration data and reads the PLC status during the self-test process.

[0110] Specifically, in this embodiment, the bus module master station is connected to the PLC for data exchange, and the PLC is used to remotely monitor and integrate the communication data between the bus module master station and each bus module slave station.

[0111] Specifically, in this embodiment, after the PLC is powered on, the bus module master station also enters the self-test process, mainly reading the basic configuration data and PLC status. The user downloads the configured data of each bus module slave station to the memory of the PLC through the host computer, so that the subsequent bus master station module reads the configuration data in the memory and sends it to each bus module slave station.

[0112] As a preferred embodiment, before the bus module master station is controlled to send the first message to reset the communication of devices within a preset range, the method further includes:

[0113] Establish a data mapping table in the bus module master station.

[0114] The correspondence between the address of the open data area in the PLC and the data in each PDO object and SDO object of the bus module master is stored.

[0115] Specifically, in this embodiment, the data management module in the bus module master station is used to exchange data with the PLC task. During the data exchange process, the data exchange between the CANopen master station module and the PLC is completed by a data mapping method.

[0116] Specifically, in this embodiment, a data mapping table is established in the bus module master station to store the corresponding relationship between the address of the PLC open data area and the data in each PDO object and SDO object. When the bus module master station receives the corresponding data object processing, it queries the data mapping table according to the number of the data object to obtain the address of the corresponding PLC open data area. The data processing module in the bus module master station stores the data in the data object in the corresponding address; and the PLC can also use this open data area to read or modify the data here in the user program, thus completing the data control of the PLC on the bus module master station, and achieving the purpose of the PLC controlling the bus module master station network and the remote control of the corresponding slave station.

[0117] See also Figure 4 , Figure 4 A flowchart of a control bus module master station provided in the present application generates a target replacement node ID in a dynamic ID pool and reallocates the target replacement node ID to a corresponding bus module slave station.

[0118] As a preferred embodiment, controlling the bus module master station to generate a target replacement node ID in a dynamic ID pool and reallocating the target replacement node ID to a corresponding bus module slave station includes:

[0119] S61. Control the bus module master station to generate a target replacement node ID through a hash function to ensure the uniqueness of the target replacement node ID.

[0120] S62. Control the bus module master station to reallocate the target replacement node ID to the corresponding bus module slave station.

[0121] Specifically, in this embodiment, the bus module master station is controlled to generate a target replacement node ID through a hash function, and allocates it to the bus module slave station that needs to be replaced, thereby ensuring the uniqueness of the node ID in the bus system.

[0122] See also Figure 5 , Figure 5 A schematic diagram of a flow chart of controlling a bus module master station to reallocate a target replacement node ID to a corresponding bus module slave station is provided in the present application.

[0123] As a preferred embodiment, controlling the bus module master station to reallocate the target replacement node ID to the corresponding bus module slave station includes:

[0124] S621. Control the bus module master station to send a target replacement node ID to the bus module slave station through a network management command or an SDO message.

[0125] S622, the control bus module updates the configuration after receiving the target replacement node ID from the station, and starts to communicate using the new node ID.

[0126] See also Figure 6 , Figure 6 The present application provides a flowchart for controlling a bus module master station to issue a duplicate address detection command and determining whether an address conflict exists based on a node ID returned by each bus module slave station.

[0127] As a preferred embodiment, controlling the bus module master station to issue a duplicate address detection command, and judging whether there is an address conflict according to the node ID returned by each bus module slave station includes:

[0128] S41. The control bus module master sends a duplicate address detection command through an SDO message or an NMT command.

[0129] S42, controlling each bus module slave station to return the node ID assigned to it respectively according to the duplicate address detection command.

[0130] S43, controlling the bus module master station to compare the node IDs returned by each bus module slave station to check whether there are duplicate node IDs.

[0131] See also Figure 7 The embodiment of the present invention provides a bus module networking control device, the device comprising:

[0132] The initial reset module 1 is used to control the bus module master station to send a first message to reset the communication of devices within a preset range.

[0133] The pre-operation control module 2 is used to control the bus modules within a preset range to return a second message from the station and enter a pre-operation state.

[0134] The node ID allocation module 3 is used to control the bus module master station to monitor the second message and allocate a node ID to each bus module slave station according to a predefined rule.

[0135] The conflict checking module 4 is used to control the bus module master station to send a duplicate address detection command, and to determine whether there is an address conflict according to the node ID returned by each bus module slave station.

[0136] The storage module 5 is used to control the bus module master station to store the conflicting node ID into the dynamic ID pool if there is an address conflict; wherein the dynamic ID pool is set to a dynamic array structure, and the dynamic array structure can be automatically expanded to accommodate more node IDs;

[0137] The dynamic generation module 6 is used to control the bus module master station to generate a target replacement node ID in the dynamic ID pool, and reallocate the target replacement node ID to the corresponding bus module slave station.

[0138] The pre-operation confirmation module 7 is used to control the bus module master station to send a pre-operation instruction to ensure that each bus module slave station is in a pre-operation state.

[0139] The parameter configuration module 8 is used to control the bus module master station to configure the parameters of each bus module slave station through the first data format and then start the corresponding bus module slave station.

[0140] The message transmission module 9 is used to control the bus module master station to transmit messages in the second data format after confirming that each bus module slave station has entered an operational state.

[0141] In addition, combined Figure 1 The bus module networking control method described in the embodiment of the present invention can be implemented by a network bus module networking control device. Figure 8 A schematic diagram of the hardware structure of a bus module networking control device provided in an embodiment of the present invention is shown.

[0142] The bus module networking control device may include a processor 401 and a memory 402 storing computer program instructions.

[0143] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0144] The memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 402 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 402 may be inside or outside the data processing device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory. In a specific embodiment, the memory 402 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0145] The processor 401 implements any one of the bus module networking control methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .

[0146] In one example, the bus module networking control device may further include a communication interface 403 and a bus 410. Figure 8 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.

[0147] The communication interface 403 is mainly used to implement the communication between the modules, devices, units and / or equipment in the embodiment of the present invention.

[0148] Bus 410 includes hardware, software or both, and couples the components of bus module networking control device to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. Where appropriate, bus 410 may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.

[0149] In addition, in combination with a bus module networking control method in the above embodiment, an embodiment of the present invention may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions. When the computer program instructions are executed by a processor, any bus module networking control method in the above embodiment is implemented.

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

[0151] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.

Claims

1. A bus module networking control method, characterized in that: The bus module networking control method comprises: Control the bus module master station to send a first message to reset the communication of devices within a preset range; Control the bus modules within the preset range to return a second message from the station and enter a pre-operation state; Control the bus module master station to listen to the second message, and assign a node ID to each of the bus module slave stations according to a predefined rule; Control the bus module master station to issue a duplicate address detection command, and determine whether there is an address conflict according to the node ID returned by each bus module slave station; If there is an address conflict, control the bus module master station to store the conflicting node ID into a dynamic ID pool; wherein the dynamic ID pool is set to a dynamic array structure, and the dynamic array structure can automatically expand to accommodate more node IDs; Control the bus module master station to generate a target replacement node ID in the dynamic ID pool, and reallocate the target replacement node ID to the corresponding bus module slave station; Controlling the bus module master station to send a pre-operation instruction to ensure that each of the bus module slave stations is in a pre-operation state; After controlling the bus module master station to configure parameters of each bus module slave station in a first data format, the corresponding bus module slave station is started; After confirming that each of the bus module slave stations has entered an operable state, the bus module master station is controlled to transmit messages using a second data format.

2. A bus module networking control method according to claim 1, characterized in that: The controlling the bus module master station to monitor the second message and assigning a node ID to each of the bus module slave stations according to a predefined rule comprises: Control the bus module master station to obtain the geographical location coordinate information corresponding to each of the bus module slave stations in the second message; Encode the geographic location coordinate information into a corresponding node ID; The encoded node ID is correspondingly assigned to each of the bus module slave stations.

3. A bus module networking control method according to claim 1, characterized in that: The dynamic array structure can be automatically expanded to accommodate more node IDs, and controlling the dynamic array structure to achieve automatic expansion includes: defining the allocation capacity of the dynamic array structure; Real-time monitoring of the current capacity of the dynamic array structure; If the current capacity of the dynamic array structure is greater than or equal to the allocated capacity of the dynamic array structure, the dynamic array structure is controlled to automatically expand.

4. A bus module networking control method according to claim 1, characterized in that: Before the control bus module master station sends a first message to reset the communication of devices within a preset range, the method includes: After the PLC is powered on, the bus module master station is controlled to enter the self-test process; The bus module master station is controlled to read basic configuration data and read PLC status in the self-check process.

5. A bus module networking control method according to claim 4, characterized in that: Before the control bus module master station sends a first message to reset the communication of devices within a preset range, the method further includes: Establishing a data mapping table in the bus module master station; The correspondence between the address of the open data area in the PLC and the data in each PDO object and SDO object of the bus module master station is stored.

6. A bus module networking control method according to claim 1, characterized in that: The controlling the bus module master station to generate a target replacement node ID in the dynamic ID pool and reallocating the target replacement node ID to the corresponding bus module slave station comprises: Control the bus module master station to generate the target replacement node ID through a hash function to ensure the uniqueness of the target replacement node ID; The bus module master station is controlled to reallocate the target replacement node ID to the corresponding bus module slave station.

7. A bus module networking control method according to claim 1, characterized in that: The controlling the bus module master station to issue a duplicate address detection command, and judging whether there is an address conflict according to the node ID returned by each of the bus module slave stations includes: Control the bus module master station to issue the duplicate address detection command through an SDO message or an NMT command; Control each of the bus module slave stations to return the respective assigned node IDs according to the duplicate address detection command; The bus module master station is controlled to compare the node IDs returned by each of the bus module slave stations to check whether there are duplicate node IDs.

8. A bus module networking control device, characterized in that: The device comprises: An initial reset module, used for controlling the bus module master station to send a first message to reset the communication of devices within a preset range; A pre-operation control module, used for controlling the bus modules within the preset range to return a second message from the station and enter a pre-operation state; A node ID allocation module, used for controlling the bus module master station to listen to the second message and allocate a node ID to each of the bus module slave stations according to a predefined rule; A conflict checking module, used to control the bus module master station to issue a duplicate address detection command, and to determine whether there is an address conflict according to the node ID returned by each of the bus module slave stations; A storage module, used for controlling the bus module master station to store the conflicting node ID into a dynamic ID pool if there is an address conflict; wherein the dynamic ID pool is set as a dynamic array structure, and the dynamic array structure can be automatically expanded to accommodate more node IDs; A dynamic generation module, used for controlling the bus module master station to generate a target replacement node ID in the dynamic ID pool, and reallocating the target replacement node ID to a corresponding bus module slave station; A pre-operation confirmation module, used for controlling the bus module master station to send a pre-operation instruction to ensure that each of the bus module slave stations is in a pre-operation state; A parameter configuration module, used for controlling the bus module master station to configure parameters of each bus module slave station through a first data format and then starting the corresponding bus module slave station; The message transmission module is used to control the bus module master station to transmit messages in a second data format after confirming that each of the bus module slave stations has entered an operational state.

9. A bus module networking control device, characterized in that: include: At least one processor, at least one memory and computer program instructions stored in the memory, when the computer program instructions are executed by the processor, implement the method according to any one of claims 1 to 7.

10. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.