Read-write function detection device and method for IO module of gateway machine equipment

By using the detection client and MQTT protocol in the gateway device IO module, the self-detection of the IO module is realized, solving the problems of low manual detection efficiency and deviation of result, and achieving fast and accurate detection and intelligent alarm reminder.

CN119299345APending Publication Date: 2025-01-10安徽征途电气有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411443993.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, the detection of the IO module of the gateway device relies on manual operation, and there are problems of deviation in detection results and low efficiency.

Method used

Design a reading and writing function detection device of the IO module of the gateway device, and directly connects the input and output ends of the gateway device by using the detection client to directly connect to the input and output ends of the gateway device. Through the message issuing module, the message subscription module and the signal detection module, the MQTT protocol is used to realize the self-important self-important Detection, no additional equipment required.

Benefits of technology

It realizes fast and accurate self-detection of IO modules, simplifies the operation process, improves detection efficiency, and optionally equipped with an alarm module to enhance intelligence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299345A_ABST
    Figure CN119299345A_ABST
Patent Text Reader

Abstract

The invention discloses a read-write function detection device and method for an IO module of gateway machine equipment, and the device comprises a detection client and an extension socket, the detection client is provided with a network port, and the detection client is internally provided with a message publishing module, a message subscription module and a signal detection module; the input end and the output end of the IO module connected with the gateway machine equipment are in butt joint through an extension socket, a network port of the detection client is directly connected with a network port of the gateway machine equipment, and a detection message is sent to the gateway machine equipment through the message issuing module; and the gateway machine equipment writes information into the O port according to the detection message, detects the state value change of the I port, organizes the change information into an MQTT message and feeds back the MQTT message to the detection client, so that self-detection of the IO module is realized. The scheme is simple and effective, and whether the gateway machine design IO module has a problem can be rapidly and accurately detected; the scheme is simple, effective and easy to operate, and any external detection equipment is not needed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a device and method for detecting the read and write functions of an IO module of a gateway device, and belongs to the technology of smart distribution station. Background Art

[0002] In the substation, there are usually some power auxiliary equipment such as infrared, smoke, water immersion and other switch signal sensor equipment, and some sensor equipment with opening and closing control capabilities such as fans, lights, water pumps, etc. These devices play an important role in assisting and ensuring the safe and stable operation of power equipment.

[0003] The gateway IO module includes an input interface and an output interface. The input interface is generally used to access sensor signals. In the smart station room gateway equipment, infrared, smoke, water immersion and other sensor devices are generally connected. When the sensor device signal changes, the gateway collects signals through the input interface and senses the sensor opening and closing status information in real time; and the output interface can not only access the sensor opening and closing status, but also control the switch of the sensor through the output interface. Such sensor devices include lights, water pumps, fans, etc. The IO module is an indispensable part of the gateway equipment, and the stable and effective operation of the module is also particularly important. Before the gateway leaves the factory, the IO module must be effectively tested. Usually, a multimeter is used to manually test each point of the IO module. Due to the differences in experience or operation in manual testing, deviations will be caused in the test results of the IO module. Summary of the invention

[0004] Purpose of the invention: In order to overcome the shortcomings of the prior art, the present invention provides a read-write function detection device and method for the IO module of a gateway device. The invention is simple and effective, and can quickly and accurately detect whether there is a problem with the IO module designed for the gateway. The solution is simple, effective and easy to operate, and does not require any external detection equipment. It only needs to connect to the input and output ends of the gateway device itself, combine the detection command sent by the detection client, and check the status of the gateway response message to achieve self-detection of the IO module of the gateway device.

[0005] Technical solution: To achieve the above purpose, the technical solution adopted by the present invention is: A read-write function detection device for an IO module of a gateway device comprises a detection client and a socket, a network port is set on the detection client, and a message publishing module, a message subscription module and a signal detection module are set in the detection client; The socket is used to connect the input end and the output end of the IO module of the gateway device, and the I port and the O port corresponding to the serial number are connected one by one; The network port of the detection client is directly connected to the network port of the gateway device; The message publishing module generates a detection message according to the detection command, and sends the detection message to the gateway device through the network port; the detection command includes the sequence number of the O port to be detected and the corresponding control target value, and the control target value of the O port to be detected is opposite to the current state value; The message subscription module subscribes to the MQTT message of the specified topic published by the gateway device by calling or using MqttBroker, and sends the MQTT message of the specified topic published by the subscribed gateway device to the signal detection module; the MQTT message is that after the gateway device receives the detection message through the network port, it obtains the detection command by parsing the detection message, writes the control target value into the O port to be detected according to the detection command, and the gateway device detects whether the status value of the I port changes, organizes the sequence number of the I port whose status value has changed and the changed status value into an MQTT message and publishes it with the specified topic, and the message subscription module subscribes to the MQTT message through MqttBroker; The signal detection module parses the MQTT message to obtain the I port whose status value has changed and the status value after the change in the IO module of the gateway device, and determines whether the sequence number and corresponding status value of the I port are consistent with the sequence number and corresponding control target value of the O port to be detected. If they are consistent, the detection is passed.

