Hot-swap method based on high-speed backplane system

Through a high-speed backplane system based on FPGA, the interface components and data frame exchange of the master station module and slave station module are used to solve the problem of hot plugging in the existing technology, and the rapid detection and real-time response of slave station modules are realized, and the flexibility and reliability of the system are improved.

CN119299400BActive Publication Date: 2025-09-05KUNSHAN SVL ELECTRIC CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411430197.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-09-05
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

The existing high-speed backplane communication system does not support hot plugging, which makes it impossible to remove or add slave modules in real time during the system operation, limiting the flexibility and maintainability of the system.

Method used

The high-speed backplane system based on FPGA is adopted to realize data exchange through the interface components between the master station module and the slave station module. Combined with the transmission and reception of continuous and discontinuous data frames, it realizes rapid detection and real-time response to the slave station module, and supports hot plug-in operation.

Benefits of technology

It realizes rapid removal and real-time access of slave modules, ensuring that the data exchange of online slave modules is not affected, improving the flexibility and reliability of the system, and reducing maintenance costs and operation risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299400B_ABST
    Figure CN119299400B_ABST
Patent Text Reader

Abstract

The present application discloses a high-speed backplane system based on FPGA and a hot-swap method based on the system, wherein the system includes a controller and a communication component, the communication component includes multiple communication modules, the communication component specifically includes a master module and at least one slave module, the controller is connected to the master module, the master module and the slave module are both provided with an FPGA chip, and the FPGA chip in the master module is also electrically connected to an MCU; the master module and the slave module each include at least a sending interface and a receiving interface, and the master module and the slave module exchange data frames through an interface component composed of the sending interface and the receiving interface. The present application can realize rapid detection and real-time response of the access and removal of the slave module, and does not affect the data exchange of the online slave module during the hot-swap process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial automation control, and in particular to a high-speed backplane system based on FPGA and a hot-swap method based on the system. Background Art

[0002] In the field of industrial automation and control, high-speed backplane communication systems are a key technology for enabling rapid data transmission between devices. However, existing high-speed backplane systems generally lack hot-swappability, making it impossible to remove or add slave modules while the system is running, limiting system flexibility and maintainability. Currently, removing or adding slave modules typically requires manual operation while the system is shut down or powered off. This approach not only affects system continuity but also increases maintenance costs and operational risks.

[0003] It can be seen that current technology cannot achieve hot-swapping of slave modules without shutting down the system, thereby limiting the real-time adjustment capability and fault recovery speed of the high-speed backplane communication system. Summary of the Invention

[0004] The present application provides an FPGA-based high-speed backplane system and a hot-swap method based on the system, which can realize rapid detection and real-time response of the access and removal of slave modules, and does not affect the data exchange of online slave modules during the hot-swap process.

[0005] In the first aspect, the present application provides a high-speed backplane system based on FPGA, which adopts the following technical solutions:

[0006] A high-speed backplane system based on an FPGA includes a controller and a communication component. The communication component includes multiple communication modules, specifically a master module and at least one slave module. The controller is connected to the master module. The master module and the slave module are each provided with an FPGA chip. The FPGA chip in the master module is also electrically connected to an MCU.

[0007] The master station module and the slave station module each include at least one sending interface and one receiving interface. The master station module and the slave station module interact with data frames through an interface component composed of the sending interface and the receiving interface. The sending interface includes an uplink sending interface and a downlink sending interface, and the receiving interface includes an uplink receiving interface and a downlink receiving interface.

[0008] By adopting the above technical means, the master module and the slave module realize data exchange through the interface component, so that the master module controls the slave module and obtains the information of the slave module. The structure is simple, and the connection between the modules is stable and reliable, which improves the efficiency of the system on site and reduces costs.

[0009] Preferably, all the communication modules are connected in series, each of the communication modules has at least one corresponding lower-level module or one upper-level module, and the communication modules send and receive the data frames through the interface component. The data frames include continuous data frames and discontinuous data frames, and the continuous data frames are composed of segment data frames of each slave module.

[0010] When the master station module sends the continuous data frames to the slave station module, the slave station module continues to send data input data frames to the master station module. Each of the sending interface and the receiving interface is independent of each other and does not affect the interaction of the data frames.

[0011] By adopting the above technical means, the sending and receiving of all communication modules of this system are independent of each other, realizing high-speed full-duplex communication of this system, reducing the cycle of data exchange and improving operation efficiency.

[0012] In a second aspect, the present application provides a hot-swap method based on a high-speed backplane system, which adopts the following technical solutions:

[0013] A hot-swap method based on a high-speed backplane system, based on any of the above-mentioned FPGA-based high-speed backplane systems, comprises the following steps:

[0014] All communication modules are started, and the master station module in the communication module sends non-continuous data frames to all slave station modules in sequence, thereby realizing connection communication operations for all the slave station modules;

[0015] The master station module performs data comparison on all the slave station modules. After completing the data comparison, the master station module sends continuous data frames to all the slave station modules. Each slave station module determines whether it is an end slave station module based on the continuous data frames.

[0016] If the slave module is not the terminal slave module, the current slave module performs an offline detection on the slave module as its own subordinate module and obtains the detection result; if the slave module is the terminal slave module, the current slave module performs an access detection and obtains the detection result;

[0017] The master station module removes or connects the corresponding slave station module according to the detection result.

[0018] By adopting the above technical means, the master station module sends continuous data frames to the slave station module through continuous data frames to achieve the purpose of controlling the slave station module and sending the configured data. The slave station module determines whether it is the last slave station module through the received continuous data frames. If not, it performs offline detection to confirm whether the lower-level module is offline. If so, it confirms whether there is a newly connected lower-level module, thereby realizing the rapid removal detection and real-time access function of the slave station module, and improving the accuracy of the reported information.

[0019] Preferably, the starting of all communication modules, wherein the master station module in the communication module sends non-continuous data frames to all slave station modules in sequence, thereby realizing connection communication operations for all the slave station modules, specifically includes the following steps:

[0020] Start all communication modules, each slave module sends its own existence data frame to its own upper module, and the master module performs connection communication operations on all the slave modules, which include querying the existence of the lower module, assigning an ID, and obtaining attribute setting data;

[0021] When the master station module receives the self-existence data frame, it stores it in its own FPGA chip, and the MCU of the master station module sends a lower-level existence confirmation data frame to the FPGA chip. The FPGA chip replies to the MCU whether there is the lower-level slave module according to the self-existence data frame;

[0022] The master station module sends an allocation ID data frame to the slave station module at its lower level, and the slave station module receives the allocated ID according to the allocation ID data frame and sends a confirmation ID data frame to the master station module;

[0023] After receiving the confirmation ID data frame, the master station module sends an attribute acquisition data frame to the current slave station module, and the current slave station module replies with its own attribute setting data to the master station module according to the attribute acquisition data frame;

[0024] The master station module repeats the connection communication operation until the master station module no longer receives the lower-level existence data frame.

[0025] By adopting the above technical means, the master station module sequentially performs operations such as allocating IDs, obtaining attribute setting data, and inquiring whether the lower-level modules exist on all slave station modules, thereby realizing the connection between the master station module and all slave station modules and obtaining data in the slave station modules. The slave station modules can realize subsequent offline and access detection through the assigned IDs.

[0026] Preferably, the master station module performs data comparison on all the slave station modules, specifically comprising the following steps:

[0027] When the master module assigns an ID to the confirmed existing subordinate module, the ID of the subordinate module is incremented by one relative to the ID of the corresponding superior module until the ID is assigned to all the slave modules;

[0028] The master station module receives the configuration setting data sent by the controller of the high-speed backplane system. Each group of the configuration setting data has a corresponding ID. The master station module compares the configuration setting data with the attribute setting data having the same ID and obtains a comparison result. The master station module determines the command type of the corresponding segment data frame in the continuous data frame based on the comparison result of each slave station module.

[0029] By adopting the above technical means, an ID allocation rule is set, which provides a basis for the subsequent slave module to determine whether it is the last slave module; and the master module compares the data in the slave module with the data set in the controller based on the ID, which can confirm whether the data in the slave module is correct, ensuring the data accuracy and security of the communication between subsequent modules.

[0030] Preferably, after completing the data comparison, the master station module sends continuous data frames to all the slave station modules, and each of the slave station modules determines whether it is an end slave station module based on the continuous data frames, which specifically includes the following steps:

[0031] The master station module sends continuous data frames to all the slave station modules, wherein the continuous data frames include output data sent by the master station module to each of the slave station modules;

[0032] When the slave station module receives the continuous data frame, each of the slave station modules obtains the corresponding segment data frame from the continuous data frame according to its own ID;

[0033] When the segment data frame containing an ID greater than the ID of the slave module exists in the continuous data frames received by the slave module, the current slave module has the lower-level module, and the current slave module determines that it is not the end slave module.

[0034] By adopting the above-mentioned technical means, the slave module can determine whether it is the last slave module from the continuous data frames obtained based on its assigned ID. Since the ID allocation rule is to perform increment operations in sequence, as long as a slave module has a lower-level module, its own ID must be smaller than that of the lower-level module. Therefore, as long as there is an ID larger than its own in the continuous data frames, it can be proved that the slave module has a lower-level module, that is, the slave module is not the end slave module.

[0035] Preferably, if the slave module is not the terminal slave module, the current slave module performs offline detection on the slave module as its own subordinate module and obtains the detection result, which specifically includes the following steps:

[0036] When there is a segment data frame containing an ID greater than the ID of the slave module among the continuous data frames received by the slave module, the slave module currently monitors its own uplink receiving interface;

[0037] When the uplink receiving interface does not receive the data input data frame sent by the lower-level slave station module to the master station module within the preset interval time, it is determined that the lower-level slave station module of the current slave station module is offline, and the data input data frame is the segment data frame sent by each slave station module to the master station module after the data comparison is completed.

[0038] By adopting the above-mentioned technical means, a method for implementing offline detection of the slave module is set up. Since the data input data frame of the slave module is sent continuously and uninterruptedly, when the data input data frame sent by the lower-level module is not received within the preset interval time, it can be determined that the lower-level module is offline.

[0039] Preferably, after determining that the subordinate slave module of the current slave module is offline, the method further includes the following steps:

[0040] The current slave module generates a lower-level offline data frame, and the lower-level offline data frame passes through all the upper-level modules of the current slave module in sequence, and is sent to the master module along with the data input data frame of all the upper-level modules;

[0041] When the master station module receives the lower-level offline data frame, it deletes the segment data frame of the offline slave station module from the continuous data frame according to the lower-level offline data frame to obtain a secondary updated continuous data frame, and the master station module sends the secondary updated continuous data frame to all the slave station modules;

[0042] After the slave module receives the secondary update continuous data frame, it determines whether the sent lower-level offline data frame is successfully received by the master module based on the secondary update continuous data frame;

[0043] If the reception is successful, the current slave module continues to send the data input data frame to the master module.

[0044] By adopting the above-mentioned technical means, a slave module that detects that a lower-level module is offline sends a lower-level offline data frame to the master module, so that the master module is informed of the offline status. The master module will change the continuous data frames sent to remove the offline module. The data frames generated between the above-mentioned slave module and the master module due to the lower-level module being offline are sent and received simultaneously with the data frame interaction between the master module and the remaining slave modules. Therefore, when the segment data frame of the offline module is removed, the data exchange of the online slave module is not affected.

[0045] Preferably, if the slave station module is the terminal slave station module, the current slave station module performs access detection and obtains the detection result, specifically comprising the following steps:

[0046] When there is no segment data frame containing an ID greater than the ID of the slave module in the continuous data frames received by the slave module, the current end slave module monitors its own uplink receiving interface;

[0047] If the uplink receiving interface receives the existing data frame, it is determined that a new slave module is connected to the lower level of the current terminal slave module.

