Hot plug detection method for expansion module in electronic equipment and terminal

By integrating a serial communication interface for the CPU main control board and expansion module in electronic devices, and using the Modbus protocol to manage communications, the shortcomings of hot plug detection of expansion modules in the existing technology are solved, and dynamic management of hot plugging of expansion modules is realized, and the availability and flexibility of the system are improved.

CN120179480AInactive Publication Date: 2025-06-20FUZHOU WECON ELECTRONICS TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510654888.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-06-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The lack of support for hot-swap detection of expansion modules in existing electronic devices, resulting in the inability to safely add or remove modules without interrupting the system operation, affecting the availability and stability of the system.

Method used

By integrating a serial communication interface on the CPU main control board and expansion module, the Modbus protocol is used to establish and disconnect the serial communication connection with the expansion module without interrupting the system operation, and automatic initialization and configuration of the new access module is achieved.

Benefits of technology

It realizes dynamic management of hot plug-in and dynamic management of expansion modules without interrupting the system operation, improves system availability and flexibility and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179480A_ABST
    Figure CN120179480A_ABST
Patent Text Reader

Abstract

The invention provides a hot plug detection method for an expansion module in electronic equipment and a terminal, and the method comprises the steps: after a system is powered on, a CPU main control board continuously monitors whether a new expansion module is inserted into a bus, and serial communication interfaces are integrated on the CPU main control board and the expansion module; when the CPU main control board detects that a new extension module is connected to the bus in series, serial communication with the original extension modules except the new extension module is closed through the Modbus protocol, and a first station number is distributed to the new extension module; and the CPU main control board starts serial communication with the original expansion module through a Modbus protocol. The serial communication interface is added on the basis of existing bus communication, the CPU main control board is used for detecting whether a new extension module is accessed or not through the Modbus protocol under the condition that system operation is not interrupted, the initialization and configuration process of the new extension module can be automatically completed, and hot plug dynamic management of the extension module is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic devices, and particularly to a hot plug and unplug detection method for an expansion module in an electronic device and a terminal. Background Art

[0002] In existing electronic devices, the communication between the expansion module and the main control board mostly relies on a fixed bus communication method. Although this method can meet the basic data transmission requirements, in practical applications, once the module needs to be replaced or upgraded, the entire system often needs to be shut down, which not only increases the maintenance cost but also affects the availability and stability of the system.

[0003] The existing communication method lacks support for hot plug and unplug of the module, resulting in the inability to safely add or remove the module without shutting down the system. In addition, there is a lack of an effective mechanism in the prior art to monitor the state changes of the module, such as the insertion and removal of the module, which limits the flexibility and reliability of the system. Summary of the Invention

[0004] The technical problem to be solved by the present invention is: to provide a hot plug and unplug detection method for an expansion module in an electronic device and a terminal, which can realize dynamic management of hot plug and unplug of the expansion module without interrupting the system operation.

[0005] To solve the above technical problem, the technical solution adopted by the present invention is: A hot plug and unplug detection method for an expansion module in an electronic device, comprising the steps of: S1. After the system is powered on, the CPU main control board continuously monitors whether a new expansion module is inserted on the bus. Both the CPU main control board and the expansion module are integrated with a serial communication interface; S2. When the CPU main control board detects that a new expansion module is connected in series to the bus, it closes the serial communication with the original expansion modules other than the new expansion module through the Modbus protocol and assigns a first station number to the new expansion module; S3. The CPU main control board opens the serial communication with the original expansion modules through the Modbus protocol.

[0006] To solve the above technical problem, another technical solution adopted by the present invention is: A hot plug and unplug detection terminal for an expansion module in an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: S1. After the system is powered on, the CPU main control board continuously monitors whether a new expansion module is inserted on the bus. Both the CPU main control board and the expansion module are integrated with a serial communication interface; S2. When the CPU main control board detects that a new extension module is connected in series to the bus, it closes the serial communication with the original extension modules other than the new extension module through the Modbus protocol and assigns a first station number to the new extension module; S3. The CPU main control board enables the serial communication with the original extension modules through the Modbus protocol.

[0007] The beneficial effects of the present invention are as follows: A hot plug and play detection method and a terminal for an extension module in an electronic device are provided. By adding a serial communication interface on the basis of the existing bus communication, the CPU main control board uses the Modbus protocol to establish and disconnect the serial communication connection with each extension module without interrupting the system operation. When it is detected that a new extension module is connected to the bus, the initialization and configuration of the newly connected extension module can be automatically completed, enabling the newly connected extension module to seamlessly integrate into the existing control system without interrupting other ongoing operations, realizing the dynamic management of hot plug and play of the extension module. Description of the Drawings

