Packet capture method for industrial equipment when wirelessly transmitting control commands

By using gateways for time synchronization and packet analysis in industrial equipment, the delay problem in wireless control signal transmission is solved, the flexibility and scalability of wireless transmission is improved, and the connection and maintenance process is simplified.

CN118984468BActive Publication Date: 2024-12-20CHANGZHOU XUTEC SYST TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411471385.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2024-12-20
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

Existing industrial equipment has delay problems in wireless control signal transmission, and wired connections are complex and difficult to maintain, lacking flexibility and scalability.

Method used

Time synchronization is performed through gateway A, gateway B, and gateway C, and transmitted data packets are captured and analyzed, key information is extracted to evaluate the working performance of industrial equipment under the wireless network, and to calculate the delay of control commands.

Benefits of technology

It realizes flexibility and scalability of wireless transmission, reduces connection and maintenance difficulties, and can accurately evaluate the operating status of industrial equipment under wireless networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118984468B_ABST
    Figure CN118984468B_ABST
Patent Text Reader

Abstract

The present invention discloses a packet capture method for industrial equipment when wirelessly transmitting control commands, comprising the following steps: the controller of the industrial equipment sends a control command and transmits it to gateway B and gateway C through gateway A; gateway B transmits the control command to control object one, and gateway C transmits the control command to control object two; gateway O is connected to the external network and obtains the current system clock through the NTP service, and gateway O synchronizes the time of the system clock to gateway A, gateway B and gateway C; in gateway A, gateway B and gateway C, the data packets generated by the transmission of the control command are captured respectively, and the key information in the data packets is extracted; the key information is analyzed to evaluate the working performance of the industrial equipment under the wireless network. The present invention can be applied to packet capture analysis of different wireless communication networks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of wireless communications, and in particular to a method for capturing packets when industrial equipment transmits control commands wirelessly. Background Art

[0002] With the development of industrial technology, many industrial equipment have been automated. In automated industrial equipment, controllers are usually used to control the motion of the actuators in the industrial equipment. Existing industrial equipment mainly uses wired transmission to transmit control signals. For example, a three-axis motion mechanism contains at least three motors. The controller must be connected to the three motors through three transmission lines. This leads to too many cables inside the industrial equipment, making it difficult to organize the cables. In addition, the wired connection method has the disadvantages of poor flexibility, poor scalability, high maintenance difficulty, and high cost. Therefore, many industrial equipment want to transform wired control into wireless control. However, the transmission of control signals during wireless control is also wireless. There will be a delay from sending signals to receiving signals in wireless transmission. Therefore, it is necessary to capture and analyze the data generated during wireless transmission to observe the operating status of industrial equipment in wireless control mode so as to make timely adjustments. Summary of the invention

[0003] In order to solve the problems existing in the prior art, the present invention provides a packet capture method for industrial equipment when wirelessly transmitting control commands, which can be applied to packet capture analysis of different wireless communication networks.

[0004] The technical solution adopted by the present invention to solve the technical problem is: a method for capturing packets when industrial equipment transmits control commands wirelessly, comprising the following steps:

[0005] S1, the controller of the industrial equipment sends a control command and transmits it to gateway B and gateway C through gateway A;

[0006] S2, the gateway B transmits the control command to the control object 1, and the gateway C transmits the control command to the control object 2;

[0007] S3, connecting gateway O to the external network and obtaining the current system clock through the NTP service, and the gateway O synchronizes the time of the system clock to the gateways A, B and C;

[0008] S4, capturing data packets generated by the transmission control command in the gateway A, gateway B, and gateway C respectively, and extracting key information in the data packets;

[0009] S5. Analyze the key information to evaluate the working performance of the industrial equipment under the wireless network.

[0010] Further, in the first communication mode, extracting key information from the data packet includes:

[0011] Filter out all data packets between the controller and the controlled object according to the physical address;

[0012] Extracting data records from each of the data packets, the data records comprising: a timestamp, a physical address of the controller, a physical address of the controlled object, and a cycle count value;

[0013] In the same cycle, the data packet of the controller and the data packet of the controlled object are matched;

[0014] According to the corresponding relationship, the timestamp difference between the data packet of the controller and the data packet of the controlled object is calculated to obtain the time delay between sending and receiving the control command.

[0015] Further, matching the data packet of the controller with the data packet of the control object includes:

[0016] Determine whether the physical address in the data packet of the controller is the same as the physical address in the data packet of the control object, and whether the physical address in the data packet sent by the control object is the same as the physical address in the data packet received; if they are the same, proceed to the next step;