[0048] By adopting the above technical means, a detection method for the lower-level access of the last slave module to a new slave module is set. After the slave module is started, it will continue to send its own existence data frame to the upper-level module. Therefore, if the last slave module receives the upstream self-existence data frame, it means that it has accessed a new lower-level slave module.

[0049] Preferably, after determining that the current terminal slave module is connected to the new lower-level slave module, the method further includes the following steps:

[0050] The current terminal slave module generates a lower-level online data frame and forwards it to the master module. After receiving the lower-level online data frame from the terminal slave module, the master module performs the operations of allocating an ID and obtaining attribute setting data on the newly connected slave module.

[0051] After completing the operation of acquiring the attribute setting data of the newly connected slave module, the master module performs the data comparison on the newly connected slave module and obtains a comparison result, and the master module determines the segment data frame of the newly connected slave module according to the comparison result;

[0052] The data frames generated by the allocation ID, the acquisition of the attribute setting data, and the data comparison and the lower-level online data frame along with the data frames of the remaining slave modules realize the interaction between the master module and the newly connected slave module;

[0053] The upstream receiving interface of the newly connected slave module is continuously monitored, and the allocation ID, the acquisition of the attribute setting data and the comparison with the data are repeated until no new subordinate module is connected.

[0054] By adopting the above technical means, the connection communication operations are performed on the newly connected slave station modules in sequence, so that they are connected to the master station module and can communicate. The data frames generated during the connection are sent and received at the same time as the data frames are exchanged between the master station module and the remaining slave station modules. Therefore, when a new slave station module is connected, the data exchange of the online slave station module is not affected.

[0055] In summary, this application has at least the following beneficial effects:

[0056] 1. This application realizes rapid removal detection and real-time access detection of the slave module by continuously sending data frames and continuously monitoring the uplink receiving interface, ensuring the rapid response and accurate reporting of information by the slave module, with fast reaction speed and high execution efficiency, thereby improving the real-time performance, stability and efficiency of the system.

[0057] 2. The data frames generated in the process of removing and connecting the slave module of this application are sent or received simultaneously with the data frames of the remaining communication modules, ensuring that the data exchange of the online slave module is not affected during the hot plugging process, and also ensuring the stability of communication of the remaining communication modules in the system, thereby improving the flexibility and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 This is an architectural diagram of a high-speed backplane system based on FPGA according to an embodiment of the present application;

[0059] Figure 2 This is a flow chart of a hot-swap method based on a high-speed backplane system according to an embodiment of the present application;

[0060] Figure 3 This is a flow chart of connecting a master station module with its subordinate slave station module in a hot-swap method based on a high-speed backplane system according to an embodiment of the present application;

[0061] Figure 4 This is a flow chart of a hot-swap method based on a high-speed backplane system according to an embodiment of the present application, in which a master station module is connected to other slave station modules through its subordinate slave station module;

[0062] Figure 5 This is a flow chart of offline and access detection of a slave module in a hot-swap method based on a high-speed backplane system according to an embodiment of the present application;

[0063] Figure 6 This is a flow chart of confirming an offline module in a hot-swap method based on a high-speed backplane system according to an embodiment of the present application;

[0064] Figure 7 This is a flow chart of access detection and connection of a new slave module in a hot-swap method based on a high-speed backplane system in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The present application provides a high-speed backplane system based on FPGA and a hot-swap method based on the system. In order to make the purpose, technical solution and advantages of the present application clearer, the implementation method of the present application will be further described in detail below.

[0066] The following is a further detailed description of an embodiment of an FPGA-based high-speed backplane system of the present application in conjunction with the accompanying drawings.

[0067] A high-speed FPGA-based backplane system includes a controller and a communication component. In this embodiment, the controller is a PLC, and the communication component includes multiple communication modules, specifically including a master module and at least one slave module. The controller is connected to the master module, and each of the master module and the slave module is provided with an FPGA chip. The FPGA chip in the master module is also electrically connected to an MCU.

[0068] The FPGA chip in the slave module is necessary. The MCU can decide whether to set it up based on the functional complexity of the slave module. The MCU and FPGA chip of the master module are connected via SPI, QSPI or parallel port to exchange data.

[0069] The master station module and the slave station module each include at least one sending interface and one receiving interface. The master station module and the slave station module exchange data frames via an interface component consisting of the sending interface and the receiving interface.

[0070] In a specific implementation, the master module and the slave modules and the slave modules are connected via LVDS interfaces. The master module has one LVDS transmitting interface and one LVDS receiving interface, and the slave module has two LVDS transmitting interfaces and two LVDS receiving interfaces.

[0071] All communication modules are connected in series, each communication module has at least one corresponding lower-level module or one upper-level module, and the communication modules send and receive data frames through interface components.

[0072] like Figure 1 As shown, in this embodiment, the lower-level module of the master station module is the first slave station module, and the corresponding upper-level module of the first slave station module is the master station module. In this embodiment, the LVDS interface in the interface component is named according to the output direction of the data, so the sending interface includes an uplink sending interface and a downlink sending interface, and the receiving interface includes an uplink receiving interface and a downlink receiving interface.

[0073] For example, for a master module, the two LVDS interfaces are defined as a downlink transmit interface and an uplink receive interface; for a slave module, the four LVDS interfaces are defined as a downlink receive interface, a downlink transmit interface, an uplink receive interface, and an uplink transmit interface. Each transmit interface and receive interface are independent of each other and do not affect the exchange of data frames.

[0074] Data frames include continuous data frames and non-continuous data frames. Continuous data frames are composed of segment data frames from each slave module. Assuming there is one master module and three slave modules, a continuous data frame consists of the segment data frame from the first slave module, the segment data frame from the second slave module, and the segment data frame from the third slave module.

[0075] A non-continuous data frame is a data frame that contains data from only one communication module, and a continuous data frame is a data frame that contains data from multiple communication modules.

