High-speed backboard system based on FPGA (Field Programmable Gate Array) and hot plug method based on high-speed backboard system

By using FPGA technology in high-speed backplane systems, the slave module is quickly detected and real-time response is achieved, and the hot plugging function is supported, which solves the problem that existing systems cannot adjust slave modules without shutdown, and improves the system flexibility and reliability.

CN119299400AActive Publication Date: 2025-01-10KUNSHAN SVL ELECTRIC CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The existing high-speed backplane system does not support hot plugging, which limits the flexibility and maintainability of the system, and cannot adjust or recover slave modules in real time without shutdown.

Method used

A high-speed backplane system based on FPGA is designed, using the master station module and the slave station module to realize data exchange through interface components, and the slave station module is quickly detected by sending and receiving continuous data frames and non-continuous data frames. and real-time response, supporting hot plug-in operation.

Benefits of technology

It realizes the rapid removal of slave modules and real-time access detection, ensuring the real-time and stability of the system, improving the flexibility and reliability of the system, and avoiding the impact on online data exchange during hot plugging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299400A_ABST
    Figure CN119299400A_ABST
Patent Text Reader

Abstract

The invention discloses a high-speed backboard system based on an FPGA and a hot plug method based on the system.The system comprises a controller and a communication assembly, the communication assembly comprises a plurality of communication modules, the communication assembly specifically comprises a master station module and at least one slave station module, the controller is connected with the master station module, and the slave station module is connected with the controller. An FPGA (Field Programmable Gate Array) chip is arranged in each of the master station module and the slave station module, and the FPGA chip in the master station module is electrically connected with an MCU (Microprogrammed Control Unit); each of the master station module and the slave station module at least comprises a sending interface and a receiving interface, and interaction of data frames is carried out between the master station module and the slave station module through an interface assembly composed of the sending interface and the receiving interface. According to the invention, rapid detection and real-time response of access and removal of the slave station module can be realized, and data exchange of the on-line slave station module is not affected in the hot plug 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 control, high-speed backplane communication system is one of the key technologies to achieve fast data transmission between devices. However, the high-speed backplane system in the prior art usually does not support hot-swap function, which makes it impossible to remove or add slave modules in real time during system operation, limiting the flexibility and maintainability of the system. At present, when removing and adding slave modules, manual operation is usually required when the system is shut down or powered off. This method not only affects the continuous operation of the system, but also increases maintenance costs and operational risks.

[0003] It can be seen that the current technology cannot realize hot swapping of slave modules without shutting down the system, thus 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 a high-speed backplane system based on FPGA and a hot-plug method based on the system, which can realize rapid detection and real-time response of access and removal of slave modules, and does not affect the data exchange of online slave modules during the hot-plug process.

[0005] In the first aspect, the present application provides a high-speed backplane system based on FPGA, which adopts the following technical solutions: A high-speed backplane system based on FPGA, comprising a controller and a communication component, wherein the communication component comprises a plurality of communication modules, wherein the communication component specifically comprises a master station module and at least one slave station module, wherein the controller is connected to the master station module, wherein the master station module and the slave station module are each provided with an FPGA chip, and the FPGA chip in the master station module is also electrically connected to an MCU; 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 each other via an interface component consisting 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.

[0006] By adopting the above technical means, the master station module and the slave station module realize data exchange through the interface component, so that the master station module controls the slave station module and obtains the information of the slave station module. The structure is simple, the connection between the modules is stable and reliable, the efficiency of the system on site is improved, and the cost is reduced.

[0007] 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 module sends and receives the data frame through the interface component, the data frame includes a continuous data frame and a non-continuous data frame, and the continuous data frame is composed of a segment data frame of each slave module; 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, and each of the sending interface and the receiving interface are independent of each other and do not affect the interaction of the data frames.

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

[0009] In a second aspect, the present application provides a hot-plugging method based on a high-speed backplane system, which adopts the following technical solution: A hot-swap method based on a high-speed backplane system, based on any of the above-mentioned high-speed backplane systems based on FPGA, comprises the following steps: 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 turn, so as to realize the connection communication operation of all the slave station modules; The master station module performs data comparison on all the slave station modules. After the data comparison is completed, 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. 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; The master station module removes or connects the corresponding slave station module according to the detection result.

[0010] By adopting the above-mentioned 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 subordinate module is offline. If so, it confirms whether there is a newly connected subordinate 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.