[0006] In this case, the gateway device detects the I port using the detection program that comes with the gateway device, or it can use a related detection program developed in accordance with the agreement, which can publish MQTT messages of specified topics by either calling or using MqttBroker; at the same time, it must be able to parse the detection message and execute the corresponding instructions.

[0007] The device in this case does not need to be connected to any other external detection equipment. It only needs to connect to the input and output terminals of the gateway device itself, check the status of the gateway response message in combination with the detection command sent by the detection client, and realize the self-detection of the IO module of the gateway device. The device is simple, effective and easy to operate. In addition, the power strip is not necessary to use. The same effect can be achieved by connecting the corresponding I port and O port with wires. Considering that the positions of the output and input terminals of the same model of gateway devices on the panel are generally fixed, it is more convenient to use a manufactured and fixed power strip. When testing, all ports can be connected by directly inserting the power strip; the power strip can be made into a standard part.

[0008] Specifically, the message publishing module includes an input unit, a message generating unit and a detection trigger unit; the input unit is used to input the serial number of the O port to be detected and the corresponding control target value; the message generating unit generates a detection message according to the serial number of the O port to be detected and the corresponding control target value; the detection trigger unit sends the detection message to the gateway device through the network port, and at the same time sends the serial number of the O port to be detected and the corresponding control target value to the signal detection module.

[0009] In this case, an alarm module can also be designed to issue an alarm reminder when an abnormality is detected in the IO module of the gateway device, further improving the intelligence of the detection.

[0010] Specifically, the input unit is designed as a mechanical key or a human-computer interaction interface.

[0011] A method for detecting the read and write functions of an IO module of a gateway device comprises the following steps: Step 1. Connect the input and output ends of the IO module of the gateway device through hardware, and connect the I port and O port corresponding to the serial number one by one; Step 2. Connect the network port of the detection client and the network port of the gateway device through a network cable; Step 3. Deploy an MqttBroker, connect the detection client and gateway device detection program to the MqttBroker, and subscribe to the specified topic; Step 4. Set the detection command on the detection client, including the serial number of the O port to be detected and the corresponding control target value, requiring the control target value of the O port to be detected to be opposite to the current state value; generate a detection message according to the detection command, and send the detection message to the gateway device through the network port; Step 5: After the gateway device receives the detection message through the network port, it obtains the detection command by parsing the detection message, and writes the control target value into the O port to be detected according to the detection command; Step 6. The gateway device detection program detects whether the status value of the I port has changed. If it has changed, the serial number of the I port whose status value has changed and the changed status value are organized into an MQTT message and published with the specified topic; Step 7. After the detection client subscribes to the MQTT message of the specified topic published by the gateway device detection program through MqttBroker, it parses the MQTT message to obtain the I port whose status value has changed and the status value after the change in the IO module of the gateway device, and determines whether the serial number and corresponding status value of the I port are consistent with the serial number and corresponding control target value of the O port to be detected. If they are consistent, the detection passes.

[0012] The method in this case does not require any other external detection equipment. It only needs to connect to the input and output ends of the gateway device itself, combine the detection command sent by the detection client, and check the status of the gateway machine's response message to achieve self-detection of the gateway machine's IO module. This method is simple, effective and easy to operate.

[0013] A more specific solution is that in Step 4, the detection client sends the detection message to the gateway device through the network port and starts the timer; in Step 7, if the detection client subscribes to the MQTT message of the specified topic published by the detection program of the gateway device through MqttBroker within the specified time, and the sequence number of the I port whose state value has changed and the changed state value are analyzed to be consistent with the sequence number of the O port to be detected and the corresponding control target value, then the detection is passed. This solution requires that the detection client receives the MQTT message fed back by the gateway device within the specified time, otherwise, it is judged that the detection fails or fails the detection.

[0014] Another more specific solution is that in Step 4, the number of O ports to be detected is one; in Step 6, after the gateway device writes the control target value into the O port to be detected according to the detection command, the gateway device detection program organizes the sequence number of the first I port whose state value has changed and the changed state value into an MQTT message and publishes it with a specified topic. This solution limits the number of O ports to be detected to one; this solution can also be combined with the time-limited solution to form a new solution.