[0076] When a slave module has a lower-level module, the slave module establishes a hardware-triggered forwarding channel and forwards continuous data frames to its own lower-level module through the downlink transmission interface B without delay at the nanosecond level. Therefore, for the continuous data frames sent by the master module, all slave modules can be considered to have received the same continuous data frames synchronously.

[0077] The master module exchanges input and output data of all slave modules through continuous data frames. When the master module continuously sends continuous data frames to all slave modules, all slave modules enter the continuous receiving and sending state, and the slave modules continuously send data input data frames to the master module.

[0078] In another specific embodiment, a method for implementing LVDS communication based on FPGA is disclosed, which adopts the following technical solution:

[0079] A hot-swap method based on a high-speed backplane system, based on the above-mentioned FPGA-based high-speed backplane system, such as Figure 2 As shown, the following steps are included:

[0080] S1. Start all communication modules. The master module in the communication module sends non-continuous data frames to all slave modules in sequence to achieve connection communication operations for all slave modules. Specifically, the steps include:

[0081] S11, connect all communication modules in series, connect the master module to the PLC controller, start all communication modules, and combine Figure 3 As shown, each slave module sends its own existence data frame to its own superior module.

[0082] After all the slave modules are started, each slave module actively starts the uplink sending interface to continuously send its own existence data frame to its own upper module, and starts the uplink receiving interface to facilitate receiving its own existence data frame sent by the lower slave module.

[0083] After the master module is started, the FPGA chip starts the uplink receiving interface. When the master module receives its own data frame sent by the slave module using the uplink sending interface, it stores it in its own FPGA chip.

[0084] After each upper-level module receives its own existence data frame sent by the corresponding lower-level module, the upper-level module generates a lower-level module existence flag based on its own existence data frame and stores it in its own FPGA chip.

[0085] S12: The master module starts to perform connection communication operations on all slave modules. The connection communication operations include inquiring whether the subordinate module exists, assigning an ID, and obtaining attribute setting data.

[0086] The master module first inquires whether the subordinate module exists: the MCU of the master module sends a subordinate existence confirmation data frame to its own FPGA chip. The FPGA chip replies to the MCU whether there is a subordinate slave module based on whether its own data frame exists. Specifically, the master module uses the scan command to inquire whether there is a subordinate module existence flag in its own FPGA chip. The FPGA chip replies to the MCU based on whether there is a subordinate module existence flag.

[0087] If it exists, the master module determines that it has a lower-level module; if it does not exist, the master module determines that it has no lower-level module.

[0088] If there is only a master module in the system, the FPGA chip of the master module cannot receive its own data frames from the lower-level slave modules, and the scan command will be repeated between the MCU and FPGA.

[0089] S13. After the master module confirms that it has a subordinate slave module (subordinate module), it performs an ID allocation operation: the master module sends an ID allocation data frame to its subordinate module.

[0090] In a specific implementable manner, the master station module allocates an ID number of 1 to its subordinate slave station module, that is, the subordinate module of the master station module is the first slave station module.

[0091] The slave module receives the assigned ID according to the assigned ID data frame and sends a confirmation ID data frame to the master module.

[0092] In a specific implementable manner, after the downlink receiving interface of the current slave module obtains the assigned ID number according to the assigned ID data frame, the uplink sending interface stops continuously sending its own data frames and records the assigned ID.

[0093] The slave module sends a confirmation ID data frame to the master module through its own uplink transmission interface, indicating that it has received the assigned ID;

[0094] When the master module receives the ID confirmation data frame, it determines that the ID allocation of the current slave module is successful.

[0095] S14. After receiving the confirmation ID data frame, the master module sends a property acquisition data frame to the current slave module to obtain the property setting data of the first slave module. In this embodiment, the property setting data includes the first order number and the first PD data length of the first slave module.

[0096] The current first slave module replies its own attribute setting data to the master module according to the attribute acquisition data frame, and the master module receives and stores the attribute setting data of the current first slave module.

[0097] Through the above steps, the lower-level module of the master module, ie, the first slave module, has successfully completed the connection with the master module.

[0098] S15. The master module repeats the connection communication operation until the master module no longer receives the data frame from the lower level.

[0099] S151 : The master station module sends a lower-level existence confirmation data frame to the current first slave station module, inquiring whether the first slave station module has a lower-level module.

[0100] If the uplink receiving interface of the current first slave module receives its own data frame, the first slave module replies to the master module with a lower-level data frame, indicating that the first slave module has a lower-level module.

[0101] S152, when the first slave module replies to the master module that there is a lower module, refer to Figure 4 The master module assigns an ID to the currently confirmed slave module. In this embodiment, the master module increments the ID of the currently confirmed slave module by one relative to the ID of the corresponding superior module until all slave modules have been assigned IDs. Therefore, the subordinate module of the first slave module is assigned ID number 2, which indicates the second slave module.

[0102] S153. After allocating the ID number of the currently confirmed existing slave module, the master module obtains the property setting data of the currently confirmed existing slave module, that is, obtains the first order number and the first PD data length of the second slave module.

[0103] It should be noted that after the slave module assigns an ID, it does not process the assigned ID data frame whose ID is greater than its own ID internally, and directly forwards it to the downlink sending interface.

[0104] That is to say, when the slave module has not been assigned an ID, it needs to process the allocation ID data frame received by the downstream interface, and the processing method is to reply with an allocation success data frame; if the slave module has been assigned an ID, it does not process the received allocation ID data frame, but directly forwards it to the downstream sending interface and sends it to the lower-level slave module.

[0105] This processing method is not only used for the allocation ID data frame, but also for the sending attribute acquisition data frame and the replied attribute setting data.

[0106] For example, in a specific implementable method, after the first slave station module is successfully connected to the master station module, when the downstream receiving interface receives an allocation ID data frame, an attribute acquisition data frame or a lower-level existence confirmation data frame, since the first slave station module has successfully allocated the ID, the first slave station module does not process the allocation ID data frame, the attribute acquisition data frame and the lower-level existence confirmation data frame of the second slave station module or other slave station modules internally, and directly forwards them to the downstream sending interface; similarly, the first slave station module does not process the allocation success data frame, the attribute setting data replied and the reply to the lower-level existence confirmation data frame received by the upstream receiving interface of the first slave station module internally, and directly forwards them to the upstream sending interface.