[0011] 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, so as to realize the connection communication operation of all the slave station modules, specifically comprises the following steps: 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, and the connection communication operations sequentially include asking whether the lower module exists, assigning an ID, and obtaining attribute setting data; 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, and the FPGA chip replies to the MCU whether there is a lower-level slave station 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 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.

[0012] By adopting the above-mentioned technical means, the master station module sequentially executes the operations of allocating IDs, obtaining attribute setting data, and inquiring whether the subordinate modules exist for all the slave station modules, thereby realizing the connection between the master station module and all the slave station modules, and obtaining the data in the slave station modules. The slave station modules can realize subsequent offline and access detection through the assigned IDs.

[0013] Preferably, the master station module performs data comparison on all the slave station modules, specifically comprising the following steps: When the master station module assigns the 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 station modules; 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, and 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.

[0014] 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 subsequent communication between modules.

[0015] 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: 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 a 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 subordinate module, and the current slave module determines that it is not the terminal slave module.

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

[0017] Preferably, if the slave station module is not the terminal slave station module, the current slave station module performs offline detection on the slave station module as its own subordinate module and obtains the detection result, which specifically includes the following steps: 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; 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.

[0018] 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.

[0019] Preferably, after determining that the subordinate slave module of the current slave module is offline, the method further includes the following steps: The current slave station module generates a lower-level offline data frame, which passes through all the upper-level modules of the current slave station module in sequence, and is sent to the master station module along with the data input data frames of all the upper-level modules; When the master station module receives the lower-level offline data frame, the segment data frame of the offline slave station module is deleted 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 station module receives the second update continuous data frame, it determines whether the sent lower-level offline data frame is successfully received by the master station module according to the second 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.

[0020] 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 direction of 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.

[0021] 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 including the following steps: 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; If the uplink receiving interface receives the existing data frame, it is determined that the new slave station module is connected to the lower level of the current terminal slave station module.

[0022] By adopting the above-mentioned 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 uplink data frame of its own existence, it means that it has access to a new lower-level slave module.

[0023] 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: 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 of 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 the operation of acquiring the attribute setting data of the newly connected slave module is completed, the master module performs the data comparison on the newly connected slave module and obtains the 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 attribute setting data and the data comparison 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; The upstream receiving interface of the newly connected slave module is continuously monitored, and the allocation of ID, the acquisition of attribute setting data and the data comparison are repeated until no new subordinate module is connected.

[0024] By adopting the above-mentioned technical means, the connection and communication operations are performed on the newly connected slave station module in sequence, so that it can complete the connection with the master station module and 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.

[0025] In summary, this application has at least the following beneficial effects: 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, thus improving the real-time, stability and efficiency of the system.

[0026] 2. The data frames generated in the process of removing and connecting the slave station 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 station 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

[0027] Figure 1 This is an architecture diagram of a high-speed backplane system based on FPGA according to an embodiment of the present application; Figure 2 is a flow chart of a hot-plug method based on a high-speed backplane system according to an embodiment of the present application; Figure 3 It 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 in an embodiment of the present application; Figure 4 It is a flow chart of the hot-swap method based on the high-speed backplane system in the embodiment of the present application, in which the master station module is connected to the remaining slave station modules through its subordinate slave station module; Figure 5 It is a flow chart of performing offline and access detection on a slave module in a hot-swap method based on a high-speed backplane system in an embodiment of the present application; Figure 6 It is a flow chart of confirming an offline module in a hot-plug method based on a high-speed backplane system in an embodiment of the present application; Figure 7 It 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

[0028] 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.

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

[0030] A high-speed backplane system based on FPGA includes a controller and a communication component. In this embodiment, the controller is a PLC, the communication component includes multiple communication modules, and the communication component specifically includes a master station module and at least one slave station module. The controller is connected to the master station module, and the master station module and the slave station module are both provided with an FPGA chip. The FPGA chip in the master station module is also electrically connected to an MCU. The FPGA chip is necessary in the slave module. The MCU can decide whether to set it according to 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.

[0031] 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 composed of the sending interface and the receiving interface.

[0032] In a specific implementable manner, the master module and the slave module and the slave modules are connected via LVDS interfaces. The master module has one LVDS transmission interface and one LVDS reception interface, and the slave module has two LVDS transmission interfaces and two LVDS reception interfaces.

[0033] All communication modules are connected in series with each other, 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 the interface components.

[0034] 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.

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

[0036] The data frame includes continuous data frame and non-continuous data frame. The continuous data frame is composed of the segment data frame of each slave module. Assuming there is 1 master module and 3 slave modules, the continuous data frame is composed of the segment data frame of the first slave module + the segment data frame of the second slave module + the segment data frame of the third slave module.