[0008] Figure 1 It is the overall flowchart of a hot plug and play detection method for an extension module in an electronic device according to an embodiment of the present invention; Figure 2 It is a schematic diagram of the connection relationship between the CPU main control board and multiple extension modules in an embodiment of the present invention; Figure 3 It is the flowchart of detecting the disconnection of the extension module in a hot plug and play detection method for an extension module in an electronic device according to an embodiment of the present invention; Figure 4 It is a schematic diagram of the structure of a hot plug and play detection terminal for an extension module in an electronic device according to an embodiment of the present invention.

[0009] Label Description: 1. A hot plug and play detection terminal for an extension module in an electronic device; 2. A memory; 3. A processor. Detailed Embodiments

[0010] To describe the technical content, the achieved objectives and the effects of the present invention in detail, the following is described in conjunction with the embodiments and the accompanying drawings.

[0011] Please refer to Figures 1 to 3 , A hot plug and play detection method for an extension module in an electronic device, including the steps: S1. After the system is powered on, the CPU main control board continuously monitors whether a new extension module is inserted into the bus. Both the CPU main control board and the extension module are integrated with serial communication interfaces; S2. When the CPU main control board detects that a new expansion module is connected in series to the bus, it closes the serial communication with the original expansion modules other than the new expansion module through the Modbus protocol and assigns a first station number to the new expansion module; S3. The CPU main control board enables the serial communication with the original expansion modules through the Modbus protocol.

[0012] As can be seen from the above description, the beneficial effects of the present invention are as follows: A hot-plug detection method for expansion modules in an electronic device is provided. By adding a serial communication interface on the basis of the existing bus communication, the CPU main control board uses the Modbus protocol to establish and disconnect the serial communication connection with each expansion module without interrupting the system operation. When a new expansion module is detected to be connected to the bus, the initialization and configuration of the newly connected expansion module can be automatically completed, enabling the newly connected expansion module to seamlessly integrate into the existing control system without interrupting other ongoing operations, realizing the dynamic management of hot-plugging of expansion modules.

[0013] Further, the first station number is greater than or equal to 128; After the step S3, the following steps are further included: S4. The CPU main control board updates the station number of the new expansion module from the first station number to a second station number through the Modbus protocol and returns to step S1. The second station number is a value within 1 to 127 other than the station numbers of the original expansion modules.

[0014] As can be seen from the above description, since the station numbers in the Modbus standard protocol start from 1, and in order to ensure that the number of expansion modules is neither too many nor too few, a default first station number of 128 is assigned to each newly connected and powered-on expansion module. Subsequently, a unique station number within 1 to 127 other than the station numbers already occupied by the original expansion modules is re-assigned to the newly connected expansion module, ensuring that the data transmission is not disrupted when all expansion modules are disconnected and then re-enabled, and also facilitating the subsequent management of each expansion module.

[0015] Further, in the steps S1 to S4, the following steps are also included: The CPU main control board regularly sends serial communication interface requests to all the expansion modules on the bus through the Modbus protocol and receives the response status of each expansion module; If there is an unresponsive module, it is determined that the unresponsive module has dropped off the line.

[0016] Further, after determining that the unresponsive module has dropped off the line, the following steps are also included: The CPU main control board disconnects the serial communication with the unresponsive module and all the subsequent cascaded expansion modules through the Modbus protocol.

[0017] As can be seen from the above description, since the expansion modules are electrically connected to the CPU main control board in a cascaded manner through the bus, when there is an unresponsive expansion module, the unresponsive expansion module and all the subsequent cascaded expansion modules can be directly considered as offline and unavailable. By disconnecting the serial communication of the unresponsive module and all the subsequent cascaded expansion modules, the normal use of the expansion modules before the unresponsive module can be ensured.

[0018] Further, the main control chips of the CPU main control board and the expansion modules are both chips designed using FPGA.

[0019] As can be seen from the above description, the CPU main control board and the expansion modules obtained by using the chips designed with FPGA ensure the application of the Modbus standard protocol.