[0015] Another more specific solution is that in Step 4, the number of O ports to be detected is more than two; in Step 6, after the gateway device writes the control target value into the O port to be detected according to the detection command, the gateway device detection program organizes the serial numbers of all I ports whose status values ​​have changed within a detection cycle and the changed status values ​​into MQTT messages and publishes them with a specified topic. This solution limits the number of O ports to be detected to more than two, and a complete detection cycle is required to detect whether the I port has changed.

[0016] Specifically, in Step 1, the input end and the output end of the IO module of the gateway device are connected through a socket, and the I ports and O ports corresponding to the serial numbers are connected one by one.

[0017] Specifically, a message publishing module, a message subscription module and a signal detection module are set in the detection client; the message publishing module includes an input unit, a message generating unit and a detection trigger unit; the input unit is used to input the serial number of the O port to be detected and the corresponding control target value; the message generating unit generates a detection message according to the serial number of the O port to be detected and the corresponding control target value; the detection trigger unit sends the detection message to the gateway device through the network port, and at the same time sends the serial number of the O port to be detected and the corresponding control target value to the signal detection module.

[0018] Specifically, the input unit is designed as a mechanical key or a human-computer interaction interface.

[0019] Beneficial effects: The read-write function detection device and method of the gateway device IO module provided by the present invention are simple and effective, and can quickly and accurately detect whether there is a problem with the gateway device IO module design; the solution is simple, effective and easy to operate, and does not require any external detection equipment. It only needs to connect to the input and output ends of the gateway device itself, combine the detection command sent by the detection client, and check the gateway device response message status to realize the self-detection of the gateway device IO module. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a hardware connection diagram of the device of the present invention; Figure 2 It is a schematic diagram of the framework structure of the device of the present invention; Figure 3 It is a schematic diagram of the implementation process of the method of the present invention. DETAILED DESCRIPTION

[0021] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0022] like Figure 1 As shown, a read-write function detection device for the IO module of a gateway device includes a detection client and a power strip, and a network port is set on the detection client; the power strip is used to connect the input end and the output end of the IO module of the gateway device, and the I port and the O port corresponding to the serial number are connected one by one; the network port of the detection client is directly connected to the network port of the gateway device. Figure 1 In the table, I1~I8 represent the input ports of the gateway device (referred to as I ports), and O1~O8 represent the output ports of the gateway device (referred to as O ports). like Figure 2 As shown, it is an architectural block diagram of a gateway device and a detection client. The detection client includes a message publishing module, a message subscription module and a signal detection module, and the gateway device includes an IO module, a gateway detection program and a message subscription module.

[0023] In the detection client, the message publishing module generates a detection message according to the detection command, and sends the detection message to the gateway device through the network port; the detection command includes the serial number of the O port to be detected and the corresponding control target value, and the control target value of the O port to be detected is opposite to the current state value. The message subscription module subscribes to the MQTT message of the specified topic published by the gateway device through MqttBroker, and sends the MQTT message of the specified topic published by the subscribed gateway device to the signal detection module; the MQTT message is that after the gateway device receives the detection message through the network port, it obtains the detection command by parsing the detection message, writes the control target value into the O port to be detected according to the detection command, and the gateway device detects whether the state value of the I port changes, organizes the serial number of the I port whose state value changes and the changed state value into an MQTT message and publishes it with a specified topic, and the message subscription module subscribes to the MQTT message through MqttBroker. The signal detection module parses the MQTT message to obtain the I port whose status value has changed and the status value after the change in the IO module of the gateway device, and determines whether the sequence number and corresponding status value of the I port are consistent with the sequence number and corresponding control target value of the O port to be detected. If they are consistent, the detection is passed.

[0024] The message publishing module includes an input unit, a message generation unit and a detection trigger unit; the input unit is used to input the serial number of the O port to be detected and the corresponding control target value; the message generation unit generates a detection message according to the serial number of the O port to be detected and the corresponding control target value; the detection trigger unit sends the detection message to the gateway device through the network port, and at the same time sends the serial number of the O port to be detected and the corresponding control target value to the signal detection module. The input unit is designed as a mechanical button or a human-computer interaction interface.

[0025] In the gateway device, the gateway detection program uses the built-in program of the gateway device, which can publish MQTT messages of specified topics by calling or using MqttBroker; at the same time, it must be able to parse the detection message and execute the corresponding instructions. The message subscription module subscribes to the detection client to publish the detection message through MqttBroker.