[0017] Determine whether the cycle count value in the controller's data packet and the cycle count value in the control object's data packet belong to the same cycle. If so, correspond the controller's data packet with the control object's data packet; otherwise, do not correspond.

[0018] Further, in the second communication mode, extracting key information from the data packet includes:

[0019] Extract the communication protocol and message key fields in the data packet between the remote control terminal and the gateway according to the filtering rules;

[0020] The key fields include: timestamp, IP address of the remote control terminal, IP address of the gateway, port number of the remote control terminal, port number of the gateway, security request sequence number of the communication protocol and response handle;

[0021] Matching the data packets of the remote control terminal with the data packets of the gateway;

[0022] According to the corresponding relationship, the time stamp difference between the data packet of the remote control terminal and the data packet of the gateway is calculated to obtain the two-way delay between sending and receiving the control command.

[0023] Further, the data packet of the remote control terminal and the data packet of the gateway are matched, including:

[0024] Determine whether the IP address of the remote control terminal in the data packet corresponds to the IP address of the gateway. If so, proceed to the next step;

[0025] Determine whether the port number of the remote control terminal and the port number of the gateway in the data packet are correct and the same. If yes, proceed to the next step;

[0026] Determine whether the security request sequence number of the communication protocol between the remote control terminal and the gateway in the data packet is the same, and whether the response handle between the remote control terminal and the gateway in the data packet is the same. If they are the same, the security request sequence number and response handle of the qualified data packet are matched.

[0027] Furthermore, in the second communication mode, the controller is wirelessly connected to the remote control terminal through gateway A, and the remote control terminal sends a start-stop control command to the gateway A, and the gateway A then sends the start-stop control command to the controller, gateway B or gateway C.

[0028] Furthermore, the time synchronization process in step S3 includes:

[0029] The host computer is remotely connected to the gateway O, and obtains the system clock through the external network interface of the gateway O;

[0030] Start ptp41 and phc2sys time synchronization functions on the gateway O;

[0031] When the gateway O is ready, the host computer remotely connects to the gateways A, B and C at the same time, and starts the ptp41 and phc2sys time synchronization functions of the gateways A, B and C;

[0032] When the network card clocks of all gateways are consistent with the system clock, time synchronization is completed.

[0033] Furthermore, the gateway A, gateway B and gateway C are all connected to a wireless communication network, and the wireless communication network includes a 5G network and a WIFI6 network.

[0034] The beneficial effect of the present invention is that the packet capture method of the present invention when the industrial equipment transmits the control command wirelessly transmits the control command through the gateway, synchronizes the clocks of each gateway, captures the valid data packet from the gateway, matches the data packet, calculates the delay of the control command in the wireless transmission, and is used to evaluate the operation status of the industrial equipment under the wireless network. Compared with the wired transmission method, wireless transmission is more flexible and extensible, without complicated connecting wires, and the maintenance difficulty is greatly reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0036] Figure 1 It is a flow chart of the packet capturing method of the industrial equipment of the present invention when wirelessly transmitting control commands.

[0037] Figure 2 It is an architectural diagram of the industrial equipment wireless transmission system of the present invention.

[0038] Figure 3 It is another architecture diagram of the industrial equipment wireless transmission system of the present invention. DETAILED DESCRIPTION

[0039] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0040] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0041] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0042] like Figures 1 to 3As shown, the packet capture method of industrial equipment when wirelessly transmitting control commands of the present invention comprises the following steps: S1, the controller of the industrial equipment sends a control command and transmits it to gateway B and gateway C through gateway A. S2, gateway B transmits the control command to control object one, and gateway C transmits the control command to control object two. S3, gateway O is connected to the external network and obtains the current system clock through the NTP service, and gateway O synchronizes the system clock time to gateway A, gateway B and gateway C. S4, the data packets generated by the transmission of control commands are captured in gateway A, gateway B and gateway C respectively, and the key information in the data packets is extracted. S5, the key information is analyzed to evaluate the working performance of the industrial equipment under the wireless network.

[0043] It should be noted that the controller is, for example, a PLC, and the controller is used to send control commands. For example, control object one and control object two are both servo motors, or control object one is a servo motor and control object two is another PLC. The controller is not directly connected to control object one and control object two, but wirelessly transmits control commands through a gateway. Before performing the packet capture step, the clocks of gateway A, gateway B, and gateway C need to be synchronized to ensure the accuracy of subsequent packet capture results. By extracting key information from the captured data packets, the delay of the control command during wireless transmission can be analyzed to evaluate the operating status of industrial equipment under a wireless network.