[0020] Please refer to Figure 4 , a hot-swap detection terminal for expansion modules in an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: S1. After the system is powered on, the CPU main control board continuously monitors whether there is a new expansion module inserted on the bus. Both the CPU main control board and the expansion modules are integrated with serial communication interfaces. S2. When the CPU main control board detects that a new expansion module is cascaded to the bus, it closes the serial communication with the original expansion modules except the new expansion module through the Modbus protocol and assigns a first station number to the new expansion module. S3. The CPU main control board enables the serial communication with the original expansion modules through the Modbus protocol.

[0021] As can be seen from the above description, the beneficial effects of the present invention are as follows: Based on the same technical concept, in cooperation with the above-mentioned hot-swap detection method for expansion modules in an electronic device, a hot-swap detection terminal for expansion modules in an electronic device is provided. By adding a serial communication interface on the basis of the existing bus communication, the CPU main control board uses the Modbus protocol to establish and disconnect the serial communication connection with each expansion module without interrupting the system operation. When it is detected that a new expansion module is connected to the bus, the initialization and configuration of the newly connected expansion module can be automatically completed, enabling the newly connected expansion module to seamlessly integrate into the existing control system without interrupting other ongoing operations, realizing the hot-plug dynamic management of the expansion modules.

[0022] Further, the first station number is greater than or equal to 128; After the step S3, the following steps are further included: S4. The CPU main control board updates the station number of the new expansion module from the first station number to the second station number through the Modbus protocol, and returns to step S1. The second station number is a value within 1 to 127 except for the station numbers of the original expansion modules.

[0023] As can be seen from the above description, since the station numbers in the Modbus standard protocol start from 1, and in order to ensure that the number of expansion modules is neither too large nor too small, when a new expansion module is connected and powered on, a default first station number of 128 is assigned. Subsequently, a unique station number within 1 to 127 except for the station numbers already occupied by the original expansion modules is re-assigned to the newly connected expansion module, ensuring that the data transmission is not disordered when all expansion modules are disconnected and then powered on again, and also facilitating the subsequent management of each expansion module.

[0024] Further, the steps S1 to S4 further include: The CPU main control board periodically sends a serial communication interface request to all the expansion modules on the bus through the Modbus protocol, and receives the response status of each expansion module; If there is an unresponsive module, it is determined that the unresponsive module has dropped off the line.

[0025] Further, after determining that the unresponsive module has dropped off the line, the following steps are further included: The CPU main control board disconnects the serial communication with the unresponsive module and all the expansion modules connected in series after it through the Modbus protocol.

[0026] As can be seen from the above description, since the expansion modules are electrically connected to the CPU main control board in a series connection through the bus, when there is an unresponsive expansion module, the unresponsive expansion module and all the expansion modules connected in series after it can be directly considered as dropped off the line and unavailable. By disconnecting the serial communication of the unresponsive module and all the expansion modules connected in series after it, the normal use of the expansion modules before the unresponsive module is ensured.

[0027] Further, the main control chips of the CPU main control board and the expansion module are both chips designed by using FPGA.

[0028] As can be seen from the above description, the CPU main control board and the expansion module obtained by using the chips designed by FPGA ensure the application of the Modbus standard protocol.

[0029] A hot-swap detection method and a terminal for an expansion module in an electronic device provided by the present invention are mainly applied to the scenario of continuously expanding multiple sensor modules in the electronic device without power interruption. The following is a specific description in combination with specific embodiments: Please refer to Figure 1 and Figure 2 , Embodiment 1 of the present invention is as follows: A hot-swap detection method for an expansion module in an electronic device, as Figure 1 shown, includes the steps of: S1. After the system is powered on, the CPU main control board continuously monitors whether there is a new expansion module inserted on the bus.

[0030] In this embodiment, it is possible to determine whether a new expansion module is inserted by means of whether there is a communication response, or to determine the insertion of a new expansion module by monitoring the change of the communication interface level in daily life.

[0031] As Figure 2 shown, between the CPU main control board and multiple expansion modules, they are not only connected in series through the bus, and both the CPU main control board and the expansion module are integrated with RS-485 modules, that is, the CPU main control board and the expansion module are provided with serial communication interfaces with RS-485 interfaces to realize the serial communication between the CPU main control board and each expansion module, and the main control chips of the CPU main control board and the expansion module are both chips designed by FPGA to ensure the subsequent application of the Modbus standard protocol.

[0032] S2. When the CPU main control board detects that a new expansion module is connected in series to the bus, it closes the serial communication with the original expansion modules except the new expansion module through the Modbus protocol and assigns a first station number to the new expansion module. At the same time, before assigning the station number, it is also necessary to configure the basic parameters such as the corresponding physical address and the original bus communication content of the new expansion module.

