A communication system and method for wireless networking of agricultural Internet of Things
By designing a wireless network communication system for terminal nodes, gateway nodes and cloud platforms, and using specific TCP protocols and 4G networks, the problem of low data transmission speed and efficiency of agricultural IoT systems is solved, and accurate and timely data transmission and efficient data are achieved transmission.
Patent Information
- Application Number
- CN202010709102.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-22
- Publication Date
- 2024-12-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Agricultural IoT systems have problems such as unreasonable architecture, small scale, inconvenient management and low communication efficiency, especially in terms of data transmission speed and real-time performance, and the existing protocols are low in flexibility and are not suitable for large-scale data storage and use.
A wireless network communication system including terminal nodes, gateway nodes and cloud platforms was designed to communicate in two directions through WIFI and 4G and above networks. A specific TCP communication protocol is adopted to ensure accurate and timely data transmission, reduce network overhead, and through Send data requests in broadcast format.
It realizes accurate and timely transmission of data collected by terminals to the cloud, improves data transmission speed and efficiency, and is suitable for large-scale and real-time agricultural Internet of Things systems, saving network resources.
Smart Images

Figure CN111787122B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural information technology, and in particular to a communication system and method for wireless networking of agricultural Internet of Things. Background Art
[0002] The construction of the agricultural Internet of Things is of practical significance for accurately, timely and quickly collecting field information and reducing the manpower input in the agricultural production process. The agricultural Internet of Things has become a hot spot for research and development, but due to the particularity of the agricultural environment, especially the relative scarcity of network resources, the development of the agricultural Internet of Things is restricted. The current agricultural Internet of Things still has a series of problems such as unreasonable architecture, small scale, inconvenient management, and low communication efficiency. In terms of architectural design, the current agricultural Internet of Things is mostly small-scale networking and control, which cannot form a good connection with the cloud, is not conducive to large-scale commissioning and management, and is not conducive to the storage and utilization of massive data; in the choice of communication methods, Zigbee, Lora, GPRS and other methods are mostly used. Although they meet the requirements of low power consumption, they have limitations in distance or data transmission speed, low real-time performance and slow speed; in terms of communication protocols, although there are lightweight Internet of Things protocols such as MQTT and CoAP to choose from, there are still low flexibility or inapplicability when using them.
[0003] Therefore, the present invention proposes a communication system and method for wireless networking of agricultural Internet of Things. Summary of the invention
[0004] The purpose of the present invention is to provide a communication system and method for wireless networking of agricultural Internet of Things in view of the defects of the prior art.
[0005] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0006] A communication system for wireless networking of agricultural Internet of Things, comprising: a terminal node, a gateway node, and a cloud platform;
[0007] The terminal node is used to obtain data information related to agriculture and send the obtained data information to the gateway node;
[0008] The gateway node is connected to the terminal nodes for receiving data information sent by the terminal nodes and sending the data information to the cloud platform;
[0009] The cloud platform is connected to several gateway nodes for communication, and is used for receiving data information sent by the gateway nodes and storing the received data information.
[0010] Furthermore, the cloud platform is also used to send a data request to the gateway node;
[0011] The gateway node is further used to receive a data request sent by the cloud platform and send the data request to the terminal node;
[0012] The terminal node is also used to receive the data request sent by the gateway node and process the data request.
[0013] Furthermore, the gateway node communicates with the plurality of terminal nodes by establishing a first TCP communication protocol via WIFI, and the message format of the first TCP communication protocol includes a fixed header, a variable header, and a payload in sequence;
[0014] The fixed header occupies 1 byte, of which bits 7-4 indicate the message type, which includes two types: request CALL and response REPLY; bits 3-0 indicate the message flag, which includes the heartbeat request PINGCALL and data request DATACALL of the request CALL type, the heartbeat response PONGREPLY and data sending DATASEND of the response REPLY type;
[0015] The variable header occupies 1 byte and indicates the terminal node number TID; when the message flag is data request DATACALL, heartbeat response PONGREPLY and data sending DATASEND, the protocol message contains a variable header; when the message flag is heartbeat request PINGCALL, the protocol message does not include a variable header;
[0016] When the message flag of the TCP communication protocol is DATASEND, the protocol message includes a payload. The payload contains one or more records. A record includes a remaining flag, a data type, a data length, and valid data. The remaining flag and the data type occupy 1 byte together. Bit 7 represents the remaining flag, indicating whether there is the next record. Bits 6-0 represent the data type. The data length occupies 4 bytes, indicating the length of the valid data. The valid data represents the actual data, which is the specific data corresponding to the data type.
[0017] Furthermore, the cloud platform communicates with the plurality of gateway nodes using a second TCP communication protocol established through a communication network, and the message format of the second TCP communication protocol is, in order, a fixed header, a variable header, and a payload;
[0018] The fixed header occupies 2 bytes, of which bits 7-4 of the first byte indicate the message type, which includes two types: request CALL and response REPLY; bits 3-0 of the first byte indicate the message flag, which includes connection request CONCALL, disconnection request DISCONCALL, heartbeat request PINGCALL and data request DATACALL of the request CALL type, and connection response CONREPLY, disconnection response DISCONREPLY, heartbeat response PONGREPLY, data response DATAREPLY and data sending DATASEND of the response REPLY type; the second byte indicates the message identifier XID;
[0019] The variable header occupies 1 byte. When the message flag is a data request DATACALL and a data send DATASEN, it indicates the terminal node number TID; when the message flag is a response REPLY message flag other than a data send DATASEND, it indicates the response status, where the response status includes ACCEPT and DENY; when the message flag is a connection request CONCALL, a disconnection request DISCONCALL, or a heartbeat request PINGCALL, the message does not have a variable header;
[0020] When the message flag is DATASEND, the message contains a payload, which contains one or more records. A record includes the remaining flag, data type, data length, and valid data. The remaining flag and data type occupy 1 byte together. Bit 7 represents the remaining flag, indicating whether there is the next record. Bits 6-0 represent the data type. The data length occupies 4 bytes, indicating the length of the valid data. The valid data represents the actual data, which is the specific data corresponding to the data type.
[0021] Furthermore, the gateway node sends the data request to the terminal node in a broadcasting manner.
[0022] Furthermore, when the gateway node sends a heartbeat request to several terminal nodes connected to the gateway node, all terminal nodes connected to the gateway node make a heartbeat response; when the gateway node sends a data request to several terminal nodes connected to the gateway node, all terminal nodes connected to the gateway node make a judgment based on the terminal node number TID in the message, and if the terminal node number is consistent with the terminal node number TID in the message, the terminal node executes the data request data.
[0023] Furthermore, after the cloud platform sends the data request to the gateway node, the following steps are also included:
[0024] The judgment module is used to judge whether the response data sent by the gateway node is received within a preset request number threshold. If not, it indicates that the communication is abnormal.
[0025] Accordingly, a communication method for wireless networking of agricultural Internet of Things is also provided, comprising the steps of:
[0026] S1. The cloud platform sends a data request to the gateway node;
[0027] S2. The gateway node receives the data request sent by the cloud platform and sends the data request to the terminal node;
[0028] S3. The terminal node receives the data request sent by the gateway node and processes the data request.
[0029] Furthermore, the method further comprises the steps of:
[0030] S4. The terminal node obtains data information related to agriculture and sends the obtained data information to the gateway node;
[0031] S5. The gateway node receives the data information sent by the terminal node and sends the data information to the cloud platform;
[0032] S6. The cloud platform receives the data information sent by the gateway node and stores the received data information.
[0033] Furthermore, after the cloud platform sends the data request to the gateway node, the following steps are also included:
[0034] It is determined whether the response data sent by the gateway node is received within the preset request number threshold. If not, it indicates that the communication is abnormal.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] 1. In the present invention, two-way communication can be carried out between the terminal node and the gateway node, and two-way communication can be carried out between the gateway node and the cloud platform. The data collected by the terminal can be accurately and timely transmitted to the cloud, making it convenient for agricultural workers to remotely obtain agricultural information.
[0037] 2. The communication protocol in the present invention is lightweight and reliable, which can reduce network overhead during data transmission and save network resources.
[0038] 3. In the present invention, the terminal node and the gateway node communicate via WIFI, and the gateway node and the cloud platform communicate via 4G and above networks. Combined with the communication protocol designed in the present invention, the data transmission speed is fast and the transmission efficiency is high, which can be applied to agricultural Internet of Things systems with large data transmission volume and high real-time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1This is a structural diagram of a communication system for wireless networking of agricultural Internet of Things provided in Example 1. DETAILED DESCRIPTION
[0040] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0041] The purpose of the present invention is to provide a communication system and method for wireless networking of agricultural Internet of Things in view of the defects of the prior art.
[0042] Embodiment 1
[0043] This embodiment provides a communication system for wireless networking of agricultural Internet of Things, such as Figure 1 As shown, it includes: a terminal node 13, a gateway node 12, and a cloud platform 11;
[0044] The terminal node 13 is used to obtain data information related to agriculture and send the obtained data information to the gateway node;
[0045] The gateway node 12 is connected to the terminal nodes for receiving data information sent by the terminal nodes and sending the data information to the cloud platform;
[0046] The cloud platform 11 is connected to the plurality of gateway nodes for communication, and is used for receiving data information sent by the gateway nodes and storing the received data information.
[0047] In this embodiment, the cloud platform 11 is also used to send data requests to the gateway node; the gateway node 12 is also used to receive data requests sent by the cloud platform and send the data requests to the terminal node; the terminal node 13 is also used to receive data requests sent by the gateway node and process the data requests.
[0048] In this embodiment, the agricultural Internet of Things is jointly constructed by the terminal node 13, the gateway node 12, and the cloud platform 11, and the data collected by the terminal is quickly and accurately transmitted to the cloud platform in a timely manner, so as to facilitate agricultural workers to remotely obtain agricultural information.
[0049] The main function of the terminal node 13 is to obtain data carrying agricultural information in an agricultural environment; the main function of the gateway node 12 is to perform communication protocol conversion and data forwarding with the terminal node or cloud platform; the main function of the cloud platform 11 is to send instructions, receive data and save data.
[0050] A cloud platform can establish wireless connections with N gateway nodes, N≥1; a gateway node can establish wireless connections with M terminal nodes, 1≤M≤24.
[0051] In this embodiment, multiple terminal nodes and a gateway node are regionally networked, a TCP connection is established through WIFI, and two-way communication is performed according to the terminal-gateway communication protocol.
[0052] The message format of the terminal-gateway communication protocol includes three parts, which are fixed header, variable header and payload in order. All messages must contain a fixed header, and some messages contain a variable header and a payload. The message format is shown in Table 1.
[0053]
[0054]
[0055] Table 1
[0056] The fixed header occupies 1 byte, and bits 7-4 indicate the message type, which specifically includes request (CALL) and response (REPLY), as shown in Table 2; bits 3-0 indicate the message flag, which specifically includes heartbeat request (PINGCALL) and data request (DATACALL) of the request (CALL) type, and heartbeat response (PONGREPLY) and data transmission (DATASEND) of the response (REPLY) type, as shown in Table 3; the variable header occupies 1 byte, indicating the terminal node number (TID). When the message flag is data request (DATACALL), heartbeat response (PONGREPLY) and data transmission (DATASEND), the message must contain a variable header. When the message flag is heartbeat request (PINGCALL), the message does not have a variable header, as shown in Table 4.
[0057]
[0058] Table 2
[0059]
[0060] Table 3
[0061]
[0062]
[0063] Table 4
[0064] When the message flag is data send (DATASEND), the message contains a payload, which contains one or more records. A record includes the remaining flag bit, data type, data length, and valid data. The remaining flag bit and data type occupy 1 byte together. Bit 7 represents the remaining flag bit, indicating whether there is a next record. Bits 6-0 represent the data type. The data type is defined according to the actual situation and can be temperature, humidity, light intensity, carbon dioxide concentration, crop image, pest image and other data related to agricultural information. The data length occupies 4 bytes, indicating the length of the valid data. The valid data represents the actual data, which is the specific data corresponding to the data type, see Table 5.
[0065]
[0066] Table 5
[0067] TCP connections are established between multiple gateway nodes and the cloud platform through 4G and above networks, and two-way communication is carried out according to the gateway-cloud platform communication protocol.
[0068] The message format of the gateway-cloud platform communication protocol includes three parts, which are fixed header, variable header and payload in order. All messages must contain a fixed header, and some messages contain a variable header and a payload, as shown in Table 6.
[0069]
[0070]
[0071] Table 6
[0072] The fixed header occupies 2 bytes. Bits 7-4 of the first byte indicate the message type, which includes request (CALL) and response (REPLY), as shown in Table 7; bits 3-0 of the first byte indicate the message flag, which includes connection request (CONCALL), disconnection request (DISCONCALL), heartbeat request (PINGCALL) and data request (DATACALL) of the request (CALL) type, and connection response (CONREPLY), disconnection response (DISCONREPLY), heartbeat response (PONGREPLY), data response (DATAREPLY) and data sending (DATASEND) of the response (REPLY) type, as shown in Table 8; the second byte indicates the message identifier (XID). A request-response message has the same message identifier (XID).
[0073]
[0074] Table 7
[0075]
[0076]
[0077] Table 8
[0078] The variable header occupies 1 byte. When the message flag is data request (DATACALL) and data transmission (DATASEND), it indicates the terminal node number (TID). When the message flag is other response (REPLY) type message flag except data transmission (DATASEND), it indicates the response status, which is acceptance (ACCEPT) and rejection (DENY). When the message flag is connection request (CONCALL), disconnection request (DISCONCALL), heartbeat request (PINGCALL), the message does not have a variable header, see Table 9.
[0079]
[0080] Table 9
[0081] When the message flag is data sent (DATASEND), the message contains a payload, which contains one or more records. A record includes the remaining flag bit, data type, data length, and valid data. The remaining flag bit and data type occupy 1 byte together. Bit 7 represents the remaining flag bit, indicating whether there is the next record. Bits 6-0 represent the data type. The data type is defined according to the actual situation and can be temperature, humidity, light intensity, carbon dioxide concentration, crop image, pest image and other data related to agricultural information. The data length occupies 4 bytes, indicating the length of the valid data. The valid data represents the actual data, which is the specific data corresponding to the data type.
[0082] In this embodiment, the communication method is specifically as follows: the cloud platform sends a data request to the gateway node; the gateway node sends the data request received from the cloud platform to the terminal node; the terminal node processes the data request received from the gateway node; at this time, the terminal node responds, obtains data information related to agriculture, and sends the obtained data information to the gateway node; the gateway node sends the data information received from the terminal node to the cloud platform; the cloud platform receives the data information sent by the gateway node, and stores the received data information.
[0083] In this embodiment, after the cloud platform sends a data request to the gateway node, the following steps are also included:
[0084] It is determined whether the response data sent by the gateway node is received within the preset request number threshold. If not, it indicates that the communication is abnormal.
[0085] Specifically: after the cloud platform sends a data request, it determines whether response data is received within the preset time. If not, it sends the data request again. If no response data is received within the preset request number threshold (such as 3 times), it is considered a communication abnormality.
[0086] The level of the cloud platform is higher than that of the gateway node, and the level of the gateway node is higher than that of the terminal node. Requests can only be initiated by high-level ones to low-level ones, and cannot be made across levels, that is, the cloud platform sends requests to the gateway node, and the gateway node sends requests to the terminal node; responses can only be submitted by low-level ones to high-level ones, and cannot be made across levels, that is, the terminal node responds to the gateway node, and the gateway node responds to the cloud platform.
[0087] In this embodiment, when the gateway node receives a data request from the cloud platform, it immediately makes a data response, and then sends a data request to the subordinate terminal node connected to the current gateway node. After receiving the data sent by the terminal node, the gateway node sends data to the cloud platform, that is, the gateway node's data transmission to the cloud platform is a secondary response to the cloud platform's data request; in the entire process from the cloud platform sending the request to receiving the response, the three messages of data request-data response-data transmission have the same message identifier (XID).
[0088] The gateway node's requests to its subordinate terminal nodes are all in the form of broadcast. When the gateway node sends a heartbeat request to its subordinate terminal nodes, all its subordinate terminal nodes must make a heartbeat response; when the gateway node sends a data request to its subordinate terminal nodes, all its subordinate terminal nodes make a judgment based on the terminal node number (TID) in the message. The terminal node whose terminal node number is consistent with the terminal node number (TID) in the message needs to collect data and submit a message to send data to the gateway node.
[0089] The beneficial effects of this embodiment are:
[0090] 1. In this embodiment, two-way communication can be carried out between the terminal node and the gateway node, and two-way communication can be carried out between the gateway node and the cloud platform. The data collected by the terminal can be accurately and timely transmitted to the cloud, making it convenient for agricultural workers to remotely obtain agricultural information.
[0091] 2. The communication protocol in this embodiment is lightweight and reliable, which can reduce network overhead during data transmission and save network resources.
[0092] 3. In this embodiment, the terminal node and the gateway node communicate via WIFI, and the gateway node and the cloud platform communicate via 4G and above networks. Combined with the communication protocol designed in the present invention, the data transmission speed is fast and the transmission efficiency is high, which can be applied to agricultural Internet of Things systems with large data transmission volume and high real-time requirements.
[0093] Embodiment 2
[0094] This embodiment provides a communication method for wireless networking of agricultural Internet of Things, comprising the steps of:
[0095] S1. The cloud platform sends a data request to the gateway node;
[0096] S2. The gateway node receives the data request sent by the cloud platform and sends the data request to the terminal node;
[0097] S3. The terminal node receives the data request sent by the gateway node and processes the data request.
[0098] Furthermore, the method further comprises the steps of:
[0099] S4. The terminal node obtains data information related to agriculture and sends the obtained data information to the gateway node;
[0100] S5. The gateway node receives the data information sent by the terminal node and sends the data information to the cloud platform;
[0101] S6. The cloud platform receives the data information sent by the gateway node and stores the received data information.
[0102] Furthermore, after the cloud platform sends the data request to the gateway node, the following steps are also included:
[0103] It is determined whether the response data sent by the gateway node is received within the preset request number threshold. If not, it indicates that the communication is abnormal.
[0104] It should be noted that the communication method for agricultural Internet of Things wireless networking provided in this embodiment is similar to that in Embodiment 1 and will not be elaborated here.
[0105] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A communication system for wireless networking of agricultural Internet of Things, characterized in that: include: Terminal nodes, gateway nodes, and cloud platforms; The terminal node is used to obtain data information related to agriculture and send the obtained data information to the gateway node; The gateway node is connected to the terminal nodes for receiving data information sent by the terminal nodes and sending the data information to the cloud platform; The cloud platform is connected to the plurality of gateway nodes for receiving data information sent by the gateway nodes and storing the received data information; The gateway node communicates with the plurality of terminal nodes by establishing a first TCP communication protocol through WIFI, wherein the message format of the first TCP communication protocol includes a fixed header, a variable header, and a payload in sequence; The fixed header occupies 1 byte, of which bits 7-4 indicate the message type, which includes two types: request CALL and response REPLY; bits 3-0 indicate the message flag, which includes the heartbeat request PINGCALL and data request DATACALL of the request CALL type, the heartbeat response PONGREPLY and data sending DATASEND of the response REPLY type; The variable header occupies 1 byte and indicates the terminal node number TID; when the message flag is data request DATACALL, heartbeat response PONGREPLY and data sending DATASEND, the protocol message contains a variable header; when the message flag is heartbeat request PINGCALL, the protocol message does not include a variable header; When the message flag of the TCP communication protocol is DATASEND, the protocol message includes a payload, which contains one or more records. A record includes a remaining flag, a data type, a data length, and valid data. The remaining flag and the data type occupy 1 byte. The 7th bit indicates the remaining flag, indicating whether there is a next record. The 6th to 0th bits indicate the data type. The data length occupies 4 bytes, indicating the length of the valid data. The valid data indicates the actual data, which is the specific data corresponding to the data type. The cloud platform communicates with the plurality of gateway nodes via a second TCP communication protocol established through a communication network, wherein the message format of the second TCP communication protocol is a fixed header, a variable header, and a payload in order; The fixed header occupies 2 bytes, of which the 7th to 4th bits of the first byte indicate the message type, which includes two types: request CALL and response REPLY; the 3rd to 0th bits of the first byte indicate the message flag, which includes the connection request CONCALL, disconnection request DISCONCALL, heartbeat request PINGCALL and data request DATACALL of the request CALL type, and the connection response CONREPLY, disconnection response DISCONREPLY, heartbeat response PONGREPLY, data response DATAREPLY and data sending DATASEND of the response REPLY type; the 2nd byte indicates the message identifier XID; The variable header occupies 1 byte. When the message flag is a data request DATACALL and a data send DATASEN, it indicates the terminal node number TID; when the message flag is a response REPLY message flag other than a data send DATASEND, it indicates the response status, where the response status includes ACCEPT and DENY; when the message flag is a connection request CONCALL, a disconnection request DISCONCALL, or a heartbeat request PINGCALL, the message does not have a variable header; When the message flag is DATASEND, the message contains a payload, which contains one or more records. A record includes the remaining flag, data type, data length, and valid data. The remaining flag and data type occupy 1 byte together. The 7th bit indicates the remaining flag, indicating whether there is the next record. Bits 6-0 indicate the data type. The data length occupies 4 bytes, indicating the length of the valid data. The valid data indicates the actual data, which is the specific data corresponding to the data type.
2. A communication system for wireless networking of agricultural Internet of Things according to claim 1, characterized in that: The cloud platform is also used to send data requests to the gateway node; The gateway node is further used to receive a data request sent by the cloud platform and send the data request to the terminal node; The terminal node is also used to receive the data request sent by the gateway node and process the data request.
3. A communication system for wireless networking of agricultural Internet of Things according to claim 2, characterized in that: The gateway node sends the data request to the terminal node in a broadcasting manner.
4. A communication system for wireless networking of agricultural Internet of Things according to claim 1, characterized in that: When the gateway node sends a heartbeat request to several terminal nodes connected to the gateway node, all terminal nodes connected to the gateway node make a heartbeat response; When the gateway node sends a data request to several terminal nodes connected to the gateway node, all terminal nodes connected to the gateway node make a judgment based on the terminal node number TID in the message. If the terminal node number is consistent with the terminal node number TID in the message, the terminal node executes the data request data.
5. A communication system for wireless networking of agricultural Internet of Things according to claim 2, characterized in that: After the cloud platform sends the data request to the gateway node, the following further includes: The judgment module is used to judge whether the response data sent by the gateway node is received within a preset request number threshold. If not, it indicates that the communication is abnormal.
6. A communication method for wireless networking of agricultural Internet of Things, based on a communication system for wireless networking of agricultural Internet of Things according to any one of claims 1 to 5, characterized in that: Includes steps: S1. The cloud platform sends a data request to the gateway node; S2. The gateway node receives the data request sent by the cloud platform and sends the data request to the terminal node; S3. The terminal node receives the data request sent by the gateway node and processes the data request.
7. A communication method for wireless networking of agricultural Internet of Things according to claim 6, characterized in that: Also includes the steps: S4. The terminal node obtains data information related to agriculture and sends the obtained data information to the gateway node; S5. The gateway node receives the data information sent by the terminal node and sends the data information to the cloud platform; S6. The cloud platform receives the data information sent by the gateway node and stores the received data information.
8. A communication method for wireless networking of agricultural Internet of Things according to claim 7, characterized in that: After the cloud platform sends the data request to the gateway node, the following further includes: It is determined whether the response data sent by the gateway node is received within the preset request number threshold. If not, it indicates that the communication is abnormal.