[0044] The present invention mainly takes two control objects as an example. In other embodiments, the number of control objects can be increased. In the case of multiple control objects, the key information can also be used to analyze the synchronization of the actions of the multiple control objects in the wireless network (for the scenario with the same control objects).

[0045] Gateway A, gateway B and gateway C are, for example, IoT2050. The eno1 ports of gateway A, gateway B and gateway C are all connected to the wireless communication network to realize wireless networking. Wireless communication networks include 5G networks, WIFI6 networks, etc. After gateway A receives the control command sent by the controller, it transmits it to gateway B and gateway C synchronously. During the wireless transmission process, relevant data packets will be generated in gateway A, gateway B and gateway C. By capturing the data packets and extracting and analyzing the key information in the data packets, the delay of the control command during the wireless transmission process can be analyzed.

[0046] Before performing the packet capture step, the clocks of gateway A, gateway B, and gateway C need to be synchronized. The time synchronization process includes: the host computer remotely connects to gateway O and obtains the system clock through the external network interface of gateway O; starts the ptp41 and phc2sys time synchronization functions on gateway O; when gateway O is ready, the host computer remotely connects to gateway A, gateway B, and gateway C at the same time, and starts the ptp41 and phc2sys time synchronization functions of gateway A, gateway B, and gateway C; when the network card clocks of all gateways are consistent with the system clock, it indicates that the time synchronization is completed. Specifically, the eno2 ports of gateway A, gateway B, and gateway C are connected to the same switch, the switch is connected to the host computer, and gateway O is remotely connected to the host computer. Gateway O is the Master, and gateways A, gateway B, and gateway C are the Slaves. The time synchronization process can be described as: NTP→system clock→Master network card clock→Slave network card clock→Slave system clock synchronization. In other words, gateway O first obtains the reference time through the NTP service, and other gateways use the time of gateway O as the reference time synchronization.

[0047] One control object corresponds to one gateway, and different communication modes can be set in different scenarios. In the present invention, the first communication mode is the PN communication protocol, and the second communication mode is the OPC UA communication protocol. In different communication modes, the extracted key information is different.

[0048] For example, in the first communication mode, extracting key information from a data packet includes: filtering out all data packets between the controller and the controlled object according to the physical address; extracting data records from each data packet, the data records including: timestamp, physical address of the controller, physical address of the controlled object, and cycle count value; matching the data packet of the controller with the data packet of the controlled object in the same cycle; calculating the timestamp difference between the data packet of the controller and the data packet of the controlled object according to the corresponding relationship to obtain the time delay between sending and receiving the control command. Matching the data packet of the controller with the data packet of the controlled object includes: judging whether the physical address in the data packet of the controller is the same as the physical address in the data packet of the controlled object, and whether the physical address in the data packet sent by the controlled object is the same as the physical address in the data packet received; if they are the same, proceeding to the next step; judging whether the cycle count value in the data packet of the controller and the cycle count value in the data packet of the controlled object belong to the same cycle, if so, matching the data packet of the controller with the data packet of the controlled object; otherwise, not matching.

[0049] For example, the data record is Timestamp: 2024-3-14 03:30:54.909272, Src_MAC: 4c:e7:05:63:b9:9a, Dst_MAC: 4c:e7:05:63:bb:08, Cycle_Counter: 28672. Timestamp indicates the timestamp, Src_MAC indicates the physical address of the controller, Dst_MAC indicates the physical address of the control object, and Cycle_Counter indicates the cycle count value. The controller will generate relevant data packets when sending control commands, and the control object will generate relevant data packets when receiving control commands. Since the control commands are transmitted through the gateway, there will be relevant data packets in the gateway. The cycle is set to the maximum cycle count of the PN message. After completing a cycle, the cycle count value will be reset and start counting from 0 again. The cycle count value combined with the timestamp can be used to understand whether the data packets belong to the same cycle. The cycle count value increases with the controller's scan cycle, such as: 0, 32, 64, ..., 65056; 0, 32, 64, ..., 65056. When matching data packets, two types of data packets in the same cycle need to be matched, and data packets between different cycles do not need to be matched.