[0107] S154. Repeat the above steps until the master module receives a reply from the last slave module indicating that there is no next-level slave module. The master module is ready to send continuous data frames and stops allocating IDs.

[0108] Here, the master module receives a reply from the last slave module that the next-level slave module does not exist. It is not that the last slave module directly replies to the master module. The master module's inquiry is forwarded by several intermediate slave modules to the last slave module, and the last slave module replies that the next-level slave module does not exist. The last slave module forwards this reply result to the master module through the uplink sending interface through several slave modules.

[0109] S2. Before the master module sends continuous data frames, it also performs data comparison on all slave modules. After the data comparison is completed, the master module sends continuous data frames to all slave modules. Each slave module determines whether it is the end slave module based on the continuous data frames. The specific steps include the following:

[0110] S21. The master module receives configuration setting data sent by the controller of the high-speed backplane system.

[0111] In a specific implementation method, the master station module acts as a coupler to receive information about the slave station modules set in the PLC controller (or other types of programmable logic controllers), which is referred to as configuration setting data, including the slave station module order number and PD length set according to the slave station connection sequence, called the second order number and the second PD data length. Each group of the second order number and the second PD data length has an ID number according to the slave station connection sequence. The rule for generating the ID number according to the slave station connection sequence is essentially consistent with the rule for the master station module to generate the ID number according to the increment-one assignment rule in this embodiment.

[0112] S22. Each group of configuration setting data has a corresponding ID. The master station module compares the configuration setting data with the property setting data having the same ID and obtains a comparison result.

[0113] The comparison is based on comparing the configuration setting data and the property setting data with the same ID number. The data comparison specifically includes determining whether the first order number and the second order number with the same ID are consistent, and whether the lengths of the first PD data and the second PD data match.

[0114] The length of the PD data is downward compatible, that is, the length of the first PD data can be less than or equal to the length of the second PD data, and cannot be greater than the length of the second PD data.

[0115] After the data comparison is completed, the master module obtains the comparison results corresponding to each slave module, and the comparison results include comparison success and comparison failure.

[0116] S23. The master station module determines the command type of the corresponding segment data frame in the continuous data frame according to the comparison result of each slave station module.

[0117] If the comparison is successful, the command type in the current slave module's segment data frame is "Send Slave Output Data," and the master module sends the slave output data to the slave module. If the comparison is successful, the master module's definition of the slave module is set to "Type Error," and the command type in the current slave module's segment data frame is displayed as "Abnormal Communication."

[0118] In another specific implementation method, after the comparison is successful, the command type in the segment data frame of the slave module can also be to send configuration parameters. For example, for an analog slave module, the PLC controller can set the configuration parameters for measuring voltage or current and send them to the analog slave module. After all the configuration parameters are sent, the slave output data will start to be sent.

[0119] S24, after all slave modules have been compared, the master module sends continuous data frames to all slave modules, such as Figure 5As shown, the continuous data frame includes the output data sent by the master module to each slave module. At this time, the command type of each slave module segment data frame in the continuous data frame is determined by the comparison result in the above steps.

[0120] In one specific implementation, when the command type is to send slave output data, the CMD field in the segment data frame is 0x06. When the command type is to display abnormal communication, the CMD field in the segment data frame is 0x0C, indicating that the slave module has failed the comparison. For slave modules that have failed the comparison, the master module will continue to send continuous data frames to them. The slave module will control the control system indicator to flash red rapidly based on the abnormal communication display command, indicating that the slave module has experienced a fault of the wrong type.

[0121] S25. When the slave modules receive the continuous data frames, each slave module obtains the corresponding segment data frame from the continuous data frames according to its own ID;

[0122] In a specific implementation method, assuming there is one master station module and three slave station modules, the structure of the continuous data frame is the segment data frame of the first slave station module + the segment data frame of the second slave station module + the segment data frame of the third slave station module, for example: (AA 01 00 07 06 11 22 CRC AA 02 00 07 06 33 44 CRC AA 03 00 07 06 5566 CRC).

[0123] After receiving the continuous data frame, the slave module intercepts the segment data frame corresponding to its own ID number from the continuous data frame. The specific method of interception is as follows: the slave module is triggered by 0xAA to receive data judgment, and judges whether the next byte of 0xAA is its own ID. After judging that it matches its own ID, it receives the segment data frame length defined by the subsequent two bytes, and receives its own segment data frame according to the segment data frame length.

[0124] S26. When there is a segment data frame containing an ID greater than its own ID in the continuous data frames received by the slave module, the current slave module has a lower-level module, and the current slave module determines that it is not the end slave module.

[0125] If the slave module receives consecutive data frames with an ID greater than its own, for example, the current slave module is the second slave module with an ID of 2, and the received consecutive data frames contain bytes 03, then there is a slave module with an ID of 3. The second slave module can determine that it is not the last slave module, that is, it is not the end slave module.

[0126] S3. If the slave module is not the terminal slave module, the current slave module performs an offline test on the slave module that is its own subordinate module and obtains a test result. If the slave module is the terminal slave module, the current slave module performs an access test and obtains a test result, including the following steps:

[0127] S31. For a slave module that is not a terminal slave module, the processing method specifically includes the following steps:

[0128] S311 . When a segment data frame containing an ID greater than its own ID exists in the continuous data frames received by the slave module, the current slave module monitors its own receiving interface, specifically the uplink receiving interface.

[0129] S312, combined Figure 6 As shown, when the uplink receiving interface does not receive the data input data frame sent by the lower-level slave module to the master module within the preset interval time, the lower-level slave module of the current slave module is deemed to be offline. The data input data frame is the segment data frame sent by each slave module to the master module after data comparison.

