Method for industrial wireless communication and data transmission, gateway, router and industrial detection system

By using message queues and message ID mechanisms in industrial wireless communication systems, the data transmission process is simplified, the cumbersome communication problem in existing technologies is solved, and efficient and reliable data transmission is achieved.

CN121865291APending Publication Date: 2026-04-14HAIER SMART HOME CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HAIER SMART HOME CO LTD
Filing Date
2025-11-18
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing industrial wireless communication methods require sending request and response messages at the start and end of data transmission, which makes the communication process cumbersome and affects transmission efficiency.

Method used

The system uses a message queue to store the detection data of the PLC device and uses a message ID mechanism to transmit the data. The gateway determines the target data based on the router's request command and the message ID, ensuring data continuity and no packet loss, and simplifying the communication process.

Benefits of technology

It improves the efficiency of industrial wireless communication, ensures the reliability and integrity of data transmission, reduces the data packet capacity, and avoids data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121865291A_ABST
    Figure CN121865291A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and discloses a method for industrial wireless communication and data transmission, which is applied to a gateway of an industrial detection system, and the industrial detection system comprises: a PLC device configured to collect detection data of a target device; the gateway is configured to communicate with the PLC equipment and receive detection data sent by the PLC equipment; the router is configured to wirelessly communicate with the gateway and receive the detection data sent by the gateway; the server is configured to communicate with the router and draw a detection curve for detection analysis according to the detection data sent by the router; the method comprises the following steps: storing detection data sent by PLC equipment in a message queue of a gateway; determining target data in the message queue according to the message ID in the request instruction under the condition that the request instruction for requesting the detection data sent by the router is received for the nth time, n being equal to 1, 2,...; and sending the target data and the received message ID to the router, and storing the received message ID. According to the method, the communication process is simpler, and the communication efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, such as a method, gateway, router, and industrial detection system for industrial wireless communication and data transmission. Background Technology

[0002] In industrial production, process monitoring data from relevant equipment, such as refrigeration equipment and vacuuming equipment, needs to be uploaded to a server in real time for quality control during the vacuuming process. Wired transmission requires network cabling on-site and is unsuitable for scenarios where equipment draws power from sliding contact lines for cyclical operation. Wireless transmission is more convenient, but it is susceptible to interference in the industrial environment, often resulting in disconnections and data loss.

[0003] Related technology discloses a communication method applied to a first device. The method includes: sending a first control message to a second device, the first control message including first transmission control option information, the first transmission control option information being used to request the initiation of data transmission from the first device to the second device; receiving a second control message from the second device, the second control message including second transmission control option information, the second transmission control option information being used to confirm the initiation of data transmission from the first device to the second device; and sending first data to the second device if no response message for the second control message is sent to the second device.

[0004] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art: In related technologies, request and control messages need to be sent at both the start and end stages of data transmission, and both control and response messages carry the sending sequence number and the response sequence number. This communication process is cumbersome and detrimental to improving transmission efficiency.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0007] This disclosure provides a method, gateway, router, and industrial detection system for industrial wireless communication and data transmission, which simplifies the communication process and improves communication efficiency.

[0008] In some embodiments, a method for industrial wireless communication and data transmission is applied to a gateway in an industrial inspection system, the industrial inspection system comprising: a PLC device configured to collect inspection data of a target device; a gateway configured to communicate with the PLC device and receive inspection data sent by the PLC device; a router configured to wirelessly communicate with the gateway and receive inspection data sent by the gateway; and a server configured to communicate with the router and plot inspection curves based on the inspection data sent by the router for inspection analysis; the method comprising: The detection data sent by the PLC device is stored in the gateway's message queue in the order of receipt. Upon receiving the nth request instruction from the router for detection data, the target data to be sent is determined in the message queue based on the message ID in the request instruction (n=1, 2, ...). The target data and the received message ID are then sent to the router, and the received message ID is saved. In some embodiments, a method for industrial wireless communication and data transmission is applied to a router in an industrial inspection system, the industrial inspection system comprising: a PLC device configured to collect inspection data of a target device; a gateway configured to communicate with the PLC device and receive inspection data sent by the PLC device; a router configured to wirelessly communicate with the gateway and receive inspection data sent by the gateway; and a server configured to communicate with the router and plot inspection curves based on the inspection data sent by the router for inspection analysis; the method comprising: The nth request instruction for requesting detection data is sent, where n = 1, 2, ...; the request instruction includes a message ID, which indicates the router's status; the target data and message ID are sent by the receiving gateway; the target data is determined based on the router's status.