[0050] It should be noted that when the controller sends a control command, it will generate a related data packet, and the data packet will be refreshed at a certain frequency. When the control object receives the control command, it will generate a related data packet, and the data packet will be refreshed at the same frequency as the controller. The controller, control object 1, and control object 2 are all set with unique physical addresses, so the physical address can be used to determine the sending and receiving relationship between the controller's data packet and the control object's data packet. The timestamp and the cycle count value can be combined to determine whether the two types of data packets belong to the same cycle. Therefore, the correspondence between the controller's data packet and the control object's data packet can be determined. It should be noted that the data packet file captured by the gateway does not contain only one data packet, but multiple data packets. The data packet file contains multiple data packets. In the same cycle, multiple data packets are captured. The physical addresses of the controller and the physical addresses of the control object of these data packets are the same, and the cycle count values ​​may be the same or different (but all belong to the same cycle), and the timestamps are different. After finding the corresponding relationship between the data packets, the sending and receiving relationship of the control command can be locked, and the time difference between the sending and receiving of the control command can be calculated, so as to understand the network delay of the signal during wireless transmission.

[0051] As shown in Table 1, after many tests, the average delay of sending control commands via wireless transmission is within the allowable error range (15ms), and the average time it takes for the control commands to reach control object one and control object two is not much different. For some scenarios that require synchronous operations, the wireless control method can basically meet the requirements.

[0052] Table 1

[0053]

[0054] For example, in the second communication mode, extracting key information from the data packet includes: extracting the communication protocol and message key fields from the data packet between the remote control terminal and the gateway according to the filtering rules; the key fields include: timestamp, IP address of the remote control terminal, IP address of the gateway, port number of the remote control terminal, port number of the gateway, security request sequence number of the communication protocol and response handle; matching the data packet of the remote control terminal with the data packet of the gateway; calculating the timestamp difference between the data packet of the remote control terminal and the data packet of the gateway according to the corresponding relationship to obtain the two-way delay between the sending and receiving of the control command. Matching the data packet of the remote control terminal with the data packet of the gateway includes: judging whether the IP address of the remote control terminal in the data packet corresponds to the IP address of the gateway, if yes, proceeding to the next step; judging whether the port number of the remote control terminal in the data packet and the port number of the gateway are correct and the same, if yes, proceeding to the next step; judging whether the security request sequence number of the communication protocol between the remote control terminal and the gateway in the data packet is the same, and whether the response handle between the remote control terminal and the gateway in the data packet is the same, if both are the same, matching the security request sequence number with the response handle for the qualified data packet.

[0055] It should be noted that in the second communication mode, the controller is wirelessly connected to the remote control terminal through gateway A, and the remote control terminal sends a start-stop control command to gateway A, which then transmits the start-stop control command to the controller, gateway B or gateway C. In this sending and receiving process, the communication data packet file can be captured on any device in the same network, such as the terminal or gateway. In the second communication mode, the extraction of key information and the correspondence of data packets are slightly different from those in the first communication mode. In the second communication mode, key information includes IP address, port number, security request sequence number, and response handle. This is because in the second communication mode, the connection port between the remote control terminal and gateway A is specific. Therefore, the port number should be added when extracting key information to avoid information extraction errors. The security request sequence number and response handle are also request-response relationships unique to the second communication mode, so they also need to be extracted.

[0056] For example, the command of the filtering rule can be expressed as: Tshark -r opcua_filter.pcap -Y "opcua"-T fields -e frame.time -e ip.src_host -e ip.dst_host -e tcp.srcport -etcp.dstport -e opcua.security.rqid -e opcua.RequestHandle>opcua_data.txt, where:

[0057] -Y "opcua": Set the display filter to only display OPC UA protocol packets.

[0058] -T fields: Select the output format as field format to output the fields in the specified data packet.

[0059] -e frame.time: Output the timestamp of the data packet, indicating the arrival time of each data packet.

[0060] -e ip.src_host: Output the IP address of the remote control terminal,

[0061] -e ip.dst_host : output gateway IP address,

[0062] -e tcp.srcport: output the port number of the remote control terminal,

[0063] -e tcp.dstport: output gateway port number,

[0064] -e opcua.security.rqid: Output the security request number in the OPC UA protocol.

[0065] -e opcua.RequestHandle: Outputs the response handle in the OPC UA protocol.

[0066] After matching the data packets of the remote control terminal with the data packets of the gateway, the delay can be calculated based on the timestamp.

[0067] In addition, the extracted data packets can be stored in the host computer for statistical analysis.

[0068] Since the controller and the gateway have not only the two communication modes mentioned in the article, but also other modes of communication, any communication protocol will generate relevant data packets in their respective data packet files. In other words, the data in the data packet files are varied. The difficulty of the present invention lies in how to accurately capture the required data from the varied data. Based on this, the present invention sets a specific packet capture method and data correspondence method, aiming to quickly and accurately capture valid data from the diverse data.