[0130] Because when all communication modules are communicating normally, that is, when the master module continues to send continuous data frames to the slave module, the slave module will continue to send data input data frames to the master module through the uplink sending interface. Therefore, the interval between two adjacent data input data frames sent by the slave module through the uplink sending interface is almost non-existent. Therefore, when the slave module does not receive the data input data frame sent by the lower module within the preset interval time, it can be determined that the lower module cannot send the data input data frame normally, that is, the lower module is offline.

[0131] S32. For the slave module that is the terminal slave module, the processing method specifically includes the following steps: Figure 7 As shown:

[0132] S321. When there is no segment data frame containing an ID greater than its own ID in the continuous data frames received by the slave module, the current end slave module also monitors its own receiving interface, specifically the uplink receiving interface.

[0133] S322: If the uplink receiving interface receives its own data frame, it is determined that a new slave module is connected to the lower level of the current terminal slave module.

[0134] Because when the communication module is in the startup state, the slave module will continuously send its own existence data frame through its own uplink sending interface. Therefore, once the current terminal slave module is connected to a new lower-level module and the lower-level module is powered on and started, the new lower-level module will spontaneously send its own existence data frame to the previous terminal slave module through the uplink sending interface. Once the uplink receiving interface of the terminal slave module receives its own existence data frame, it knows that a new lower-level module is connected.

[0135] S4. The master module removes or connects the corresponding slave module based on the detection results, including the following steps:

[0136] S41. For the detection result of the lower-level module being offline, the master station module removes the corresponding offline module, which specifically includes the following steps:

[0137] S411. The slave module above the offline module generates a lower-level offline data frame.

[0138] In a specific implementation method, the current upper-level slave station module generates a lower-level offline data frame by adjusting the command byte in the segment data frame. The adjustment method is that the slave station module sets a specific bit of the CMD byte in its own segment data frame, such as bit 7 is set to 1, indicating that the next-level slave station module of the slave station module is offline.

[0139] In essence, the lower-level offline data frame adjusts the CMD byte in the data input data frame of the slave module, but does not adjust the input data in the data input data frame, so it does not affect the normal data interaction between the slave module and the master module.

[0140] S412, the lower-level offline data frame is sent through the uplink sending interface of the current slave module, passes through all upper-level modules of the current slave module in sequence, and is sent to the master module along with the data input data frame of all upper-level modules.

[0141] S413. After receiving the lower-level offline data frame, the master station module deletes the segment data frame of the offline slave station module from the continuous data frame according to the lower-level offline data frame to obtain a secondary updated continuous data frame.

[0142] S414. The master station module sends the secondary updated continuous data frame to all slave station modules.

[0143] S415 , after receiving the secondary update continuous data frame, the current slave module determines whether the sent lower-level offline data frame is successfully received by the master module based on the secondary update continuous data frame.

[0144] The specific judgment method is to search for the segment data frame of the offline slave module from the secondary updated continuous data frame. If it is not found, it means that the master module has received it successfully and the offline module has been removed. If it is found, it means the opposite, and continue to send the lower-level offline data frame until the segment data frame of the offline module is no longer found.

[0145] S416: If the reception is successful, the current slave module continues to send the data input data frame to the master module.

[0146] Under normal conditions, the slave module sends the data input frame to the master module. When the offline module is removed, the slave module adjusts the command byte in the lower-level offline data frame and resumes sending the data input frame.

[0147] For ease of understanding, the whole process is described below using a specific embodiment:

[0148] Assume that the system has one master module and three slave modules (the first slave module, the second slave module, and the third slave module). Under normal circumstances, the continuous data frames sent by the master module through the downlink transmit interface are: AA01 00 07 06 11 22 CRC AA 02 00 07 06 33 44 CRC AA 03 00 07 06 55 66 CRC.

[0149] Each segment data frame uses hexadecimal, starts with 0xAA and ends with CRC. Taking AA 01 00 07 06 1122 CRC as an example, 0x01 is the ID number, 00 07 is the segment data frame length (the length is represented by two bytes, of which AA is the identifier and is not included in the data length), 0x06 is the command type (CMD byte), and bytes 11 22 are data. In this embodiment, 0x06 indicates that the slave station outputs data.

[0150] The data frame sent by the slave module is:

[0151] The data frame sent by the uplink transmission interface of the third slave module is AA 03 00 07 16 55 66 CRC;

[0152] The data frame sent by the uplink transmission interface of the second slave module is AA 02 00 07 16 33 44 CRC AA03 00 07 16 55 66 CRC;

[0153] The data frame sent by the uplink sending interface of the first slave module is AA 01 00 07 16 11 22 CRC AA02 00 07 16 33 44 CRC AA 03 00 07 16 55 66 CRC; the 16 in the CMD byte indicates the sending slave input data.

[0154] At a certain moment, the third slave module is removed. The second slave module detects that the third slave module is offline. Then, the data frame sent by the uplink transmission interface of the second slave module is AA 02 00 07 96 33 44 CRC, where 0x16 becomes 0x96. Bit 7 of the CMD byte is set to indicate that the next-level slave module is offline. It should be noted that the method of indicating offline is not limited to this method. This is just an example.

[0155] The data frame sent by the uplink transmission interface of the first slave module is AA 01 00 07 16 11 22 CRC AA02 00 07 96 33 44 CRC;

[0156] After the master station receives the data frame sent by the uplink interface of the first slave station module, the continuous data frame of the master station module becomes: AA 01 00 07 06 11 22 CRC AA 02 00 07 06 33 44 CRC;

[0157] After the second slave module receives the continuous data frames from the master module through the downlink receiving interface, it analyzes the data and finds that the data of the third slave module has been removed, indicating that the offline information of the third slave module reported has been successfully received by the master module;

[0158] Then the data frame sent by the uplink sending interface of the second slave module becomes AA 02 00 07 16 33 44CRC, and the uplink data frame of the second slave module returns to normal.

[0159] S42: For a detection result indicating the presence of a new slave module, the master module connects the new slave module, specifically including the following steps:

[0160] S421. The current terminal slave module generates a lower-level online data frame. In this embodiment, the lower-level online data frame is generated by setting bit 5 of the CMD byte in its own data input data frame by the terminal slave module, but the input data carried in the data input data frame does not change, that is, only the command type of the CMD byte is changed, so that the master module knows that a new slave module is connected to its lower level without affecting the normal data interaction between the terminal slave module and the master module.

[0161] Combine Figure 7As shown, the terminal slave module forwards the lower-level online data frame to the master module through the uplink sending interface. After receiving the lower-level online data frame from the terminal slave module, the master module allocates an ID and obtains attribute setting data for the newly connected slave module.

[0162] S422. After the operation of obtaining attribute setting data of the newly connected slave module is completed, the master module performs data comparison on the newly connected slave module and obtains a comparison result. The master module determines the segment data frame of the newly connected slave module based on the comparison result.

[0163] S423, the data frames generated by assigning ID, acquiring attribute setting data and comparing data and the lower-level online data frames along with the data frames of the remaining slave modules realize the interaction between the master module and the newly connected slave module.

[0164] S424. Continuously monitor the uplink receiving interface of the newly connected slave module, and repeatedly assign IDs, obtain attribute setting data, and compare with the data until no new lower-level modules are connected.

[0165] For ease of understanding, the entire process is described below using a specific embodiment in conjunction with step S41:

[0166] In step S41 , it can be seen that the third slave module has been removed, leaving only the master module, the first slave module, and the second slave module;

[0167] When the third slave module is connected to the second slave module again and the second slave module receives the self-confirmation data frame sent by the third slave module, the data frame sent by the uplink sending interface of the second slave module is AA 02 00 07 2633 44 CRC. In this embodiment, bit 5 of the CMD byte is set to indicate that the next-level slave is online, and 0x16 of the CMD byte becomes 0x26. It should be noted that the method of indicating that the slave module is online is not limited to this method. This is only an example.

[0168] The data frame sent by the uplink transmission interface of the first slave module is AA 01 00 07 16 11 22 CRCAA 02 00 07 26 33 44 CRC;

[0169] After the master station module receives the data frame sent by the upstream interface of the first slave station module, it learns from the 0x26 byte of the second slave station module that there is a slave station module online after the second slave station module, so it assigns it an ID number of 3. The continuous data frames sent by the master station module are: AA 01 00 07 06 11 22 CRC AA 02 00 07 06 33 44 CRC AA FF 0006 01 03 CRC; in this embodiment, AA FF 00 06 01 03 CRC is the assigned ID data frame for the slave station module, and the ID is 3.

[0170] The third slave module receives the continuous data frame from the master station. Since it has not been assigned an ID after startup, it processes the data segment AA FF 00 06 01 03 CRC in the continuous data frame, records the ID, and replies to the upper station to confirm the ID data frame, indicating that it has received the ID.

[0171] When the uplink receiving interface of the second slave module receives the confirmation ID data frame replied by the third slave module, the data frame sent by the uplink sending interface of the second slave module is: the data frame of the second slave module + the confirmation ID data frame replied by the third slave module;

[0172] The data frame sent by the uplink sending interface of the first slave module is: the first slave module data frame + the second slave module data frame + the confirmation ID data frame replied by the third slave module; here, the first slave module data frame and the second slave module data frame are both data input data frames.

[0173] After the master station module receives the uplink data frame of the first slave station module, it obtains the order number and PD length of the third slave station module. The continuous data frame of the master station module is: AA 01 00 07 06 11 22 CRC AA 02 00 07 06 33 44 CRCAA 03 00 06 03 01 CRC; in this embodiment, AA 03 00 06 03 01 CRC is a data frame for obtaining the attributes of the third slave station module.

[0174] The third slave module receives the continuous data frames from the master station, and the uplink sending interface sends a reply order number and PD length data frame;

[0175] Similarly, the master station module receives the data frame with the reply order number and PD length from the third slave station module, and inquires the third slave station module whether there is a next-level slave station module. The continuous data frames of the master station module are: AA 01 00 07 06 11 22CRC AA 02 00 07 06 33 44 CRC AA 03 00 06 04 00 CRC; in this embodiment, AA 03 00 06 0400 CRC is a data frame confirming the existence of the lower level of the third slave station module.

[0176] The third slave module receives continuous data frames from the master module and responds based on the actual situation whether there is a subordinate slave module. If the third slave module is connected to a subordinate module before connecting to the second slave module, then the third slave module will respond to the master module that there is a subordinate slave module itself, otherwise there is no subordinate slave module.

[0177] It should be noted that if the third slave module is connected to the second slave module when it is connected to a lower-level module, the uplink receiving interface of the third slave module receives its own data frame at the moment of power-on, and the uplink sending interface of its lower-level module sends its own data frame at the same time; if the third slave module is not connected to the lower-level module, its uplink receiving interface will also start continuous monitoring after power-on.

[0178] Similarly, the master module receives a reply from the third slave module as to whether there is a next-level slave module.

[0179] At this time, the master station module has obtained all the information of the third slave station module, and performs data comparison of the third slave station module internally according to the configuration setting data of the PLC. If the comparison is successful, the slave station status is normal, and if the comparison fails, it is a type error status. The segment data frame about the third slave station module in the subsequent continuous data frame of the master station module is constructed according to the comparison result. In this embodiment, if the CMD byte in the segment data frame fails, the CMD byte in the segment data frame is 0x0C, and the CMD byte in the segment data frame is 0x06 if the comparison is successful.

[0180] If the third slave module passes the comparison and replies that there is a next-level slave module, the continuous data frames of the master module are: AA 01 00 07 06 11 22 CRC AA 02 00 07 06 33 44 CRC AA 03 00 07 06 55 66 CRCAA FF 00 06 01 04 CRC, and the lower-level module of the third slave module is assigned ID number 4. The above process is repeated until the slave module replies to the master module that there is no next-level slave module. At this time, the end slave module resumes the status of continuously monitoring its own uplink receiving interface.