[0009] In some embodiments, the gateway is applied to an industrial inspection system, the industrial inspection system comprising: a PLC device configured to collect inspection data of a target device; a gateway configured to communicate with the PLC device and receive inspection data sent by the PLC device; a router configured to communicate wirelessly with the gateway and receive inspection data sent by the gateway; and a server configured to communicate with the router and draw inspection curves based on the inspection data sent by the router for inspection analysis; wherein the gateway comprises: a memory configured to store program instructions, messages, and data; and a first processor configured to execute the method described above when running program instructions.

[0010] In some embodiments, the router is applied to an industrial inspection system, characterized in that the industrial inspection system includes: a PLC device configured to collect inspection data of a target device; a gateway configured to communicate with the PLC device and receive inspection data sent by the PLC device; a router configured to communicate wirelessly with the gateway and receive inspection data sent by the gateway; and a server configured to communicate with the router and draw inspection curves based on the inspection data sent by the router for inspection analysis; wherein the router includes: a memory configured to store program instructions, messages, and data; and a second processor configured to execute the method described above when running program instructions.

[0011] In some embodiments, the industrial inspection system includes: a PLC device configured to collect inspection data of a target device; a gateway as described above; a router as described above; and a server configured to communicate with the router and perform inspection analysis by plotting inspection curves based on the inspection data sent by the router.

[0012] The method, gateway, router, and industrial detection system for industrial wireless communication and data transmission provided in this disclosure can achieve the following technical effects: The gateway sends detection data based on the request command sent by the router, along with the message ID within the request command. Furthermore, the received message ID can be used to determine the data transmission status, ensuring data continuation and preventing packet loss in case of anomalies. Data transmission based on message IDs simplifies the communication process and improves communication efficiency.

[0013] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0014] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein: Figure 1 This is a schematic diagram of an industrial testing system provided in an embodiment of this disclosure; Figure 2 This is a schematic diagram of a method for industrial wireless communication and data transmission provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram of another method for industrial wireless communication and data transmission provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of another method for industrial wireless communication and data transmission provided in an embodiment of this disclosure; Figure 5This is a schematic diagram of another method for industrial wireless communication and data transmission provided in an embodiment of this disclosure; Figure 6 This is a partial schematic diagram of an application provided by an embodiment of this disclosure; Figure 7 This is another schematic diagram of an application provided by an embodiment of this disclosure; Figure 8 This is a schematic diagram of a gateway provided in an embodiment of this disclosure; Figure 9 This is a schematic diagram of a router provided in an embodiment of this disclosure. Detailed Implementation

[0015] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0016] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0017] Unless otherwise stated, the term "multiple" means two or more.

[0018] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0019] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0020] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.

[0021] Combination Figure 1As shown, to collect process inspection data for equipment such as vacuum equipment in refrigeration piping, this disclosure provides an industrial inspection system for collecting inspection data from target equipment. An industrial inspection system includes a PLC device 40, a gateway 30, a router 20, and a server 10. The PLC device 40 is configured to collect inspection data from the target equipment. The gateway 30 is configured to communicate with the PLC device 40 and receive the inspection data sent by the PLC device 40. The router 20 is configured to communicate wirelessly with the gateway 30 and receive the inspection data sent by the gateway 30. The server 10 is configured to communicate with the router 20 and perform inspection analysis by plotting inspection curves based on the inspection data sent by the router 20.

[0022] Each PLC device connects to one or more target devices. Optionally, each PLC device connects to multiple target devices; for example, each PLC connects to three target devices. When there are many target devices, multiple PLC devices are configured. Each PLC collects the detection data from the connected target devices in real time. The number of gateways matches the number of PLC devices. The gateways sequentially send data request commands to the PLC devices based on communication protocols (such as S7, Modbus, etc.) and store the detection data sent by the PLC devices in a message queue. The router polls each gateway to receive the detection data sent by the gateways and sends the received detection data to the server (which can be replaced by a terminal device such as a computer) via TCP (Transmission Control Protocol). The server plots the received detection data as curves and performs detection analysis based on the plotted curves to analyze process quality. For example, when the process equipment is a vacuum pump for refrigeration piping, the plotted curves can be used to determine the vacuum status, such as whether there is a leak in the vacuum piping.