[0037] 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.

[0038] When a slave module has a subordinate module, the slave module establishes a hardware-triggered forwarding channel and forwards continuous data frames to its own subordinate 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.

[0039] 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 a continuous receiving and sending state, and the slave modules continuously send data input data frames to the master module.

[0040] In another specific implementation, a method for implementing LVDS communication based on FPGA is disclosed, which adopts the following technical solution: 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: S1. Start all communication modules. The master station module in the communication module sends non-continuous data frames to all slave station modules in turn to achieve connection communication operations for all slave station modules. Specifically, the steps include: 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.

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

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

[0043] 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.

[0044] S12, the master station module starts to perform connection communication operations on all slave station modules, and the connection communication operations sequentially include inquiring whether the subordinate module exists, allocating IDs, and obtaining attribute setting data.

[0045] 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 mark in its own FPGA chip, and the FPGA chip replies to the MCU based on whether there is a subordinate module existence mark.

[0046] If it exists, the master module determines that it has a subordinate module; if it does not exist, the master module determines that it has no subordinate module.

[0047] 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 subordinate slave modules, and the scan commands will be repeated between the MCU and the FPGA.

[0048] S13, after the master station module confirms that it has a subordinate slave station module (lower-level module), it executes an allocation ID operation: the master station module sends an allocation ID data frame to its own lower-level module.

[0049] 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.

[0050] 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.

[0051] 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 existing data frames and records the assigned ID.

[0052] 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; When the master module receives the ID confirmation data frame, it determines that the ID allocation of the current slave module is successful.

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

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

[0055] Through the above steps, the subordinate module of the master module, ie, the first slave module, has successfully completed the connection with the master module.

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

[0057] 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.

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

[0059] S152, when the first slave module replies to the master module that there is a lower-level module, refer to Figure 4 , the master station module assigns an ID to the currently confirmed slave station module. In this embodiment, the master station module increments the ID number of the currently confirmed slave station module relative to the ID number of the corresponding upper module until all slave station modules are assigned IDs. Therefore, for the lower module of the first slave station module, the assigned ID number is 2, which is the second slave station module.

[0060] 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.

[0061] 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 downstream sending interface.

[0062] That is to say, when the slave module has not been assigned an ID, the assigned ID data frame received by the downstream interface needs to be processed, and the processing method is to reply with an allocation success data frame; if the slave module has been assigned an ID, the received assigned ID data frame is not processed, and is directly forwarded to the downstream sending interface and sent to the lower-level slave module.

[0063] 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.

[0064] 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 subordinate 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 subordinate 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 and the reply to the subordinate 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.

[0065] S154, repeat the above steps until the master station module receives a reply from the last slave station module that there is no next-level slave station module, the master station module prepares to send continuous data frames, and the master station module stops allocating IDs.

[0066] Here, when the master module receives the reply from the last slave module that there is no next-level slave module, it does not mean that the last slave module directly replies to the master module. The inquiry of the master module is forwarded by several intermediate slave modules to reach the last slave module, and the last slave module replies that there is no next-level slave module. The last slave module forwards this reply result to the master module through the uplink sending interface through several slave modules.

[0067] S2. Before the master module sends continuous data frames, it also needs to perform 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 terminal slave module based on the continuous data frames. Specifically, the steps include: S21. The master station module receives configuration setting data sent by the controller of the high-speed backplane system.

[0068] In a specific feasible implementation mode, 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 controller), 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 already 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.

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

[0070] 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.

[0071] 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.

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

[0073] 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.

[0074] When the comparison is successful, the command type in the segment data frame of the current slave module is to send slave output data, and the master module sends slave output data to the slave module. When the comparison is successful, the master module defines the slave module as a type error, and the command type in the segment data frame of the current slave module is abnormal communication display.

[0075] In another specific implementable 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.

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

[0077] In a specific implementation method, 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 abnormal communication display, the CMD field in the segment data frame is 0x0C, indicating that the slave module comparison failed. For the slave module that failed the comparison, the master module will still send continuous data frames to it, and the slave module will control the control system indicator to flash red according to the command of the abnormal communication display, indicating that the slave module has a fault of the wrong type.

[0078] S25. When the slave module receives the continuous data frame, each slave module obtains the corresponding segment data frame from the continuous data frame according to its own ID; In a specific feasible implementation, assuming there is 1 master station module and 3 slave station modules, the continuous data frame is composed of 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).