[0026] A detection method based on the read-write function detection device of the above-mentioned gateway device IO module, if a certain input and output of the gateway device is abnormal, after the detection client controls the output of the gateway, no correct response will be obtained, so as to judge whether the output and input ports of the gateway are normal; Figure 3 As shown, the method specifically comprises the following steps: Step 1. Connect the input and output ends of the IO module of the gateway device through a socket, and connect the I port and O port corresponding to the serial number one by one; Step 2. Connect the network port of the detection client and the network port of the gateway device through a network cable; Step 3. Deploy an MqttBroker, connect the detection client and gateway device detection program to the MqttBroker, and subscribe to the specified topic; Step 4. Set the detection command on the detection client, including the serial number of the O port to be detected and the corresponding control target value, requiring the control target value of the O port to be detected to be opposite to the current state value; generate a detection message according to the detection command, and send the detection message to the gateway device through the network port; Step 5. After receiving the detection message through the network port, the gateway device obtains the detection command by parsing the detection message, and writes the control target value into the O port to be detected according to the detection command; since the state of the O port changes, the state of the I port connected to the O port will also change; Step 6. The gateway device detection program detects whether the status value of the I port has changed. If it has changed, the serial number of the I port whose status value has changed and the changed status value are organized into an MQTT message and published with the specified topic; Step 7. After the detection client subscribes to the MQTT message of the specified topic published by the gateway device detection program through MqttBroker, the I port whose status value has changed and the status value after the change in the IO module of the gateway device are obtained by parsing the MQTT message, and the serial number and corresponding status value of the I port are judged to be consistent with the serial number and corresponding control target value of the O port to be detected. If they are consistent, the detection is passed; Taking into account that clock limitation can improve the detection effect, in Step 4, the detection client sends the detection message to the gateway device through the network port and starts the timer; correspondingly, in Step 7, if the detection client subscribes to the MQTT message of the specified topic published by the gateway device detection program through MqttBroker within the specified time, and the serial number of the I port whose status value has changed and the changed status value are parsed to be consistent with the serial number of the O port to be detected and the corresponding control target value, then the detection is passed.

[0027] If a certain input and output port is tested separately, the number of O ports to be tested is set to one in Step 4; correspondingly, in Step 6, when the gateway device writes the control target value to the O port to be tested according to the detection command, the gateway device detection program organizes the serial number of the first I port whose status value changes and the changed status value into an MQTT message and publishes it with the specified topic.

[0028] If more than two input and output ports need to be tested, then in Step 4, the number of O ports to be tested is more than two; correspondingly, in Step 6, after the gateway device writes the control target value into the O port to be tested according to the detection command, the gateway device detection program organizes the serial numbers of all I ports whose status values ​​have changed within a detection cycle and the changed status values ​​into an MQTT message and publishes it with the specified topic.

[0029] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A device for detecting the read and write functions of an IO module of a gateway device, characterized in that: It includes a detection client and a power strip, a network port is set on the detection client, and a message publishing module, a message subscription module and a signal detection module are set in the detection client; The socket is used to connect the input end and the output end of the IO module of the gateway device, and the I port and the O port corresponding to the serial number are connected one by one; The network port of the detection client is directly connected to the network port of the gateway device; The message publishing module generates a detection message according to the detection command, and sends the detection message to the gateway device through the network port; the detection command includes the sequence number of the O port to be detected and the corresponding control target value, and the control target value of the O port to be detected is opposite to the current state value; The message subscription module subscribes to the MQTT message of the specified topic published by the gateway device through MqttBroker, and sends the MQTT message of the specified topic published by the subscribed gateway device to the signal detection module; the MQTT message is that after the gateway device receives the detection message through the network port, it obtains the detection command by parsing the detection message, writes the control target value into the O port to be detected according to the detection command, and the gateway device detects whether the status value of the I port changes, organizes the sequence number of the I port whose status value has changed and the changed status value into an MQTT message and publishes it with the specified topic, and the message subscription module subscribes to the MQTT message through MqttBroker; The signal detection module parses the MQTT message to obtain the I port whose status value has changed and the status value after the change in the IO module of the gateway device, and determines whether the sequence number and corresponding status value of the I port are consistent with the sequence number and corresponding control target value of the O port to be detected. If they are consistent, the detection is passed.