[0023] Based on the above system, combined with Figure 2 As shown, this disclosure provides a method for industrial wireless communication and data transmission, including: S101, the gateway stores the detection data sent by the PLC device in the message queue according to the order of receipt.

[0024] S102, upon receiving the request instruction for requesting detection data from the router for the nth time, the gateway determines the target data to be sent in the message queue based on the message ID in the request instruction, where n=1, 2, ...

[0025] S103, the gateway sends the target data and the received message ID to the router and saves the received message ID.

[0026] Here, the gateway has a data caching function, with a built-in message queue used to cache the detection data sent by the PLC device. The cached detection data follows a first-in, first-out (FIFO) principle to ensure that the detection data is transmitted in sequence for later plotting of detection curves. Before data transmission between the gateway and the router, a communication session must be established; then data transmission occurs based on the data transmission channel.

[0027] During data transmission, to avoid contention, the router polls the gateways sequentially using a master-slave round-robin mechanism. Once a gateway is polled and acknowledges its status, it sends the detection data. Specifically, the router sends a request command to a gateway requesting detection data. Upon receiving the request command, the gateway parses it to obtain a message ID (Identification Number). Based on the message ID, it identifies the target data to be sent in the message queue, sends the target data and the received message ID to the router, and saves the received message ID for this data transmission.

[0028] The message ID is used by the gateway to determine whether the router has received the target data sent by the gateway, and also by the router to determine whether the gateway has received the request instruction and sent the corresponding target data. The message ID increments with each poll of the gateway. For example, under normal data transmission conditions, if the message ID is 1 in the first poll, then in the next poll, the message ID received by the gateway will be 2 (here, the message ID increments by 1 each time). Simultaneously, the gateway saves the received message ID each time it is polled. In the next poll, the gateway can determine whether the previous target data was received by the router based on the latest message ID and the saved message ID. Understandably, if the message ID received by the gateway in this poll matches the saved message ID, it indicates that the router did not receive the target data sent in the previous poll. In this case, the target data is the target data sent in the previous poll, thus enabling data continuation in abnormal situations. If the message ID received by the gateway in this poll does not match the saved message ID, and the latest message ID increments by 1 compared to the saved message ID, it indicates that the router received the target data sent in the previous poll. At this point, the target data is the next detection data to be sent in the message queue (i.e., the detection data following the target data in the previous poll). Thus, by using an auto-incrementing message ID to implement a data transmission confirmation and acknowledgment mechanism, the reliability of data transmission is guaranteed. Furthermore, compared to existing technologies, this embodiment only requires one message ID, which reduces the amount of data packet space occupied and also helps improve data transmission efficiency.

[0029] It's important to note that, to avoid packet loss during communication, the gateway does not delete the target data from the message queue after each transmission. During the next polling cycle, once the router has received the target data from the previous poll, it deletes the target data and uses the latest first set of detection data as the new target data. The message queue contains multiple sets of detection data, with the first data popped from the stack being the first set. This prevents packet loss in the event of data transmission failure due to various interferences (wireless transmission is susceptible to numerous signals from industrial field equipment). Furthermore, the message ID value and its auto-incrementing method are pre-defined.

[0030] The method for industrial wireless communication and data transmission provided in this disclosure involves a gateway sending detection data based on a request command sent by a router and the message ID within the request command. Furthermore, the received message ID can be used to determine the data transmission status, ensuring data continuation and preventing packet loss in case of anomalies. Data transmission based on message IDs simplifies the communication process and improves communication efficiency.