[0079] 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: 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.

[0080] 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 terminal slave module.

[0081] 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 ID 2, and the received consecutive data frames contain bytes 03, then there is a slave module with ID 3, and the second slave module can determine that it is not the last slave module, that is, it is not the end slave module.

[0082] S3. 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, including the following steps: S31. For a slave module that is not a terminal slave module, the processing method specifically includes the following steps: S311. 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 monitors its own receiving interface, specifically the uplink receiving interface.

[0083] S312, Combination 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, it is determined that the lower-level slave module of the current slave module is offline. The data input data frame is the segment data frame sent by each slave module to the master module after data comparison.

[0084] 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 consecutive 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 subordinate module within the preset interval time, it can be determined that the subordinate module cannot send the data input data frame normally, that is, the subordinate module is offline.

[0085] S32: For the slave module which is the terminal slave module, the processing method specifically includes the following steps: Figure 7 As shown: 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.

[0086] 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.

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

[0088] S4. The master module removes or connects the corresponding slave module according to the detection result, including the following steps: S41. For the detection result that the lower-level module is offline, the master station module removes the corresponding offline module, which specifically includes the following steps: S411. The slave station module above the offline module generates a subordinate offline data frame.

[0089] In a specific feasible 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 to set a specific bit of the CMD byte of the slave station module in its own segment data frame, such as setting bit 7 to 1, indicating that the next-level slave station module of the slave station module is offline.

[0090] 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.

[0091] S412, the lower-level offline data frame is sent out through the uplink transmission interface of the current slave module, 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 frames of all the upper-level modules.

[0092] S413, after receiving the subordinate 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 subordinate offline data frame to obtain a secondary updated continuous data frame.

[0093] S414, the master station module sends the secondary update continuous data frame to all slave station modules.

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

[0095] 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 not found.

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

[0097] 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.

[0098] For ease of understanding, the whole process is described below using a specific embodiment: 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 respectively). Under normal circumstances, the continuous data frames sent by the master module through the downlink transmission 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.

[0099] 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 the bytes 11 22 are data. In this embodiment, 0x06 indicates that the slave station outputs data.

[0100] The data frame sent by the slave module is: The data frame sent by the uplink transmission interface of the third slave module is AA 03 00 07 16 55 66 CRC; 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; 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.

[0101] At a certain moment, the third slave module is removed, and 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. The bit7 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.

[0102] 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; 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; 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 reported offline information of the third slave module has been successfully received by the master module; As a result, the data frame sent by the uplink sending interface of the second slave station module becomes AA 02 00 07 16 33 44CRC, and the uplink data frame of the second slave station module returns to normal.

[0103] S42: For the detection result that there is a new slave module, the master module will access the new slave module, which specifically includes the following steps: S421. The current terminal slave station 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 station module, but the input data carried in the data input data frame does not change, that is to say, only the command type of the CMD byte is changed, so that the master station module knows that a new slave station module is connected to its lower level without affecting the normal data interaction between the terminal slave station module and the master station module.

[0104] Combination Figure 7 As shown, the terminal slave module forwards the lower-level online data frame to the master module through the uplink transmission 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.

[0105] S422. After the operation of acquiring the attribute setting data of the newly connected slave module is completed, the master module compares the data of the newly connected slave module and obtains the comparison result. The master module determines the segment data frame of the newly connected slave module according to the comparison result.

[0106] S423, the data frames generated by allocating 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.

[0107] S424, continuously monitor the uplink receiving interface of the newly connected slave module, and repeatedly assign IDs, obtain attribute setting data and compare data until no new subordinate modules are connected.

[0108] For ease of understanding, the whole process is described below with reference to a specific embodiment in conjunction with step S41: 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; 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 is changed to 0x26. It should be noted that the method of indicating that the slave module is online is not limited to this method, and this is just an example.

[0109] 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; 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 behind the second slave station module, so it assigns it an ID number of 3, and 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 ID data frame assigned to the slave station module, and the ID is 3.

[0110] 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 with a confirmation ID data frame to indicate that it has received the ID.

[0111] 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; 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.

[0112] After receiving the uplink data frame of the first slave module, the master module obtains the order number and PD length of the third slave module. The continuous data frame of the master 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 module.

[0113] The third slave module receives the continuous data frames from the master, and the uplink transmission interface sends a reply order number and PD length data frame; Similarly, the master station module receives the data frame of 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.

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