[0033] S3. The CPU main control board opens the serial communication with the original expansion modules through the Modbus protocol.

[0034] That is, in this embodiment, by adding a serial communication interface on the basis of the existing bus communication, the CPU main control board uses the Modbus protocol to establish and disconnect the serial communication connection with each expansion module without interrupting the system operation. When it is detected that a new expansion module is connected to the bus, it can automatically complete the initialization and configuration of the newly connected expansion module, so that the newly connected expansion module can seamlessly integrate into the existing control system without interrupting other ongoing operations, realizing the dynamic management of the hot plugging of the expansion module.

[0035] Please refer to Figure 3 , Embodiment 2 of the present invention is as follows: A hot-plug detection method for an expansion module in an electronic device. Based on the above-mentioned Embodiment 1, in this embodiment, if the first station number is greater than or equal to 128, then after step S3, the following steps are further included: S4. The CPU main control board updates the station number of the new expansion module from the first station number to the second station number through the Modbus protocol, and returns to step S1. The second station number is a value within 1 to 127 except for the station numbers of the original expansion modules.

[0036] That is, in this embodiment, since the station numbers in the Modbus standard protocol start from 1, and at the same time, in order to ensure that the number of expansion modules is neither too large nor too small, the number of modules in this embodiment is limited not to exceed 127. When a new expansion module is connected and powered on, it is assigned a default first station number of 128, that is, a number that does not coincide with the number of previous expansion modules is set according to the number of common devices. Subsequently, a unique station number within 1 to 127 except for the station numbers already occupied by the original expansion modules is re-assigned to the newly connected expansion module, ensuring that the data transmission will not be disrupted when all expansion modules are disconnected and then powered on again, and it is also convenient for the subsequent management of each expansion module. It should be noted that in other equivalent embodiments, since the largest station number in the standard protocol is 255, the limited number of modules can be appropriately expanded. For example, it can be up to 200, and the station number assigned to the new expansion module can be set to 202.

[0037] At the same time, in this embodiment, steps S1 to S4 further include: The CPU main control board periodically sends a serial communication interface request to all expansion modules on the bus through the Modbus protocol and receives the response status of each expansion module. If there is an unresponsive module, it is determined that the unresponsive module has dropped off the line. Then, the CPU main control board disconnects the serial communication with the unresponsive module and all subsequent expansion modules connected in series through the Modbus protocol. In this embodiment, when a bus communication error occurs, Modbus is used to query which module has dropped off the line. When it is found that the (n + 1)-th module has dropped off the line, the n-th module is configured to return the data, ensuring that the bus communication of the previous n modules can be normal.

[0038] That is, as Figure 3 shown, assuming that n expansion modules have been expanded, the CPU main control board periodically monitors the response of the n expansion modules on the bus. When the i-th expansion module does not respond, it is determined that the i-th module has dropped off the line, and the RS-485 communication connection of the i-th module and the subsequent i~n expansion modules is disconnected, without affecting the RS-485 communication connection of the previous (n - i) modules.

[0039] That is, since the expansion modules are electrically connected to the CPU main control board in a series connection via the bus, when a certain expansion module fails to respond, the expansion module and all subsequent expansion modules connected in series can be directly considered as offline and unavailable. By disconnecting the serial communication of the unresponsive module and all subsequent expansion modules connected in series, the normal use of the expansion modules before the unresponsive module can be ensured.

[0040] In addition, in this embodiment, the differences in the data types transmitted by the bus and the RS-485 module are supplemented and explained as follows: (1) The bus is for high-speed communication with a rate up to 100 Mbps, while the communication rate of the RS-485 module is only 115,200 bps; (2) The data flow line of the bus communication passes through each module and then returns, with very high real-time requirements; the real-time performance of the RS-485 module communication is relatively low and can be used to configure the content of the bus communication, such as station numbers, module management on the bus, communication content of the bus, etc.

[0041] In this embodiment, the bus transmission expansion module and the RS-485 module use the same FPGA chip and do not need to access signals. Therefore, in this embodiment, the design of the RS-485 module can be directly integrated on the FPGA chip, and the data interaction can directly use the DPRAM in the IP core inside the FPGA.

[0042] Please refer to Figure 4 , Embodiment 3 of the present invention is: A hot-plug detection terminal 1 for expansion modules in an electronic device, including a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, it completes the steps in the hot-plug detection method for expansion modules in an electronic device in Embodiment 1 or Embodiment 2 above.