[0031] Optionally, in step S102, the gateway determines the target data to be sent in the message queue based on the message ID in the request instruction, including: If the message ID indicates that the router is in a normal state, then delete the first set of detection data in the message queue and use the next set of detection data as the target data. Alternatively, If the message ID indicates that the router is powered on for the first time, then the first set of detection data in the message queue is used as the target data. Alternatively, If the message ID indicates that the router has encountered an abnormal situation, then the first M groups of detection data in the message queue will be used as the target data; where m≥M≥2, and m is the number of groups corresponding to the maximum transmission volume of detection data.

[0032] Here, by using the message ID received and stored by the gateway, it's possible to determine whether the message IDs of two consecutive polled sessions increment normally, thus assessing the router's status. When the message ID indicates the router's first power-on (i.e., the first power-on during each communication process), the first set of detection data in the message queue is used as the target data. That is, in each communication, the first target data transmitted is the first set of detection data in the message queue.

[0033] In subsequent normal transmission (i.e., when the message ID indicates the router is functioning normally), the first set of detection data in the message queue is deleted, and the next set of data is used as the target data. Thus, after each transmission of detection data from the message queue, the previously transmitted detection data is not deleted. Instead, the detection data sent in the previous poll is deleted during the next transmission of detection data to ensure data continuation in case of abnormal situations.

[0034] When a message ID indicates a router malfunction, to avoid data loss prior to the malfunction, the first M sets of detection data in the message queue (including detection data sent before the malfunction) are used as the target data. Here, because the router communicates with multiple gateways, each master-slave polling requires polling all gateways; this makes data transmission for any gateway based on a request cycle. After a router malfunction, the gateway's message queue has a large amount of cached data. To avoid the inability to collect PLC data, the data packet capacity can be maximized (i.e., multiple sets of detection data are transmitted). Specifically, within multiple request cycles after the router recovers from the malfunction, each gateway uses the multiple sets of detection data corresponding to the maximum data volume as the target data, thereby quickly alleviating the storage pressure on the message queue. Furthermore, the target data at this time includes the detection data sent before the malfunction; that is, when data is transmitted again after the router malfunction, the first set of data in the message queue is not deleted, avoiding data loss due to not receiving detection data during the malfunction.

[0035] Furthermore, it should be noted that, under normal circumstances, only one set of detection data is transmitted at a time in this embodiment of the present disclosure. However, in practical applications, this is not the case; the amount of detection data transmitted can be reasonably determined based on factors such as the amount of detection data and the number of PLC devices.

[0036] Optionally, if the message ID is an auto-incrementing ID, it indicates that the router is in normal condition; if the message ID is a non-auto-incrementing ID, it indicates that the router is experiencing an abnormal situation or that the router is being powered on for the first time.

[0037] As mentioned earlier, the gateway saves the latest received message ID after each request command. Thus, before sending each detection data, it checks whether the previous detection data has been received to determine the router's status. If the saved message ID has incremented (i.e., meets the preset increment method), the router is considered normal. If the message ID is not an incrementing ID, the router is considered to be malfunctioning or experiencing its first upload.

[0038] Optionally, if the message ID is a non-auto-incrementing ID, and the gateway receives a message ID with an initial value but saves a message ID that is not an initial value, then the router is considered to have encountered an abnormal situation. If the gateway receives a message ID with an initial value and saves a message ID that is also an initial value, then the router is considered to be powering on for the first time.

[0039] Here, the message ID has an initial value, which is the initial value of each device after power-on. The first data transmission after power-on is based on the initial value, and then the message ID gradually increments from the starting value of the range to the maximum value. For example, the initial value of the message ID is FFF, and the starting value of the message ID is 1 (the ending value of the range is not limited here; it is determined based on actual needs and the maximum number of data transmissions after each power-on, and generally the ending value is greater than the maximum number of data transmissions). During communication, if the gateway or router malfunctions and causes the device to power on and restart, the corresponding message ID will be the initial value. Therefore, if the message ID received by the gateway is the initial value and the stored message ID is not the initial value, it indicates that the router has malfunctioned and restarted (and then the message ID will change from the initial value to the starting value). When the message ID received by the gateway is the initial value and the stored message ID is also the initial value, it indicates that both devices are powering on for the first time.

[0040] Optionally, the gateway determines M in the following way: The gateway obtains information about the duration of abnormal situations that occur in the router or gateway, and the frequency of requests from the router to the gateway to send detection data.