[0115] It should be noted that if the third slave station module is connected to the second slave station module when it is connected to a lower-level module, the uplink receiving interface of the third slave station 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; if the third slave station module is not connected to the lower-level module, its uplink receiving interface will also start continuous monitoring after power-on.

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

[0117] 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 according to the configuration setting data of the PLC internally. 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 frames about the third slave station module in the subsequent continuous data frames of the master station module are constructed according to the comparison results. In this embodiment, if the comparison fails, the CMD byte in the segment data frame is 0x0C, and the CMD byte in the segment data frame if the comparison is successful is 0x06.

[0118] 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 continuous monitoring of the status of its own upstream receiving interface.

[0119] Through the above steps, the data frame interaction process of the removal and access of the slave station module can be clearly reflected. From the above steps, it can be seen that the data frames generated by the removal and access of the slave station 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.

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

[0121] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A high-speed backplane system based on FPGA, comprising a controller and a communication component, wherein the communication component comprises a plurality of communication modules, characterized in that: The communication component specifically includes a master station module and at least one slave station module, the controller is connected to the master station module, the master station module and the slave station module are each provided with an FPGA chip, and the FPGA chip in the master station module is also electrically connected to an MCU; 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 each other via an interface component consisting 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.

2. The FPGA-based high-speed backplane system according to claim 1, characterized in that: 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 module sends and receives the data frame through the interface component, the data frame includes a continuous data frame and a discontinuous data frame, and the continuous data frame is composed of a segment data frame of each slave station module; 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, and each of the sending interface and the receiving interface are independent of each other and do not affect the interaction of the data frames.

3. A hot-swap method based on a high-speed backplane system, based on the FPGA-based high-speed backplane system according to any one of claims 1-2, characterized in that: The steps include: 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 turn, so as to realize the connection communication operation of all the slave station modules; The master station module performs data comparison on all the slave station modules. After the data comparison is completed, 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. 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; The master station module removes or connects the corresponding slave station module according to the detection result.

4. The hot-plug method based on the high-speed backplane system according to claim 3, characterized in that: 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 comprises the following steps: 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, and the connection communication operations sequentially include asking whether the lower module exists, assigning an ID, and obtaining attribute setting data; 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, and the FPGA chip replies to the MCU whether there is a lower-level slave station 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 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.

5. The hot-plug method based on the high-speed backplane system according to claim 4, characterized in that: The master station module performs data comparison on all the slave station modules, specifically including the following steps: When the master station module assigns the 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 station modules; 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, and 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.

6. The hot-plug method based on a high-speed backplane system according to claim 4, 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 slave station module determines whether it is an end slave station module based on the continuous data frames, which specifically includes 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 a 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 subordinate module, and the current slave module determines that it is not the terminal slave module.

7. The hot-plug method based on a high-speed backplane system according to claim 4, characterized in that: 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: 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; 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.

8. The hot-plug method based on the high-speed backplane system according to claim 7, 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 station module generates a lower-level offline data frame, which passes through all the upper-level modules of the current slave station module in sequence, and is sent to the master station module along with the data input data frames of all the upper-level modules; When the master station module receives the lower-level offline data frame, the segment data frame of the offline slave station module is deleted 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 station module receives the second update continuous data frame, it determines whether the sent lower-level offline data frame is successfully received by the master station module according to the second 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.

9. The hot-plug method based on a high-speed backplane system according to claim 4, characterized in that: 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 including the following steps: 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; If the uplink receiving interface receives the existing data frame, it is determined that the new slave station module is connected to the lower level of the current terminal slave station module.

10. The hot-plug method based on the high-speed backplane system according to claim 9, 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 of 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 the operation of acquiring the attribute setting data of the newly connected slave module is completed, the master module performs the data comparison on the newly connected slave module and obtains the 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 attribute setting data and the data comparison 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; The upstream receiving interface of the newly connected slave module is continuously monitored, and the allocation of ID, the acquisition of attribute setting data and the data comparison 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

  • FPGA-based EtherCAT master-slave station design and implementation method

    CN110177013A

  • PLC system and method for achieving LVDS communication based on FPGA

    CN112506108A

  • EtherCAT (Ethernet Control Automation Technology) master station based on aneuhua operating system and implementation method of EtherCAT master station

    CN116232796A

  • Server rack monitoring system

    WO2018100735A1

Cited By

  • IO module hot plugging method, device and equipment based on FPGA and storage medium

    CN121326814A

  • FPGA-based IO module hot plug method, device and equipment and storage medium

    CN121326814B