[0181] Through the above steps, the data frame interaction process of the removal and access of the slave module can be clearly reflected. It can be seen from the above steps that the data frames generated by the removal and access of the slave module are sent or received along with the data frames of the remaining communication modules. Therefore, the removal and access do not affect the data interaction of the remaining online communication modules, ensuring the stability of the remaining communication modules in the system.

[0182] A communication method based on a high-speed backplane system is implemented, which maximizes the data exchange speed between communication modules and improves the communication efficiency between communication modules.

[0183] The above are only optional 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 principles of the present application should be included in the scope of protection of the present application.

Claims

1. A hot-swap method based on a high-speed backplane system, characterized in that: The steps include: All communication modules are started, and each slave module in the communication modules sends its own existence data frame to its own upper module. The master module sequentially sends non-continuous data frames to all the slave modules to achieve connection communication operations for all the slave modules. The master module and all the slave modules are connected in series. The connection communication operations sequentially include querying the existence of the lower module, assigning an ID, and obtaining attribute setting data; The master module receives configuration setting data sent by the controller of the high-speed backplane system, each set of the configuration setting data has a corresponding ID, and the master module compares the configuration setting data with the attribute setting data having the same ID. After completing the data comparison, the master module sends continuous data frames to all the slave modules, and each slave module determines whether it is an end slave module based on the continuous data frames. The continuous data frames are composed of segment data frames of each slave module; If the slave module is not the terminal slave module, the slave module performs offline detection, the current slave module monitors its own uplink receiving interface, and when the uplink receiving interface does not receive a data input data frame sent by the subordinate slave module to the master module within a preset interval, it is determined that the subordinate slave module of the current slave module is offline, and the data input data frame is the segment data frame sent by each slave module to the master module after the data comparison is completed; If the slave module is the terminal slave module, the slave module performs access detection, the current terminal slave module monitors its own uplink receiving interface, and if the uplink receiving interface receives its own data frame, it is determined that the current terminal slave module is connected to the new slave module; The master station module removes or connects the corresponding slave station module according to the obtained detection result.

2. The hot-swap method based on a high-speed backplane system according to claim 1, characterized in that: The master station module sends non-continuous data frames to all the slave station modules in sequence to achieve connection communication operations for all the slave station modules, further comprising the following steps: When the master station module receives the self-existence data frame, it stores it in its own FPGA chip, and the MCU of the master station module sends a lower-level existence confirmation data frame to the FPGA chip. The FPGA chip replies to the MCU whether there is the lower-level slave module according to the self-existence data frame; The master station module sends an allocation ID data frame to the slave station module at its lower level, and the slave station module receives the allocated ID according to the allocation ID data frame and sends a confirmation ID data frame to the master station module; After receiving the confirmation ID data frame, the master station module sends an attribute acquisition data frame to the current slave station module, and the current slave station module replies with its own attribute setting data to the master station module according to the attribute acquisition data frame; The master station module repeats the connection communication operation until the master station module no longer receives the lower-level existence data frame.

3. The hot-swap method based on a high-speed backplane system according to claim 1, characterized in that: The data comparison further comprises the following steps: When the master module assigns an ID to the confirmed existing subordinate module, the ID of the subordinate module is incremented by one relative to the ID of the corresponding superior module until the ID is assigned to all the slave modules; The master station module performs data comparison and obtains a comparison result. The master station module determines the command type of the corresponding segment data frame in the continuous data frame according to the comparison result of each slave station module.

4. The hot-swap method based on a high-speed backplane system according to claim 1, characterized in that: After the data comparison is completed, the master station module sends continuous data frames to all the slave station modules, and each of the slave station modules determines whether it is an end slave station module based on the continuous data frames, specifically including the following steps: The master station module sends continuous data frames to all the slave station modules, wherein the continuous data frames include output data sent by the master station module to each of the slave station modules; When the slave station module receives the continuous data frame, each of the slave station modules obtains the corresponding segment data frame from the continuous data frame according to its own ID; When the segment data frame containing an ID greater than the ID of the slave module exists in the continuous data frames received by the slave module, the current slave module has the lower-level module, and the current slave module determines that it is not the end slave module.

5. The hot-swap method based on a high-speed backplane system according to claim 1, characterized in that: After determining that the subordinate slave module of the current slave module is offline, the following steps are also included: The current slave module generates a lower-level offline data frame, and the lower-level offline data frame passes through all the upper-level modules of the current slave module in sequence, and is sent to the master module along with the data input data frame of all the upper-level modules; When the master station module receives the lower-level offline data frame, it deletes the segment data frame of the offline slave station module from the continuous data frame according to the lower-level offline data frame to obtain a secondary updated continuous data frame, and the master station module sends the secondary updated continuous data frame to all the slave station modules; After the slave module receives the secondary update continuous data frame, it determines whether the sent lower-level offline data frame is successfully received by the master module based on the secondary update continuous data frame; If the reception is successful, the current slave module continues to send the data input data frame to the master module.

6. The hot-swap method based on a high-speed backplane system according to claim 1, characterized in that: After determining that the current terminal slave module is connected to the new lower-level slave module, the following steps are also included: The current terminal slave module generates a lower-level online data frame and forwards it to the master module. After receiving the lower-level online data frame from the terminal slave module, the master module performs the operations of allocating an ID and obtaining attribute setting data on the newly connected slave module. After completing the operation of acquiring the attribute setting data of the newly connected slave module, the master module performs the data comparison on the newly connected slave module and obtains a comparison result, and the master module determines the segment data frame of the newly connected slave module according to the comparison result; The data frames generated by the allocation ID, the acquisition of the attribute setting data, and the data comparison and the lower-level online data frame along with the data frames of the remaining slave modules realize the interaction between the master module and the newly connected slave module; The upstream receiving interface of the newly connected slave module is continuously monitored, and the allocation ID, the acquisition of the attribute setting data and the comparison with the data are repeated until no new subordinate module is connected.

Citation Information

Patent Citations

  • Communication method and device for high-speed real-time industrial Ethernet

    CN101917316A