[0041] The gateway determines M based on the quotient of duration and request cycle, rounded down.

[0042] Here, the request period primarily depends on the number of gateways. With a fixed data collection period for the router to collect gateway data (i.e., the set duration for each gateway to receive the router's request instruction and upload data to the router), the more gateways there are, the longer the request period. Request period = Data collection period × Number of gateways. After a router or gateway malfunctions, data transmission between them is interrupted, resulting in a large accumulation of detection data in the gateway's message queue. To avoid filling the message queue's storage space, after data communication is restored, the gateway will upload multiple sets of data (not exceeding the maximum transmission volume corresponding to the number of sets m). Specifically, M is determined by rounding down the quotient of the malfunction duration and the request period. If the rounded quotient is less than or equal to m, then the rounded value is determined as M; if the rounded quotient is greater than m, then M = m, and the number of times multiple sets of detection data are used as target data is further determined. This is determined by the multiple between the rounded value and m. If the rounded value is n times m, and n ≥ 1, then multiple sets of detection data are used as target data n times. Where the quotient and multiple are not divisible, they are rounded up. In this way, by resuming data transmission under abnormal conditions and maximizing the data packet capacity, efficient wireless data transmission with low packet loss rate is achieved.

[0043] Combination Figure 3 As shown, this disclosure provides a method for industrial wireless communication and data transmission, including: S101, the gateway stores the detection data sent by the PLC device in the message queue according to the order of receipt.

[0044] S102, upon receiving the request instruction for requesting detection data from the router for the nth time, the gateway determines the target data to be sent in the message queue based on the message ID in the request instruction, where n=1, 2, ...

[0045] S103, the gateway sends the target data and the received message ID to the router and saves the received message ID.

[0046] S204. In the event of a gateway malfunction, the gateway will set the message ID of this device to its initial value.

[0047] S205, upon receiving another request instruction to send detection data, the gateway packages and sends the first M groups of detection data in the message queue as target data; where m ≥ M ≥ 2, and m is the number of groups corresponding to the maximum transmission volume of detection data. Then, step S103 is executed.

[0048] In this embodiment, the calculation method for M is described above and will not be repeated here. When the gateway malfunctions, after the gateway restarts and powers on, the message ID becomes its initial value, replacing the previously saved message ID. When the router polls the gateway again, the gateway receives a new request instruction (including the message ID). The gateway saves the received message ID sent by the router to update the initial message ID. To avoid data loss during gateway failure, the gateway does not delete the first group of data in the message queue. Simultaneously, to avoid data accumulation occupying message queue storage space, the data packet capacity is dynamically adjusted for efficient data transmission.

[0049] Combination Figure 4 As shown, this disclosure provides another method for industrial wireless communication and data transmission, including: S301, the router sends a request instruction for the nth time to request detection data, n=1, 2, ...; where the request instruction includes a message ID, the message ID representing the router's status.

[0050] S302, the router receives the target data and message ID sent by the gateway; the target data is determined based on the router's configuration.

[0051] Here, data transmission between the router and gateway is based on the router's request command for requesting detection data. The gateway then uploads the target data based on this request command. Otherwise, the gateway does not actively upload the target data. The message ID is used for confirmation and acknowledgment between the two. As mentioned earlier, the gateway saves and returns the received message ID, and the router confirms the completion of this data transmission based on the message ID in the request command and the received feedback message ID. The message ID is then incremented for the next data communication.

[0052] As mentioned earlier, the message ID characterizes the router's status. Specifically, if the message ID increments within two consecutive data transmission cycles, the router is in a normal state. If the message ID changes to its initial value, the router has either restarted abnormally or is powering on for the first time. When the router is in a normal state or powering on for the first time, the target data is a single set of data in the gateway message queue. After the router recovers from an abnormal operation, the target data consists of multiple sets of data in the gateway message queue. Thus, using the message ID to acknowledge data transmission reduces the consumption of data packet capacity, and the acknowledgment mechanism is simple and efficient. Furthermore, based on the router's status, the data packet capacity can be adjusted in real time to achieve efficient data transmission.

[0053] Optionally, there are N gateways, where N≥2; the request instructions sent by the router to request detection data include: the router sends data request instructions to multiple gateways sequentially based on a master-slave round-robin mechanism.

[0054] As mentioned earlier, the router collects the detection data temporarily stored by the gateways based on an active polling mechanism. When multiple gateways exist, the router sends data request commands to each gateway sequentially. For example, if there are N gateways, the router sends a data request command to the i-th gateway in turn. This gateway uploads the target data during the time period before the router sends a data request command to the (i+1)-th gateway. The time required for the router to poll all gateways once is one request cycle.

[0055] Optionally, if the message ID is an auto-incrementing ID, it indicates that the router is in normal condition; if the message ID is a non-auto-incrementing ID, it indicates that the router is experiencing an abnormal situation or that the router is being powered on for the first time.

[0056] Here, if the router's message ID is within a preset range and increments within adjacent request periods, then the message ID is an auto-incrementing ID; if the message ID is an initial value, then it is a non-auto-incrementing ID. For example, the initial value of the message ID is FFF, and the value range of the message ID is [1, OFF]. When the router receives target data from the gateway and determines that the received message ID matches its stored message ID, it increments the message ID and uses this incremented message ID to poll and collect data again. In this way, message acknowledgment between the router and the gateway is achieved through the message ID, ensuring the accuracy of data transmission.

[0057] Combination Figure 5 As shown, this disclosure provides another method for industrial wireless communication and data transmission, including: S303, under normal router conditions, after receiving the target data and message ID sent by the gateway, the router increments the message ID. Alternatively, S304, when the router restarts, the router sets the message ID to the initial ID. Alternatively, In S305, when a request command to send detection data is sent for the first time, the router sets the message ID to the initial ID.

[0058] S301, the router sends a request command for the nth time to request detection data, n=1, 2, ...; where the request command includes a message ID, which indicates the router's status; S302, the router receives the target data and message ID sent by the gateway; the target data is determined based on the router's configuration.

[0059] Here, when the router is in normal operation (i.e., during normal communication), it increments the message ID after receiving the detection data uploaded by the gateway. In the next round of polling, it sends a request command containing the incremented message ID to the corresponding gateway. Conversely, if no data is received from a gateway in a given round, the message ID is not incremented. In the next round of polling, a request command containing the non-incremented message ID is sent to that gateway. This prevents data packet loss.

[0060] When the router restarts or sends a request command upon its first power-on, the message ID included in the request command is the initial ID. This allows the gateway to determine the router's status and thus identify the target data as including the first group of data in the current message queue. This enables data transmission to resume after a router restart, avoiding packet loss.

[0061] Optionally, the method further includes: when the message ID is the initial ID, after the router receives the target data and message ID sent by the gateway, updating the initial ID to an auto-incrementing ID.

[0062] Here, when the router's message ID is the initial ID, after receiving the target data and message ID uploaded by the gateway, the router updates the initial ID to the starting value of the message ID, such as 1. In subsequent data transmissions, the message ID is incremented. In this way, the message ID not only serves as a communication acknowledgment, but can also be used to further determine the router's status.

[0063] The following example illustrates the data transmission between a router and a gateway.

[0064] Combination Figure 6 As shown, in Phase 1, the router and gateway power on for the first time. The gateway, based on communication protocols (such as S7, Modbus, etc.), sequentially sends data request commands to the PLC devices and receives the collected data from the PLC devices, temporarily storing the collected data in a message queue. The router sends a request command to the gateway based on a master-slave polling mechanism (this request command contains message ID=FFF); the gateway receives the request command, obtains and saves the message ID, and sends the first set of detection data in the message queue as the target data to the router.

[0065] Phase 2, Normal Communication Phase. The router receives the target data sent by the gateway (the target data contains message ID=FFF), updates the message ID to message ID=1, and sends a request command (this request command contains message ID=1) during the second polling. The gateway receives this request command, confirms and saves message ID=1, deletes the first set of detection data from the message queue, and sends the new first set of detection data as the target data to the router. The router receives the target data sent by the gateway (the target data contains message ID=1) and increments the message ID by 1, and this cycle repeats.

[0066] Combination Figure 7 As shown, in stage 3, the gateway failure and recovery stage, the gateway restarts abnormally during the (n+1)th polling, saving the initial message ID. During the (n+2)th poll, it receives a request command from the router (this command contains message ID=n; since the gateway failed during the (n+1)th poll, the router did not receive the target data, so the message ID remains unchanged). The gateway confirms that the received message ID is inconsistent with the saved message ID, and sends the first M groups of data in the message queue (the current first group of data is not deleted) as the target data to the router, while saving the received message ID. The router receives the target data sent by the gateway (the target data contains message ID=n), increments the message ID, and resumes normal communication.

[0067] Phase 4: Router Anomaly and Recovery Phase. Before the (n+5)th poll, the router abnormally restarts, with the message ID equal to the initial ID. The (n+5)th poll sends a request command (containing message ID=FFF). The gateway confirms that the received message ID (ID=FFF) is inconsistent with the saved message ID (ID=n+4), and sends the first M groups of data in the message queue as the target data to the router, while saving the received message ID. The router receives the target data sent by the gateway (containing message ID=FFF), updates the message ID to message ID=1, and resumes normal communication.

[0068] Combination Figure 8 As shown, this embodiment of the disclosure provides a gateway 30 applied to an industrial inspection system. The industrial inspection system includes: a PLC device 40 configured to collect inspection data of a target device; a gateway 30 configured to communicate with the PLC device 40 and receive the inspection data sent by the PLC device 40; a router 20 configured to wirelessly communicate with the gateway 30 and receive the inspection data sent by the gateway 30; and a server 10 configured to communicate with the router 20 and draw inspection curves based on the inspection data sent by the router 20 for inspection analysis. The gateway 30 includes: a memory 31 configured to store program instructions, messages, and data; and a first processor 32 configured to execute the method described above when running program instructions.

[0069] Combination Figure 9 As shown, this embodiment of the disclosure provides a router 20 applied to an industrial inspection system. The industrial inspection system includes: a PLC device 40 configured to collect inspection data of a target device; a gateway 30 configured to communicate with the PLC device 40 and receive the inspection data sent by the PLC device 40; a router 20 configured to wirelessly communicate with the gateway 30 and receive the inspection data sent by the gateway 30; and a server 10 configured to communicate with the router 20 and draw inspection curves based on the inspection data sent by the router for inspection analysis. The router 20 includes: a memory 21 configured to store program instructions, messages, and data; and a second processor 22 configured to execute the method described above when running program instructions.

[0070] Furthermore, the logical instructions in the aforementioned memory 21 (31) can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0071] The memory 21 (31) is a computer-readable storage medium that can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The first processor 22 (or the second processor 32) executes functional applications and data processing by running the program instructions / modules stored in the memory 21 (31), that is, it implements the method for industrial wireless communication and data transmission in the above embodiments.