2. The device for detecting the read and write functions of the IO module of the gateway device according to claim 1, characterized in that: The message publishing module includes an input unit, a message generating unit and a detection triggering unit; the input unit is used to input the serial number of the O port to be detected and the corresponding control target value; the message generating unit generates a detection message according to the serial number of the O port to be detected and the corresponding control target value; the detection triggering unit sends the detection message to the gateway device through the network port, and at the same time sends the serial number of the O port to be detected and the corresponding control target value to the signal detection module.

3. The device for detecting the read and write functions of the IO module of the gateway device according to claim 2, characterized in that: The input unit is designed as a mechanical key or a human-computer interaction interface.

4. A method for detecting the read and write functions of an IO module of a gateway device, characterized in that: The steps include: Step 1. Connect the input and output ends of the IO module of the gateway device through hardware, and connect the I port and O port corresponding to the serial number one by one; Step 2. Connect the network port of the detection client and the network port of the gateway device through a network cable; Step 3. Deploy an MqttBroker, connect the detection client and gateway device detection program to the MqttBroker, and subscribe to the specified topic; Step 4. Set the detection command on the detection client, including the serial number of the O port to be detected and the corresponding control target value, requiring the control target value of the O port to be detected to be opposite to the current state value; generate a detection message according to the detection command, and send the detection message to the gateway device through the network port; Step 5: After the gateway device receives the detection message through the network port, it obtains the detection command by parsing the detection message, and writes the control target value into the O port to be detected according to the detection command; Step 6. The gateway device detection program detects whether the status value of the I port has changed. If it has changed, the serial number of the I port whose status value has changed and the changed status value are organized into an MQTT message and published with the specified topic; Step 7. After the detection client subscribes to the MQTT message of the specified topic published by the gateway device detection program through MqttBroker, it parses the MQTT message to obtain the I port whose status value has changed and the status value after the change in the IO module of the gateway device, and determines whether the serial number and corresponding status value of the I port are consistent with the serial number and corresponding control target value of the O port to be detected. If they are consistent, the detection passes.

5. The method for detecting the read and write functions of the IO module of the gateway device according to claim 4, characterized in that: In the Step 4, the detection client sends the detection message to the gateway device through the network port and starts the timer; in the Step 7, if the detection client subscribes to the MQTT message of the specified topic published by the gateway device detection program through MqttBroker within the specified time, and the serial number of the I port whose status value has changed and the changed status value are parsed to be consistent with the serial number of the O port to be detected and the corresponding control target value, then the detection is passed.

6. The method for detecting the read and write functions of the IO module of the gateway device according to claim 4, characterized in that: In the Step 4, the number of O ports to be detected is one; in the Step 6, after the gateway device writes the control target value into the O port to be detected according to the detection command, the gateway device detection program organizes the sequence number of the first I port whose status value has changed and the changed status value into an MQTT message and publishes it with the specified topic.

7. The method for detecting the read and write functions of the IO module of the gateway device according to claim 4, characterized in that: In Step 4, the number of O ports to be detected is more than two; in Step 6, after the gateway device writes the control target value into the O port to be detected according to the detection command, the gateway device detection program organizes the serial numbers of all I ports whose status values ​​have changed within a detection cycle and the changed status values ​​into an MQTT message and publishes it with a specified topic.

8. The method for detecting the read and write functions of the IO module of the gateway device according to claim 4, characterized in that: In the Step 1, the input end and the output end of the IO module of the gateway device are connected through a socket strip, and the I ports and O ports corresponding to the serial numbers are connected one by one.

9. The method for detecting the read and write functions of the IO module of the gateway device according to claim 4, characterized in that: A message publishing module, a message subscription module and a signal detection module are set in the detection client; the message publishing module includes an input unit, a message generating unit and a detection trigger unit; the input unit is used to input the serial number of the O port to be detected and the corresponding control target value; the message generating unit generates a detection message according to the serial number of the O port to be detected and the corresponding control target value; the detection trigger unit sends the detection message to the gateway device through the network port, and at the same time sends the serial number of the O port to be detected and the corresponding control target value to the signal detection module.

10. The method for detecting the read and write functions of the IO module of the gateway device according to claim 9, characterized in that: The input unit is designed as a mechanical key or a human-computer interaction interface.

Citation Information

Patent Citations

  • MQTT protocol simulation method and simulation equipment

    CN112039722A

  • Gateway communication method and system based on MQTT and message agreement, and gateway equipment

    CN114124649A

  • IO module read-write function detection device and detection method of gateway machine equipment

    CN117857387A

  • Device and method for detecting read-write function of serial port module of gateway machine equipment

    CN117880143A

  • Method and device for supporting multiple users to perform data read-write and message tracking on serial port

    CN118018603A