[0069] In summary, the packet capture method of the industrial equipment during wireless transmission of control commands of the present invention transmits control commands wirelessly through the gateway, synchronizes the clocks of each gateway, captures valid data packets from the gateway, matches the data packets of the controller with the data packets of the gateway, calculates the delay of the control command in wireless transmission, and is used to evaluate the operating status of the industrial equipment under the wireless network. Compared with wired transmission, wireless transmission is more flexible and extensible, without complicated connecting wires, and the maintenance difficulty is greatly reduced.

[0070] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A method for capturing packets when industrial equipment transmits control commands wirelessly. It is characterized in that The following steps are involved: S1, the controller of the industrial equipment sends a control command and transmits it to gateway B and gateway C through gateway A; S2, the gateway B transmits the control command to the control object 1, and the gateway C transmits the control command to the control object 2; S3, connecting gateway O to the external network and obtaining the current system clock through the NTP service, and the gateway O synchronizes the time of the system clock to the gateways A, B and C; S4, capturing data packets generated by the transmission control command in the gateway A, gateway B, and gateway C respectively, and extracting key information in the data packets; S5. Analyze the key information to evaluate the working performance of the industrial equipment under the wireless network; In the first communication mode, extracting key information from the data packet includes: Filter out all data packets between the controller and the controlled object according to the physical address; Extracting data records from each of the data packets, the data records comprising: a timestamp, a physical address of the controller, a physical address of the controlled object, and a cycle count value; In the same cycle, the data packet of the controller and the data packet of the controlled object are matched; According to the corresponding relationship, the timestamp difference between the data packet of the controller and the data packet of the controlled object is calculated to obtain the time delay between sending and receiving the control command; Matching the data packet of the controller with the data packet of the controlled object includes: Determine whether the physical address in the data packet of the controller is the same as the physical address in the data packet of the control object, and whether the physical address in the data packet sent by the control object is the same as the physical address in the data packet received; if they are the same, proceed to the next step; Determine whether the cycle count value in the data packet of the controller and the cycle count value in the data packet of the controlled object belong to the same cycle, if so, correspond the data packet of the controller with the data packet of the controlled object; otherwise, do not correspond; In the second communication mode, extracting key information from the data packet includes: Extract the communication protocol and message key fields in the data packet between the remote control terminal and the gateway according to the filtering rules; The key fields include: timestamp, IP address of the remote control terminal, IP address of the gateway, port number of the remote control terminal, port number of the gateway, security request sequence number of the communication protocol and response handle; Matching the data packets of the remote control terminal with the data packets of the gateway; According to the corresponding relationship, the timestamp difference between the data packet of the remote control terminal and the data packet of the gateway is calculated to obtain the two-way delay between sending and receiving the control command; The data packet of the remote control terminal corresponds to the data packet of the gateway, including: Determine whether the IP address of the remote control terminal in the data packet corresponds to the IP address of the gateway. If so, proceed to the next step; Determine whether the port number of the remote control terminal and the port number of the gateway in the data packet are correct and the same. If yes, proceed to the next step; Determine whether the security request sequence numbers of the communication protocol between the remote control terminal and the gateway in the data packet are the same, and whether the response handles between the remote control terminal and the gateway in the data packet are the same. If they are the same, match the security request sequence numbers and response handles of the qualified data packets; In the second communication mode, the controller is wirelessly connected to the remote control terminal through gateway A, and the remote control terminal sends a start / stop control command to the gateway A, which then sends the start / stop control command to the controller, gateway B or gateway C.

2. The method for capturing packets when industrial equipment transmits control commands wirelessly as claimed in claim 1, It is characterized in that The time synchronization process in step S3 includes: The host computer is remotely connected to the gateway O, and obtains the system clock through the external network interface of the gateway O; Start ptp41 and phc2sys time synchronization functions on the gateway O; When the gateway O is ready, the host computer remotely connects to the gateways A, B and C at the same time, and starts the ptp41 and phc2sys time synchronization functions of the gateways A, B and C; When the network card clocks of all gateways are consistent with the system clock, time synchronization is completed.

3. The method for capturing packets when industrial equipment transmits control commands wirelessly as claimed in claim 1, It is characterized in that The gateway A, gateway B and gateway C are all connected to the wireless communication network, which includes a 5G network and a WIFI6 network.