[0072] The memory 21 (31) may include a program storage area and a data storage area, wherein the program storage area may store the operating system and an application program required for at least one function; and the data storage area may store data created based on the use of the terminal device, etc. In addition, the memory 21 (31) may include high-speed random access memory and may also include non-volatile memory.

[0073] This disclosure provides another industrial inspection system, including: a PLC device configured to collect inspection data of a target device; a gateway as described above; a router as described above; and a server configured to communicate with the router and draw inspection curves for inspection analysis based on the inspection data sent by the router.

[0074] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to perform the above-described method for industrial wireless communication and data transmission.

[0075] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., and other media capable of storing program code.

[0076] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0077] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0078] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0079] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A method for industrial wireless communication and data transmission, applied to a gateway in an industrial detection system, characterized in that, The industrial testing system includes: a PLC device configured to collect testing data from a target device; a gateway configured to communicate with the PLC device and receive testing data sent by the PLC device; a router configured to communicate wirelessly with the gateway and receive testing data sent by the gateway; and a server configured to communicate with the router and plot testing curves based on the testing data sent by the router for testing analysis. The method includes: The detection data sent by the PLC device is stored in the message queue of the gateway in the order of receipt; Upon receiving the request instruction for detection data from the router for the nth time, determine the target data to be sent in the message queue based on the message ID in the request instruction, where n=1, 2, ...; Send the target data and the received message ID to the router, and save the received message ID.