[0043] In summary, the hot-plug detection method and terminal for expansion modules in an electronic device provided by the present invention have the following beneficial effects: 1. It realizes a true hot-plug function, allowing new expansion modules to be connected or removed without interrupting the system operation, improving the availability and flexibility of the system.

[0044] 2. It realizes an efficient monitoring mechanism for the response status of expansion modules, enhancing the stability and security of the system.

[0045] 3. By automating the power-on initialization and station number configuration, the need for manual intervention is reduced, and the maintenance cost is lowered.

[0046] 4. It supports the dynamic management of multiple expansion modules, providing more flexible options for the construction of complex systems.

[0047] The above are only embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, shall be similarly included in the patent protection scope of the present invention.

Claims

1. A hot-plug detection method for an expansion module in an electronic device, characterized in that: Includes steps: S1. After the system is powered on, the CPU main control board continuously monitors whether there is a new expansion module inserted into the bus, and the CPU main control board and the expansion module are both integrated with a serial communication interface; S2. When the CPU main control board detects that a new expansion module is connected in series to the bus, the serial communication with the original expansion modules except the new expansion module is closed through the Modbus protocol, and a first station number is allocated to the new expansion module; S3. The CPU main control board starts serial communication with the original expansion module through the Modbus protocol.

2. The hot-plug detection method for an expansion module in an electronic device according to claim 1, characterized in that: The first station number is greater than or equal to 128; After step S3, the following steps are also included: S4. The CPU main control board updates the station number of the new expansion module from the first station number to the second station number through the Modbus protocol, and returns to step S1, where the second station number is a value in the range of 1 to 127 in addition to the original station number of the expansion module.

3. The hot-plug detection method for an expansion module in an electronic device according to claim 2, characterized in that: The steps S1 to S4 also include: The CPU main control board regularly sends serial communication interface requests to all the expansion modules on the bus through the Modbus protocol, and receives the response status of each expansion module; If there is an unresponsive module, it is determined that the unresponsive module has been offline.

4. The hot-plug detection method for an expansion module in an electronic device according to claim 3, characterized in that: After determining that the unresponsive module has been offline, the method further includes: The CPU main control board disconnects the serial communication with the unresponsive module and all the subsequent expansion modules connected in series through the Modbus protocol.

5. The hot-plug detection method for an expansion module in an electronic device according to claim 1, characterized in that: The main control chips of the CPU main control board and the expansion module are both chips designed using FPGA.

6. A hot-swap detection terminal for an expansion module in an electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S1. After the system is powered on, the CPU main control board continuously monitors whether there is a new expansion module inserted into the bus, and the CPU main control board and the expansion module are both integrated with a serial communication interface; S2. When the CPU main control board detects that a new expansion module is connected in series to the bus, the serial communication with the original expansion modules except the new expansion module is closed through the Modbus protocol, and a first station number is allocated to the new expansion module; S3. The CPU main control board starts serial communication with the original expansion module through the Modbus protocol.

7. The hot-swap detection terminal for expansion modules in an electronic device according to claim 6, characterized in that: The first station number is greater than or equal to 128; After step S3, the following steps are also included: S4. The CPU main control board updates the station number of the new expansion module from the first station number to the second station number through the Modbus protocol, and returns to step S1, where the second station number is a value in the range of 1 to 127 in addition to the original station number of the expansion module.

8. The hot-swap detection terminal for expansion modules in an electronic device according to claim 7, characterized in that: The steps S1 to S4 also include: The CPU main control board regularly sends serial communication interface requests to all the expansion modules on the bus through the Modbus protocol, and receives the response status of each expansion module; If there is an unresponsive module, it is determined that the unresponsive module has been offline.

9. The hot-swap detection terminal for expansion modules in an electronic device according to claim 8, characterized in that: After determining that the unresponsive module has been offline, the method further includes: The CPU main control board disconnects the serial communication with the unresponsive module and all the subsequent expansion modules connected in series through the Modbus protocol.

10. The hot-swap detection terminal for expansion modules in an electronic device according to claim 6, characterized in that: The main control chips of the CPU main control board and the expansion module are both chips designed using FPGA.

Citation Information

Patent Citations

  • Automatic Modbus remote terminal unit (RTU) bus address allocation method

    CN106878488A

  • Sewage treatment monitoring system and method based on MODBUS protocol

    CN110275466A

  • Implementation method of serial hot plug controller in PCIe (Peripheral Component Interconnect Express) system

    CN118860937A

  • Hot-pluggable component detection logic

    US6401157B1