2. The method according to claim 1, characterized in that, Determine the target data to be sent in the message queue based on the message ID in the request command, including: If the message ID indicates that the router is in a normal state, then delete the first set of detection data in the message queue and use the next set of detection data as the target data; or, If the message ID indicates that the router is powered on for the first time, then the first set of detection data in the message queue will be used as the target data; or, If the message ID indicates that the router has encountered an abnormal situation, then the first M groups of detection data in the message queue will be used as the target data; where m≥M≥2, and m is the number of groups corresponding to the maximum transmission volume of detection data.

3. The method according to claim 2, characterized in that, If the message ID is an auto-incrementing ID, it indicates that the router is in normal condition; if the message ID is not an auto-incrementing ID, it indicates that the router is experiencing an abnormal situation or that the router is being powered on for the first time.

4. The method according to claim 1, characterized in that, If the gateway malfunctions, the method further includes: Set the message ID of this device to the initial value; Upon receiving another request instruction to send detection data, the first M groups of detection data in the message queue are packaged and sent as target data; where m≥M≥2, and m is the number of groups corresponding to the maximum transmission volume of detection data.

5. The method according to claim 2 or 4, characterized in that, M is determined in the following way: The duration of abnormal situations occurring in the router or gateway and the frequency of the router's requests to the gateway to send detection data are obtained. M is determined by rounding down the quotient of the duration and the request period.

6. A method for industrial wireless communication and data transmission, applied to a router in an industrial detection system, characterized in that, The industrial testing system includes: a PLC device configured to collect testing data from a target device; a gateway configured to communicate with the PLC device and receive testing data sent by the PLC device; a router configured to communicate wirelessly with the gateway and receive testing data sent by the gateway; and a server configured to communicate with the router and plot testing curves based on the testing data sent by the router for testing analysis. The method includes: The nth request instruction to send detection data, n=1, 2, ...; where the request instruction includes a message ID, which indicates the router's status; Receive the target data and message ID sent by the gateway; the target data is determined based on the router's configuration.

7. The method according to claim 6, characterized in that, If the message ID is an auto-incrementing ID, it indicates that the router is in normal condition; if the message ID is not an auto-incrementing ID, it indicates that the router is experiencing an abnormal situation or that the router is being powered on for the first time.

8. The method according to claim 7, characterized in that, Also includes: When the router is in normal working order, after receiving the target data and message ID sent by the gateway, it increments the message ID. or, If the router restarts, set the message ID to the initial ID; or, In the case of the first request to send detection data, the message ID is set to the initial ID.

9. The method according to claim 8, characterized in that, Also includes: If the message ID is the initial ID, after receiving the target data and message ID sent by the gateway, the initial ID is updated to an auto-incrementing ID.

10. The method according to claim 6, characterized in that, There are N gateways, where N ≥ 2; the request instruction to send detection data includes: Data request commands are sent sequentially to multiple gateways based on a master-slave polling mechanism.

11. A gateway, applied in an industrial inspection system, characterized in that, The industrial testing system includes: a PLC device configured to collect testing data from the target device; a gateway configured to communicate with the PLC device and receive testing data sent by the PLC device; a router configured to communicate wirelessly with the gateway and receive testing data sent by the gateway; and a server configured to communicate with the router and plot testing curves based on the testing data sent by the router for testing analysis; wherein, the gateway includes: The memory is configured to store program instructions, messages, and data. The first processor is configured to execute the method as described in any one of claims 1 to 5 when running program instructions.

12. A router, used in an industrial inspection system, characterized in that, The industrial testing system includes: a PLC device configured to collect testing data from the target device; a gateway configured to communicate with the PLC device and receive testing data sent by the PLC device; a router configured to communicate wirelessly with the gateway and receive testing data sent by the gateway; and a server configured to communicate with the router and plot testing curves based on the testing data sent by the router for testing analysis; wherein the router includes: The memory is configured to store program instructions, messages, and data. The second processor is configured to execute the method as described in any one of claims 6 to 10 when running program instructions.

13. An industrial inspection system, characterized in that, include: The PLC device is configured to collect detection data from the target device. The gateway as described in claim 11; The router as described in claim 12; and, The server is configured to communicate with the router and perform detection analysis by plotting detection curves based on the detection data sent by the router.